iclient-openlayers.js 4.6 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044
  1. /*!
  2. *
  3. * iclient-openlayers.(https://iclient.supermap.io)
  4. * Copyright© 2000 - 2021 SuperMap Software Co.Ltd
  5. * license: Apache-2.0
  6. * version: v10.1.1
  7. *
  8. */
  9. /******/ (function() { // webpackBootstrap
  10. /******/ var __webpack_modules__ = ({
  11. /***/ 898:
  12. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  13. module.exports = __webpack_require__(70);
  14. /***/ }),
  15. /***/ 937:
  16. /***/ (function(module) {
  17. (function (self) {
  18. 'use strict'; // if __disableNativeFetch is set to true, the it will always polyfill fetch
  19. // with Ajax.
  20. if (!self.__disableNativeFetch && self.fetch) {
  21. return;
  22. }
  23. function normalizeName(name) {
  24. if (typeof name !== 'string') {
  25. name = String(name);
  26. }
  27. if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
  28. throw new TypeError('Invalid character in header field name');
  29. }
  30. return name.toLowerCase();
  31. }
  32. function normalizeValue(value) {
  33. if (typeof value !== 'string') {
  34. value = String(value);
  35. }
  36. return value;
  37. }
  38. function Headers(headers) {
  39. this.map = {};
  40. if (headers instanceof Headers) {
  41. headers.forEach(function (value, name) {
  42. this.append(name, value);
  43. }, this);
  44. } else if (headers) {
  45. Object.getOwnPropertyNames(headers).forEach(function (name) {
  46. this.append(name, headers[name]);
  47. }, this);
  48. }
  49. }
  50. Headers.prototype.append = function (name, value) {
  51. name = normalizeName(name);
  52. value = normalizeValue(value);
  53. var list = this.map[name];
  54. if (!list) {
  55. list = [];
  56. this.map[name] = list;
  57. }
  58. list.push(value);
  59. };
  60. Headers.prototype['delete'] = function (name) {
  61. delete this.map[normalizeName(name)];
  62. };
  63. Headers.prototype.get = function (name) {
  64. var values = this.map[normalizeName(name)];
  65. return values ? values[0] : null;
  66. };
  67. Headers.prototype.getAll = function (name) {
  68. return this.map[normalizeName(name)] || [];
  69. };
  70. Headers.prototype.has = function (name) {
  71. return this.map.hasOwnProperty(normalizeName(name));
  72. };
  73. Headers.prototype.set = function (name, value) {
  74. this.map[normalizeName(name)] = [normalizeValue(value)];
  75. };
  76. Headers.prototype.forEach = function (callback, thisArg) {
  77. Object.getOwnPropertyNames(this.map).forEach(function (name) {
  78. this.map[name].forEach(function (value) {
  79. callback.call(thisArg, value, name, this);
  80. }, this);
  81. }, this);
  82. };
  83. function consumed(body) {
  84. if (body.bodyUsed) {
  85. return Promise.reject(new TypeError('Already read'));
  86. }
  87. body.bodyUsed = true;
  88. }
  89. function fileReaderReady(reader) {
  90. return new Promise(function (resolve, reject) {
  91. reader.onload = function () {
  92. resolve(reader.result);
  93. };
  94. reader.onerror = function () {
  95. reject(reader.error);
  96. };
  97. });
  98. }
  99. function readBlobAsArrayBuffer(blob) {
  100. var reader = new FileReader();
  101. reader.readAsArrayBuffer(blob);
  102. return fileReaderReady(reader);
  103. }
  104. function readBlobAsText(blob, options) {
  105. var reader = new FileReader();
  106. var contentType = options.headers.map['content-type'] ? options.headers.map['content-type'].toString() : '';
  107. var regex = /charset\=[0-9a-zA-Z\-\_]*;?/;
  108. var _charset = blob.type.match(regex) || contentType.match(regex);
  109. var args = [blob];
  110. if (_charset) {
  111. args.push(_charset[0].replace(/^charset\=/, '').replace(/;$/, ''));
  112. }
  113. reader.readAsText.apply(reader, args);
  114. return fileReaderReady(reader);
  115. }
  116. var support = {
  117. blob: 'FileReader' in self && 'Blob' in self && function () {
  118. try {
  119. new Blob();
  120. return true;
  121. } catch (e) {
  122. return false;
  123. }
  124. }(),
  125. formData: 'FormData' in self,
  126. arrayBuffer: 'ArrayBuffer' in self
  127. };
  128. function Body() {
  129. this.bodyUsed = false;
  130. this._initBody = function (body, options) {
  131. this._bodyInit = body;
  132. if (typeof body === 'string') {
  133. this._bodyText = body;
  134. } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
  135. this._bodyBlob = body;
  136. this._options = options;
  137. } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
  138. this._bodyFormData = body;
  139. } else if (!body) {
  140. this._bodyText = '';
  141. } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {// Only support ArrayBuffers for POST method.
  142. // Receiving ArrayBuffers happens via Blobs, instead.
  143. } else {
  144. throw new Error('unsupported BodyInit type');
  145. }
  146. };
  147. if (support.blob) {
  148. this.blob = function () {
  149. var rejected = consumed(this);
  150. if (rejected) {
  151. return rejected;
  152. }
  153. if (this._bodyBlob) {
  154. return Promise.resolve(this._bodyBlob);
  155. } else if (this._bodyFormData) {
  156. throw new Error('could not read FormData body as blob');
  157. } else {
  158. return Promise.resolve(new Blob([this._bodyText]));
  159. }
  160. };
  161. this.arrayBuffer = function () {
  162. return this.blob().then(readBlobAsArrayBuffer);
  163. };
  164. this.text = function () {
  165. var rejected = consumed(this);
  166. if (rejected) {
  167. return rejected;
  168. }
  169. if (this._bodyBlob) {
  170. return readBlobAsText(this._bodyBlob, this._options);
  171. } else if (this._bodyFormData) {
  172. throw new Error('could not read FormData body as text');
  173. } else {
  174. return Promise.resolve(this._bodyText);
  175. }
  176. };
  177. } else {
  178. this.text = function () {
  179. var rejected = consumed(this);
  180. return rejected ? rejected : Promise.resolve(this._bodyText);
  181. };
  182. }
  183. if (support.formData) {
  184. this.formData = function () {
  185. return this.text().then(decode);
  186. };
  187. }
  188. this.json = function () {
  189. return this.text().then(JSON.parse);
  190. };
  191. return this;
  192. } // HTTP methods whose capitalization should be normalized
  193. var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
  194. function normalizeMethod(method) {
  195. var upcased = method.toUpperCase();
  196. return methods.indexOf(upcased) > -1 ? upcased : method;
  197. }
  198. function Request(input, options) {
  199. options = options || {};
  200. var body = options.body;
  201. if (Request.prototype.isPrototypeOf(input)) {
  202. if (input.bodyUsed) {
  203. throw new TypeError('Already read');
  204. }
  205. this.url = input.url;
  206. this.credentials = input.credentials;
  207. if (!options.headers) {
  208. this.headers = new Headers(input.headers);
  209. }
  210. this.method = input.method;
  211. this.mode = input.mode;
  212. if (!body) {
  213. body = input._bodyInit;
  214. input.bodyUsed = true;
  215. }
  216. } else {
  217. this.url = input;
  218. }
  219. this.credentials = options.credentials || this.credentials || 'omit';
  220. if (options.headers || !this.headers) {
  221. this.headers = new Headers(options.headers);
  222. }
  223. this.method = normalizeMethod(options.method || this.method || 'GET');
  224. this.mode = options.mode || this.mode || null;
  225. this.referrer = null;
  226. if ((this.method === 'GET' || this.method === 'HEAD') && body) {
  227. throw new TypeError('Body not allowed for GET or HEAD requests');
  228. }
  229. this._initBody(body, options);
  230. }
  231. Request.prototype.clone = function () {
  232. return new Request(this);
  233. };
  234. function decode(body) {
  235. var form = new FormData();
  236. body.trim().split('&').forEach(function (bytes) {
  237. if (bytes) {
  238. var split = bytes.split('=');
  239. var name = split.shift().replace(/\+/g, ' ');
  240. var value = split.join('=').replace(/\+/g, ' ');
  241. form.append(decodeURIComponent(name), decodeURIComponent(value));
  242. }
  243. });
  244. return form;
  245. }
  246. function headers(xhr) {
  247. var head = new Headers();
  248. var pairs = xhr.getAllResponseHeaders().trim().split('\n');
  249. pairs.forEach(function (header) {
  250. var split = header.trim().split(':');
  251. var key = split.shift().trim();
  252. var value = split.join(':').trim();
  253. head.append(key, value);
  254. });
  255. return head;
  256. }
  257. Body.call(Request.prototype);
  258. function Response(bodyInit, options) {
  259. if (!options) {
  260. options = {};
  261. }
  262. this._initBody(bodyInit, options);
  263. this.type = 'default';
  264. this.status = options.status;
  265. this.ok = this.status >= 200 && this.status < 300;
  266. this.statusText = options.statusText;
  267. this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
  268. this.url = options.url || '';
  269. }
  270. Body.call(Response.prototype);
  271. Response.prototype.clone = function () {
  272. return new Response(this._bodyInit, {
  273. status: this.status,
  274. statusText: this.statusText,
  275. headers: new Headers(this.headers),
  276. url: this.url
  277. });
  278. };
  279. Response.error = function () {
  280. var response = new Response(null, {
  281. status: 0,
  282. statusText: ''
  283. });
  284. response.type = 'error';
  285. return response;
  286. };
  287. var redirectStatuses = [301, 302, 303, 307, 308];
  288. Response.redirect = function (url, status) {
  289. if (redirectStatuses.indexOf(status) === -1) {
  290. throw new RangeError('Invalid status code');
  291. }
  292. return new Response(null, {
  293. status: status,
  294. headers: {
  295. location: url
  296. }
  297. });
  298. };
  299. self.Headers = Headers;
  300. self.Request = Request;
  301. self.Response = Response;
  302. self.fetch = function (input, init) {
  303. return new Promise(function (resolve, reject) {
  304. var request;
  305. if (Request.prototype.isPrototypeOf(input) && !init) {
  306. request = input;
  307. } else {
  308. request = new Request(input, init);
  309. }
  310. var xhr = new XMLHttpRequest();
  311. function responseURL() {
  312. if ('responseURL' in xhr) {
  313. return xhr.responseURL;
  314. } // Avoid security warnings on getResponseHeader when not allowed by CORS
  315. if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
  316. return xhr.getResponseHeader('X-Request-URL');
  317. }
  318. return;
  319. }
  320. var __onLoadHandled = false;
  321. function onload() {
  322. if (xhr.readyState !== 4) {
  323. return;
  324. }
  325. var status = xhr.status === 1223 ? 204 : xhr.status;
  326. if (status < 100 || status > 599) {
  327. if (__onLoadHandled) {
  328. return;
  329. } else {
  330. __onLoadHandled = true;
  331. }
  332. reject(new TypeError('Network request failed'));
  333. return;
  334. }
  335. var options = {
  336. status: status,
  337. statusText: xhr.statusText,
  338. headers: headers(xhr),
  339. url: responseURL()
  340. };
  341. var body = 'response' in xhr ? xhr.response : xhr.responseText;
  342. if (__onLoadHandled) {
  343. return;
  344. } else {
  345. __onLoadHandled = true;
  346. }
  347. resolve(new Response(body, options));
  348. }
  349. xhr.onreadystatechange = onload;
  350. xhr.onload = onload;
  351. xhr.onerror = function () {
  352. if (__onLoadHandled) {
  353. return;
  354. } else {
  355. __onLoadHandled = true;
  356. }
  357. reject(new TypeError('Network request failed'));
  358. };
  359. xhr.open(request.method, request.url, true); // `withCredentials` should be setted after calling `.open` in IE10
  360. // http://stackoverflow.com/a/19667959/1219343
  361. try {
  362. if (request.credentials === 'include') {
  363. if ('withCredentials' in xhr) {
  364. xhr.withCredentials = true;
  365. } else {
  366. console && console.warn && console.warn('withCredentials is not supported, you can ignore this warning');
  367. }
  368. }
  369. } catch (e) {
  370. console && console.warn && console.warn('set withCredentials error:' + e);
  371. }
  372. if ('responseType' in xhr && support.blob) {
  373. xhr.responseType = 'blob';
  374. }
  375. request.headers.forEach(function (value, name) {
  376. xhr.setRequestHeader(name, value);
  377. });
  378. xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
  379. });
  380. };
  381. self.fetch.polyfill = true; // Support CommonJS
  382. if ( true && module.exports) {
  383. module.exports = self.fetch;
  384. }
  385. })(typeof self !== 'undefined' ? self : this);
  386. /***/ }),
  387. /***/ 238:
  388. /***/ (function(module, exports) {
  389. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  390. if (true) {
  391. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  392. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  393. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  394. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  395. } else { var mod; }
  396. })(this, function (exports, module) {
  397. 'use strict';
  398. var defaultOptions = {
  399. timeout: 5000,
  400. jsonpCallback: 'callback',
  401. jsonpCallbackFunction: null
  402. };
  403. function generateCallbackFunction() {
  404. return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
  405. }
  406. function clearFunction(functionName) {
  407. // IE8 throws an exception when you try to delete a property on window
  408. // http://stackoverflow.com/a/1824228/751089
  409. try {
  410. delete window[functionName];
  411. } catch (e) {
  412. window[functionName] = undefined;
  413. }
  414. }
  415. function removeScript(scriptId) {
  416. var script = document.getElementById(scriptId);
  417. if (script) {
  418. document.getElementsByTagName('head')[0].removeChild(script);
  419. }
  420. }
  421. function fetchJsonp(_url) {
  422. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // to avoid param reassign
  423. var url = _url;
  424. var timeout = options.timeout || defaultOptions.timeout;
  425. var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
  426. var timeoutId = undefined;
  427. return new Promise(function (resolve, reject) {
  428. var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
  429. var scriptId = jsonpCallback + '_' + callbackFunction;
  430. window[callbackFunction] = function (response) {
  431. resolve({
  432. ok: true,
  433. // keep consistent with fetch API
  434. json: function json() {
  435. return Promise.resolve(response);
  436. }
  437. });
  438. if (timeoutId) clearTimeout(timeoutId);
  439. removeScript(scriptId);
  440. clearFunction(callbackFunction);
  441. }; // Check if the user set their own params, and if not add a ? to start a list of params
  442. url += url.indexOf('?') === -1 ? '?' : '&';
  443. var jsonpScript = document.createElement('script');
  444. jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
  445. if (options.charset) {
  446. jsonpScript.setAttribute('charset', options.charset);
  447. }
  448. jsonpScript.id = scriptId;
  449. document.getElementsByTagName('head')[0].appendChild(jsonpScript);
  450. timeoutId = setTimeout(function () {
  451. reject(new Error('JSONP request to ' + _url + ' timed out'));
  452. clearFunction(callbackFunction);
  453. removeScript(scriptId);
  454. window[callbackFunction] = function () {
  455. clearFunction(callbackFunction);
  456. };
  457. }, timeout); // Caught if got 404/500
  458. jsonpScript.onerror = function () {
  459. reject(new Error('JSONP request to ' + _url + ' failed'));
  460. clearFunction(callbackFunction);
  461. removeScript(scriptId);
  462. if (timeoutId) clearTimeout(timeoutId);
  463. };
  464. });
  465. } // export as global function
  466. /*
  467. let local;
  468. if (typeof global !== 'undefined') {
  469. local = global;
  470. } else if (typeof self !== 'undefined') {
  471. local = self;
  472. } else {
  473. try {
  474. local = Function('return this')();
  475. } catch (e) {
  476. throw new Error('polyfill failed because global object is unavailable in this environment');
  477. }
  478. }
  479. local.fetchJsonp = fetchJsonp;
  480. */
  481. module.exports = fetchJsonp;
  482. });
  483. /***/ }),
  484. /***/ 944:
  485. /***/ (function(module, exports, __webpack_require__) {
  486. /* module decorator */ module = __webpack_require__.nmd(module);
  487. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  488. /**
  489. * lodash (Custom Build) <https://lodash.com/>
  490. * Build: `lodash modularize exports="npm" -o ./`
  491. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  492. * Released under MIT license <https://lodash.com/license>
  493. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  494. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  495. */
  496. /** Used as the size to enable large array optimizations. */
  497. var LARGE_ARRAY_SIZE = 200;
  498. /** Used as the `TypeError` message for "Functions" methods. */
  499. var FUNC_ERROR_TEXT = 'Expected a function';
  500. /** Used to stand-in for `undefined` hash values. */
  501. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  502. /** Used to compose bitmasks for comparison styles. */
  503. var UNORDERED_COMPARE_FLAG = 1,
  504. PARTIAL_COMPARE_FLAG = 2;
  505. /** Used as references for various `Number` constants. */
  506. var INFINITY = 1 / 0,
  507. MAX_SAFE_INTEGER = 9007199254740991;
  508. /** `Object#toString` result references. */
  509. var argsTag = '[object Arguments]',
  510. arrayTag = '[object Array]',
  511. boolTag = '[object Boolean]',
  512. dateTag = '[object Date]',
  513. errorTag = '[object Error]',
  514. funcTag = '[object Function]',
  515. genTag = '[object GeneratorFunction]',
  516. mapTag = '[object Map]',
  517. numberTag = '[object Number]',
  518. objectTag = '[object Object]',
  519. promiseTag = '[object Promise]',
  520. regexpTag = '[object RegExp]',
  521. setTag = '[object Set]',
  522. stringTag = '[object String]',
  523. symbolTag = '[object Symbol]',
  524. weakMapTag = '[object WeakMap]';
  525. var arrayBufferTag = '[object ArrayBuffer]',
  526. dataViewTag = '[object DataView]',
  527. float32Tag = '[object Float32Array]',
  528. float64Tag = '[object Float64Array]',
  529. int8Tag = '[object Int8Array]',
  530. int16Tag = '[object Int16Array]',
  531. int32Tag = '[object Int32Array]',
  532. uint8Tag = '[object Uint8Array]',
  533. uint8ClampedTag = '[object Uint8ClampedArray]',
  534. uint16Tag = '[object Uint16Array]',
  535. uint32Tag = '[object Uint32Array]';
  536. /** Used to match property names within property paths. */
  537. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  538. reIsPlainProp = /^\w*$/,
  539. reLeadingDot = /^\./,
  540. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  541. /**
  542. * Used to match `RegExp`
  543. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  544. */
  545. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  546. /** Used to match backslashes in property paths. */
  547. var reEscapeChar = /\\(\\)?/g;
  548. /** Used to detect host constructors (Safari). */
  549. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  550. /** Used to detect unsigned integer values. */
  551. var reIsUint = /^(?:0|[1-9]\d*)$/;
  552. /** Used to identify `toStringTag` values of typed arrays. */
  553. var typedArrayTags = {};
  554. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  555. 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;
  556. /** Detect free variable `global` from Node.js. */
  557. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  558. /** Detect free variable `self`. */
  559. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  560. /** Used as a reference to the global object. */
  561. var root = freeGlobal || freeSelf || Function('return this')();
  562. /** Detect free variable `exports`. */
  563. var freeExports = ( false ? 0 : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  564. /** Detect free variable `module`. */
  565. var freeModule = freeExports && ( false ? 0 : _typeof(module)) == 'object' && module && !module.nodeType && module;
  566. /** Detect the popular CommonJS extension `module.exports`. */
  567. var moduleExports = freeModule && freeModule.exports === freeExports;
  568. /** Detect free variable `process` from Node.js. */
  569. var freeProcess = moduleExports && freeGlobal.process;
  570. /** Used to access faster Node.js helpers. */
  571. var nodeUtil = function () {
  572. try {
  573. return freeProcess && freeProcess.binding('util');
  574. } catch (e) {}
  575. }();
  576. /* Node.js helper references. */
  577. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  578. /**
  579. * A specialized version of `_.some` for arrays without support for iteratee
  580. * shorthands.
  581. *
  582. * @private
  583. * @param {Array} [array] The array to iterate over.
  584. * @param {Function} predicate The function invoked per iteration.
  585. * @returns {boolean} Returns `true` if any element passes the predicate check,
  586. * else `false`.
  587. */
  588. function arraySome(array, predicate) {
  589. var index = -1,
  590. length = array ? array.length : 0;
  591. while (++index < length) {
  592. if (predicate(array[index], index, array)) {
  593. return true;
  594. }
  595. }
  596. return false;
  597. }
  598. /**
  599. * The base implementation of `_.property` without support for deep paths.
  600. *
  601. * @private
  602. * @param {string} key The key of the property to get.
  603. * @returns {Function} Returns the new accessor function.
  604. */
  605. function baseProperty(key) {
  606. return function (object) {
  607. return object == null ? undefined : object[key];
  608. };
  609. }
  610. /**
  611. * The base implementation of `_.times` without support for iteratee shorthands
  612. * or max array length checks.
  613. *
  614. * @private
  615. * @param {number} n The number of times to invoke `iteratee`.
  616. * @param {Function} iteratee The function invoked per iteration.
  617. * @returns {Array} Returns the array of results.
  618. */
  619. function baseTimes(n, iteratee) {
  620. var index = -1,
  621. result = Array(n);
  622. while (++index < n) {
  623. result[index] = iteratee(index);
  624. }
  625. return result;
  626. }
  627. /**
  628. * The base implementation of `_.unary` without support for storing metadata.
  629. *
  630. * @private
  631. * @param {Function} func The function to cap arguments for.
  632. * @returns {Function} Returns the new capped function.
  633. */
  634. function baseUnary(func) {
  635. return function (value) {
  636. return func(value);
  637. };
  638. }
  639. /**
  640. * Gets the value at `key` of `object`.
  641. *
  642. * @private
  643. * @param {Object} [object] The object to query.
  644. * @param {string} key The key of the property to get.
  645. * @returns {*} Returns the property value.
  646. */
  647. function getValue(object, key) {
  648. return object == null ? undefined : object[key];
  649. }
  650. /**
  651. * Checks if `value` is a host object in IE < 9.
  652. *
  653. * @private
  654. * @param {*} value The value to check.
  655. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  656. */
  657. function isHostObject(value) {
  658. // Many host objects are `Object` objects that can coerce to strings
  659. // despite having improperly defined `toString` methods.
  660. var result = false;
  661. if (value != null && typeof value.toString != 'function') {
  662. try {
  663. result = !!(value + '');
  664. } catch (e) {}
  665. }
  666. return result;
  667. }
  668. /**
  669. * Converts `map` to its key-value pairs.
  670. *
  671. * @private
  672. * @param {Object} map The map to convert.
  673. * @returns {Array} Returns the key-value pairs.
  674. */
  675. function mapToArray(map) {
  676. var index = -1,
  677. result = Array(map.size);
  678. map.forEach(function (value, key) {
  679. result[++index] = [key, value];
  680. });
  681. return result;
  682. }
  683. /**
  684. * Creates a unary function that invokes `func` with its argument transformed.
  685. *
  686. * @private
  687. * @param {Function} func The function to wrap.
  688. * @param {Function} transform The argument transform.
  689. * @returns {Function} Returns the new function.
  690. */
  691. function overArg(func, transform) {
  692. return function (arg) {
  693. return func(transform(arg));
  694. };
  695. }
  696. /**
  697. * Converts `set` to an array of its values.
  698. *
  699. * @private
  700. * @param {Object} set The set to convert.
  701. * @returns {Array} Returns the values.
  702. */
  703. function setToArray(set) {
  704. var index = -1,
  705. result = Array(set.size);
  706. set.forEach(function (value) {
  707. result[++index] = value;
  708. });
  709. return result;
  710. }
  711. /** Used for built-in method references. */
  712. var arrayProto = Array.prototype,
  713. funcProto = Function.prototype,
  714. objectProto = Object.prototype;
  715. /** Used to detect overreaching core-js shims. */
  716. var coreJsData = root['__core-js_shared__'];
  717. /** Used to detect methods masquerading as native. */
  718. var maskSrcKey = function () {
  719. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  720. return uid ? 'Symbol(src)_1.' + uid : '';
  721. }();
  722. /** Used to resolve the decompiled source of functions. */
  723. var funcToString = funcProto.toString;
  724. /** Used to check objects for own properties. */
  725. var hasOwnProperty = objectProto.hasOwnProperty;
  726. /**
  727. * Used to resolve the
  728. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  729. * of values.
  730. */
  731. var objectToString = objectProto.toString;
  732. /** Used to detect if a method is native. */
  733. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  734. /** Built-in value references. */
  735. var _Symbol = root.Symbol,
  736. Uint8Array = root.Uint8Array,
  737. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  738. splice = arrayProto.splice;
  739. /* Built-in method references for those with the same name as other `lodash` methods. */
  740. var nativeKeys = overArg(Object.keys, Object);
  741. /* Built-in method references that are verified to be native. */
  742. var DataView = getNative(root, 'DataView'),
  743. Map = getNative(root, 'Map'),
  744. Promise = getNative(root, 'Promise'),
  745. Set = getNative(root, 'Set'),
  746. WeakMap = getNative(root, 'WeakMap'),
  747. nativeCreate = getNative(Object, 'create');
  748. /** Used to detect maps, sets, and weakmaps. */
  749. var dataViewCtorString = toSource(DataView),
  750. mapCtorString = toSource(Map),
  751. promiseCtorString = toSource(Promise),
  752. setCtorString = toSource(Set),
  753. weakMapCtorString = toSource(WeakMap);
  754. /** Used to convert symbols to primitives and strings. */
  755. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  756. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  757. symbolToString = symbolProto ? symbolProto.toString : undefined;
  758. /**
  759. * Creates a hash object.
  760. *
  761. * @private
  762. * @constructor
  763. * @param {Array} [entries] The key-value pairs to cache.
  764. */
  765. function Hash(entries) {
  766. var index = -1,
  767. length = entries ? entries.length : 0;
  768. this.clear();
  769. while (++index < length) {
  770. var entry = entries[index];
  771. this.set(entry[0], entry[1]);
  772. }
  773. }
  774. /**
  775. * Removes all key-value entries from the hash.
  776. *
  777. * @private
  778. * @name clear
  779. * @memberOf Hash
  780. */
  781. function hashClear() {
  782. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  783. }
  784. /**
  785. * Removes `key` and its value from the hash.
  786. *
  787. * @private
  788. * @name delete
  789. * @memberOf Hash
  790. * @param {Object} hash The hash to modify.
  791. * @param {string} key The key of the value to remove.
  792. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  793. */
  794. function hashDelete(key) {
  795. return this.has(key) && delete this.__data__[key];
  796. }
  797. /**
  798. * Gets the hash value for `key`.
  799. *
  800. * @private
  801. * @name get
  802. * @memberOf Hash
  803. * @param {string} key The key of the value to get.
  804. * @returns {*} Returns the entry value.
  805. */
  806. function hashGet(key) {
  807. var data = this.__data__;
  808. if (nativeCreate) {
  809. var result = data[key];
  810. return result === HASH_UNDEFINED ? undefined : result;
  811. }
  812. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  813. }
  814. /**
  815. * Checks if a hash value for `key` exists.
  816. *
  817. * @private
  818. * @name has
  819. * @memberOf Hash
  820. * @param {string} key The key of the entry to check.
  821. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  822. */
  823. function hashHas(key) {
  824. var data = this.__data__;
  825. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  826. }
  827. /**
  828. * Sets the hash `key` to `value`.
  829. *
  830. * @private
  831. * @name set
  832. * @memberOf Hash
  833. * @param {string} key The key of the value to set.
  834. * @param {*} value The value to set.
  835. * @returns {Object} Returns the hash instance.
  836. */
  837. function hashSet(key, value) {
  838. var data = this.__data__;
  839. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  840. return this;
  841. } // Add methods to `Hash`.
  842. Hash.prototype.clear = hashClear;
  843. Hash.prototype['delete'] = hashDelete;
  844. Hash.prototype.get = hashGet;
  845. Hash.prototype.has = hashHas;
  846. Hash.prototype.set = hashSet;
  847. /**
  848. * Creates an list cache object.
  849. *
  850. * @private
  851. * @constructor
  852. * @param {Array} [entries] The key-value pairs to cache.
  853. */
  854. function ListCache(entries) {
  855. var index = -1,
  856. length = entries ? entries.length : 0;
  857. this.clear();
  858. while (++index < length) {
  859. var entry = entries[index];
  860. this.set(entry[0], entry[1]);
  861. }
  862. }
  863. /**
  864. * Removes all key-value entries from the list cache.
  865. *
  866. * @private
  867. * @name clear
  868. * @memberOf ListCache
  869. */
  870. function listCacheClear() {
  871. this.__data__ = [];
  872. }
  873. /**
  874. * Removes `key` and its value from the list cache.
  875. *
  876. * @private
  877. * @name delete
  878. * @memberOf ListCache
  879. * @param {string} key The key of the value to remove.
  880. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  881. */
  882. function listCacheDelete(key) {
  883. var data = this.__data__,
  884. index = assocIndexOf(data, key);
  885. if (index < 0) {
  886. return false;
  887. }
  888. var lastIndex = data.length - 1;
  889. if (index == lastIndex) {
  890. data.pop();
  891. } else {
  892. splice.call(data, index, 1);
  893. }
  894. return true;
  895. }
  896. /**
  897. * Gets the list cache value for `key`.
  898. *
  899. * @private
  900. * @name get
  901. * @memberOf ListCache
  902. * @param {string} key The key of the value to get.
  903. * @returns {*} Returns the entry value.
  904. */
  905. function listCacheGet(key) {
  906. var data = this.__data__,
  907. index = assocIndexOf(data, key);
  908. return index < 0 ? undefined : data[index][1];
  909. }
  910. /**
  911. * Checks if a list cache value for `key` exists.
  912. *
  913. * @private
  914. * @name has
  915. * @memberOf ListCache
  916. * @param {string} key The key of the entry to check.
  917. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  918. */
  919. function listCacheHas(key) {
  920. return assocIndexOf(this.__data__, key) > -1;
  921. }
  922. /**
  923. * Sets the list cache `key` to `value`.
  924. *
  925. * @private
  926. * @name set
  927. * @memberOf ListCache
  928. * @param {string} key The key of the value to set.
  929. * @param {*} value The value to set.
  930. * @returns {Object} Returns the list cache instance.
  931. */
  932. function listCacheSet(key, value) {
  933. var data = this.__data__,
  934. index = assocIndexOf(data, key);
  935. if (index < 0) {
  936. data.push([key, value]);
  937. } else {
  938. data[index][1] = value;
  939. }
  940. return this;
  941. } // Add methods to `ListCache`.
  942. ListCache.prototype.clear = listCacheClear;
  943. ListCache.prototype['delete'] = listCacheDelete;
  944. ListCache.prototype.get = listCacheGet;
  945. ListCache.prototype.has = listCacheHas;
  946. ListCache.prototype.set = listCacheSet;
  947. /**
  948. * Creates a map cache object to store key-value pairs.
  949. *
  950. * @private
  951. * @constructor
  952. * @param {Array} [entries] The key-value pairs to cache.
  953. */
  954. function MapCache(entries) {
  955. var index = -1,
  956. length = entries ? entries.length : 0;
  957. this.clear();
  958. while (++index < length) {
  959. var entry = entries[index];
  960. this.set(entry[0], entry[1]);
  961. }
  962. }
  963. /**
  964. * Removes all key-value entries from the map.
  965. *
  966. * @private
  967. * @name clear
  968. * @memberOf MapCache
  969. */
  970. function mapCacheClear() {
  971. this.__data__ = {
  972. 'hash': new Hash(),
  973. 'map': new (Map || ListCache)(),
  974. 'string': new Hash()
  975. };
  976. }
  977. /**
  978. * Removes `key` and its value from the map.
  979. *
  980. * @private
  981. * @name delete
  982. * @memberOf MapCache
  983. * @param {string} key The key of the value to remove.
  984. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  985. */
  986. function mapCacheDelete(key) {
  987. return getMapData(this, key)['delete'](key);
  988. }
  989. /**
  990. * Gets the map value for `key`.
  991. *
  992. * @private
  993. * @name get
  994. * @memberOf MapCache
  995. * @param {string} key The key of the value to get.
  996. * @returns {*} Returns the entry value.
  997. */
  998. function mapCacheGet(key) {
  999. return getMapData(this, key).get(key);
  1000. }
  1001. /**
  1002. * Checks if a map value for `key` exists.
  1003. *
  1004. * @private
  1005. * @name has
  1006. * @memberOf MapCache
  1007. * @param {string} key The key of the entry to check.
  1008. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1009. */
  1010. function mapCacheHas(key) {
  1011. return getMapData(this, key).has(key);
  1012. }
  1013. /**
  1014. * Sets the map `key` to `value`.
  1015. *
  1016. * @private
  1017. * @name set
  1018. * @memberOf MapCache
  1019. * @param {string} key The key of the value to set.
  1020. * @param {*} value The value to set.
  1021. * @returns {Object} Returns the map cache instance.
  1022. */
  1023. function mapCacheSet(key, value) {
  1024. getMapData(this, key).set(key, value);
  1025. return this;
  1026. } // Add methods to `MapCache`.
  1027. MapCache.prototype.clear = mapCacheClear;
  1028. MapCache.prototype['delete'] = mapCacheDelete;
  1029. MapCache.prototype.get = mapCacheGet;
  1030. MapCache.prototype.has = mapCacheHas;
  1031. MapCache.prototype.set = mapCacheSet;
  1032. /**
  1033. *
  1034. * Creates an array cache object to store unique values.
  1035. *
  1036. * @private
  1037. * @constructor
  1038. * @param {Array} [values] The values to cache.
  1039. */
  1040. function SetCache(values) {
  1041. var index = -1,
  1042. length = values ? values.length : 0;
  1043. this.__data__ = new MapCache();
  1044. while (++index < length) {
  1045. this.add(values[index]);
  1046. }
  1047. }
  1048. /**
  1049. * Adds `value` to the array cache.
  1050. *
  1051. * @private
  1052. * @name add
  1053. * @memberOf SetCache
  1054. * @alias push
  1055. * @param {*} value The value to cache.
  1056. * @returns {Object} Returns the cache instance.
  1057. */
  1058. function setCacheAdd(value) {
  1059. this.__data__.set(value, HASH_UNDEFINED);
  1060. return this;
  1061. }
  1062. /**
  1063. * Checks if `value` is in the array cache.
  1064. *
  1065. * @private
  1066. * @name has
  1067. * @memberOf SetCache
  1068. * @param {*} value The value to search for.
  1069. * @returns {number} Returns `true` if `value` is found, else `false`.
  1070. */
  1071. function setCacheHas(value) {
  1072. return this.__data__.has(value);
  1073. } // Add methods to `SetCache`.
  1074. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1075. SetCache.prototype.has = setCacheHas;
  1076. /**
  1077. * Creates a stack cache object to store key-value pairs.
  1078. *
  1079. * @private
  1080. * @constructor
  1081. * @param {Array} [entries] The key-value pairs to cache.
  1082. */
  1083. function Stack(entries) {
  1084. this.__data__ = new ListCache(entries);
  1085. }
  1086. /**
  1087. * Removes all key-value entries from the stack.
  1088. *
  1089. * @private
  1090. * @name clear
  1091. * @memberOf Stack
  1092. */
  1093. function stackClear() {
  1094. this.__data__ = new ListCache();
  1095. }
  1096. /**
  1097. * Removes `key` and its value from the stack.
  1098. *
  1099. * @private
  1100. * @name delete
  1101. * @memberOf Stack
  1102. * @param {string} key The key of the value to remove.
  1103. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1104. */
  1105. function stackDelete(key) {
  1106. return this.__data__['delete'](key);
  1107. }
  1108. /**
  1109. * Gets the stack value for `key`.
  1110. *
  1111. * @private
  1112. * @name get
  1113. * @memberOf Stack
  1114. * @param {string} key The key of the value to get.
  1115. * @returns {*} Returns the entry value.
  1116. */
  1117. function stackGet(key) {
  1118. return this.__data__.get(key);
  1119. }
  1120. /**
  1121. * Checks if a stack value for `key` exists.
  1122. *
  1123. * @private
  1124. * @name has
  1125. * @memberOf Stack
  1126. * @param {string} key The key of the entry to check.
  1127. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1128. */
  1129. function stackHas(key) {
  1130. return this.__data__.has(key);
  1131. }
  1132. /**
  1133. * Sets the stack `key` to `value`.
  1134. *
  1135. * @private
  1136. * @name set
  1137. * @memberOf Stack
  1138. * @param {string} key The key of the value to set.
  1139. * @param {*} value The value to set.
  1140. * @returns {Object} Returns the stack cache instance.
  1141. */
  1142. function stackSet(key, value) {
  1143. var cache = this.__data__;
  1144. if (cache instanceof ListCache) {
  1145. var pairs = cache.__data__;
  1146. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  1147. pairs.push([key, value]);
  1148. return this;
  1149. }
  1150. cache = this.__data__ = new MapCache(pairs);
  1151. }
  1152. cache.set(key, value);
  1153. return this;
  1154. } // Add methods to `Stack`.
  1155. Stack.prototype.clear = stackClear;
  1156. Stack.prototype['delete'] = stackDelete;
  1157. Stack.prototype.get = stackGet;
  1158. Stack.prototype.has = stackHas;
  1159. Stack.prototype.set = stackSet;
  1160. /**
  1161. * Creates an array of the enumerable property names of the array-like `value`.
  1162. *
  1163. * @private
  1164. * @param {*} value The value to query.
  1165. * @param {boolean} inherited Specify returning inherited property names.
  1166. * @returns {Array} Returns the array of property names.
  1167. */
  1168. function arrayLikeKeys(value, inherited) {
  1169. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  1170. // Safari 9 makes `arguments.length` enumerable in strict mode.
  1171. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  1172. var length = result.length,
  1173. skipIndexes = !!length;
  1174. for (var key in value) {
  1175. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  1176. result.push(key);
  1177. }
  1178. }
  1179. return result;
  1180. }
  1181. /**
  1182. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1183. *
  1184. * @private
  1185. * @param {Array} array The array to inspect.
  1186. * @param {*} key The key to search for.
  1187. * @returns {number} Returns the index of the matched value, else `-1`.
  1188. */
  1189. function assocIndexOf(array, key) {
  1190. var length = array.length;
  1191. while (length--) {
  1192. if (eq(array[length][0], key)) {
  1193. return length;
  1194. }
  1195. }
  1196. return -1;
  1197. }
  1198. /**
  1199. * The base implementation of `_.get` without support for default values.
  1200. *
  1201. * @private
  1202. * @param {Object} object The object to query.
  1203. * @param {Array|string} path The path of the property to get.
  1204. * @returns {*} Returns the resolved value.
  1205. */
  1206. function baseGet(object, path) {
  1207. path = isKey(path, object) ? [path] : castPath(path);
  1208. var index = 0,
  1209. length = path.length;
  1210. while (object != null && index < length) {
  1211. object = object[toKey(path[index++])];
  1212. }
  1213. return index && index == length ? object : undefined;
  1214. }
  1215. /**
  1216. * The base implementation of `getTag`.
  1217. *
  1218. * @private
  1219. * @param {*} value The value to query.
  1220. * @returns {string} Returns the `toStringTag`.
  1221. */
  1222. function baseGetTag(value) {
  1223. return objectToString.call(value);
  1224. }
  1225. /**
  1226. * The base implementation of `_.hasIn` without support for deep paths.
  1227. *
  1228. * @private
  1229. * @param {Object} [object] The object to query.
  1230. * @param {Array|string} key The key to check.
  1231. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  1232. */
  1233. function baseHasIn(object, key) {
  1234. return object != null && key in Object(object);
  1235. }
  1236. /**
  1237. * The base implementation of `_.isEqual` which supports partial comparisons
  1238. * and tracks traversed objects.
  1239. *
  1240. * @private
  1241. * @param {*} value The value to compare.
  1242. * @param {*} other The other value to compare.
  1243. * @param {Function} [customizer] The function to customize comparisons.
  1244. * @param {boolean} [bitmask] The bitmask of comparison flags.
  1245. * The bitmask may be composed of the following flags:
  1246. * 1 - Unordered comparison
  1247. * 2 - Partial comparison
  1248. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  1249. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1250. */
  1251. function baseIsEqual(value, other, customizer, bitmask, stack) {
  1252. if (value === other) {
  1253. return true;
  1254. }
  1255. if (value == null || other == null || !isObject(value) && !isObjectLike(other)) {
  1256. return value !== value && other !== other;
  1257. }
  1258. return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
  1259. }
  1260. /**
  1261. * A specialized version of `baseIsEqual` for arrays and objects which performs
  1262. * deep comparisons and tracks traversed objects enabling objects with circular
  1263. * references to be compared.
  1264. *
  1265. * @private
  1266. * @param {Object} object The object to compare.
  1267. * @param {Object} other The other object to compare.
  1268. * @param {Function} equalFunc The function to determine equivalents of values.
  1269. * @param {Function} [customizer] The function to customize comparisons.
  1270. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
  1271. * for more details.
  1272. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  1273. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  1274. */
  1275. function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
  1276. var objIsArr = isArray(object),
  1277. othIsArr = isArray(other),
  1278. objTag = arrayTag,
  1279. othTag = arrayTag;
  1280. if (!objIsArr) {
  1281. objTag = getTag(object);
  1282. objTag = objTag == argsTag ? objectTag : objTag;
  1283. }
  1284. if (!othIsArr) {
  1285. othTag = getTag(other);
  1286. othTag = othTag == argsTag ? objectTag : othTag;
  1287. }
  1288. var objIsObj = objTag == objectTag && !isHostObject(object),
  1289. othIsObj = othTag == objectTag && !isHostObject(other),
  1290. isSameTag = objTag == othTag;
  1291. if (isSameTag && !objIsObj) {
  1292. stack || (stack = new Stack());
  1293. return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
  1294. }
  1295. if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
  1296. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  1297. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  1298. if (objIsWrapped || othIsWrapped) {
  1299. var objUnwrapped = objIsWrapped ? object.value() : object,
  1300. othUnwrapped = othIsWrapped ? other.value() : other;
  1301. stack || (stack = new Stack());
  1302. return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
  1303. }
  1304. }
  1305. if (!isSameTag) {
  1306. return false;
  1307. }
  1308. stack || (stack = new Stack());
  1309. return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
  1310. }
  1311. /**
  1312. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  1313. *
  1314. * @private
  1315. * @param {Object} object The object to inspect.
  1316. * @param {Object} source The object of property values to match.
  1317. * @param {Array} matchData The property names, values, and compare flags to match.
  1318. * @param {Function} [customizer] The function to customize comparisons.
  1319. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  1320. */
  1321. function baseIsMatch(object, source, matchData, customizer) {
  1322. var index = matchData.length,
  1323. length = index,
  1324. noCustomizer = !customizer;
  1325. if (object == null) {
  1326. return !length;
  1327. }
  1328. object = Object(object);
  1329. while (index--) {
  1330. var data = matchData[index];
  1331. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  1332. return false;
  1333. }
  1334. }
  1335. while (++index < length) {
  1336. data = matchData[index];
  1337. var key = data[0],
  1338. objValue = object[key],
  1339. srcValue = data[1];
  1340. if (noCustomizer && data[2]) {
  1341. if (objValue === undefined && !(key in object)) {
  1342. return false;
  1343. }
  1344. } else {
  1345. var stack = new Stack();
  1346. if (customizer) {
  1347. var result = customizer(objValue, srcValue, key, object, source, stack);
  1348. }
  1349. if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
  1350. return false;
  1351. }
  1352. }
  1353. }
  1354. return true;
  1355. }
  1356. /**
  1357. * The base implementation of `_.isNative` without bad shim checks.
  1358. *
  1359. * @private
  1360. * @param {*} value The value to check.
  1361. * @returns {boolean} Returns `true` if `value` is a native function,
  1362. * else `false`.
  1363. */
  1364. function baseIsNative(value) {
  1365. if (!isObject(value) || isMasked(value)) {
  1366. return false;
  1367. }
  1368. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  1369. return pattern.test(toSource(value));
  1370. }
  1371. /**
  1372. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  1373. *
  1374. * @private
  1375. * @param {*} value The value to check.
  1376. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  1377. */
  1378. function baseIsTypedArray(value) {
  1379. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
  1380. }
  1381. /**
  1382. * The base implementation of `_.iteratee`.
  1383. *
  1384. * @private
  1385. * @param {*} [value=_.identity] The value to convert to an iteratee.
  1386. * @returns {Function} Returns the iteratee.
  1387. */
  1388. function baseIteratee(value) {
  1389. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  1390. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  1391. if (typeof value == 'function') {
  1392. return value;
  1393. }
  1394. if (value == null) {
  1395. return identity;
  1396. }
  1397. if (_typeof(value) == 'object') {
  1398. return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  1399. }
  1400. return property(value);
  1401. }
  1402. /**
  1403. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  1404. *
  1405. * @private
  1406. * @param {Object} object The object to query.
  1407. * @returns {Array} Returns the array of property names.
  1408. */
  1409. function baseKeys(object) {
  1410. if (!isPrototype(object)) {
  1411. return nativeKeys(object);
  1412. }
  1413. var result = [];
  1414. for (var key in Object(object)) {
  1415. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  1416. result.push(key);
  1417. }
  1418. }
  1419. return result;
  1420. }
  1421. /**
  1422. * The base implementation of `_.matches` which doesn't clone `source`.
  1423. *
  1424. * @private
  1425. * @param {Object} source The object of property values to match.
  1426. * @returns {Function} Returns the new spec function.
  1427. */
  1428. function baseMatches(source) {
  1429. var matchData = getMatchData(source);
  1430. if (matchData.length == 1 && matchData[0][2]) {
  1431. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  1432. }
  1433. return function (object) {
  1434. return object === source || baseIsMatch(object, source, matchData);
  1435. };
  1436. }
  1437. /**
  1438. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  1439. *
  1440. * @private
  1441. * @param {string} path The path of the property to get.
  1442. * @param {*} srcValue The value to match.
  1443. * @returns {Function} Returns the new spec function.
  1444. */
  1445. function baseMatchesProperty(path, srcValue) {
  1446. if (isKey(path) && isStrictComparable(srcValue)) {
  1447. return matchesStrictComparable(toKey(path), srcValue);
  1448. }
  1449. return function (object) {
  1450. var objValue = get(object, path);
  1451. return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
  1452. };
  1453. }
  1454. /**
  1455. * A specialized version of `baseProperty` which supports deep paths.
  1456. *
  1457. * @private
  1458. * @param {Array|string} path The path of the property to get.
  1459. * @returns {Function} Returns the new accessor function.
  1460. */
  1461. function basePropertyDeep(path) {
  1462. return function (object) {
  1463. return baseGet(object, path);
  1464. };
  1465. }
  1466. /**
  1467. * The base implementation of `_.pullAt` without support for individual
  1468. * indexes or capturing the removed elements.
  1469. *
  1470. * @private
  1471. * @param {Array} array The array to modify.
  1472. * @param {number[]} indexes The indexes of elements to remove.
  1473. * @returns {Array} Returns `array`.
  1474. */
  1475. function basePullAt(array, indexes) {
  1476. var length = array ? indexes.length : 0,
  1477. lastIndex = length - 1;
  1478. while (length--) {
  1479. var index = indexes[length];
  1480. if (length == lastIndex || index !== previous) {
  1481. var previous = index;
  1482. if (isIndex(index)) {
  1483. splice.call(array, index, 1);
  1484. } else if (!isKey(index, array)) {
  1485. var path = castPath(index),
  1486. object = parent(array, path);
  1487. if (object != null) {
  1488. delete object[toKey(last(path))];
  1489. }
  1490. } else {
  1491. delete array[toKey(index)];
  1492. }
  1493. }
  1494. }
  1495. return array;
  1496. }
  1497. /**
  1498. * The base implementation of `_.slice` without an iteratee call guard.
  1499. *
  1500. * @private
  1501. * @param {Array} array The array to slice.
  1502. * @param {number} [start=0] The start position.
  1503. * @param {number} [end=array.length] The end position.
  1504. * @returns {Array} Returns the slice of `array`.
  1505. */
  1506. function baseSlice(array, start, end) {
  1507. var index = -1,
  1508. length = array.length;
  1509. if (start < 0) {
  1510. start = -start > length ? 0 : length + start;
  1511. }
  1512. end = end > length ? length : end;
  1513. if (end < 0) {
  1514. end += length;
  1515. }
  1516. length = start > end ? 0 : end - start >>> 0;
  1517. start >>>= 0;
  1518. var result = Array(length);
  1519. while (++index < length) {
  1520. result[index] = array[index + start];
  1521. }
  1522. return result;
  1523. }
  1524. /**
  1525. * The base implementation of `_.toString` which doesn't convert nullish
  1526. * values to empty strings.
  1527. *
  1528. * @private
  1529. * @param {*} value The value to process.
  1530. * @returns {string} Returns the string.
  1531. */
  1532. function baseToString(value) {
  1533. // Exit early for strings to avoid a performance hit in some environments.
  1534. if (typeof value == 'string') {
  1535. return value;
  1536. }
  1537. if (isSymbol(value)) {
  1538. return symbolToString ? symbolToString.call(value) : '';
  1539. }
  1540. var result = value + '';
  1541. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  1542. }
  1543. /**
  1544. * Casts `value` to a path array if it's not one.
  1545. *
  1546. * @private
  1547. * @param {*} value The value to inspect.
  1548. * @returns {Array} Returns the cast property path array.
  1549. */
  1550. function castPath(value) {
  1551. return isArray(value) ? value : stringToPath(value);
  1552. }
  1553. /**
  1554. * A specialized version of `baseIsEqualDeep` for arrays with support for
  1555. * partial deep comparisons.
  1556. *
  1557. * @private
  1558. * @param {Array} array The array to compare.
  1559. * @param {Array} other The other array to compare.
  1560. * @param {Function} equalFunc The function to determine equivalents of values.
  1561. * @param {Function} customizer The function to customize comparisons.
  1562. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  1563. * for more details.
  1564. * @param {Object} stack Tracks traversed `array` and `other` objects.
  1565. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  1566. */
  1567. function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
  1568. var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
  1569. arrLength = array.length,
  1570. othLength = other.length;
  1571. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  1572. return false;
  1573. } // Assume cyclic values are equal.
  1574. var stacked = stack.get(array);
  1575. if (stacked && stack.get(other)) {
  1576. return stacked == other;
  1577. }
  1578. var index = -1,
  1579. result = true,
  1580. seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : undefined;
  1581. stack.set(array, other);
  1582. stack.set(other, array); // Ignore non-index properties.
  1583. while (++index < arrLength) {
  1584. var arrValue = array[index],
  1585. othValue = other[index];
  1586. if (customizer) {
  1587. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  1588. }
  1589. if (compared !== undefined) {
  1590. if (compared) {
  1591. continue;
  1592. }
  1593. result = false;
  1594. break;
  1595. } // Recursively compare arrays (susceptible to call stack limits).
  1596. if (seen) {
  1597. if (!arraySome(other, function (othValue, othIndex) {
  1598. if (!seen.has(othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
  1599. return seen.add(othIndex);
  1600. }
  1601. })) {
  1602. result = false;
  1603. break;
  1604. }
  1605. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
  1606. result = false;
  1607. break;
  1608. }
  1609. }
  1610. stack['delete'](array);
  1611. stack['delete'](other);
  1612. return result;
  1613. }
  1614. /**
  1615. * A specialized version of `baseIsEqualDeep` for comparing objects of
  1616. * the same `toStringTag`.
  1617. *
  1618. * **Note:** This function only supports comparing values with tags of
  1619. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  1620. *
  1621. * @private
  1622. * @param {Object} object The object to compare.
  1623. * @param {Object} other The other object to compare.
  1624. * @param {string} tag The `toStringTag` of the objects to compare.
  1625. * @param {Function} equalFunc The function to determine equivalents of values.
  1626. * @param {Function} customizer The function to customize comparisons.
  1627. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  1628. * for more details.
  1629. * @param {Object} stack Tracks traversed `object` and `other` objects.
  1630. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  1631. */
  1632. function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
  1633. switch (tag) {
  1634. case dataViewTag:
  1635. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  1636. return false;
  1637. }
  1638. object = object.buffer;
  1639. other = other.buffer;
  1640. case arrayBufferTag:
  1641. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  1642. return false;
  1643. }
  1644. return true;
  1645. case boolTag:
  1646. case dateTag:
  1647. case numberTag:
  1648. // Coerce booleans to `1` or `0` and dates to milliseconds.
  1649. // Invalid dates are coerced to `NaN`.
  1650. return eq(+object, +other);
  1651. case errorTag:
  1652. return object.name == other.name && object.message == other.message;
  1653. case regexpTag:
  1654. case stringTag:
  1655. // Coerce regexes to strings and treat strings, primitives and objects,
  1656. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  1657. // for more details.
  1658. return object == other + '';
  1659. case mapTag:
  1660. var convert = mapToArray;
  1661. case setTag:
  1662. var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
  1663. convert || (convert = setToArray);
  1664. if (object.size != other.size && !isPartial) {
  1665. return false;
  1666. } // Assume cyclic values are equal.
  1667. var stacked = stack.get(object);
  1668. if (stacked) {
  1669. return stacked == other;
  1670. }
  1671. bitmask |= UNORDERED_COMPARE_FLAG; // Recursively compare objects (susceptible to call stack limits).
  1672. stack.set(object, other);
  1673. var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
  1674. stack['delete'](object);
  1675. return result;
  1676. case symbolTag:
  1677. if (symbolValueOf) {
  1678. return symbolValueOf.call(object) == symbolValueOf.call(other);
  1679. }
  1680. }
  1681. return false;
  1682. }
  1683. /**
  1684. * A specialized version of `baseIsEqualDeep` for objects with support for
  1685. * partial deep comparisons.
  1686. *
  1687. * @private
  1688. * @param {Object} object The object to compare.
  1689. * @param {Object} other The other object to compare.
  1690. * @param {Function} equalFunc The function to determine equivalents of values.
  1691. * @param {Function} customizer The function to customize comparisons.
  1692. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  1693. * for more details.
  1694. * @param {Object} stack Tracks traversed `object` and `other` objects.
  1695. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  1696. */
  1697. function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
  1698. var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
  1699. objProps = keys(object),
  1700. objLength = objProps.length,
  1701. othProps = keys(other),
  1702. othLength = othProps.length;
  1703. if (objLength != othLength && !isPartial) {
  1704. return false;
  1705. }
  1706. var index = objLength;
  1707. while (index--) {
  1708. var key = objProps[index];
  1709. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  1710. return false;
  1711. }
  1712. } // Assume cyclic values are equal.
  1713. var stacked = stack.get(object);
  1714. if (stacked && stack.get(other)) {
  1715. return stacked == other;
  1716. }
  1717. var result = true;
  1718. stack.set(object, other);
  1719. stack.set(other, object);
  1720. var skipCtor = isPartial;
  1721. while (++index < objLength) {
  1722. key = objProps[index];
  1723. var objValue = object[key],
  1724. othValue = other[key];
  1725. if (customizer) {
  1726. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  1727. } // Recursively compare objects (susceptible to call stack limits).
  1728. if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
  1729. result = false;
  1730. break;
  1731. }
  1732. skipCtor || (skipCtor = key == 'constructor');
  1733. }
  1734. if (result && !skipCtor) {
  1735. var objCtor = object.constructor,
  1736. othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.
  1737. if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  1738. result = false;
  1739. }
  1740. }
  1741. stack['delete'](object);
  1742. stack['delete'](other);
  1743. return result;
  1744. }
  1745. /**
  1746. * Gets the data for `map`.
  1747. *
  1748. * @private
  1749. * @param {Object} map The map to query.
  1750. * @param {string} key The reference key.
  1751. * @returns {*} Returns the map data.
  1752. */
  1753. function getMapData(map, key) {
  1754. var data = map.__data__;
  1755. return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
  1756. }
  1757. /**
  1758. * Gets the property names, values, and compare flags of `object`.
  1759. *
  1760. * @private
  1761. * @param {Object} object The object to query.
  1762. * @returns {Array} Returns the match data of `object`.
  1763. */
  1764. function getMatchData(object) {
  1765. var result = keys(object),
  1766. length = result.length;
  1767. while (length--) {
  1768. var key = result[length],
  1769. value = object[key];
  1770. result[length] = [key, value, isStrictComparable(value)];
  1771. }
  1772. return result;
  1773. }
  1774. /**
  1775. * Gets the native function at `key` of `object`.
  1776. *
  1777. * @private
  1778. * @param {Object} object The object to query.
  1779. * @param {string} key The key of the method to get.
  1780. * @returns {*} Returns the function if it's native, else `undefined`.
  1781. */
  1782. function getNative(object, key) {
  1783. var value = getValue(object, key);
  1784. return baseIsNative(value) ? value : undefined;
  1785. }
  1786. /**
  1787. * Gets the `toStringTag` of `value`.
  1788. *
  1789. * @private
  1790. * @param {*} value The value to query.
  1791. * @returns {string} Returns the `toStringTag`.
  1792. */
  1793. var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11,
  1794. // for data views in Edge < 14, and promises in Node.js.
  1795. 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) {
  1796. getTag = function getTag(value) {
  1797. var result = objectToString.call(value),
  1798. Ctor = result == objectTag ? value.constructor : undefined,
  1799. ctorString = Ctor ? toSource(Ctor) : undefined;
  1800. if (ctorString) {
  1801. switch (ctorString) {
  1802. case dataViewCtorString:
  1803. return dataViewTag;
  1804. case mapCtorString:
  1805. return mapTag;
  1806. case promiseCtorString:
  1807. return promiseTag;
  1808. case setCtorString:
  1809. return setTag;
  1810. case weakMapCtorString:
  1811. return weakMapTag;
  1812. }
  1813. }
  1814. return result;
  1815. };
  1816. }
  1817. /**
  1818. * Checks if `path` exists on `object`.
  1819. *
  1820. * @private
  1821. * @param {Object} object The object to query.
  1822. * @param {Array|string} path The path to check.
  1823. * @param {Function} hasFunc The function to check properties.
  1824. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  1825. */
  1826. function hasPath(object, path, hasFunc) {
  1827. path = isKey(path, object) ? [path] : castPath(path);
  1828. var result,
  1829. index = -1,
  1830. length = path.length;
  1831. while (++index < length) {
  1832. var key = toKey(path[index]);
  1833. if (!(result = object != null && hasFunc(object, key))) {
  1834. break;
  1835. }
  1836. object = object[key];
  1837. }
  1838. if (result) {
  1839. return result;
  1840. }
  1841. var length = object ? object.length : 0;
  1842. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  1843. }
  1844. /**
  1845. * Checks if `value` is a valid array-like index.
  1846. *
  1847. * @private
  1848. * @param {*} value The value to check.
  1849. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  1850. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  1851. */
  1852. function isIndex(value, length) {
  1853. length = length == null ? MAX_SAFE_INTEGER : length;
  1854. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  1855. }
  1856. /**
  1857. * Checks if `value` is a property name and not a property path.
  1858. *
  1859. * @private
  1860. * @param {*} value The value to check.
  1861. * @param {Object} [object] The object to query keys on.
  1862. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  1863. */
  1864. function isKey(value, object) {
  1865. if (isArray(value)) {
  1866. return false;
  1867. }
  1868. var type = _typeof(value);
  1869. if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
  1870. return true;
  1871. }
  1872. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  1873. }
  1874. /**
  1875. * Checks if `value` is suitable for use as unique object key.
  1876. *
  1877. * @private
  1878. * @param {*} value The value to check.
  1879. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1880. */
  1881. function isKeyable(value) {
  1882. var type = _typeof(value);
  1883. return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
  1884. }
  1885. /**
  1886. * Checks if `func` has its source masked.
  1887. *
  1888. * @private
  1889. * @param {Function} func The function to check.
  1890. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1891. */
  1892. function isMasked(func) {
  1893. return !!maskSrcKey && maskSrcKey in func;
  1894. }
  1895. /**
  1896. * Checks if `value` is likely a prototype object.
  1897. *
  1898. * @private
  1899. * @param {*} value The value to check.
  1900. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  1901. */
  1902. function isPrototype(value) {
  1903. var Ctor = value && value.constructor,
  1904. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  1905. return value === proto;
  1906. }
  1907. /**
  1908. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  1909. *
  1910. * @private
  1911. * @param {*} value The value to check.
  1912. * @returns {boolean} Returns `true` if `value` if suitable for strict
  1913. * equality comparisons, else `false`.
  1914. */
  1915. function isStrictComparable(value) {
  1916. return value === value && !isObject(value);
  1917. }
  1918. /**
  1919. * A specialized version of `matchesProperty` for source values suitable
  1920. * for strict equality comparisons, i.e. `===`.
  1921. *
  1922. * @private
  1923. * @param {string} key The key of the property to get.
  1924. * @param {*} srcValue The value to match.
  1925. * @returns {Function} Returns the new spec function.
  1926. */
  1927. function matchesStrictComparable(key, srcValue) {
  1928. return function (object) {
  1929. if (object == null) {
  1930. return false;
  1931. }
  1932. return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
  1933. };
  1934. }
  1935. /**
  1936. * Gets the parent value at `path` of `object`.
  1937. *
  1938. * @private
  1939. * @param {Object} object The object to query.
  1940. * @param {Array} path The path to get the parent value of.
  1941. * @returns {*} Returns the parent value.
  1942. */
  1943. function parent(object, path) {
  1944. return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
  1945. }
  1946. /**
  1947. * Converts `string` to a property path array.
  1948. *
  1949. * @private
  1950. * @param {string} string The string to convert.
  1951. * @returns {Array} Returns the property path array.
  1952. */
  1953. var stringToPath = memoize(function (string) {
  1954. string = toString(string);
  1955. var result = [];
  1956. if (reLeadingDot.test(string)) {
  1957. result.push('');
  1958. }
  1959. string.replace(rePropName, function (match, number, quote, string) {
  1960. result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
  1961. });
  1962. return result;
  1963. });
  1964. /**
  1965. * Converts `value` to a string key if it's not a string or symbol.
  1966. *
  1967. * @private
  1968. * @param {*} value The value to inspect.
  1969. * @returns {string|symbol} Returns the key.
  1970. */
  1971. function toKey(value) {
  1972. if (typeof value == 'string' || isSymbol(value)) {
  1973. return value;
  1974. }
  1975. var result = value + '';
  1976. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  1977. }
  1978. /**
  1979. * Converts `func` to its source code.
  1980. *
  1981. * @private
  1982. * @param {Function} func The function to process.
  1983. * @returns {string} Returns the source code.
  1984. */
  1985. function toSource(func) {
  1986. if (func != null) {
  1987. try {
  1988. return funcToString.call(func);
  1989. } catch (e) {}
  1990. try {
  1991. return func + '';
  1992. } catch (e) {}
  1993. }
  1994. return '';
  1995. }
  1996. /**
  1997. * Gets the last element of `array`.
  1998. *
  1999. * @static
  2000. * @memberOf _
  2001. * @since 0.1.0
  2002. * @category Array
  2003. * @param {Array} array The array to query.
  2004. * @returns {*} Returns the last element of `array`.
  2005. * @example
  2006. *
  2007. * _.last([1, 2, 3]);
  2008. * // => 3
  2009. */
  2010. function last(array) {
  2011. var length = array ? array.length : 0;
  2012. return length ? array[length - 1] : undefined;
  2013. }
  2014. /**
  2015. * Removes all elements from `array` that `predicate` returns truthy for
  2016. * and returns an array of the removed elements. The predicate is invoked
  2017. * with three arguments: (value, index, array).
  2018. *
  2019. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  2020. * to pull elements from an array by value.
  2021. *
  2022. * @static
  2023. * @memberOf _
  2024. * @since 2.0.0
  2025. * @category Array
  2026. * @param {Array} array The array to modify.
  2027. * @param {Function} [predicate=_.identity]
  2028. * The function invoked per iteration.
  2029. * @returns {Array} Returns the new array of removed elements.
  2030. * @example
  2031. *
  2032. * var array = [1, 2, 3, 4];
  2033. * var evens = _.remove(array, function(n) {
  2034. * return n % 2 == 0;
  2035. * });
  2036. *
  2037. * console.log(array);
  2038. * // => [1, 3]
  2039. *
  2040. * console.log(evens);
  2041. * // => [2, 4]
  2042. */
  2043. function remove(array, predicate) {
  2044. var result = [];
  2045. if (!(array && array.length)) {
  2046. return result;
  2047. }
  2048. var index = -1,
  2049. indexes = [],
  2050. length = array.length;
  2051. predicate = baseIteratee(predicate, 3);
  2052. while (++index < length) {
  2053. var value = array[index];
  2054. if (predicate(value, index, array)) {
  2055. result.push(value);
  2056. indexes.push(index);
  2057. }
  2058. }
  2059. basePullAt(array, indexes);
  2060. return result;
  2061. }
  2062. /**
  2063. * Creates a function that memoizes the result of `func`. If `resolver` is
  2064. * provided, it determines the cache key for storing the result based on the
  2065. * arguments provided to the memoized function. By default, the first argument
  2066. * provided to the memoized function is used as the map cache key. The `func`
  2067. * is invoked with the `this` binding of the memoized function.
  2068. *
  2069. * **Note:** The cache is exposed as the `cache` property on the memoized
  2070. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  2071. * constructor with one whose instances implement the
  2072. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  2073. * method interface of `delete`, `get`, `has`, and `set`.
  2074. *
  2075. * @static
  2076. * @memberOf _
  2077. * @since 0.1.0
  2078. * @category Function
  2079. * @param {Function} func The function to have its output memoized.
  2080. * @param {Function} [resolver] The function to resolve the cache key.
  2081. * @returns {Function} Returns the new memoized function.
  2082. * @example
  2083. *
  2084. * var object = { 'a': 1, 'b': 2 };
  2085. * var other = { 'c': 3, 'd': 4 };
  2086. *
  2087. * var values = _.memoize(_.values);
  2088. * values(object);
  2089. * // => [1, 2]
  2090. *
  2091. * values(other);
  2092. * // => [3, 4]
  2093. *
  2094. * object.a = 2;
  2095. * values(object);
  2096. * // => [1, 2]
  2097. *
  2098. * // Modify the result cache.
  2099. * values.cache.set(object, ['a', 'b']);
  2100. * values(object);
  2101. * // => ['a', 'b']
  2102. *
  2103. * // Replace `_.memoize.Cache`.
  2104. * _.memoize.Cache = WeakMap;
  2105. */
  2106. function memoize(func, resolver) {
  2107. if (typeof func != 'function' || resolver && typeof resolver != 'function') {
  2108. throw new TypeError(FUNC_ERROR_TEXT);
  2109. }
  2110. var memoized = function memoized() {
  2111. var args = arguments,
  2112. key = resolver ? resolver.apply(this, args) : args[0],
  2113. cache = memoized.cache;
  2114. if (cache.has(key)) {
  2115. return cache.get(key);
  2116. }
  2117. var result = func.apply(this, args);
  2118. memoized.cache = cache.set(key, result);
  2119. return result;
  2120. };
  2121. memoized.cache = new (memoize.Cache || MapCache)();
  2122. return memoized;
  2123. } // Assign cache to `_.memoize`.
  2124. memoize.Cache = MapCache;
  2125. /**
  2126. * Performs a
  2127. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2128. * comparison between two values to determine if they are equivalent.
  2129. *
  2130. * @static
  2131. * @memberOf _
  2132. * @since 4.0.0
  2133. * @category Lang
  2134. * @param {*} value The value to compare.
  2135. * @param {*} other The other value to compare.
  2136. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2137. * @example
  2138. *
  2139. * var object = { 'a': 1 };
  2140. * var other = { 'a': 1 };
  2141. *
  2142. * _.eq(object, object);
  2143. * // => true
  2144. *
  2145. * _.eq(object, other);
  2146. * // => false
  2147. *
  2148. * _.eq('a', 'a');
  2149. * // => true
  2150. *
  2151. * _.eq('a', Object('a'));
  2152. * // => false
  2153. *
  2154. * _.eq(NaN, NaN);
  2155. * // => true
  2156. */
  2157. function eq(value, other) {
  2158. return value === other || value !== value && other !== other;
  2159. }
  2160. /**
  2161. * Checks if `value` is likely an `arguments` object.
  2162. *
  2163. * @static
  2164. * @memberOf _
  2165. * @since 0.1.0
  2166. * @category Lang
  2167. * @param {*} value The value to check.
  2168. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  2169. * else `false`.
  2170. * @example
  2171. *
  2172. * _.isArguments(function() { return arguments; }());
  2173. * // => true
  2174. *
  2175. * _.isArguments([1, 2, 3]);
  2176. * // => false
  2177. */
  2178. function isArguments(value) {
  2179. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  2180. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  2181. }
  2182. /**
  2183. * Checks if `value` is classified as an `Array` object.
  2184. *
  2185. * @static
  2186. * @memberOf _
  2187. * @since 0.1.0
  2188. * @category Lang
  2189. * @param {*} value The value to check.
  2190. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  2191. * @example
  2192. *
  2193. * _.isArray([1, 2, 3]);
  2194. * // => true
  2195. *
  2196. * _.isArray(document.body.children);
  2197. * // => false
  2198. *
  2199. * _.isArray('abc');
  2200. * // => false
  2201. *
  2202. * _.isArray(_.noop);
  2203. * // => false
  2204. */
  2205. var isArray = Array.isArray;
  2206. /**
  2207. * Checks if `value` is array-like. A value is considered array-like if it's
  2208. * not a function and has a `value.length` that's an integer greater than or
  2209. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  2210. *
  2211. * @static
  2212. * @memberOf _
  2213. * @since 4.0.0
  2214. * @category Lang
  2215. * @param {*} value The value to check.
  2216. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  2217. * @example
  2218. *
  2219. * _.isArrayLike([1, 2, 3]);
  2220. * // => true
  2221. *
  2222. * _.isArrayLike(document.body.children);
  2223. * // => true
  2224. *
  2225. * _.isArrayLike('abc');
  2226. * // => true
  2227. *
  2228. * _.isArrayLike(_.noop);
  2229. * // => false
  2230. */
  2231. function isArrayLike(value) {
  2232. return value != null && isLength(value.length) && !isFunction(value);
  2233. }
  2234. /**
  2235. * This method is like `_.isArrayLike` except that it also checks if `value`
  2236. * is an object.
  2237. *
  2238. * @static
  2239. * @memberOf _
  2240. * @since 4.0.0
  2241. * @category Lang
  2242. * @param {*} value The value to check.
  2243. * @returns {boolean} Returns `true` if `value` is an array-like object,
  2244. * else `false`.
  2245. * @example
  2246. *
  2247. * _.isArrayLikeObject([1, 2, 3]);
  2248. * // => true
  2249. *
  2250. * _.isArrayLikeObject(document.body.children);
  2251. * // => true
  2252. *
  2253. * _.isArrayLikeObject('abc');
  2254. * // => false
  2255. *
  2256. * _.isArrayLikeObject(_.noop);
  2257. * // => false
  2258. */
  2259. function isArrayLikeObject(value) {
  2260. return isObjectLike(value) && isArrayLike(value);
  2261. }
  2262. /**
  2263. * Checks if `value` is classified as a `Function` object.
  2264. *
  2265. * @static
  2266. * @memberOf _
  2267. * @since 0.1.0
  2268. * @category Lang
  2269. * @param {*} value The value to check.
  2270. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2271. * @example
  2272. *
  2273. * _.isFunction(_);
  2274. * // => true
  2275. *
  2276. * _.isFunction(/abc/);
  2277. * // => false
  2278. */
  2279. function isFunction(value) {
  2280. // The use of `Object#toString` avoids issues with the `typeof` operator
  2281. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2282. var tag = isObject(value) ? objectToString.call(value) : '';
  2283. return tag == funcTag || tag == genTag;
  2284. }
  2285. /**
  2286. * Checks if `value` is a valid array-like length.
  2287. *
  2288. * **Note:** This method is loosely based on
  2289. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  2290. *
  2291. * @static
  2292. * @memberOf _
  2293. * @since 4.0.0
  2294. * @category Lang
  2295. * @param {*} value The value to check.
  2296. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  2297. * @example
  2298. *
  2299. * _.isLength(3);
  2300. * // => true
  2301. *
  2302. * _.isLength(Number.MIN_VALUE);
  2303. * // => false
  2304. *
  2305. * _.isLength(Infinity);
  2306. * // => false
  2307. *
  2308. * _.isLength('3');
  2309. * // => false
  2310. */
  2311. function isLength(value) {
  2312. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  2313. }
  2314. /**
  2315. * Checks if `value` is the
  2316. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2317. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2318. *
  2319. * @static
  2320. * @memberOf _
  2321. * @since 0.1.0
  2322. * @category Lang
  2323. * @param {*} value The value to check.
  2324. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2325. * @example
  2326. *
  2327. * _.isObject({});
  2328. * // => true
  2329. *
  2330. * _.isObject([1, 2, 3]);
  2331. * // => true
  2332. *
  2333. * _.isObject(_.noop);
  2334. * // => true
  2335. *
  2336. * _.isObject(null);
  2337. * // => false
  2338. */
  2339. function isObject(value) {
  2340. var type = _typeof(value);
  2341. return !!value && (type == 'object' || type == 'function');
  2342. }
  2343. /**
  2344. * Checks if `value` is object-like. A value is object-like if it's not `null`
  2345. * and has a `typeof` result of "object".
  2346. *
  2347. * @static
  2348. * @memberOf _
  2349. * @since 4.0.0
  2350. * @category Lang
  2351. * @param {*} value The value to check.
  2352. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  2353. * @example
  2354. *
  2355. * _.isObjectLike({});
  2356. * // => true
  2357. *
  2358. * _.isObjectLike([1, 2, 3]);
  2359. * // => true
  2360. *
  2361. * _.isObjectLike(_.noop);
  2362. * // => false
  2363. *
  2364. * _.isObjectLike(null);
  2365. * // => false
  2366. */
  2367. function isObjectLike(value) {
  2368. return !!value && _typeof(value) == 'object';
  2369. }
  2370. /**
  2371. * Checks if `value` is classified as a `Symbol` primitive or object.
  2372. *
  2373. * @static
  2374. * @memberOf _
  2375. * @since 4.0.0
  2376. * @category Lang
  2377. * @param {*} value The value to check.
  2378. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  2379. * @example
  2380. *
  2381. * _.isSymbol(Symbol.iterator);
  2382. * // => true
  2383. *
  2384. * _.isSymbol('abc');
  2385. * // => false
  2386. */
  2387. function isSymbol(value) {
  2388. return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
  2389. }
  2390. /**
  2391. * Checks if `value` is classified as a typed array.
  2392. *
  2393. * @static
  2394. * @memberOf _
  2395. * @since 3.0.0
  2396. * @category Lang
  2397. * @param {*} value The value to check.
  2398. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  2399. * @example
  2400. *
  2401. * _.isTypedArray(new Uint8Array);
  2402. * // => true
  2403. *
  2404. * _.isTypedArray([]);
  2405. * // => false
  2406. */
  2407. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  2408. /**
  2409. * Converts `value` to a string. An empty string is returned for `null`
  2410. * and `undefined` values. The sign of `-0` is preserved.
  2411. *
  2412. * @static
  2413. * @memberOf _
  2414. * @since 4.0.0
  2415. * @category Lang
  2416. * @param {*} value The value to process.
  2417. * @returns {string} Returns the string.
  2418. * @example
  2419. *
  2420. * _.toString(null);
  2421. * // => ''
  2422. *
  2423. * _.toString(-0);
  2424. * // => '-0'
  2425. *
  2426. * _.toString([1, 2, 3]);
  2427. * // => '1,2,3'
  2428. */
  2429. function toString(value) {
  2430. return value == null ? '' : baseToString(value);
  2431. }
  2432. /**
  2433. * Gets the value at `path` of `object`. If the resolved value is
  2434. * `undefined`, the `defaultValue` is returned in its place.
  2435. *
  2436. * @static
  2437. * @memberOf _
  2438. * @since 3.7.0
  2439. * @category Object
  2440. * @param {Object} object The object to query.
  2441. * @param {Array|string} path The path of the property to get.
  2442. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  2443. * @returns {*} Returns the resolved value.
  2444. * @example
  2445. *
  2446. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  2447. *
  2448. * _.get(object, 'a[0].b.c');
  2449. * // => 3
  2450. *
  2451. * _.get(object, ['a', '0', 'b', 'c']);
  2452. * // => 3
  2453. *
  2454. * _.get(object, 'a.b.c', 'default');
  2455. * // => 'default'
  2456. */
  2457. function get(object, path, defaultValue) {
  2458. var result = object == null ? undefined : baseGet(object, path);
  2459. return result === undefined ? defaultValue : result;
  2460. }
  2461. /**
  2462. * Checks if `path` is a direct or inherited property of `object`.
  2463. *
  2464. * @static
  2465. * @memberOf _
  2466. * @since 4.0.0
  2467. * @category Object
  2468. * @param {Object} object The object to query.
  2469. * @param {Array|string} path The path to check.
  2470. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  2471. * @example
  2472. *
  2473. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  2474. *
  2475. * _.hasIn(object, 'a');
  2476. * // => true
  2477. *
  2478. * _.hasIn(object, 'a.b');
  2479. * // => true
  2480. *
  2481. * _.hasIn(object, ['a', 'b']);
  2482. * // => true
  2483. *
  2484. * _.hasIn(object, 'b');
  2485. * // => false
  2486. */
  2487. function hasIn(object, path) {
  2488. return object != null && hasPath(object, path, baseHasIn);
  2489. }
  2490. /**
  2491. * Creates an array of the own enumerable property names of `object`.
  2492. *
  2493. * **Note:** Non-object values are coerced to objects. See the
  2494. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  2495. * for more details.
  2496. *
  2497. * @static
  2498. * @since 0.1.0
  2499. * @memberOf _
  2500. * @category Object
  2501. * @param {Object} object The object to query.
  2502. * @returns {Array} Returns the array of property names.
  2503. * @example
  2504. *
  2505. * function Foo() {
  2506. * this.a = 1;
  2507. * this.b = 2;
  2508. * }
  2509. *
  2510. * Foo.prototype.c = 3;
  2511. *
  2512. * _.keys(new Foo);
  2513. * // => ['a', 'b'] (iteration order is not guaranteed)
  2514. *
  2515. * _.keys('hi');
  2516. * // => ['0', '1']
  2517. */
  2518. function keys(object) {
  2519. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  2520. }
  2521. /**
  2522. * This method returns the first argument it receives.
  2523. *
  2524. * @static
  2525. * @since 0.1.0
  2526. * @memberOf _
  2527. * @category Util
  2528. * @param {*} value Any value.
  2529. * @returns {*} Returns `value`.
  2530. * @example
  2531. *
  2532. * var object = { 'a': 1 };
  2533. *
  2534. * console.log(_.identity(object) === object);
  2535. * // => true
  2536. */
  2537. function identity(value) {
  2538. return value;
  2539. }
  2540. /**
  2541. * Creates a function that returns the value at `path` of a given object.
  2542. *
  2543. * @static
  2544. * @memberOf _
  2545. * @since 2.4.0
  2546. * @category Util
  2547. * @param {Array|string} path The path of the property to get.
  2548. * @returns {Function} Returns the new accessor function.
  2549. * @example
  2550. *
  2551. * var objects = [
  2552. * { 'a': { 'b': 2 } },
  2553. * { 'a': { 'b': 1 } }
  2554. * ];
  2555. *
  2556. * _.map(objects, _.property('a.b'));
  2557. * // => [2, 1]
  2558. *
  2559. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  2560. * // => [1, 2]
  2561. */
  2562. function property(path) {
  2563. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  2564. }
  2565. module.exports = remove;
  2566. /***/ }),
  2567. /***/ 820:
  2568. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  2569. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2570. /**
  2571. * lodash (Custom Build) <https://lodash.com/>
  2572. * Build: `lodash modularize exports="npm" -o ./`
  2573. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  2574. * Released under MIT license <https://lodash.com/license>
  2575. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  2576. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  2577. */
  2578. /** Used as references for various `Number` constants. */
  2579. var MAX_SAFE_INTEGER = 9007199254740991;
  2580. /** `Object#toString` result references. */
  2581. var argsTag = '[object Arguments]',
  2582. funcTag = '[object Function]',
  2583. genTag = '[object GeneratorFunction]',
  2584. mapTag = '[object Map]',
  2585. objectTag = '[object Object]',
  2586. promiseTag = '[object Promise]',
  2587. setTag = '[object Set]',
  2588. weakMapTag = '[object WeakMap]';
  2589. var dataViewTag = '[object DataView]';
  2590. /**
  2591. * Used to match `RegExp`
  2592. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  2593. */
  2594. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  2595. /** Used to detect host constructors (Safari). */
  2596. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  2597. /** Used to detect unsigned integer values. */
  2598. var reIsUint = /^(?:0|[1-9]\d*)$/;
  2599. /** Detect free variable `global` from Node.js. */
  2600. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  2601. /** Detect free variable `self`. */
  2602. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  2603. /** Used as a reference to the global object. */
  2604. var root = freeGlobal || freeSelf || Function('return this')();
  2605. /**
  2606. * A specialized version of `_.map` for arrays without support for iteratee
  2607. * shorthands.
  2608. *
  2609. * @private
  2610. * @param {Array} [array] The array to iterate over.
  2611. * @param {Function} iteratee The function invoked per iteration.
  2612. * @returns {Array} Returns the new mapped array.
  2613. */
  2614. function arrayMap(array, iteratee) {
  2615. var index = -1,
  2616. length = array ? array.length : 0,
  2617. result = Array(length);
  2618. while (++index < length) {
  2619. result[index] = iteratee(array[index], index, array);
  2620. }
  2621. return result;
  2622. }
  2623. /**
  2624. * The base implementation of `_.times` without support for iteratee shorthands
  2625. * or max array length checks.
  2626. *
  2627. * @private
  2628. * @param {number} n The number of times to invoke `iteratee`.
  2629. * @param {Function} iteratee The function invoked per iteration.
  2630. * @returns {Array} Returns the array of results.
  2631. */
  2632. function baseTimes(n, iteratee) {
  2633. var index = -1,
  2634. result = Array(n);
  2635. while (++index < n) {
  2636. result[index] = iteratee(index);
  2637. }
  2638. return result;
  2639. }
  2640. /**
  2641. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2642. * of key-value pairs for `object` corresponding to the property names of `props`.
  2643. *
  2644. * @private
  2645. * @param {Object} object The object to query.
  2646. * @param {Array} props The property names to get values for.
  2647. * @returns {Object} Returns the key-value pairs.
  2648. */
  2649. function baseToPairs(object, props) {
  2650. return arrayMap(props, function (key) {
  2651. return [key, object[key]];
  2652. });
  2653. }
  2654. /**
  2655. * Gets the value at `key` of `object`.
  2656. *
  2657. * @private
  2658. * @param {Object} [object] The object to query.
  2659. * @param {string} key The key of the property to get.
  2660. * @returns {*} Returns the property value.
  2661. */
  2662. function getValue(object, key) {
  2663. return object == null ? undefined : object[key];
  2664. }
  2665. /**
  2666. * Checks if `value` is a host object in IE < 9.
  2667. *
  2668. * @private
  2669. * @param {*} value The value to check.
  2670. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  2671. */
  2672. function isHostObject(value) {
  2673. // Many host objects are `Object` objects that can coerce to strings
  2674. // despite having improperly defined `toString` methods.
  2675. var result = false;
  2676. if (value != null && typeof value.toString != 'function') {
  2677. try {
  2678. result = !!(value + '');
  2679. } catch (e) {}
  2680. }
  2681. return result;
  2682. }
  2683. /**
  2684. * Converts `map` to its key-value pairs.
  2685. *
  2686. * @private
  2687. * @param {Object} map The map to convert.
  2688. * @returns {Array} Returns the key-value pairs.
  2689. */
  2690. function mapToArray(map) {
  2691. var index = -1,
  2692. result = Array(map.size);
  2693. map.forEach(function (value, key) {
  2694. result[++index] = [key, value];
  2695. });
  2696. return result;
  2697. }
  2698. /**
  2699. * Creates a unary function that invokes `func` with its argument transformed.
  2700. *
  2701. * @private
  2702. * @param {Function} func The function to wrap.
  2703. * @param {Function} transform The argument transform.
  2704. * @returns {Function} Returns the new function.
  2705. */
  2706. function overArg(func, transform) {
  2707. return function (arg) {
  2708. return func(transform(arg));
  2709. };
  2710. }
  2711. /**
  2712. * Converts `set` to its value-value pairs.
  2713. *
  2714. * @private
  2715. * @param {Object} set The set to convert.
  2716. * @returns {Array} Returns the value-value pairs.
  2717. */
  2718. function setToPairs(set) {
  2719. var index = -1,
  2720. result = Array(set.size);
  2721. set.forEach(function (value) {
  2722. result[++index] = [value, value];
  2723. });
  2724. return result;
  2725. }
  2726. /** Used for built-in method references. */
  2727. var funcProto = Function.prototype,
  2728. objectProto = Object.prototype;
  2729. /** Used to detect overreaching core-js shims. */
  2730. var coreJsData = root['__core-js_shared__'];
  2731. /** Used to detect methods masquerading as native. */
  2732. var maskSrcKey = function () {
  2733. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2734. return uid ? 'Symbol(src)_1.' + uid : '';
  2735. }();
  2736. /** Used to resolve the decompiled source of functions. */
  2737. var funcToString = funcProto.toString;
  2738. /** Used to check objects for own properties. */
  2739. var hasOwnProperty = objectProto.hasOwnProperty;
  2740. /**
  2741. * Used to resolve the
  2742. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2743. * of values.
  2744. */
  2745. var objectToString = objectProto.toString;
  2746. /** Used to detect if a method is native. */
  2747. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  2748. /** Built-in value references. */
  2749. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  2750. /* Built-in method references for those with the same name as other `lodash` methods. */
  2751. var nativeKeys = overArg(Object.keys, Object);
  2752. /* Built-in method references that are verified to be native. */
  2753. var DataView = getNative(root, 'DataView'),
  2754. Map = getNative(root, 'Map'),
  2755. Promise = getNative(root, 'Promise'),
  2756. Set = getNative(root, 'Set'),
  2757. WeakMap = getNative(root, 'WeakMap');
  2758. /** Used to detect maps, sets, and weakmaps. */
  2759. var dataViewCtorString = toSource(DataView),
  2760. mapCtorString = toSource(Map),
  2761. promiseCtorString = toSource(Promise),
  2762. setCtorString = toSource(Set),
  2763. weakMapCtorString = toSource(WeakMap);
  2764. /**
  2765. * Creates an array of the enumerable property names of the array-like `value`.
  2766. *
  2767. * @private
  2768. * @param {*} value The value to query.
  2769. * @param {boolean} inherited Specify returning inherited property names.
  2770. * @returns {Array} Returns the array of property names.
  2771. */
  2772. function arrayLikeKeys(value, inherited) {
  2773. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  2774. // Safari 9 makes `arguments.length` enumerable in strict mode.
  2775. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  2776. var length = result.length,
  2777. skipIndexes = !!length;
  2778. for (var key in value) {
  2779. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  2780. result.push(key);
  2781. }
  2782. }
  2783. return result;
  2784. }
  2785. /**
  2786. * The base implementation of `getTag`.
  2787. *
  2788. * @private
  2789. * @param {*} value The value to query.
  2790. * @returns {string} Returns the `toStringTag`.
  2791. */
  2792. function baseGetTag(value) {
  2793. return objectToString.call(value);
  2794. }
  2795. /**
  2796. * The base implementation of `_.isNative` without bad shim checks.
  2797. *
  2798. * @private
  2799. * @param {*} value The value to check.
  2800. * @returns {boolean} Returns `true` if `value` is a native function,
  2801. * else `false`.
  2802. */
  2803. function baseIsNative(value) {
  2804. if (!isObject(value) || isMasked(value)) {
  2805. return false;
  2806. }
  2807. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  2808. return pattern.test(toSource(value));
  2809. }
  2810. /**
  2811. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  2812. *
  2813. * @private
  2814. * @param {Object} object The object to query.
  2815. * @returns {Array} Returns the array of property names.
  2816. */
  2817. function baseKeys(object) {
  2818. if (!isPrototype(object)) {
  2819. return nativeKeys(object);
  2820. }
  2821. var result = [];
  2822. for (var key in Object(object)) {
  2823. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  2824. result.push(key);
  2825. }
  2826. }
  2827. return result;
  2828. }
  2829. /**
  2830. * Creates a `_.toPairs` or `_.toPairsIn` function.
  2831. *
  2832. * @private
  2833. * @param {Function} keysFunc The function to get the keys of a given object.
  2834. * @returns {Function} Returns the new pairs function.
  2835. */
  2836. function createToPairs(keysFunc) {
  2837. return function (object) {
  2838. var tag = getTag(object);
  2839. if (tag == mapTag) {
  2840. return mapToArray(object);
  2841. }
  2842. if (tag == setTag) {
  2843. return setToPairs(object);
  2844. }
  2845. return baseToPairs(object, keysFunc(object));
  2846. };
  2847. }
  2848. /**
  2849. * Gets the native function at `key` of `object`.
  2850. *
  2851. * @private
  2852. * @param {Object} object The object to query.
  2853. * @param {string} key The key of the method to get.
  2854. * @returns {*} Returns the function if it's native, else `undefined`.
  2855. */
  2856. function getNative(object, key) {
  2857. var value = getValue(object, key);
  2858. return baseIsNative(value) ? value : undefined;
  2859. }
  2860. /**
  2861. * Gets the `toStringTag` of `value`.
  2862. *
  2863. * @private
  2864. * @param {*} value The value to query.
  2865. * @returns {string} Returns the `toStringTag`.
  2866. */
  2867. var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11,
  2868. // for data views in Edge < 14, and promises in Node.js.
  2869. 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) {
  2870. getTag = function getTag(value) {
  2871. var result = objectToString.call(value),
  2872. Ctor = result == objectTag ? value.constructor : undefined,
  2873. ctorString = Ctor ? toSource(Ctor) : undefined;
  2874. if (ctorString) {
  2875. switch (ctorString) {
  2876. case dataViewCtorString:
  2877. return dataViewTag;
  2878. case mapCtorString:
  2879. return mapTag;
  2880. case promiseCtorString:
  2881. return promiseTag;
  2882. case setCtorString:
  2883. return setTag;
  2884. case weakMapCtorString:
  2885. return weakMapTag;
  2886. }
  2887. }
  2888. return result;
  2889. };
  2890. }
  2891. /**
  2892. * Checks if `value` is a valid array-like index.
  2893. *
  2894. * @private
  2895. * @param {*} value The value to check.
  2896. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  2897. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  2898. */
  2899. function isIndex(value, length) {
  2900. length = length == null ? MAX_SAFE_INTEGER : length;
  2901. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  2902. }
  2903. /**
  2904. * Checks if `func` has its source masked.
  2905. *
  2906. * @private
  2907. * @param {Function} func The function to check.
  2908. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  2909. */
  2910. function isMasked(func) {
  2911. return !!maskSrcKey && maskSrcKey in func;
  2912. }
  2913. /**
  2914. * Checks if `value` is likely a prototype object.
  2915. *
  2916. * @private
  2917. * @param {*} value The value to check.
  2918. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  2919. */
  2920. function isPrototype(value) {
  2921. var Ctor = value && value.constructor,
  2922. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  2923. return value === proto;
  2924. }
  2925. /**
  2926. * Converts `func` to its source code.
  2927. *
  2928. * @private
  2929. * @param {Function} func The function to process.
  2930. * @returns {string} Returns the source code.
  2931. */
  2932. function toSource(func) {
  2933. if (func != null) {
  2934. try {
  2935. return funcToString.call(func);
  2936. } catch (e) {}
  2937. try {
  2938. return func + '';
  2939. } catch (e) {}
  2940. }
  2941. return '';
  2942. }
  2943. /**
  2944. * Checks if `value` is likely an `arguments` object.
  2945. *
  2946. * @static
  2947. * @memberOf _
  2948. * @since 0.1.0
  2949. * @category Lang
  2950. * @param {*} value The value to check.
  2951. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  2952. * else `false`.
  2953. * @example
  2954. *
  2955. * _.isArguments(function() { return arguments; }());
  2956. * // => true
  2957. *
  2958. * _.isArguments([1, 2, 3]);
  2959. * // => false
  2960. */
  2961. function isArguments(value) {
  2962. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  2963. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  2964. }
  2965. /**
  2966. * Checks if `value` is classified as an `Array` object.
  2967. *
  2968. * @static
  2969. * @memberOf _
  2970. * @since 0.1.0
  2971. * @category Lang
  2972. * @param {*} value The value to check.
  2973. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  2974. * @example
  2975. *
  2976. * _.isArray([1, 2, 3]);
  2977. * // => true
  2978. *
  2979. * _.isArray(document.body.children);
  2980. * // => false
  2981. *
  2982. * _.isArray('abc');
  2983. * // => false
  2984. *
  2985. * _.isArray(_.noop);
  2986. * // => false
  2987. */
  2988. var isArray = Array.isArray;
  2989. /**
  2990. * Checks if `value` is array-like. A value is considered array-like if it's
  2991. * not a function and has a `value.length` that's an integer greater than or
  2992. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  2993. *
  2994. * @static
  2995. * @memberOf _
  2996. * @since 4.0.0
  2997. * @category Lang
  2998. * @param {*} value The value to check.
  2999. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  3000. * @example
  3001. *
  3002. * _.isArrayLike([1, 2, 3]);
  3003. * // => true
  3004. *
  3005. * _.isArrayLike(document.body.children);
  3006. * // => true
  3007. *
  3008. * _.isArrayLike('abc');
  3009. * // => true
  3010. *
  3011. * _.isArrayLike(_.noop);
  3012. * // => false
  3013. */
  3014. function isArrayLike(value) {
  3015. return value != null && isLength(value.length) && !isFunction(value);
  3016. }
  3017. /**
  3018. * This method is like `_.isArrayLike` except that it also checks if `value`
  3019. * is an object.
  3020. *
  3021. * @static
  3022. * @memberOf _
  3023. * @since 4.0.0
  3024. * @category Lang
  3025. * @param {*} value The value to check.
  3026. * @returns {boolean} Returns `true` if `value` is an array-like object,
  3027. * else `false`.
  3028. * @example
  3029. *
  3030. * _.isArrayLikeObject([1, 2, 3]);
  3031. * // => true
  3032. *
  3033. * _.isArrayLikeObject(document.body.children);
  3034. * // => true
  3035. *
  3036. * _.isArrayLikeObject('abc');
  3037. * // => false
  3038. *
  3039. * _.isArrayLikeObject(_.noop);
  3040. * // => false
  3041. */
  3042. function isArrayLikeObject(value) {
  3043. return isObjectLike(value) && isArrayLike(value);
  3044. }
  3045. /**
  3046. * Checks if `value` is classified as a `Function` object.
  3047. *
  3048. * @static
  3049. * @memberOf _
  3050. * @since 0.1.0
  3051. * @category Lang
  3052. * @param {*} value The value to check.
  3053. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  3054. * @example
  3055. *
  3056. * _.isFunction(_);
  3057. * // => true
  3058. *
  3059. * _.isFunction(/abc/);
  3060. * // => false
  3061. */
  3062. function isFunction(value) {
  3063. // The use of `Object#toString` avoids issues with the `typeof` operator
  3064. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  3065. var tag = isObject(value) ? objectToString.call(value) : '';
  3066. return tag == funcTag || tag == genTag;
  3067. }
  3068. /**
  3069. * Checks if `value` is a valid array-like length.
  3070. *
  3071. * **Note:** This method is loosely based on
  3072. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  3073. *
  3074. * @static
  3075. * @memberOf _
  3076. * @since 4.0.0
  3077. * @category Lang
  3078. * @param {*} value The value to check.
  3079. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  3080. * @example
  3081. *
  3082. * _.isLength(3);
  3083. * // => true
  3084. *
  3085. * _.isLength(Number.MIN_VALUE);
  3086. * // => false
  3087. *
  3088. * _.isLength(Infinity);
  3089. * // => false
  3090. *
  3091. * _.isLength('3');
  3092. * // => false
  3093. */
  3094. function isLength(value) {
  3095. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  3096. }
  3097. /**
  3098. * Checks if `value` is the
  3099. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  3100. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  3101. *
  3102. * @static
  3103. * @memberOf _
  3104. * @since 0.1.0
  3105. * @category Lang
  3106. * @param {*} value The value to check.
  3107. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  3108. * @example
  3109. *
  3110. * _.isObject({});
  3111. * // => true
  3112. *
  3113. * _.isObject([1, 2, 3]);
  3114. * // => true
  3115. *
  3116. * _.isObject(_.noop);
  3117. * // => true
  3118. *
  3119. * _.isObject(null);
  3120. * // => false
  3121. */
  3122. function isObject(value) {
  3123. var type = _typeof(value);
  3124. return !!value && (type == 'object' || type == 'function');
  3125. }
  3126. /**
  3127. * Checks if `value` is object-like. A value is object-like if it's not `null`
  3128. * and has a `typeof` result of "object".
  3129. *
  3130. * @static
  3131. * @memberOf _
  3132. * @since 4.0.0
  3133. * @category Lang
  3134. * @param {*} value The value to check.
  3135. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  3136. * @example
  3137. *
  3138. * _.isObjectLike({});
  3139. * // => true
  3140. *
  3141. * _.isObjectLike([1, 2, 3]);
  3142. * // => true
  3143. *
  3144. * _.isObjectLike(_.noop);
  3145. * // => false
  3146. *
  3147. * _.isObjectLike(null);
  3148. * // => false
  3149. */
  3150. function isObjectLike(value) {
  3151. return !!value && _typeof(value) == 'object';
  3152. }
  3153. /**
  3154. * Creates an array of the own enumerable property names of `object`.
  3155. *
  3156. * **Note:** Non-object values are coerced to objects. See the
  3157. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  3158. * for more details.
  3159. *
  3160. * @static
  3161. * @since 0.1.0
  3162. * @memberOf _
  3163. * @category Object
  3164. * @param {Object} object The object to query.
  3165. * @returns {Array} Returns the array of property names.
  3166. * @example
  3167. *
  3168. * function Foo() {
  3169. * this.a = 1;
  3170. * this.b = 2;
  3171. * }
  3172. *
  3173. * Foo.prototype.c = 3;
  3174. *
  3175. * _.keys(new Foo);
  3176. * // => ['a', 'b'] (iteration order is not guaranteed)
  3177. *
  3178. * _.keys('hi');
  3179. * // => ['0', '1']
  3180. */
  3181. function keys(object) {
  3182. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  3183. }
  3184. /**
  3185. * Creates an array of own enumerable string keyed-value pairs for `object`
  3186. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  3187. * entries are returned.
  3188. *
  3189. * @static
  3190. * @memberOf _
  3191. * @since 4.0.0
  3192. * @alias entries
  3193. * @category Object
  3194. * @param {Object} object The object to query.
  3195. * @returns {Array} Returns the key-value pairs.
  3196. * @example
  3197. *
  3198. * function Foo() {
  3199. * this.a = 1;
  3200. * this.b = 2;
  3201. * }
  3202. *
  3203. * Foo.prototype.c = 3;
  3204. *
  3205. * _.toPairs(new Foo);
  3206. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  3207. */
  3208. var toPairs = createToPairs(keys);
  3209. module.exports = toPairs;
  3210. /***/ }),
  3211. /***/ 957:
  3212. /***/ (function(module, exports, __webpack_require__) {
  3213. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3214. (function (global, factory) {
  3215. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  3216. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  3217. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  3218. __WEBPACK_AMD_DEFINE_FACTORY__),
  3219. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
  3220. })(this, function () {
  3221. 'use strict';
  3222. /**
  3223. * @this {Promise}
  3224. */
  3225. function finallyConstructor(callback) {
  3226. var constructor = this.constructor;
  3227. return this.then(function (value) {
  3228. // @ts-ignore
  3229. return constructor.resolve(callback()).then(function () {
  3230. return value;
  3231. });
  3232. }, function (reason) {
  3233. // @ts-ignore
  3234. return constructor.resolve(callback()).then(function () {
  3235. // @ts-ignore
  3236. return constructor.reject(reason);
  3237. });
  3238. });
  3239. } // Store setTimeout reference so promise-polyfill will be unaffected by
  3240. // other code modifying setTimeout (like sinon.useFakeTimers())
  3241. var setTimeoutFunc = setTimeout;
  3242. function isArray(x) {
  3243. return Boolean(x && typeof x.length !== 'undefined');
  3244. }
  3245. function noop() {} // Polyfill for Function.prototype.bind
  3246. function bind(fn, thisArg) {
  3247. return function () {
  3248. fn.apply(thisArg, arguments);
  3249. };
  3250. }
  3251. /**
  3252. * @constructor
  3253. * @param {Function} fn
  3254. */
  3255. function Promise(fn) {
  3256. if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
  3257. if (typeof fn !== 'function') throw new TypeError('not a function');
  3258. /** @type {!number} */
  3259. this._state = 0;
  3260. /** @type {!boolean} */
  3261. this._handled = false;
  3262. /** @type {Promise|undefined} */
  3263. this._value = undefined;
  3264. /** @type {!Array<!Function>} */
  3265. this._deferreds = [];
  3266. doResolve(fn, this);
  3267. }
  3268. function handle(self, deferred) {
  3269. while (self._state === 3) {
  3270. self = self._value;
  3271. }
  3272. if (self._state === 0) {
  3273. self._deferreds.push(deferred);
  3274. return;
  3275. }
  3276. self._handled = true;
  3277. Promise._immediateFn(function () {
  3278. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  3279. if (cb === null) {
  3280. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  3281. return;
  3282. }
  3283. var ret;
  3284. try {
  3285. ret = cb(self._value);
  3286. } catch (e) {
  3287. reject(deferred.promise, e);
  3288. return;
  3289. }
  3290. resolve(deferred.promise, ret);
  3291. });
  3292. }
  3293. function resolve(self, newValue) {
  3294. try {
  3295. // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
  3296. if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
  3297. if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) {
  3298. var then = newValue.then;
  3299. if (newValue instanceof Promise) {
  3300. self._state = 3;
  3301. self._value = newValue;
  3302. finale(self);
  3303. return;
  3304. } else if (typeof then === 'function') {
  3305. doResolve(bind(then, newValue), self);
  3306. return;
  3307. }
  3308. }
  3309. self._state = 1;
  3310. self._value = newValue;
  3311. finale(self);
  3312. } catch (e) {
  3313. reject(self, e);
  3314. }
  3315. }
  3316. function reject(self, newValue) {
  3317. self._state = 2;
  3318. self._value = newValue;
  3319. finale(self);
  3320. }
  3321. function finale(self) {
  3322. if (self._state === 2 && self._deferreds.length === 0) {
  3323. Promise._immediateFn(function () {
  3324. if (!self._handled) {
  3325. Promise._unhandledRejectionFn(self._value);
  3326. }
  3327. });
  3328. }
  3329. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  3330. handle(self, self._deferreds[i]);
  3331. }
  3332. self._deferreds = null;
  3333. }
  3334. /**
  3335. * @constructor
  3336. */
  3337. function Handler(onFulfilled, onRejected, promise) {
  3338. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  3339. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  3340. this.promise = promise;
  3341. }
  3342. /**
  3343. * Take a potentially misbehaving resolver function and make sure
  3344. * onFulfilled and onRejected are only called once.
  3345. *
  3346. * Makes no guarantees about asynchrony.
  3347. */
  3348. function doResolve(fn, self) {
  3349. var done = false;
  3350. try {
  3351. fn(function (value) {
  3352. if (done) return;
  3353. done = true;
  3354. resolve(self, value);
  3355. }, function (reason) {
  3356. if (done) return;
  3357. done = true;
  3358. reject(self, reason);
  3359. });
  3360. } catch (ex) {
  3361. if (done) return;
  3362. done = true;
  3363. reject(self, ex);
  3364. }
  3365. }
  3366. Promise.prototype['catch'] = function (onRejected) {
  3367. return this.then(null, onRejected);
  3368. };
  3369. Promise.prototype.then = function (onFulfilled, onRejected) {
  3370. // @ts-ignore
  3371. var prom = new this.constructor(noop);
  3372. handle(this, new Handler(onFulfilled, onRejected, prom));
  3373. return prom;
  3374. };
  3375. Promise.prototype['finally'] = finallyConstructor;
  3376. Promise.all = function (arr) {
  3377. return new Promise(function (resolve, reject) {
  3378. if (!isArray(arr)) {
  3379. return reject(new TypeError('Promise.all accepts an array'));
  3380. }
  3381. var args = Array.prototype.slice.call(arr);
  3382. if (args.length === 0) return resolve([]);
  3383. var remaining = args.length;
  3384. function res(i, val) {
  3385. try {
  3386. if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
  3387. var then = val.then;
  3388. if (typeof then === 'function') {
  3389. then.call(val, function (val) {
  3390. res(i, val);
  3391. }, reject);
  3392. return;
  3393. }
  3394. }
  3395. args[i] = val;
  3396. if (--remaining === 0) {
  3397. resolve(args);
  3398. }
  3399. } catch (ex) {
  3400. reject(ex);
  3401. }
  3402. }
  3403. for (var i = 0; i < args.length; i++) {
  3404. res(i, args[i]);
  3405. }
  3406. });
  3407. };
  3408. Promise.resolve = function (value) {
  3409. if (value && _typeof(value) === 'object' && value.constructor === Promise) {
  3410. return value;
  3411. }
  3412. return new Promise(function (resolve) {
  3413. resolve(value);
  3414. });
  3415. };
  3416. Promise.reject = function (value) {
  3417. return new Promise(function (resolve, reject) {
  3418. reject(value);
  3419. });
  3420. };
  3421. Promise.race = function (arr) {
  3422. return new Promise(function (resolve, reject) {
  3423. if (!isArray(arr)) {
  3424. return reject(new TypeError('Promise.race accepts an array'));
  3425. }
  3426. for (var i = 0, len = arr.length; i < len; i++) {
  3427. Promise.resolve(arr[i]).then(resolve, reject);
  3428. }
  3429. });
  3430. }; // Use polyfill for setImmediate for performance gains
  3431. Promise._immediateFn = // @ts-ignore
  3432. typeof setImmediate === 'function' && function (fn) {
  3433. // @ts-ignore
  3434. setImmediate(fn);
  3435. } || function (fn) {
  3436. setTimeoutFunc(fn, 0);
  3437. };
  3438. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  3439. if (typeof console !== 'undefined' && console) {
  3440. console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
  3441. }
  3442. };
  3443. /** @suppress {undefinedVars} */
  3444. var globalNS = function () {
  3445. // the only reliable means to get the global object is
  3446. // `Function('return this')()`
  3447. // However, this causes CSP violations in Chrome apps.
  3448. if (typeof self !== 'undefined') {
  3449. return self;
  3450. }
  3451. if (typeof window !== 'undefined') {
  3452. return window;
  3453. }
  3454. if (typeof __webpack_require__.g !== 'undefined') {
  3455. return __webpack_require__.g;
  3456. }
  3457. throw new Error('unable to locate global object');
  3458. }();
  3459. if (!('Promise' in globalNS)) {
  3460. globalNS['Promise'] = Promise;
  3461. } else if (!globalNS.Promise.prototype['finally']) {
  3462. globalNS.Promise.prototype['finally'] = finallyConstructor;
  3463. }
  3464. });
  3465. /***/ }),
  3466. /***/ 70:
  3467. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  3468. /* module decorator */ module = __webpack_require__.nmd(module);
  3469. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3470. /**
  3471. * Copyright (c) 2014-present, Facebook, Inc.
  3472. *
  3473. * This source code is licensed under the MIT license found in the
  3474. * LICENSE file in the root directory of this source tree.
  3475. */
  3476. var runtime = function (exports) {
  3477. "use strict";
  3478. var Op = Object.prototype;
  3479. var hasOwn = Op.hasOwnProperty;
  3480. var undefined; // More compressible than void 0.
  3481. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  3482. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  3483. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  3484. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  3485. function define(obj, key, value) {
  3486. Object.defineProperty(obj, key, {
  3487. value: value,
  3488. enumerable: true,
  3489. configurable: true,
  3490. writable: true
  3491. });
  3492. return obj[key];
  3493. }
  3494. try {
  3495. // IE 8 has a broken Object.defineProperty that only works on DOM objects.
  3496. define({}, "");
  3497. } catch (err) {
  3498. define = function define(obj, key, value) {
  3499. return obj[key] = value;
  3500. };
  3501. }
  3502. function wrap(innerFn, outerFn, self, tryLocsList) {
  3503. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  3504. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  3505. var generator = Object.create(protoGenerator.prototype);
  3506. var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
  3507. // .throw, and .return methods.
  3508. generator._invoke = makeInvokeMethod(innerFn, self, context);
  3509. return generator;
  3510. }
  3511. exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
  3512. // record like context.tryEntries[i].completion. This interface could
  3513. // have been (and was previously) designed to take a closure to be
  3514. // invoked without arguments, but in all the cases we care about we
  3515. // already have an existing method we want to call, so there's no need
  3516. // to create a new function object. We can even get away with assuming
  3517. // the method takes exactly one argument, since that happens to be true
  3518. // in every case, so we don't have to touch the arguments object. The
  3519. // only additional allocation required is the completion record, which
  3520. // has a stable shape and so hopefully should be cheap to allocate.
  3521. function tryCatch(fn, obj, arg) {
  3522. try {
  3523. return {
  3524. type: "normal",
  3525. arg: fn.call(obj, arg)
  3526. };
  3527. } catch (err) {
  3528. return {
  3529. type: "throw",
  3530. arg: err
  3531. };
  3532. }
  3533. }
  3534. var GenStateSuspendedStart = "suspendedStart";
  3535. var GenStateSuspendedYield = "suspendedYield";
  3536. var GenStateExecuting = "executing";
  3537. var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
  3538. // breaking out of the dispatch switch statement.
  3539. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
  3540. // .constructor.prototype properties for functions that return Generator
  3541. // objects. For full spec compliance, you may wish to configure your
  3542. // minifier not to mangle the names of these two functions.
  3543. function Generator() {}
  3544. function GeneratorFunction() {}
  3545. function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
  3546. // don't natively support it.
  3547. var IteratorPrototype = {};
  3548. IteratorPrototype[iteratorSymbol] = function () {
  3549. return this;
  3550. };
  3551. var getProto = Object.getPrototypeOf;
  3552. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  3553. if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  3554. // This environment has a native %IteratorPrototype%; use it instead
  3555. // of the polyfill.
  3556. IteratorPrototype = NativeIteratorPrototype;
  3557. }
  3558. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  3559. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  3560. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  3561. GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
  3562. // Iterator interface in terms of a single ._invoke method.
  3563. function defineIteratorMethods(prototype) {
  3564. ["next", "throw", "return"].forEach(function (method) {
  3565. define(prototype, method, function (arg) {
  3566. return this._invoke(method, arg);
  3567. });
  3568. });
  3569. }
  3570. exports.isGeneratorFunction = function (genFun) {
  3571. var ctor = typeof genFun === "function" && genFun.constructor;
  3572. return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
  3573. // do is to check its .name property.
  3574. (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
  3575. };
  3576. exports.mark = function (genFun) {
  3577. if (Object.setPrototypeOf) {
  3578. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  3579. } else {
  3580. genFun.__proto__ = GeneratorFunctionPrototype;
  3581. define(genFun, toStringTagSymbol, "GeneratorFunction");
  3582. }
  3583. genFun.prototype = Object.create(Gp);
  3584. return genFun;
  3585. }; // Within the body of any async function, `await x` is transformed to
  3586. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  3587. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  3588. // meant to be awaited.
  3589. exports.awrap = function (arg) {
  3590. return {
  3591. __await: arg
  3592. };
  3593. };
  3594. function AsyncIterator(generator, PromiseImpl) {
  3595. function invoke(method, arg, resolve, reject) {
  3596. var record = tryCatch(generator[method], generator, arg);
  3597. if (record.type === "throw") {
  3598. reject(record.arg);
  3599. } else {
  3600. var result = record.arg;
  3601. var value = result.value;
  3602. if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
  3603. return PromiseImpl.resolve(value.__await).then(function (value) {
  3604. invoke("next", value, resolve, reject);
  3605. }, function (err) {
  3606. invoke("throw", err, resolve, reject);
  3607. });
  3608. }
  3609. return PromiseImpl.resolve(value).then(function (unwrapped) {
  3610. // When a yielded Promise is resolved, its final value becomes
  3611. // the .value of the Promise<{value,done}> result for the
  3612. // current iteration.
  3613. result.value = unwrapped;
  3614. resolve(result);
  3615. }, function (error) {
  3616. // If a rejected Promise was yielded, throw the rejection back
  3617. // into the async generator function so it can be handled there.
  3618. return invoke("throw", error, resolve, reject);
  3619. });
  3620. }
  3621. }
  3622. var previousPromise;
  3623. function enqueue(method, arg) {
  3624. function callInvokeWithMethodAndArg() {
  3625. return new PromiseImpl(function (resolve, reject) {
  3626. invoke(method, arg, resolve, reject);
  3627. });
  3628. }
  3629. return previousPromise = // If enqueue has been called before, then we want to wait until
  3630. // all previous Promises have been resolved before calling invoke,
  3631. // so that results are always delivered in the correct order. If
  3632. // enqueue has not been called before, then it is important to
  3633. // call invoke immediately, without waiting on a callback to fire,
  3634. // so that the async generator function has the opportunity to do
  3635. // any necessary setup in a predictable way. This predictability
  3636. // is why the Promise constructor synchronously invokes its
  3637. // executor callback, and why async functions synchronously
  3638. // execute code before the first await. Since we implement simple
  3639. // async functions in terms of async generators, it is especially
  3640. // important to get this right, even though it requires care.
  3641. previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
  3642. // invocations of the iterator.
  3643. callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  3644. } // Define the unified helper method that is used to implement .next,
  3645. // .throw, and .return (see defineIteratorMethods).
  3646. this._invoke = enqueue;
  3647. }
  3648. defineIteratorMethods(AsyncIterator.prototype);
  3649. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  3650. return this;
  3651. };
  3652. exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
  3653. // AsyncIterator objects; they just return a Promise for the value of
  3654. // the final result produced by the iterator.
  3655. exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  3656. if (PromiseImpl === void 0) PromiseImpl = Promise;
  3657. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  3658. return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
  3659. : iter.next().then(function (result) {
  3660. return result.done ? result.value : iter.next();
  3661. });
  3662. };
  3663. function makeInvokeMethod(innerFn, self, context) {
  3664. var state = GenStateSuspendedStart;
  3665. return function invoke(method, arg) {
  3666. if (state === GenStateExecuting) {
  3667. throw new Error("Generator is already running");
  3668. }
  3669. if (state === GenStateCompleted) {
  3670. if (method === "throw") {
  3671. throw arg;
  3672. } // Be forgiving, per 25.3.3.3.3 of the spec:
  3673. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  3674. return doneResult();
  3675. }
  3676. context.method = method;
  3677. context.arg = arg;
  3678. while (true) {
  3679. var delegate = context.delegate;
  3680. if (delegate) {
  3681. var delegateResult = maybeInvokeDelegate(delegate, context);
  3682. if (delegateResult) {
  3683. if (delegateResult === ContinueSentinel) continue;
  3684. return delegateResult;
  3685. }
  3686. }
  3687. if (context.method === "next") {
  3688. // Setting context._sent for legacy support of Babel's
  3689. // function.sent implementation.
  3690. context.sent = context._sent = context.arg;
  3691. } else if (context.method === "throw") {
  3692. if (state === GenStateSuspendedStart) {
  3693. state = GenStateCompleted;
  3694. throw context.arg;
  3695. }
  3696. context.dispatchException(context.arg);
  3697. } else if (context.method === "return") {
  3698. context.abrupt("return", context.arg);
  3699. }
  3700. state = GenStateExecuting;
  3701. var record = tryCatch(innerFn, self, context);
  3702. if (record.type === "normal") {
  3703. // If an exception is thrown from innerFn, we leave state ===
  3704. // GenStateExecuting and loop back for another invocation.
  3705. state = context.done ? GenStateCompleted : GenStateSuspendedYield;
  3706. if (record.arg === ContinueSentinel) {
  3707. continue;
  3708. }
  3709. return {
  3710. value: record.arg,
  3711. done: context.done
  3712. };
  3713. } else if (record.type === "throw") {
  3714. state = GenStateCompleted; // Dispatch the exception by looping back around to the
  3715. // context.dispatchException(context.arg) call above.
  3716. context.method = "throw";
  3717. context.arg = record.arg;
  3718. }
  3719. }
  3720. };
  3721. } // Call delegate.iterator[context.method](context.arg) and handle the
  3722. // result, either by returning a { value, done } result from the
  3723. // delegate iterator, or by modifying context.method and context.arg,
  3724. // setting context.delegate to null, and returning the ContinueSentinel.
  3725. function maybeInvokeDelegate(delegate, context) {
  3726. var method = delegate.iterator[context.method];
  3727. if (method === undefined) {
  3728. // A .throw or .return when the delegate iterator has no .throw
  3729. // method always terminates the yield* loop.
  3730. context.delegate = null;
  3731. if (context.method === "throw") {
  3732. // Note: ["return"] must be used for ES3 parsing compatibility.
  3733. if (delegate.iterator["return"]) {
  3734. // If the delegate iterator has a return method, give it a
  3735. // chance to clean up.
  3736. context.method = "return";
  3737. context.arg = undefined;
  3738. maybeInvokeDelegate(delegate, context);
  3739. if (context.method === "throw") {
  3740. // If maybeInvokeDelegate(context) changed context.method from
  3741. // "return" to "throw", let that override the TypeError below.
  3742. return ContinueSentinel;
  3743. }
  3744. }
  3745. context.method = "throw";
  3746. context.arg = new TypeError("The iterator does not provide a 'throw' method");
  3747. }
  3748. return ContinueSentinel;
  3749. }
  3750. var record = tryCatch(method, delegate.iterator, context.arg);
  3751. if (record.type === "throw") {
  3752. context.method = "throw";
  3753. context.arg = record.arg;
  3754. context.delegate = null;
  3755. return ContinueSentinel;
  3756. }
  3757. var info = record.arg;
  3758. if (!info) {
  3759. context.method = "throw";
  3760. context.arg = new TypeError("iterator result is not an object");
  3761. context.delegate = null;
  3762. return ContinueSentinel;
  3763. }
  3764. if (info.done) {
  3765. // Assign the result of the finished delegate to the temporary
  3766. // variable specified by delegate.resultName (see delegateYield).
  3767. context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
  3768. context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
  3769. // exception, let the outer generator proceed normally. If
  3770. // context.method was "next", forget context.arg since it has been
  3771. // "consumed" by the delegate iterator. If context.method was
  3772. // "return", allow the original .return call to continue in the
  3773. // outer generator.
  3774. if (context.method !== "return") {
  3775. context.method = "next";
  3776. context.arg = undefined;
  3777. }
  3778. } else {
  3779. // Re-yield the result returned by the delegate method.
  3780. return info;
  3781. } // The delegate iterator is finished, so forget it and continue with
  3782. // the outer generator.
  3783. context.delegate = null;
  3784. return ContinueSentinel;
  3785. } // Define Generator.prototype.{next,throw,return} in terms of the
  3786. // unified ._invoke helper method.
  3787. defineIteratorMethods(Gp);
  3788. define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
  3789. // @@iterator function is called on it. Some browsers' implementations of the
  3790. // iterator prototype chain incorrectly implement this, causing the Generator
  3791. // object to not be returned from this call. This ensures that doesn't happen.
  3792. // See https://github.com/facebook/regenerator/issues/274 for more details.
  3793. Gp[iteratorSymbol] = function () {
  3794. return this;
  3795. };
  3796. Gp.toString = function () {
  3797. return "[object Generator]";
  3798. };
  3799. function pushTryEntry(locs) {
  3800. var entry = {
  3801. tryLoc: locs[0]
  3802. };
  3803. if (1 in locs) {
  3804. entry.catchLoc = locs[1];
  3805. }
  3806. if (2 in locs) {
  3807. entry.finallyLoc = locs[2];
  3808. entry.afterLoc = locs[3];
  3809. }
  3810. this.tryEntries.push(entry);
  3811. }
  3812. function resetTryEntry(entry) {
  3813. var record = entry.completion || {};
  3814. record.type = "normal";
  3815. delete record.arg;
  3816. entry.completion = record;
  3817. }
  3818. function Context(tryLocsList) {
  3819. // The root entry object (effectively a try statement without a catch
  3820. // or a finally block) gives us a place to store values thrown from
  3821. // locations where there is no enclosing try statement.
  3822. this.tryEntries = [{
  3823. tryLoc: "root"
  3824. }];
  3825. tryLocsList.forEach(pushTryEntry, this);
  3826. this.reset(true);
  3827. }
  3828. exports.keys = function (object) {
  3829. var keys = [];
  3830. for (var key in object) {
  3831. keys.push(key);
  3832. }
  3833. keys.reverse(); // Rather than returning an object with a next method, we keep
  3834. // things simple and return the next function itself.
  3835. return function next() {
  3836. while (keys.length) {
  3837. var key = keys.pop();
  3838. if (key in object) {
  3839. next.value = key;
  3840. next.done = false;
  3841. return next;
  3842. }
  3843. } // To avoid creating an additional object, we just hang the .value
  3844. // and .done properties off the next function object itself. This
  3845. // also ensures that the minifier will not anonymize the function.
  3846. next.done = true;
  3847. return next;
  3848. };
  3849. };
  3850. function values(iterable) {
  3851. if (iterable) {
  3852. var iteratorMethod = iterable[iteratorSymbol];
  3853. if (iteratorMethod) {
  3854. return iteratorMethod.call(iterable);
  3855. }
  3856. if (typeof iterable.next === "function") {
  3857. return iterable;
  3858. }
  3859. if (!isNaN(iterable.length)) {
  3860. var i = -1,
  3861. next = function next() {
  3862. while (++i < iterable.length) {
  3863. if (hasOwn.call(iterable, i)) {
  3864. next.value = iterable[i];
  3865. next.done = false;
  3866. return next;
  3867. }
  3868. }
  3869. next.value = undefined;
  3870. next.done = true;
  3871. return next;
  3872. };
  3873. return next.next = next;
  3874. }
  3875. } // Return an iterator with no values.
  3876. return {
  3877. next: doneResult
  3878. };
  3879. }
  3880. exports.values = values;
  3881. function doneResult() {
  3882. return {
  3883. value: undefined,
  3884. done: true
  3885. };
  3886. }
  3887. Context.prototype = {
  3888. constructor: Context,
  3889. reset: function reset(skipTempReset) {
  3890. this.prev = 0;
  3891. this.next = 0; // Resetting context._sent for legacy support of Babel's
  3892. // function.sent implementation.
  3893. this.sent = this._sent = undefined;
  3894. this.done = false;
  3895. this.delegate = null;
  3896. this.method = "next";
  3897. this.arg = undefined;
  3898. this.tryEntries.forEach(resetTryEntry);
  3899. if (!skipTempReset) {
  3900. for (var name in this) {
  3901. // Not sure about the optimal order of these conditions:
  3902. if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
  3903. this[name] = undefined;
  3904. }
  3905. }
  3906. }
  3907. },
  3908. stop: function stop() {
  3909. this.done = true;
  3910. var rootEntry = this.tryEntries[0];
  3911. var rootRecord = rootEntry.completion;
  3912. if (rootRecord.type === "throw") {
  3913. throw rootRecord.arg;
  3914. }
  3915. return this.rval;
  3916. },
  3917. dispatchException: function dispatchException(exception) {
  3918. if (this.done) {
  3919. throw exception;
  3920. }
  3921. var context = this;
  3922. function handle(loc, caught) {
  3923. record.type = "throw";
  3924. record.arg = exception;
  3925. context.next = loc;
  3926. if (caught) {
  3927. // If the dispatched exception was caught by a catch block,
  3928. // then let that catch block handle the exception normally.
  3929. context.method = "next";
  3930. context.arg = undefined;
  3931. }
  3932. return !!caught;
  3933. }
  3934. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3935. var entry = this.tryEntries[i];
  3936. var record = entry.completion;
  3937. if (entry.tryLoc === "root") {
  3938. // Exception thrown outside of any try block that could handle
  3939. // it, so set the completion value of the entire function to
  3940. // throw the exception.
  3941. return handle("end");
  3942. }
  3943. if (entry.tryLoc <= this.prev) {
  3944. var hasCatch = hasOwn.call(entry, "catchLoc");
  3945. var hasFinally = hasOwn.call(entry, "finallyLoc");
  3946. if (hasCatch && hasFinally) {
  3947. if (this.prev < entry.catchLoc) {
  3948. return handle(entry.catchLoc, true);
  3949. } else if (this.prev < entry.finallyLoc) {
  3950. return handle(entry.finallyLoc);
  3951. }
  3952. } else if (hasCatch) {
  3953. if (this.prev < entry.catchLoc) {
  3954. return handle(entry.catchLoc, true);
  3955. }
  3956. } else if (hasFinally) {
  3957. if (this.prev < entry.finallyLoc) {
  3958. return handle(entry.finallyLoc);
  3959. }
  3960. } else {
  3961. throw new Error("try statement without catch or finally");
  3962. }
  3963. }
  3964. }
  3965. },
  3966. abrupt: function abrupt(type, arg) {
  3967. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3968. var entry = this.tryEntries[i];
  3969. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  3970. var finallyEntry = entry;
  3971. break;
  3972. }
  3973. }
  3974. if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
  3975. // Ignore the finally entry if control is not jumping to a
  3976. // location outside the try/catch block.
  3977. finallyEntry = null;
  3978. }
  3979. var record = finallyEntry ? finallyEntry.completion : {};
  3980. record.type = type;
  3981. record.arg = arg;
  3982. if (finallyEntry) {
  3983. this.method = "next";
  3984. this.next = finallyEntry.finallyLoc;
  3985. return ContinueSentinel;
  3986. }
  3987. return this.complete(record);
  3988. },
  3989. complete: function complete(record, afterLoc) {
  3990. if (record.type === "throw") {
  3991. throw record.arg;
  3992. }
  3993. if (record.type === "break" || record.type === "continue") {
  3994. this.next = record.arg;
  3995. } else if (record.type === "return") {
  3996. this.rval = this.arg = record.arg;
  3997. this.method = "return";
  3998. this.next = "end";
  3999. } else if (record.type === "normal" && afterLoc) {
  4000. this.next = afterLoc;
  4001. }
  4002. return ContinueSentinel;
  4003. },
  4004. finish: function finish(finallyLoc) {
  4005. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4006. var entry = this.tryEntries[i];
  4007. if (entry.finallyLoc === finallyLoc) {
  4008. this.complete(entry.completion, entry.afterLoc);
  4009. resetTryEntry(entry);
  4010. return ContinueSentinel;
  4011. }
  4012. }
  4013. },
  4014. "catch": function _catch(tryLoc) {
  4015. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4016. var entry = this.tryEntries[i];
  4017. if (entry.tryLoc === tryLoc) {
  4018. var record = entry.completion;
  4019. if (record.type === "throw") {
  4020. var thrown = record.arg;
  4021. resetTryEntry(entry);
  4022. }
  4023. return thrown;
  4024. }
  4025. } // The context.catch method must only be called with a location
  4026. // argument that corresponds to a known catch block.
  4027. throw new Error("illegal catch attempt");
  4028. },
  4029. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  4030. this.delegate = {
  4031. iterator: values(iterable),
  4032. resultName: resultName,
  4033. nextLoc: nextLoc
  4034. };
  4035. if (this.method === "next") {
  4036. // Deliberately forget the last sent value so that we don't
  4037. // accidentally pass it on to the delegate.
  4038. this.arg = undefined;
  4039. }
  4040. return ContinueSentinel;
  4041. }
  4042. }; // Regardless of whether this script is executing as a CommonJS module
  4043. // or not, return the runtime object so that we can declare the variable
  4044. // regeneratorRuntime in the outer scope, which allows this module to be
  4045. // injected easily by `bin/regenerator --include-runtime script.js`.
  4046. return exports;
  4047. }( // If this script is executing as a CommonJS module, use module.exports
  4048. // as the regeneratorRuntime namespace. Otherwise create a new empty
  4049. // object. Either way, the resulting object will be used to initialize
  4050. // the regeneratorRuntime variable at the top of this file.
  4051. ( false ? 0 : _typeof(module)) === "object" ? module.exports : {});
  4052. try {
  4053. regeneratorRuntime = runtime;
  4054. } catch (accidentalStrictMode) {
  4055. // This module should not be running in strict mode, so the above
  4056. // assignment should always work unless something is misconfigured. Just
  4057. // in case runtime.js accidentally runs in strict mode, we can escape
  4058. // strict mode using a global Function call. This could conceivably fail
  4059. // if a Content Security Policy forbids using Function, but in that case
  4060. // the proper solution is to fix the accidental strict mode problem. If
  4061. // you've misconfigured your bundler to force strict mode and applied a
  4062. // CSP to forbid Function, and you're not willing to fix either of those
  4063. // problems, please detail your unique predicament in a GitHub issue.
  4064. Function("r", "regeneratorRuntime = r")(runtime);
  4065. }
  4066. /***/ })
  4067. /******/ });
  4068. /************************************************************************/
  4069. /******/ // The module cache
  4070. /******/ var __webpack_module_cache__ = {};
  4071. /******/
  4072. /******/ // The require function
  4073. /******/ function __webpack_require__(moduleId) {
  4074. /******/ // Check if module is in cache
  4075. /******/ if(__webpack_module_cache__[moduleId]) {
  4076. /******/ return __webpack_module_cache__[moduleId].exports;
  4077. /******/ }
  4078. /******/ // Create a new module (and put it into the cache)
  4079. /******/ var module = __webpack_module_cache__[moduleId] = {
  4080. /******/ id: moduleId,
  4081. /******/ loaded: false,
  4082. /******/ exports: {}
  4083. /******/ };
  4084. /******/
  4085. /******/ // Execute the module function
  4086. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  4087. /******/
  4088. /******/ // Flag the module as loaded
  4089. /******/ module.loaded = true;
  4090. /******/
  4091. /******/ // Return the exports of the module
  4092. /******/ return module.exports;
  4093. /******/ }
  4094. /******/
  4095. /************************************************************************/
  4096. /******/ /* webpack/runtime/compat get default export */
  4097. /******/ !function() {
  4098. /******/ // getDefaultExport function for compatibility with non-harmony modules
  4099. /******/ __webpack_require__.n = function(module) {
  4100. /******/ var getter = module && module.__esModule ?
  4101. /******/ function() { return module['default']; } :
  4102. /******/ function() { return module; };
  4103. /******/ __webpack_require__.d(getter, { a: getter });
  4104. /******/ return getter;
  4105. /******/ };
  4106. /******/ }();
  4107. /******/
  4108. /******/ /* webpack/runtime/define property getters */
  4109. /******/ !function() {
  4110. /******/ // define getter functions for harmony exports
  4111. /******/ __webpack_require__.d = function(exports, definition) {
  4112. /******/ for(var key in definition) {
  4113. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  4114. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  4115. /******/ }
  4116. /******/ }
  4117. /******/ };
  4118. /******/ }();
  4119. /******/
  4120. /******/ /* webpack/runtime/global */
  4121. /******/ !function() {
  4122. /******/ __webpack_require__.g = (function() {
  4123. /******/ if (typeof globalThis === 'object') return globalThis;
  4124. /******/ try {
  4125. /******/ return this || new Function('return this')();
  4126. /******/ } catch (e) {
  4127. /******/ if (typeof window === 'object') return window;
  4128. /******/ }
  4129. /******/ })();
  4130. /******/ }();
  4131. /******/
  4132. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  4133. /******/ !function() {
  4134. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  4135. /******/ }();
  4136. /******/
  4137. /******/ /* webpack/runtime/node module decorator */
  4138. /******/ !function() {
  4139. /******/ __webpack_require__.nmd = function(module) {
  4140. /******/ module.paths = [];
  4141. /******/ if (!module.children) module.children = [];
  4142. /******/ return module;
  4143. /******/ };
  4144. /******/ }();
  4145. /******/
  4146. /************************************************************************/
  4147. !function() {
  4148. "use strict";
  4149. // UNUSED EXPORTS: AddressMatchService, AggQueryBuilderParameter, AggregationParameter, AggregationQueryBuilderType, AggregationType, AlongLineDirection, AnalystAreaUnit, AnalystSizeUnit, AreaSolarRadiationParameters, ArrayStatistic, AttributesPopContainer, BaiduMap, BufferAnalystParameters, BufferDistance, BufferEndType, BufferRadiusUnit, BufferSetting, BuffersAnalystJobsParameter, BurstPipelineAnalystParameters, ChangeTileVersion, ChartQueryFilterParameter, ChartQueryParameters, ChartService, ChartType, CityTabsPage, ClientType, ClipAnalystMode, ClipParameter, CloverShape, ColorDictionary, ColorGradientType, ColorSpaceType, ColorsPickerUtil, CommonContainer, CommonTheme, ComponentsUtil, ComputeWeightMatrixParameters, DataFlow, DataFlowService, DataFormat, DataItemOrderBy, DataItemType, DataReturnMode, DataReturnOption, DatasetBufferAnalystParameters, DatasetInfo, DatasetOverlayAnalystParameters, DatasetSurfaceAnalystParameters, DatasetThiessenAnalystParameters, DatasourceConnectionInfo, DeafultCanvasStyle, DensityKernelAnalystParameters, DirectionType, DropDownBox, EditFeaturesParameters, EditType, ElasticSearch, EngineType, Exponent, FacilityAnalyst3DParameters, FacilityAnalystSinks3DParameters, FacilityAnalystSources3DParameters, FacilityAnalystStreamParameters, FacilityAnalystTracedown3DParameters, FacilityAnalystTraceup3DParameters, FacilityAnalystUpstream3DParameters, FeatureService, FetchRequest, FieldParameters, FieldService, FieldStatisticsParameters, FileConfig, FileModel, FileReaderUtil, FileTypes, FillGradientMode, FilterAggParameter, FilterField, FilterParameter, FindClosestFacilitiesParameters, FindLocationParameters, FindMTSPPathsParameters, FindPathParameters, FindServiceAreasParameters, FindTSPPathsParameters, GenerateSpatialDataParameters, GeoBoundingBoxQueryBuilderParameter, GeoCodingParameter, GeoDecodingParameter, GeoFeature, GeoHashGridAggParameter, GeoRelationAnalystParameters, GeometryBufferAnalystParameters, GeometryOverlayAnalystParameters, GeometrySurfaceAnalystParameters, GeometryThiessenAnalystParameters, GeometryType, GeoprocessingService, GetFeatureMode, GetFeaturesByBoundsParameters, GetFeaturesByBufferParameters, GetFeaturesByGeometryParameters, GetFeaturesByIDsParameters, GetFeaturesBySQLParameters, GetGridCellInfosParameters, GraduatedMode, Graph, GraphAxesTextDisplayMode, Graphic, GraphicCanvasRenderer, GraphicWebGLRenderer, Grid, GridCellInfosService, GridType, HeatMap, HitCloverShape, IManager, IManagerCreateNodeParam, IManagerServiceBase, IPortal, IPortalAddDataParam, IPortalAddResourceParam, IPortalDataConnectionInfoParam, IPortalDataMetaInfoParam, IPortalDataStoreInfoParam, IPortalQueryParam, IPortalQueryResult, IPortalRegisterServiceParam, IPortalResource, IPortalServiceBase, IPortalShareEntity, IPortalShareParam, IPortalUser, Image, ImageSuperMapRest, IndexTabsPageContainer, InterpolationAlgorithmType, InterpolationAnalystParameters, InterpolationIDWAnalystParameters, InterpolationKrigingAnalystParameters, InterpolationRBFAnalystParameters, JoinItem, JoinType, KernelDensityJobParameter, KeyServiceParameter, Label, LabelBackShape, LabelImageCell, LabelMatrixCell, LabelMixedTextStyle, LabelOverLengthMode, LabelSymbolCell, LabelThemeCell, LayerInfoService, LayerStatus, LayerType, LinkItem, Logo, MapExtend, MapService, MapboxStyles, MappingParameters, Mapv, MapvCanvasLayer, MapvLayer, MathExpressionAnalysisParameters, MeasureMode, MeasureParameters, MeasureService, MessageBox, NavTabsPage, NetworkAnalyst3DService, NetworkAnalystService, Online, OnlineData, OnlineQueryDatasParameter, OnlineServiceBase, OutputSetting, OutputType, OverlapDisplayedOptions, OverlayAnalystParameters, OverlayGeoJobParameter, OverlayGraphic, OverlayOperationType, PaginationContainer, PixelFormat, PointWithMeasure, PopContainer, ProcessingService, QueryByBoundsParameters, QueryByDistanceParameters, QueryByGeometryParameters, QueryBySQLParameters, QueryOption, QueryParameters, QueryService, Range, RangeMode, RankSymbol, Route, RouteCalculateMeasureParameters, RouteLocatorParameters, ScaleLine, SearchMode, SecurityManager, Select, ServerColor, ServerFeature, ServerGeometry, ServerInfo, ServerStyle, ServerTextStyle, ServerTheme, ServerType, ServiceBase, ServiceStatus, SetLayerInfoParameters, SetLayerStatusParameters, SetLayersInfoParameters, SideType, SingleObjectQueryJobsParameter, SmoothMethod, SpatialAnalystService, SpatialQueryMode, SpatialRelationType, StatisticAnalystMode, StatisticMode, StopQueryParameters, StyleMap, StyleUtils, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SummaryType, SuperMap, SuperMapCloud, SupplyCenter, SupplyCenterType, SurfaceAnalystMethod, SurfaceAnalystParameters, SurfaceAnalystParametersSetting, TerrainCurvatureCalculationParameters, TextAlignment, Theme, ThemeDotDensity, ThemeFeature, ThemeFlow, ThemeGraduatedSymbol, ThemeGraduatedSymbolStyle, ThemeGraph, ThemeGraphAxes, ThemeGraphItem, ThemeGraphSize, ThemeGraphText, ThemeGraphTextFormat, ThemeGraphType, ThemeGridRange, ThemeGridRangeItem, ThemeGridUnique, ThemeGridUniqueItem, ThemeLabel, ThemeLabelAlongLine, ThemeLabelBackground, ThemeLabelItem, ThemeLabelText, ThemeLabelUniqueItem, ThemeMemoryData, ThemeOffset, ThemeParameters, ThemeRange, ThemeRangeItem, ThemeService, ThemeType, ThemeUnique, ThemeUniqueItem, ThiessenAnalystParameters, Tianditu, TileSuperMapRest, TimeFlowControl, TokenServiceParameter, TopologyValidatorJobsParameter, TopologyValidatorRule, TrafficTransferAnalystService, TransferLine, TransferPathParameters, TransferPreference, TransferSolutionParameters, TransferTactic, TransportationAnalystParameter, TransportationAnalystResultSetting, Turf, TurnType, UGCLayer, UGCLayerType, UGCMapLayer, UGCSubLayer, Unique, Unit, UpdateEdgeWeightParameters, UpdateTurnNodeWeightParameters, Util, VariogramMode, Vector, VectorClipJobsParameter, VectorTileStyles, VectorTileSuperMapRest, WebMap, WebPrintingJobService, lineMap, lineStyle, pointMap, pointStyle, polygonMap, polygonStyle
  4150. ;// CONCATENATED MODULE: external "ol.Observable"
  4151. var external_ol_Observable_namespaceObject = ol.Observable;
  4152. var external_ol_Observable_default = /*#__PURE__*/__webpack_require__.n(external_ol_Observable_namespaceObject);
  4153. ;// CONCATENATED MODULE: ./src/openlayers/services/ServiceBase.js
  4154. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4155. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4156. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  4157. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  4158. 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); }; }
  4159. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  4160. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  4161. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  4162. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  4163. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  4164. * This program are made available under the terms of the Apache License, Version 2.0
  4165. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4166. /**
  4167. * @class ol.supermap.ServiceBase
  4168. * @category iServer
  4169. * @classdesc ol.supermap 的服务基类。
  4170. * @param {string} url - 与客户端交互的服务地址。
  4171. * @param {Object} options - 参数。
  4172. * @param {string} [options.proxy] - 服务代理地址。
  4173. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  4174. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  4175. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  4176. * @param {Object} [options.headers] - 请求头。
  4177. * @extends {ol/Observable}
  4178. */
  4179. var ServiceBase = /*#__PURE__*/function (_Observable) {
  4180. _inherits(ServiceBase, _Observable);
  4181. var _super = _createSuper(ServiceBase);
  4182. function ServiceBase(url, options) {
  4183. var _this;
  4184. _classCallCheck(this, ServiceBase);
  4185. _this = _super.call(this, url, options);
  4186. _this.options = options || {};
  4187. _this.url = url;
  4188. _this.dispatchEvent({
  4189. type: 'initialized',
  4190. value: _assertThisInitialized(_this)
  4191. });
  4192. return _this;
  4193. }
  4194. return ServiceBase;
  4195. }((external_ol_Observable_default()));
  4196. ;// CONCATENATED MODULE: ./src/common/SuperMap.js
  4197. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  4198. * This program are made available under the terms of the Apache License, Version 2.0
  4199. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4200. var SuperMap = window.SuperMap = window.SuperMap || {};
  4201. SuperMap.Components = window.SuperMap.Components || {};
  4202. ;// CONCATENATED MODULE: ./src/common/REST.js
  4203. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  4204. * This program are made available under the terms of the Apache License, Version 2.0
  4205. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4206. /**
  4207. * @enum DataFormat
  4208. * @memberOf SuperMap
  4209. * @description 服务请求返回结果数据类型
  4210. * @type {string}
  4211. */
  4212. var DataFormat = SuperMap.DataFormat = {
  4213. /** GEOJSON */
  4214. GEOJSON: "GEOJSON",
  4215. /** ISERVER */
  4216. ISERVER: "ISERVER"
  4217. };
  4218. /**
  4219. * @enum ServerType
  4220. * @memberOf SuperMap
  4221. * @description 服务器类型
  4222. * @type {string}
  4223. */
  4224. var ServerType = SuperMap.ServerType = {
  4225. /** ISERVER */
  4226. ISERVER: "ISERVER",
  4227. /** IPORTAL */
  4228. IPORTAL: "IPORTAL",
  4229. /** ONLINE */
  4230. ONLINE: "ONLINE"
  4231. };
  4232. /**
  4233. * @enum GeometryType
  4234. * @memberOf SuperMap
  4235. * @description 几何对象枚举,定义了一系列几何对象类型。
  4236. * @type {string}
  4237. */
  4238. var GeometryType = SuperMap.GeometryType = {
  4239. /** LINE */
  4240. LINE: "LINE",
  4241. /** LINEM */
  4242. LINEM: "LINEM",
  4243. /** POINT */
  4244. POINT: "POINT",
  4245. /** REGION */
  4246. REGION: "REGION",
  4247. /** POINTEPS */
  4248. POINTEPS: "POINTEPS",
  4249. /** LINEEPS */
  4250. LINEEPS: "LINEEPS",
  4251. /** REGIONEPS */
  4252. REGIONEPS: "REGIONEPS",
  4253. /** ELLIPSE */
  4254. ELLIPSE: "ELLIPSE",
  4255. /** CIRCLE */
  4256. CIRCLE: "CIRCLE",
  4257. /** TEXT */
  4258. TEXT: "TEXT",
  4259. /** RECTANGLE */
  4260. RECTANGLE: "RECTANGLE",
  4261. /** UNKNOWN */
  4262. UNKNOWN: "UNKNOWN",
  4263. /** GEOCOMPOUND */
  4264. GEOCOMPOUND: "GEOCOMPOUND"
  4265. };
  4266. /**
  4267. * @enum QueryOption
  4268. * @memberOf SuperMap
  4269. * @description 查询结果类型枚举,描述查询结果返回类型,包括只返回属性、只返回几何实体以及返回属性和几何实体。
  4270. * @type {string}
  4271. */
  4272. var QueryOption = SuperMap.QueryOption = {
  4273. /** 属性 */
  4274. ATTRIBUTE: "ATTRIBUTE",
  4275. /** 属性和几何对象 */
  4276. ATTRIBUTEANDGEOMETRY: "ATTRIBUTEANDGEOMETRY",
  4277. /** 几何对象 */
  4278. GEOMETRY: "GEOMETRY"
  4279. };
  4280. /**
  4281. * @enum JoinType
  4282. * @memberOf SuperMap
  4283. * @description 关联查询时的关联类型常量。
  4284. * 该类定义了两个表之间的连接类型常量,决定了对两个表之间进行连接查询时,查询结果中得到的记录的情况。
  4285. * @type {string}
  4286. */
  4287. var JoinType = SuperMap.JoinType = {
  4288. /** INNERJOIN */
  4289. INNERJOIN: "INNERJOIN",
  4290. /** LEFTJOIN */
  4291. LEFTJOIN: "LEFTJOIN"
  4292. };
  4293. /**
  4294. * @enum SpatialQueryMode
  4295. * @memberOf SuperMap
  4296. * @description 空间查询模式枚举。该类定义了空间查询操作模式常量。
  4297. * @type {string}
  4298. */
  4299. var SpatialQueryMode = SuperMap.SpatialQueryMode = {
  4300. /** 包含空间查询模式 */
  4301. CONTAIN: "CONTAIN",
  4302. /** 交叉空间查询模式 */
  4303. CROSS: "CROSS",
  4304. /** 分离空间查询模式 */
  4305. DISJOINT: "DISJOINT",
  4306. /** 重合空间查询模式 */
  4307. IDENTITY: "IDENTITY",
  4308. /** 相交空间查询模式 */
  4309. INTERSECT: "INTERSECT",
  4310. /** 无空间查询 */
  4311. NONE: "NONE",
  4312. /** 叠加空间查询模式 */
  4313. OVERLAP: "OVERLAP",
  4314. /** 邻接空间查询模式 */
  4315. TOUCH: "TOUCH",
  4316. /** 被包含空间查询模式 */
  4317. WITHIN: "WITHIN"
  4318. };
  4319. /**
  4320. * @enum SpatialRelationType
  4321. * @memberOf SuperMap
  4322. * @description 数据集对象间的空间关系枚举。
  4323. * 该类定义了数据集对象间的空间关系类型常量。
  4324. * @type {string}
  4325. */
  4326. var SpatialRelationType = SuperMap.SpatialRelationType = {
  4327. /** 包含关系 */
  4328. CONTAIN: "CONTAIN",
  4329. /** 相交关系 */
  4330. INTERSECT: "INTERSECT",
  4331. /** 被包含关系 */
  4332. WITHIN: "WITHIN"
  4333. };
  4334. /**
  4335. * @enum MeasureMode
  4336. * @memberOf SuperMap
  4337. * @type {string}
  4338. * @description 量算模式枚举。
  4339. * 该类定义了两种测量模式:距离测量和面积测量。
  4340. */
  4341. var MeasureMode = SuperMap.MeasureMode = {
  4342. /** 距离测量 */
  4343. DISTANCE: "DISTANCE",
  4344. /** 面积测量 */
  4345. AREA: "AREA"
  4346. };
  4347. /**
  4348. * @enum Unit
  4349. * @memberOf SuperMap
  4350. * @description 距离单位枚举。
  4351. * 该类定义了一系列距离单位类型。
  4352. * @type {string}
  4353. */
  4354. var REST_Unit = SuperMap.Unit = {
  4355. /** 米 */
  4356. METER: "METER",
  4357. /** 千米 */
  4358. KILOMETER: "KILOMETER",
  4359. /** 英里 */
  4360. MILE: "MILE",
  4361. /** 码 */
  4362. YARD: "YARD",
  4363. /** 度 */
  4364. DEGREE: "DEGREE",
  4365. /** 毫米 */
  4366. MILLIMETER: "MILLIMETER",
  4367. /** 厘米 */
  4368. CENTIMETER: "CENTIMETER",
  4369. /** 英寸 */
  4370. INCH: "INCH",
  4371. /** 分米 */
  4372. DECIMETER: "DECIMETER",
  4373. /** 英尺 */
  4374. FOOT: "FOOT",
  4375. /** 秒 */
  4376. SECOND: "SECOND",
  4377. /** 分 */
  4378. MINUTE: "MINUTE",
  4379. /** 弧度 */
  4380. RADIAN: "RADIAN"
  4381. };
  4382. /**
  4383. * @enum BufferRadiusUnit
  4384. * @memberOf SuperMap
  4385. * @description 缓冲区距离单位枚举。
  4386. * 该类定义了一系列缓冲距离单位类型。
  4387. * @type {string}
  4388. */
  4389. var BufferRadiusUnit = SuperMap.BufferRadiusUnit = {
  4390. /** 厘米 */
  4391. CENTIMETER: "CENTIMETER",
  4392. /** 分米 */
  4393. DECIMETER: "DECIMETER",
  4394. /** 英尺 */
  4395. FOOT: "FOOT",
  4396. /** 英寸 */
  4397. INCH: "INCH",
  4398. /** 千米 */
  4399. KILOMETER: "KILOMETER",
  4400. /** 米 */
  4401. METER: "METER",
  4402. /** 英里 */
  4403. MILE: "MILE",
  4404. /** 毫米 */
  4405. MILLIMETER: "MILLIMETER",
  4406. /** 码 */
  4407. YARD: "YARD"
  4408. };
  4409. /**
  4410. * @enum EngineType
  4411. * @memberOf SuperMap
  4412. * @description 数据源引擎类型枚举。
  4413. * @type {string}
  4414. */
  4415. var EngineType = SuperMap.EngineType = {
  4416. /** 影像只读引擎类型,文件引擎,针对通用影像格式如 BMP,JPG,TIFF 以及超图自定义影像格式 SIT 等。 */
  4417. IMAGEPLUGINS: "IMAGEPLUGINS",
  4418. /** OGC 引擎类型,针对于 Web 数据源,Web 引擎,目前支持的类型有 WMS,WFS,WCS。 */
  4419. OGC: "OGC",
  4420. /** Oracle 引擎类型,针对 Oracle 数据源,数据库引擎。 */
  4421. ORACLEPLUS: "ORACLEPLUS",
  4422. /** SDB 引擎类型,文件引擎,即 SDB 数据源。 */
  4423. SDBPLUS: "SDBPLUS",
  4424. /** SQL Server 引擎类型,针对 SQL Server 数据源,数据库引擎 */
  4425. SQLPLUS: "SQLPLUS",
  4426. /** UDB 引擎类型,文件引擎。 */
  4427. UDB: "UDB"
  4428. };
  4429. /**
  4430. * @enum ThemeGraphTextFormat
  4431. * @memberOf SuperMap
  4432. * @description 统计专题图文本显示格式枚举。
  4433. * @type {string}
  4434. */
  4435. var ThemeGraphTextFormat = SuperMap.ThemeGraphTextFormat = {
  4436. /** 标题。以各子项的标题来进行标注。 */
  4437. CAPTION: "CAPTION",
  4438. /** 标题 + 百分数。以各子项的标题和所占的百分比来进行标注。 */
  4439. CAPTION_PERCENT: "CAPTION_PERCENT",
  4440. /** 标题 + 实际数值。以各子项的标题和真实数值来进行标注。 */
  4441. CAPTION_VALUE: "CAPTION_VALUE",
  4442. /** 百分数。以各子项所占的百分比来进行标注。 */
  4443. PERCENT: "PERCENT",
  4444. /** 实际数值。以各子项的真实数值来进行标注。 */
  4445. VALUE: "VALUE"
  4446. };
  4447. /**
  4448. * @enum ThemeGraphType
  4449. * @memberOf SuperMap
  4450. * @description 统计专题图类型枚举。
  4451. * @type {string}
  4452. */
  4453. var ThemeGraphType = SuperMap.ThemeGraphType = {
  4454. /** 面积图。 */
  4455. AREA: "AREA",
  4456. /** 柱状图。 */
  4457. BAR: "BAR",
  4458. /** 三维柱状图。 */
  4459. BAR3D: "BAR3D",
  4460. /** 折线图。 */
  4461. LINE: "LINE",
  4462. /** 饼图。 */
  4463. PIE: "PIE",
  4464. /** 三维饼图。 */
  4465. PIE3D: "PIE3D",
  4466. /** 点状图。 */
  4467. POINT: "POINT",
  4468. /** 环状图。 */
  4469. RING: "RING",
  4470. /** 玫瑰图。 */
  4471. ROSE: "ROSE",
  4472. /** 三维玫瑰图。 */
  4473. ROSE3D: "ROSE3D",
  4474. /** 堆叠柱状图。 */
  4475. STACK_BAR: "STACK_BAR",
  4476. /** 三维堆叠柱状图。 */
  4477. STACK_BAR3D: "STACK_BAR3D",
  4478. /** 阶梯图。 */
  4479. STEP: "STEP"
  4480. };
  4481. /**
  4482. * @enum GraphAxesTextDisplayMode
  4483. * @memberOf SuperMap
  4484. * @description 统计专题图坐标轴文本显示模式。
  4485. * @type {string}
  4486. */
  4487. var GraphAxesTextDisplayMode = SuperMap.GraphAxesTextDisplayMode = {
  4488. /** 显示全部文本。 */
  4489. ALL: "ALL",
  4490. /** 不显示。 */
  4491. NONE: "NONE",
  4492. /** 显示Y轴的文本。 */
  4493. YAXES: "YAXES"
  4494. };
  4495. /**
  4496. * @enum GraduatedMode
  4497. * @memberOf SuperMap
  4498. * @description 专题图分级模式枚举。
  4499. *
  4500. * @type {string}
  4501. */
  4502. var GraduatedMode = SuperMap.GraduatedMode = {
  4503. /** 常量分级模式。 */
  4504. CONSTANT: "CONSTANT",
  4505. /** 对数分级模式。 */
  4506. LOGARITHM: "LOGARITHM",
  4507. /** 平方根分级模式。 */
  4508. SQUAREROOT: "SQUAREROOT"
  4509. };
  4510. /**
  4511. * @enum RangeMode
  4512. * @memberOf SuperMap
  4513. * @description 范围分段专题图分段方式枚举。
  4514. * @type {string}
  4515. */
  4516. var RangeMode = SuperMap.RangeMode = {
  4517. /** 自定义分段法。 */
  4518. CUSTOMINTERVAL: "CUSTOMINTERVAL",
  4519. /** 等距离分段法。 */
  4520. EQUALINTERVAL: "EQUALINTERVAL",
  4521. /** 对数分段法。 */
  4522. LOGARITHM: "LOGARITHM",
  4523. /** 等计数分段法。 */
  4524. QUANTILE: "QUANTILE",
  4525. /** 平方根分段法。 */
  4526. SQUAREROOT: "SQUAREROOT",
  4527. /** 标准差分段法。 */
  4528. STDDEVIATION: "STDDEVIATION"
  4529. };
  4530. /**
  4531. * @enum ThemeType
  4532. * @memberOf SuperMap
  4533. * @description 专题图类型枚举。
  4534. * @type {string}
  4535. */
  4536. var ThemeType = SuperMap.ThemeType = {
  4537. /** 点密度专题图。 */
  4538. DOTDENSITY: "DOTDENSITY",
  4539. /** 等级符号专题图。 */
  4540. GRADUATEDSYMBOL: "GRADUATEDSYMBOL",
  4541. /** 统计专题图。 */
  4542. GRAPH: "GRAPH",
  4543. /** 标签专题图。 */
  4544. LABEL: "LABEL",
  4545. /** 分段专题图。 */
  4546. RANGE: "RANGE",
  4547. /** 単值专题图。 */
  4548. UNIQUE: "UNIQUE"
  4549. };
  4550. /**
  4551. * @enum ColorGradientType
  4552. * @memberOf SuperMap
  4553. * @description 渐变颜色枚举。
  4554. * @type {string}
  4555. */
  4556. var ColorGradientType = SuperMap.ColorGradientType = {
  4557. /** 黑白渐变色。 */
  4558. BLACK_WHITE: "BLACKWHITE",
  4559. /** 蓝黑渐变色。 */
  4560. BLUE_BLACK: "BLUEBLACK",
  4561. /** 蓝红渐变色。 */
  4562. BLUE_RED: "BLUERED",
  4563. /** 蓝白渐变色。 */
  4564. BLUE_WHITE: "BLUEWHITE",
  4565. /** 青黑渐变色。 */
  4566. CYAN_BLACK: "CYANBLACK",
  4567. /** 青蓝渐变色。 */
  4568. CYAN_BLUE: "CYANBLUE",
  4569. /** 青绿渐变色。 */
  4570. CYAN_GREEN: "CYANGREEN",
  4571. /** 青白渐变色。 */
  4572. CYAN_WHITE: "CYANWHITE",
  4573. /** 绿黑渐变色。 */
  4574. GREEN_BLACK: "GREENBLACK",
  4575. /** 绿蓝渐变色。 */
  4576. GREEN_BLUE: "GREENBLUE",
  4577. /** 绿橙紫渐变色。 */
  4578. GREEN_ORANGE_VIOLET: "GREENORANGEVIOLET",
  4579. /** 绿红渐变色。 */
  4580. GREEN_RED: "GREENRED",
  4581. /** 蓝红渐变色。 */
  4582. GREEN_WHITE: "GREENWHITE",
  4583. /** 粉黑渐变色。 */
  4584. PINK_BLACK: "PINKBLACK",
  4585. /** 粉蓝渐变色。 */
  4586. PINK_BLUE: "PINKBLUE",
  4587. /** 粉红渐变色。 */
  4588. PINK_RED: "PINKRED",
  4589. /** 粉白渐变色。 */
  4590. PINK_WHITE: "PINKWHITE",
  4591. /** 彩虹色。 */
  4592. RAIN_BOW: "RAINBOW",
  4593. /** 红黑渐变色。 */
  4594. RED_BLACK: "REDBLACK",
  4595. /** 红白渐变色。 */
  4596. RED_WHITE: "REDWHITE",
  4597. /** 光谱渐变。 */
  4598. SPECTRUM: "SPECTRUM",
  4599. /** 地形渐变,用于三维显示效果较好。 */
  4600. TERRAIN: "TERRAIN",
  4601. /** 黄黑渐变色。 */
  4602. YELLOW_BLACK: "YELLOWBLACK",
  4603. /** 黄蓝渐变色。 */
  4604. YELLOW_BLUE: "YELLOWBLUE",
  4605. /** 黄绿渐变色。 */
  4606. YELLOW_GREEN: "YELLOWGREEN",
  4607. /** 黄红渐变色。 */
  4608. YELLOW_RED: "YELLOWRED",
  4609. /** 黄白渐变色。 */
  4610. YELLOW_WHITE: "YELLOWWHITE"
  4611. };
  4612. /**
  4613. * @enum TextAlignment
  4614. * @memberOf SuperMap
  4615. * @description 文本对齐枚举。
  4616. * @type {string}
  4617. */
  4618. var TextAlignment = SuperMap.TextAlignment = {
  4619. /** 左上角对齐。 */
  4620. TOPLEFT: "TOPLEFT",
  4621. /** 顶部居中对齐。 */
  4622. TOPCENTER: "TOPCENTER",
  4623. /** 右上角对齐。 */
  4624. TOPRIGHT: "TOPRIGHT",
  4625. /** 基准线左对齐。 */
  4626. BASELINELEFT: "BASELINELEFT",
  4627. /** 基准线居中对齐。 */
  4628. BASELINECENTER: "BASELINECENTER",
  4629. /** 基准线右对齐。 */
  4630. BASELINERIGHT: "BASELINERIGHT",
  4631. /** 左下角对齐。 */
  4632. BOTTOMLEFT: "BOTTOMLEFT",
  4633. /** 底部居中对齐。 */
  4634. BOTTOMCENTER: "BOTTOMCENTER",
  4635. /** 右下角对齐。 */
  4636. BOTTOMRIGHT: "BOTTOMRIGHT",
  4637. /** 左中对齐。 */
  4638. MIDDLELEFT: "MIDDLELEFT",
  4639. /** 中心对齐。 */
  4640. MIDDLECENTER: "MIDDLECENTER",
  4641. /** 右中对齐。 */
  4642. MIDDLERIGHT: "MIDDLERIGHT"
  4643. };
  4644. /**
  4645. * @enum FillGradientMode
  4646. * @memberOf SuperMap
  4647. * @description 渐变填充风格的渐变类型枚举。
  4648. * @type {string}
  4649. */
  4650. var FillGradientMode = SuperMap.FillGradientMode = {
  4651. /** 无渐变。 */
  4652. NONE: "NONE",
  4653. /** 线性渐变填充。 */
  4654. LINEAR: "LINEAR",
  4655. /** 辐射渐变填充。 */
  4656. RADIAL: "RADIAL",
  4657. /** 圆锥渐变填充。 */
  4658. CONICAL: "CONICAL",
  4659. /** 四角渐变填充。 */
  4660. SQUARE: "SQUARE"
  4661. };
  4662. /**
  4663. * @enum AlongLineDirection
  4664. * @memberOf SuperMap
  4665. * @description 标签沿线标注方向枚举。
  4666. * @type {string}
  4667. */
  4668. var AlongLineDirection = SuperMap.AlongLineDirection = {
  4669. /** 沿线的法线方向放置标签。 */
  4670. NORMAL: "ALONG_LINE_NORMAL",
  4671. /** 从下到上,从左到右放置。 */
  4672. LB_TO_RT: "LEFT_BOTTOM_TO_RIGHT_TOP",
  4673. /** 从上到下,从左到右放置。 */
  4674. LT_TO_RB: "LEFT_TOP_TO_RIGHT_BOTTOM",
  4675. /** 从下到上,从右到左放置。 */
  4676. RB_TO_LT: "RIGHT_BOTTOM_TO_LEFT_TOP",
  4677. /** 从上到下,从右到左放置。 */
  4678. RT_TO_LB: "RIGHT_TOP_TO_LEFT_BOTTOM"
  4679. };
  4680. /**
  4681. * @enum LabelBackShape
  4682. * @memberOf SuperMap
  4683. * @description 标签专题图中标签背景的形状枚举。
  4684. * @type {string}
  4685. */
  4686. var LabelBackShape = SuperMap.LabelBackShape = {
  4687. /** 菱形背景,即标签背景的形状为菱形。 */
  4688. DIAMOND: "DIAMOND",
  4689. /** 椭圆形背景,即标签背景的行状为椭圆形。 */
  4690. ELLIPSE: "ELLIPSE",
  4691. /** 符号背景,即标签背景的形状为设定的符号。 */
  4692. MARKER: "MARKER",
  4693. /** 空背景,即不使用任何形状作为标签的背景。 */
  4694. NONE: "NONE",
  4695. /** 矩形背景,即标签背景的形状为矩形。 */
  4696. RECT: "RECT",
  4697. /** 圆角矩形背景,即标签背景的形状为圆角矩形。 */
  4698. ROUNDRECT: "ROUNDRECT",
  4699. /** 三角形背景,即标签背景的形状为三角形。 */
  4700. TRIANGLE: "TRIANGLE"
  4701. };
  4702. /**
  4703. * @enum LabelOverLengthMode
  4704. * @memberOf SuperMap
  4705. * @description 标签专题图中超长标签的处理模式枚举。
  4706. * @type {string}
  4707. */
  4708. var LabelOverLengthMode = SuperMap.LabelOverLengthMode = {
  4709. /** 换行显示。 */
  4710. NEWLINE: "NEWLINE",
  4711. /** 对超长标签不进行处理。 */
  4712. NONE: "NONE",
  4713. /** 省略超出部分。 */
  4714. OMIT: "OMIT"
  4715. };
  4716. /**
  4717. * @enum DirectionType
  4718. * @memberOf SuperMap
  4719. * @description 网络分析中方向枚举。
  4720. * 在行驶引导子项中使用。
  4721. * @type {string}
  4722. */
  4723. var DirectionType = SuperMap.DirectionType = {
  4724. /** 东。 */
  4725. EAST: "EAST",
  4726. /** 无方向。 */
  4727. NONE: "NONE",
  4728. /** 北。 */
  4729. NORTH: "NORTH",
  4730. /** 南。 */
  4731. SOURTH: "SOURTH",
  4732. /** 西。 */
  4733. WEST: "WEST"
  4734. };
  4735. /**
  4736. * @enum SideType
  4737. * @memberOf SuperMap
  4738. * @description 行驶位置枚举。
  4739. * 表示在行驶在路的左边、右边或者路上的枚举,该类用在行驶导引子项类中。
  4740. * @type {string}
  4741. */
  4742. var SideType = SuperMap.SideType = {
  4743. /** 路的左侧。 */
  4744. LEFT: "LEFT",
  4745. /** 在路上(即路的中间)。 */
  4746. MIDDLE: "MIDDLE",
  4747. /** 无效值。 */
  4748. NONE: "NONE",
  4749. /** 路的右侧。 */
  4750. RIGHT: "RIGHT"
  4751. };
  4752. /**
  4753. * @enum SupplyCenterType
  4754. * @memberOf SuperMap
  4755. * @description 资源供给中心类型枚举。
  4756. * 该枚举定义了网络分析中资源中心点的类型,主要用于资源分配和选址分区。
  4757. * 资源供给中心点的类型包括非中心,固定中心和可选中心。固定中心用于资源分配分析; 固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  4758. * @type {string}
  4759. */
  4760. var SupplyCenterType = SuperMap.SupplyCenterType = {
  4761. /** 固定中心点。 */
  4762. FIXEDCENTER: "FIXEDCENTER",
  4763. /** 非中心点。 */
  4764. NULL: "NULL",
  4765. /** 可选中心点。 */
  4766. OPTIONALCENTER: "OPTIONALCENTER"
  4767. };
  4768. /**
  4769. * @enum TurnType
  4770. * @memberOf SuperMap
  4771. * @description 转弯方向枚举。
  4772. * 用在行驶引导子项类中,表示转弯的方向。
  4773. * @type {string}
  4774. */
  4775. var TurnType = SuperMap.TurnType = {
  4776. /** 向前直行。 */
  4777. AHEAD: "AHEAD",
  4778. /** 掉头。 */
  4779. BACK: "BACK",
  4780. /** 终点,不拐弯。 */
  4781. END: "END",
  4782. /** 左转弯。 */
  4783. LEFT: "LEFT",
  4784. /** 无效值。 */
  4785. NONE: "NONE",
  4786. /** 右转弯。 */
  4787. RIGHT: "RIGHT"
  4788. };
  4789. /**
  4790. * @enum BufferEndType
  4791. * @memberOf SuperMap
  4792. * @description 缓冲区分析BufferEnd类型。
  4793. * @type {string}
  4794. */
  4795. var BufferEndType = SuperMap.BufferEndType = {
  4796. /** FLAT */
  4797. FLAT: "FLAT",
  4798. /** ROUND */
  4799. ROUND: "ROUND"
  4800. };
  4801. /**
  4802. * @enum OverlayOperationType
  4803. * @memberOf SuperMap
  4804. * @description 叠加分析类型枚举。
  4805. * @type {string}
  4806. */
  4807. var OverlayOperationType = SuperMap.OverlayOperationType = {
  4808. /** 操作数据集(几何对象)裁剪被操作数据集(几何对象)。 */
  4809. CLIP: "CLIP",
  4810. /** 在被操作数据集(几何对象)上擦除掉与操作数据集(几何对象)相重合的部分。 */
  4811. ERASE: "ERASE",
  4812. /**对被操作数据集(几何对象)进行同一操作,即操作执行后,被操作数据集(几何对象)包含来自操作数据集(几何对象)的几何形状。 */
  4813. IDENTITY: "IDENTITY",
  4814. /** 对两个数据集(几何对象)求交,返回两个数据集(几何对象)的交集。 */
  4815. INTERSECT: "INTERSECT",
  4816. /** 对两个面数据集(几何对象)进行合并操作。 */
  4817. UNION: "UNION",
  4818. /** 对两个面数据集(几何对象)进行更新操作。 */
  4819. UPDATE: "UPDATE",
  4820. /** 对两个面数据集(几何对象)进行对称差操作。 */
  4821. XOR: "XOR"
  4822. };
  4823. /**
  4824. * @enum OutputType
  4825. * @memberOf SuperMap
  4826. * @description 分布式分析输出类型枚举。
  4827. * @type {string}
  4828. */
  4829. var OutputType = SuperMap.OutputType = {
  4830. /** INDEXEDHDFS */
  4831. INDEXEDHDFS: "INDEXEDHDFS",
  4832. /** UDB */
  4833. UDB: "UDB",
  4834. /** MONGODB */
  4835. MONGODB: "MONGODB",
  4836. /** PG */
  4837. PG: "PG"
  4838. };
  4839. /**
  4840. * @enum SmoothMethod
  4841. * @memberOf SuperMap
  4842. * @description 光滑方法枚举。
  4843. * 用于从Grid 或DEM数据生成等值线或等值面时对等值线或者等值面的边界线进行平滑处理的方法。
  4844. * @type {string}
  4845. */
  4846. var SmoothMethod = SuperMap.SmoothMethod = {
  4847. /** B 样条法。 */
  4848. BSPLINE: "BSPLINE",
  4849. /** 磨角法。 */
  4850. POLISH: "POLISH"
  4851. };
  4852. /**
  4853. * @enum SurfaceAnalystMethod
  4854. * @memberOf SuperMap
  4855. * @description 表面分析方法枚举。
  4856. * 通过对数据进行表面分析,能够挖掘原始数据所包含的信息,使某些细节明显化,易于分析。
  4857. * @type {string}
  4858. */
  4859. var SurfaceAnalystMethod = SuperMap.SurfaceAnalystMethod = {
  4860. /** 等值线提取。 */
  4861. ISOLINE: "ISOLINE",
  4862. /** 等值面提取。 */
  4863. ISOREGION: "ISOREGION"
  4864. };
  4865. /**
  4866. * @enum DataReturnMode
  4867. * @memberOf SuperMap
  4868. * @description 数据返回模式枚举。
  4869. * 该枚举用于指定空间分析返回结果模式,包含返回数据集标识和记录集、只返回数据集标识(数据集名称@数据源名称)及只返回记录集三种模式。
  4870. * @type {string}
  4871. */
  4872. var DataReturnMode = SuperMap.DataReturnMode = {
  4873. /** 返回结果数据集标识(数据集名称@数据源名称)和记录集(RecordSet)。 */
  4874. DATASET_AND_RECORDSET: "DATASET_AND_RECORDSET",
  4875. /** 只返回数据集标识(数据集名称@数据源名称)。 */
  4876. DATASET_ONLY: "DATASET_ONLY",
  4877. /** 只返回记录集(RecordSet)。 */
  4878. RECORDSET_ONLY: "RECORDSET_ONLY"
  4879. };
  4880. /**
  4881. * @enum EditType
  4882. * @memberOf SuperMap
  4883. * @description 要素集更新模式枚举。
  4884. * 该枚举用于指定数据服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  4885. * @type {string}
  4886. */
  4887. var EditType = SuperMap.EditType = {
  4888. /** 增加操作。 */
  4889. ADD: "add",
  4890. /** 修改操作。 */
  4891. UPDATE: "update",
  4892. /** 删除操作。 */
  4893. DELETE: "delete"
  4894. };
  4895. /**
  4896. * @enum TransferTactic
  4897. * @memberOf SuperMap
  4898. * @description 公交换乘策略枚举。
  4899. * 该枚举用于指定公交服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  4900. * @type {string}
  4901. */
  4902. var TransferTactic = SuperMap.TransferTactic = {
  4903. /** 时间短。 */
  4904. LESS_TIME: "LESS_TIME",
  4905. /** 少换乘。 */
  4906. LESS_TRANSFER: "LESS_TRANSFER",
  4907. /** 少步行。 */
  4908. LESS_WALK: "LESS_WALK",
  4909. /** 距离最短。 */
  4910. MIN_DISTANCE: "MIN_DISTANCE"
  4911. };
  4912. /**
  4913. * @enum TransferPreference
  4914. * @memberOf SuperMap
  4915. * @description 公交换乘策略枚举。
  4916. * 该枚举用于指定交通换乘服务中设置地铁优先、公交优先、不乘地铁、无偏好等偏好设置。
  4917. * @type {string}
  4918. */
  4919. var TransferPreference = SuperMap.TransferPreference = {
  4920. /** 公交汽车优先。 */
  4921. BUS: "BUS",
  4922. /** 地铁优先。 */
  4923. SUBWAY: "SUBWAY",
  4924. /** 不乘坐地铁。 */
  4925. NO_SUBWAY: "NO_SUBWAY",
  4926. /** 无乘车偏好。 */
  4927. NONE: "NONE"
  4928. };
  4929. /**
  4930. * @enum GridType
  4931. * @memberOf SuperMap
  4932. * @description 地图背景格网类型枚举。
  4933. * @type {string}
  4934. */
  4935. var GridType = SuperMap.GridType = {
  4936. /** 十字叉丝。 */
  4937. CROSS: "CROSS",
  4938. /** 网格线。 */
  4939. GRID: "GRID",
  4940. /** 点。 */
  4941. POINT: "POINT"
  4942. };
  4943. /**
  4944. * @enum ColorSpaceType
  4945. * @memberOf SuperMap
  4946. * @description 色彩空间枚举。
  4947. * 由于成色原理的不同,决定了显示器、投影仪这类靠色光直接合成颜色的颜色设备和打印机、
  4948. * 印刷机这类靠使用颜料的印刷设备在生成颜色方式上的区别。
  4949. * 针对上述不同成色方式,SuperMap 提供两种色彩空间,
  4950. * 分别为 RGB 和 CMYK。RGB 主要用于显示系统中,CMYK 主要用于印刷系统中。
  4951. * @type {string}
  4952. */
  4953. var ColorSpaceType = SuperMap.ColorSpaceType = {
  4954. /** 该类型主要在印刷系统使用。 */
  4955. CMYK: "CMYK",
  4956. /** 该类型主要在显示系统中使用。 */
  4957. RGB: "RGB"
  4958. };
  4959. /**
  4960. * @enum LayerType
  4961. * @memberOf SuperMap
  4962. * @description 图层类型。
  4963. * @type {string}
  4964. */
  4965. var LayerType = SuperMap.LayerType = {
  4966. /** SuperMap UGC 类型图层。如矢量图层、栅格(Grid)图层、影像图层。 */
  4967. UGC: "UGC",
  4968. /** WMS 图层。 */
  4969. WMS: "WMS",
  4970. /** WFS 图层。 */
  4971. WFS: "WFS",
  4972. /** 自定义图层。 */
  4973. CUSTOM: "CUSTOM"
  4974. };
  4975. /**
  4976. * @enum UGCLayerType
  4977. * @memberOf SuperMap
  4978. * @description UGC图层类型。
  4979. * @type {string}
  4980. */
  4981. var UGCLayerType = SuperMap.UGCLayerType = {
  4982. /** 专题图层。 */
  4983. THEME: "THEME",
  4984. /** 矢量图层。 */
  4985. VECTOR: "VECTOR",
  4986. /** 栅格图层。。 */
  4987. GRID: "GRID",
  4988. /** 影像图层。 */
  4989. IMAGE: "IMAGE"
  4990. };
  4991. /**
  4992. * @enum StatisticMode
  4993. * @memberOf SuperMap
  4994. * @description 字段统计方法类型。
  4995. * @type {string}
  4996. */
  4997. var StatisticMode = SuperMap.StatisticMode = {
  4998. /** 统计所选字段的平均值。 */
  4999. AVERAGE: "AVERAGE",
  5000. /** 统计所选字段的最大值。 */
  5001. MAX: "MAX",
  5002. /** 统计所选字段的最小值。 */
  5003. MIN: "MIN",
  5004. /** 统计所选字段的标准差 */
  5005. STDDEVIATION: "STDDEVIATION",
  5006. /** 统计所选字段的总和。 */
  5007. SUM: "SUM",
  5008. /** 统计所选字段的方差。 */
  5009. VARIANCE: "VARIANCE"
  5010. };
  5011. /**
  5012. * @enum PixelFormat
  5013. * @memberOf SuperMap
  5014. * @description 栅格与影像数据存储的像素格式枚举。
  5015. * @type {string}
  5016. */
  5017. var PixelFormat = SuperMap.PixelFormat = {
  5018. /** 每个像元用16个比特(即2个字节)表示。 */
  5019. BIT16: "BIT16",
  5020. /** 每个像元用32个比特(即4个字节)表示。 */
  5021. BIT32: "BIT32",
  5022. /** 每个像元用64个比特(即8个字节)表示,只提供给栅格数据集使用。 */
  5023. BIT64: "BIT64",
  5024. /** 每个像元用4个字节来表示,只提供给栅格数据集使用。 */
  5025. SINGLE: "SINGLE",
  5026. /** 每个像元用8个字节来表示,只提供给栅格数据集使用。 */
  5027. DOUBLE: "DOUBLE",
  5028. /** 每个像元用1个比特表示。 */
  5029. UBIT1: "UBIT1",
  5030. /** 每个像元用4个比特来表示。 */
  5031. UBIT4: "UBIT4",
  5032. /** 每个像元用8个比特(即1个字节)来表示。 */
  5033. UBIT8: "UBIT8",
  5034. /** 每个像元用24个比特(即3个字节)来表示。 */
  5035. UBIT24: "UBIT24",
  5036. /** 每个像元用32个比特(即4个字节)来表示。 */
  5037. UBIT32: "UBIT32"
  5038. };
  5039. /**
  5040. * @enum SearchMode
  5041. * @memberOf SuperMap
  5042. * @description 内插时使用的样本点的查找方式枚举
  5043. * @type {string}
  5044. */
  5045. var SearchMode = SuperMap.SearchMode = {
  5046. /** 使用 KDTREE 的固定点数方式查找参与内插分析的点。 */
  5047. KDTREE_FIXED_COUNT: "KDTREE_FIXED_COUNT",
  5048. /** 使用 KDTREE 的定长方式查找参与内插分析的点。 */
  5049. KDTREE_FIXED_RADIUS: "KDTREE_FIXED_RADIUS",
  5050. /** 不进行查找,使用所有的输入点进行内插分析。 */
  5051. NONE: "NONE",
  5052. /** 使用 QUADTREE 方式查找参与内插分析的点,仅对样条(RBF)插值和普通克吕金(Kriging)有用。 */
  5053. QUADTREE: "QUADTREE"
  5054. };
  5055. /**
  5056. * @enum InterpolationAlgorithmType
  5057. * @memberOf SuperMap
  5058. * @description 插值分析的算法的类型
  5059. * @type {string}
  5060. */
  5061. var InterpolationAlgorithmType = SuperMap.InterpolationAlgorithmType = {
  5062. /** 普通克吕金插值法。 */
  5063. KRIGING: "KRIGING",
  5064. /** 简单克吕金插值法。 */
  5065. SimpleKriging: "SimpleKriging",
  5066. /** 泛克吕金插值法。 */
  5067. UniversalKriging: "UniversalKriging"
  5068. };
  5069. /**
  5070. * @enum VariogramMode
  5071. * @memberOf SuperMap
  5072. * @description 克吕金(Kriging)插值时的半变函数类型枚举
  5073. * @type {string}
  5074. */
  5075. var VariogramMode = SuperMap.VariogramMode = {
  5076. /** 指数函数。 */
  5077. EXPONENTIAL: "EXPONENTIAL",
  5078. /** 高斯函数。 */
  5079. GAUSSIAN: "GAUSSIAN",
  5080. /** 球型函数。 */
  5081. SPHERICAL: "SPHERICAL"
  5082. };
  5083. /**
  5084. * @enum Exponent
  5085. * @memberOf SuperMap
  5086. * @description 定义了泛克吕金(UniversalKriging)插值时样点数据中趋势面方程的阶数
  5087. * @type {string}
  5088. */
  5089. var Exponent = SuperMap.Exponent = {
  5090. /** 阶数为1。 */
  5091. EXP1: "EXP1",
  5092. /** 阶数为2。 */
  5093. EXP2: "EXP2"
  5094. };
  5095. /**
  5096. * @enum ClientType
  5097. * @memberOf SuperMap
  5098. * @description token申请的客户端标识类型
  5099. * @type {string}
  5100. */
  5101. var ClientType = SuperMap.ClientType = {
  5102. /** 指定的 IP 地址。 */
  5103. IP: "IP",
  5104. /** 指定的 URL。 */
  5105. REFERER: "Referer",
  5106. /** 发送申请令牌请求的客户端 IP。 */
  5107. REQUESTIP: "RequestIP",
  5108. /** 不做任何验证。 */
  5109. NONE: "NONE",
  5110. /** SERVER。 */
  5111. SERVER: "SERVER",
  5112. /** WEB。 */
  5113. WEB: "WEB"
  5114. };
  5115. /**
  5116. * @enum ChartType
  5117. * @memberOf SuperMap
  5118. * @description 客户端专题图图表类型
  5119. * @type {string}
  5120. */
  5121. var ChartType = SuperMap.ChartType = {
  5122. /** 柱状图。 */
  5123. BAR: "Bar",
  5124. /** 三维柱状图。 */
  5125. BAR3D: "Bar3D",
  5126. /** 圆形图。 */
  5127. CIRCLE: "Circle",
  5128. /** 饼图。 */
  5129. PIE: "Pie",
  5130. /** 散点图。 */
  5131. POINT: "Point",
  5132. /** 折线图。 */
  5133. LINE: "Line",
  5134. /** 环状图。 */
  5135. RING: "Ring"
  5136. };
  5137. /**
  5138. * @enum ClipAnalystMode
  5139. * @memberOf SuperMap
  5140. * @description 裁剪分析模式
  5141. * @type {string}
  5142. */
  5143. var ClipAnalystMode = SuperMap.ClipAnalystMode = {
  5144. /** CLIP。 */
  5145. CLIP: "clip",
  5146. /** INTERSECT。 */
  5147. INTERSECT: "intersect"
  5148. };
  5149. /**
  5150. * @enum AnalystAreaUnit
  5151. * @memberOf SuperMap
  5152. * @description 分布式分析面积单位
  5153. * @type {string}
  5154. */
  5155. var AnalystAreaUnit = SuperMap.AnalystAreaUnit = {
  5156. /** 平方米。 */
  5157. "SQUAREMETER": "SquareMeter",
  5158. /** 平方千米。 */
  5159. "SQUAREKILOMETER": "SquareKiloMeter",
  5160. /** 公顷。 */
  5161. "HECTARE": "Hectare",
  5162. /** 公亩。 */
  5163. "ARE": "Are",
  5164. /** 英亩。 */
  5165. "ACRE": "Acre",
  5166. /** 平方英尺。 */
  5167. "SQUAREFOOT": "SquareFoot",
  5168. /** 平方码。 */
  5169. "SQUAREYARD": "SquareYard",
  5170. /** 平方英里。 */
  5171. "SQUAREMILE": "SquareMile"
  5172. };
  5173. /**
  5174. * @enum AnalystSizeUnit
  5175. * @memberOf SuperMap
  5176. * @description 分布式分析单位
  5177. * @type {string}
  5178. */
  5179. var AnalystSizeUnit = SuperMap.AnalystSizeUnit = {
  5180. /** 米。 */
  5181. "METER": "Meter",
  5182. /** 千米。 */
  5183. "KILOMETER": "Kilometer",
  5184. /** 码。 */
  5185. "YARD": "Yard",
  5186. /** 英尺。 */
  5187. "FOOT": "Foot",
  5188. /** 英里。 */
  5189. "MILE": "Mile"
  5190. };
  5191. /**
  5192. * @enum StatisticAnalystMode
  5193. * @memberOf SuperMap
  5194. * @description 分布式分析统计模式
  5195. * @type {string}
  5196. */
  5197. var StatisticAnalystMode = SuperMap.StatisticAnalystMode = {
  5198. /** 统计所选字段的最大值。 */
  5199. "MAX": "max",
  5200. /** 统计所选字段的最小值。 */
  5201. "MIN": "min",
  5202. /** 统计所选字段的平均值。 */
  5203. "AVERAGE": "average",
  5204. /** 统计所选字段的总和。 */
  5205. "SUM": "sum",
  5206. /** 统计所选字段的方差。 */
  5207. "VARIANCE": "variance",
  5208. /** 统计所选字段的标准差 */
  5209. "STDDEVIATION": "stdDeviation"
  5210. };
  5211. /**
  5212. * @enum SummaryType
  5213. * @memberOf SuperMap
  5214. * @description 分布式分析聚合类型
  5215. * @type {string}
  5216. */
  5217. var SummaryType = SuperMap.SummaryType = {
  5218. /** 格网聚合。 */
  5219. "SUMMARYMESH": "SUMMARYMESH",
  5220. /** 多边形聚合。 */
  5221. "SUMMARYREGION": "SUMMARYREGION"
  5222. };
  5223. /**
  5224. * @enum TopologyValidatorRule
  5225. * @memberOf SuperMap
  5226. * @description 拓扑检查模式枚举。该类定义了拓扑检查操作模式常量。
  5227. * @type {string}
  5228. */
  5229. var TopologyValidatorRule = SuperMap.TopologyValidatorRule = {
  5230. /** 面内无重叠,用于对面数据进行拓扑检查。 */
  5231. REGIONNOOVERLAP: "REGIONNOOVERLAP",
  5232. /** 面与面无重叠,用于对面数据进行拓扑检查。 */
  5233. REGIONNOOVERLAPWITH: "REGIONNOOVERLAPWITH",
  5234. /** 面被面包含,用于对面数据进行拓扑检查。 */
  5235. REGIONCONTAINEDBYREGION: "REGIONCONTAINEDBYREGION",
  5236. /** 面被面覆盖,用于对面数据进行拓扑检查。 */
  5237. REGIONCOVEREDBYREGION: "REGIONCOVEREDBYREGION",
  5238. /** 线与线无重叠,用于对线数据进行拓扑检查。 */
  5239. LINENOOVERLAP: "LINENOOVERLAP",
  5240. /** 线内无重叠,用于对线数据进行拓扑检查。 */
  5241. LINENOOVERLAPWITH: "LINENOOVERLAPWITH",
  5242. /** 点不相同,用于对点数据进行拓扑检查。 */
  5243. POINTNOIDENTICAL: "POINTNOIDENTICAL"
  5244. };
  5245. /**
  5246. * @enum AggregationType
  5247. * @memberOf SuperMap
  5248. * @description 聚合查询枚举类,该类定义了Es数据服务中聚合查询模式常量
  5249. * @type {string}
  5250. */
  5251. var AggregationType = SuperMap.AggregationType = {
  5252. /** 格网聚合类型。 */
  5253. GEOHASH_GRID: "geohash_grid",
  5254. /** 过滤聚合类型。 */
  5255. FILTER: "filter"
  5256. };
  5257. /**
  5258. * @enum AggregationType
  5259. * @memberOf SuperMap
  5260. * @description 聚合查询中filter查询枚举类
  5261. * @type {string}
  5262. */
  5263. var AggregationQueryBuilderType = SuperMap.AggregationQueryBuilderType = {
  5264. /** 范围查询。 */
  5265. GEO_BOUNDING_BOX: "geo_bounding_box"
  5266. };
  5267. /**
  5268. * @enum GetFeatureMode
  5269. * @memberOf SuperMap
  5270. * @description feature 查询方式。
  5271. * @type {string}
  5272. */
  5273. var GetFeatureMode = SuperMap.GetFeatureMode = {
  5274. /** 通过范围查询来获取要素。 */
  5275. BOUNDS: "BOUNDS",
  5276. /** 通过几何对象的缓冲区来获取要素。 */
  5277. BUFFER: "BUFFER",
  5278. /** 通过 ID 来获取要素。 */
  5279. ID: "ID",
  5280. /** 通过空间查询模式来获取要素。 */
  5281. SPATIAL: "SPATIAL",
  5282. /** 通过 SQL 查询来获取要素。 */
  5283. SQL: 'SQL'
  5284. };
  5285. /**
  5286. * @enum RasterFunctionType
  5287. * @memberOf SuperMap
  5288. * @description 栅格分析方法。
  5289. * @type {string}
  5290. */
  5291. var RasterFunctionType = SuperMap.RasterFunctionType = {
  5292. /** 归一化植被指数。 */
  5293. NDVI: "NDVI",
  5294. /** 阴影面分析。 */
  5295. HILLSHADE: "HILLSHADE"
  5296. };
  5297. /**
  5298. * @enum ResourceType
  5299. * @memberOf SuperMap
  5300. * @description iportal资源类型。
  5301. * @version 10.0.1
  5302. * @type {string}
  5303. */
  5304. var ResourceType = SuperMap.ResourceType = {
  5305. /** 地图。 */
  5306. MAP: "MAP",
  5307. /** 服务。 */
  5308. SERVICE: "SERVICE",
  5309. /** 场景。 */
  5310. SCENE: "SCENE",
  5311. /** 数据。 */
  5312. DATA: "DATA",
  5313. /** 洞察。 */
  5314. INSIGHTS_WORKSPACE: "INSIGHTS_WORKSPACE",
  5315. /** 大屏。 */
  5316. MAP_DASHBOARD: "MAP_DASHBOARD"
  5317. };
  5318. /**
  5319. * @enum OrderBy
  5320. * @memberOf SuperMap
  5321. * @description iportal资源排序字段。
  5322. * @version 10.0.1
  5323. * @type {string}
  5324. */
  5325. var OrderBy = SuperMap.OrderBy = {
  5326. /** 按更新时间排序 */
  5327. UPDATETIME: "UPDATETIME",
  5328. /** 按热度(可能是访问量、下载量)排序 */
  5329. HEATLEVEL: "HEATLEVEL",
  5330. /** 按相关性排序 */
  5331. RELEVANCE: "RELEVANCE"
  5332. };
  5333. /**
  5334. * @enum OrderType
  5335. * @memberOf SuperMap
  5336. * @description iportal资源升序还是降序过滤
  5337. * @version 10.0.1
  5338. * @type {string}
  5339. */
  5340. var OrderType = SuperMap.OrderType = {
  5341. /** 升序 */
  5342. ASC: "ASC",
  5343. /** 降序 */
  5344. DESC: "DESC"
  5345. };
  5346. /**
  5347. * @enum SearchType
  5348. * @memberOf SuperMap
  5349. * @description iportal资源查询的范围进行过滤
  5350. * @version 10.0.1
  5351. * @type {string}
  5352. */
  5353. var SearchType = SuperMap.SearchType = {
  5354. /** 公开资源。 */
  5355. PUBLIC: "PUBLIC",
  5356. /** 我的资源。 */
  5357. MY_RES: "MY_RES",
  5358. /** 我的群组资源。 */
  5359. MYGROUP_RES: "MYGROUP_RES",
  5360. /** 我的部门资源。 */
  5361. MYDEPARTMENT_RES: "MYDEPARTMENT_RES",
  5362. /** 分享给我的资源。 */
  5363. SHARETOME_RES: "SHARETOME_RES"
  5364. };
  5365. /**
  5366. * @enum AggregationTypes
  5367. * @memberOf SuperMap
  5368. * @description iportal资源聚合查询的类型
  5369. * @version 10.0.1
  5370. * @type {string}
  5371. */
  5372. var AggregationTypes = SuperMap.AggregationTypes = {
  5373. /** 标签 */
  5374. TAG: "TAG",
  5375. /** 资源类型 */
  5376. TYPE: "TYPE"
  5377. };
  5378. /**
  5379. * @enum PermissionType
  5380. * @memberOf SuperMap
  5381. * @description iportal资源权限类型。
  5382. * @version 10.0.1
  5383. * @type {string}
  5384. */
  5385. var PermissionType = SuperMap.PermissionType = {
  5386. /** 可检索 */
  5387. SEARCH: "SEARCH",
  5388. /** 可查看 */
  5389. READ: "READ",
  5390. /** 可编辑 */
  5391. READWRITE: "READWRITE",
  5392. /** 可删除 */
  5393. DELETE: "DELETE",
  5394. /** 可下载,包括可读、可检索 */
  5395. DOWNLOAD: "DOWNLOAD"
  5396. };
  5397. /**
  5398. * @enum EntityType
  5399. * @memberOf SuperMap
  5400. * @description iportal资源实体类型。
  5401. * @version 10.0.1
  5402. * @type {string}
  5403. */
  5404. var EntityType = SuperMap.EntityType = {
  5405. /** 部门 */
  5406. DEPARTMENT: "DEPARTMENT",
  5407. /** 用户组 */
  5408. GROUP: "GROUP",
  5409. /** 群组 */
  5410. IPORTALGROUP: "IPORTALGROUP",
  5411. /** 角色 */
  5412. ROLE: "ROLE",
  5413. /** 用户 */
  5414. USER: "USER"
  5415. };
  5416. /**
  5417. * @enum DataItemType
  5418. * @memberOf SuperMap
  5419. * @description iportal数据类型。
  5420. * @version 10.0.1
  5421. * @type {string}
  5422. */
  5423. var DataItemType = SuperMap.DataItemType = {
  5424. /** 工作空间 sxwu, smwu, sxw, smw */
  5425. WORKSPACE: "WORKSPACE",
  5426. /** udb 数据源 */
  5427. UDB: "UDB",
  5428. /** shp空间数据 */
  5429. SHP: "SHP",
  5430. /** excel数据 */
  5431. EXCEL: "EXCEL",
  5432. /** csv数据 */
  5433. CSV: "CSV",
  5434. /** geojson数据。 */
  5435. GEOJSON: "GEOJSON",
  5436. /** smtiles */
  5437. SMTILES: "SMTILES",
  5438. /** svtiles */
  5439. SVTILES: "SVTILES",
  5440. /** mbtiles */
  5441. MBTILES: "MBTILES",
  5442. /** tpk */
  5443. TPK: "TPK",
  5444. /** ugc v5 */
  5445. UGCV5: "UGCV5",
  5446. /** UGCV5_MVT */
  5447. UGCV5_MVT: "UGCV5_MVT",
  5448. /** json数据 */
  5449. JSON: "JSON"
  5450. };
  5451. /**
  5452. * @enum WebExportFormatType
  5453. * @memberOf SuperMap
  5454. * @description Web 打印输出的格式。
  5455. * @version 10.0.1
  5456. * @type {string}
  5457. */
  5458. var WebExportFormatType = SuperMap.WebExportFormatType = {
  5459. /** png */
  5460. PNG: "PNG",
  5461. /** pdf */
  5462. PDF: "PDF"
  5463. };
  5464. /**
  5465. * @enum WebScaleOrientationType
  5466. * @memberOf SuperMap
  5467. * @description Web 比例尺的方位样式。
  5468. * @version 10.0.1
  5469. * @type {string}
  5470. */
  5471. var WebScaleOrientationType = SuperMap.WebScaleOrientationType = {
  5472. /** horizontal labels below */
  5473. HORIZONTALLABELSBELOW: "HORIZONTALLABELSBELOW",
  5474. /** horizontal labels above */
  5475. HORIZONTALLABELSABOVE: "HORIZONTALLABELSABOVE",
  5476. /** vertical labels left */
  5477. VERTICALLABELSLEFT: "VERTICALLABELSLEFT",
  5478. /** vertical labels right */
  5479. VERTICALLABELSRIGHT: "VERTICALLABELSRIGHT"
  5480. };
  5481. /**
  5482. * @enum WebScaleType
  5483. * @memberOf SuperMap
  5484. * @description Web 比例尺的样式。
  5485. * @version 10.0.1
  5486. * @type {string}
  5487. */
  5488. var WebScaleType = SuperMap.WebScaleType = {
  5489. /** line */
  5490. LINE: "LINE",
  5491. /** bar */
  5492. BAR: "BAR",
  5493. /** bar sub */
  5494. BAR_SUB: "BAR_SUB"
  5495. };
  5496. /**
  5497. * @enum WebScaleUnit
  5498. * @memberOf SuperMap
  5499. * @description Web 比例尺的单位制。
  5500. * @version 10.0.1
  5501. * @type {string}
  5502. */
  5503. var WebScaleUnit = SuperMap.WebScaleUnit = {
  5504. /** meter */
  5505. METER: "METER",
  5506. /** foot */
  5507. FOOT: "FOOT",
  5508. /** degrees */
  5509. DEGREES: "DEGREES"
  5510. };
  5511. ;// CONCATENATED MODULE: ./src/common/commontypes/Size.js
  5512. function Size_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5513. 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); } }
  5514. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5515. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  5516. * This program are made available under the terms of the Apache License, Version 2.0
  5517. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5518. /**
  5519. * @class SuperMap.Size
  5520. * @category BaseTypes Style
  5521. * @classdesc 此类描绘一对高宽值的实例。
  5522. * @param {number} [w=0.0] - 宽度。
  5523. * @param {number} [h=0.0] - 高度。
  5524. *
  5525. * @example
  5526. * var size = new SuperMap.Size(31,46);
  5527. */
  5528. var Size = /*#__PURE__*/function () {
  5529. function Size(w, h) {
  5530. Size_classCallCheck(this, Size);
  5531. /**
  5532. * @member {number} [SuperMap.Size.prototype.w=0.0]
  5533. * @description 宽度。
  5534. */
  5535. this.w = w ? parseFloat(w) : 0.0;
  5536. /**
  5537. * @member {number} [SuperMap.Size.prototype.h=0.0]
  5538. * @description 高度。
  5539. */
  5540. this.h = w ? parseFloat(h) : 0.0;
  5541. this.CLASS_NAME = "SuperMap.Size";
  5542. }
  5543. /**
  5544. * @function SuperMap.Size.prototype.toString
  5545. * @description 返回此对象的字符串形式。
  5546. * @example
  5547. * var size = new SuperMap.Size(10,5);
  5548. * var str = size.toString();
  5549. * @returns {string} 例如:"w=10,h=5"。
  5550. */
  5551. _createClass(Size, [{
  5552. key: "toString",
  5553. value: function toString() {
  5554. return "w=" + this.w + ",h=" + this.h;
  5555. }
  5556. /**
  5557. * @function SuperMap.Size.prototype.clone
  5558. * @description 克隆当前size对象。
  5559. * @example
  5560. * var size = new SuperMap.Size(31,46);
  5561. * var size2 = size.clone();
  5562. * @returns {SuperMap.Size} 返回一个新的与当前 size 对象有相同宽、高的 Size 对象。
  5563. */
  5564. }, {
  5565. key: "clone",
  5566. value: function clone() {
  5567. return new Size(this.w, this.h);
  5568. }
  5569. /**
  5570. *
  5571. * @function SuperMap.Size.prototype.equals
  5572. * @description 比较两个 size 对象是否相等。
  5573. * @example
  5574. * var size = new SuperMap.Size(31,46);
  5575. * var size2 = new SuperMap.Size(31,46);
  5576. * var isEquals = size.equals(size2);
  5577. *
  5578. * @param {SuperMap.Size} sz - 用于比较相等的 Size 对象。
  5579. * @returns {boolean} 传入的 size 和当前 size 高宽相等,注意:如果传入的 size 为空则返回 false。
  5580. *
  5581. */
  5582. }, {
  5583. key: "equals",
  5584. value: function equals(sz) {
  5585. var equals = false;
  5586. if (sz != null) {
  5587. equals = this.w === sz.w && this.h === sz.h || isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h);
  5588. }
  5589. return equals;
  5590. }
  5591. /**
  5592. *
  5593. * @function SuperMap.Size.prototype.destroy
  5594. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  5595. * @example
  5596. * var size = new SuperMap.Size(31,46);
  5597. * size.destroy();
  5598. */
  5599. }, {
  5600. key: "destroy",
  5601. value: function destroy() {
  5602. this.w = null;
  5603. this.h = null;
  5604. }
  5605. }]);
  5606. return Size;
  5607. }();
  5608. SuperMap.Size = Size;
  5609. ;// CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
  5610. function Pixel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5611. 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); } }
  5612. function Pixel_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pixel_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pixel_defineProperties(Constructor, staticProps); return Constructor; }
  5613. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  5614. * This program are made available under the terms of the Apache License, Version 2.0
  5615. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5616. /**
  5617. * @class SuperMap.Pixel
  5618. * @category BaseTypes Geometry
  5619. * @classdesc 此类用 x,y 坐标描绘屏幕坐标(像素点)。
  5620. * @param {number} [x=0.0] - x 坐标。
  5621. * @param {number} [y=0.0] - y 坐标。
  5622. * @param {SuperMap.Pixel.Mode} [mode=SuperMap.Pixel.Mode.LeftTop] - 坐标模式。
  5623. *
  5624. * @example
  5625. * //单独创建一个对象
  5626. * var pixcel = new SuperMap.Pixel(100,50);
  5627. *
  5628. * //依据 size 创建
  5629. * var size = new SuperMap.Size(21,25);
  5630. * var offset = new SuperMap.Pixel(-(size.w/2), -size.h);
  5631. */
  5632. var Pixel = /*#__PURE__*/function () {
  5633. function Pixel(x, y, mode) {
  5634. Pixel_classCallCheck(this, Pixel);
  5635. /**
  5636. * @member {number} [SuperMap.Pixel.prototype.x=0.0]
  5637. * @description x 坐标。
  5638. */
  5639. this.x = x ? parseFloat(x) : 0.0;
  5640. /**
  5641. * @member {number} [SuperMap.Pixel.prototype.y=0.0]
  5642. * @description y 坐标。
  5643. */
  5644. this.y = y ? parseFloat(y) : 0.0;
  5645. /**
  5646. * @member {SuperMap.Pixel.Mode} [SuperMap.Pixel.prototype.mode=SuperMap.Pixel.Mode.LeftTop]
  5647. * @description 坐标模式,有左上、右上、右下、左下这几种模式,分别表示相对于左上角、右上角、右下角、左下角的坐标。
  5648. */
  5649. this.mode = mode;
  5650. this.CLASS_NAME = "SuperMap.Pixel";
  5651. /**
  5652. * @enum SuperMap.Pixel.Mode
  5653. * @readonly
  5654. * @description 模式。
  5655. * @type {string}
  5656. */
  5657. SuperMap.Pixel.Mode = {
  5658. /** 左上模式。*/
  5659. LeftTop: "lefttop",
  5660. /** 右上模式。 */
  5661. RightTop: "righttop",
  5662. /** 右下模式。 */
  5663. RightBottom: "rightbottom",
  5664. /** 左下模式。 */
  5665. LeftBottom: "leftbottom"
  5666. };
  5667. }
  5668. /**
  5669. * @function SuperMap.Pixel.prototype.toString
  5670. * @description 返回此对象的字符串形式。
  5671. * @example
  5672. *
  5673. * var pixcel = new SuperMap.Pixel(100,50);
  5674. * var str = pixcel.toString();
  5675. *
  5676. * @returns {string} 例如: "x=200.4,y=242.2"
  5677. */
  5678. Pixel_createClass(Pixel, [{
  5679. key: "toString",
  5680. value: function toString() {
  5681. return "x=" + this.x + ",y=" + this.y;
  5682. }
  5683. /**
  5684. * @function SuperMap.Pixel.prototype.clone
  5685. * @description 克隆当前的 pixel 对象。
  5686. * @example
  5687. * var pixcel = new SuperMap.Pixel(100,50);
  5688. * var pixcel2 = pixcel.clone();
  5689. * @returns {SuperMap.Pixel} 返回一个新的与当前 pixel 对象有相同 x、y 坐标的 pixel 对象。
  5690. */
  5691. }, {
  5692. key: "clone",
  5693. value: function clone() {
  5694. return new Pixel(this.x, this.y, this.mode);
  5695. }
  5696. /**
  5697. * @function SuperMap.Pixel.prototype.equals
  5698. * @description 比较两 pixel 是否相等。
  5699. * @example
  5700. * var pixcel = new SuperMap.Pixel(100,50);
  5701. * var pixcel2 = new SuperMap.Pixel(100,50);
  5702. * var isEquals = pixcel.equals(pixcel2);
  5703. *
  5704. * @param {SuperMap.Pixel} px - 用于比较相等的 pixel 对象。
  5705. * @returns {boolean} 如果传入的像素点和当前像素点相同返回 true,如果不同或传入参数为 NULL 则返回 false。
  5706. */
  5707. }, {
  5708. key: "equals",
  5709. value: function equals(px) {
  5710. var equals = false;
  5711. if (px != null) {
  5712. equals = this.x == px.x && this.y == px.y || isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y);
  5713. }
  5714. return equals;
  5715. }
  5716. /**
  5717. * @function SuperMap.Pixel.prototype.distanceTo
  5718. * @description 返回两个 pixel 的距离。
  5719. * @example
  5720. * var pixcel = new SuperMap.Pixel(100,50);
  5721. * var pixcel2 = new SuperMap.Pixel(110,30);
  5722. * var distance = pixcel.distanceTo(pixcel2);
  5723. *
  5724. * @param {SuperMap.Pixel} px - 用于计算的一个 pixel。
  5725. * @returns {float} 作为参数传入的像素与当前像素点的距离。
  5726. */
  5727. }, {
  5728. key: "distanceTo",
  5729. value: function distanceTo(px) {
  5730. return Math.sqrt(Math.pow(this.x - px.x, 2) + Math.pow(this.y - px.y, 2));
  5731. }
  5732. /**
  5733. * @function SuperMap.Pixel.prototype.add
  5734. * @description 在原来像素坐标基础上,x 值加上传入的 x 参数,y 值加上传入的 y 参数。
  5735. * @example
  5736. * var pixcel = new SuperMap.Pixel(100,50);
  5737. * //pixcel2是新的对象
  5738. * var pixcel2 = pixcel.add(20,30);
  5739. *
  5740. * @param {number} x - 传入的 x 值。
  5741. * @param {number} y - 传入的 y 值。
  5742. * @returns {SuperMap.Pixel} 返回一个新的 pixel 对象,该 pixel 是由当前的 pixel 与传入的 x,y 相加得到。
  5743. */
  5744. }, {
  5745. key: "add",
  5746. value: function add(x, y) {
  5747. if (x == null || y == null) {
  5748. throw new TypeError('Pixel.add cannot receive null values');
  5749. }
  5750. return new Pixel(this.x + x, this.y + y);
  5751. }
  5752. /**
  5753. * @function SuperMap.Pixel.prototype.offset
  5754. * @description 通过传入的 {@link SuperMap.Pixel} 参数对原屏幕坐标进行偏移。
  5755. * @example
  5756. * var pixcel = new SuperMap.Pixel(100,50);
  5757. * var pixcel2 = new SuperMap.Pixel(130,20);
  5758. * //pixcel3 是新的对象
  5759. * var pixcel3 = pixcel.offset(pixcel2);
  5760. *
  5761. * @param {SuperMap.Pixel} px - 传入的 <SuperMap.Pixel> 对象。
  5762. * @returns {SuperMap.Pixel} 返回一个新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
  5763. */
  5764. }, {
  5765. key: "offset",
  5766. value: function offset(px) {
  5767. var newPx = this.clone();
  5768. if (px) {
  5769. newPx = this.add(px.x, px.y);
  5770. }
  5771. return newPx;
  5772. }
  5773. /**
  5774. *
  5775. * @function SuperMap.Pixel.prototype.destroy
  5776. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  5777. * @example
  5778. * var pixcel = new SuperMap.Pixel(100,50);
  5779. * pixcel.destroy();
  5780. */
  5781. }, {
  5782. key: "destroy",
  5783. value: function destroy() {
  5784. this.x = null;
  5785. this.y = null;
  5786. this.mode = null;
  5787. }
  5788. }]);
  5789. return Pixel;
  5790. }();
  5791. SuperMap.Pixel = Pixel;
  5792. ;// CONCATENATED MODULE: ./src/common/commontypes/BaseTypes.js
  5793. function BaseTypes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5794. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  5795. * This program are made available under the terms of the Apache License, Version 2.0
  5796. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5797. /**
  5798. *@namespace SuperMap
  5799. *@category BaseTypes Namespace
  5800. */
  5801. /**
  5802. * @function SuperMap.inherit
  5803. * @description 除了 C 和 P 两个必要参数外,可以传递任意数量的对象,这些对象都将继承C。
  5804. * @memberOf SuperMap
  5805. * @param {Object} C - 继承的类。
  5806. * @param {Object} P - 被继承的父类。
  5807. */
  5808. SuperMap.inherit = function (C, P) {
  5809. var F = function F() {};
  5810. F.prototype = P.prototype;
  5811. C.prototype = new F();
  5812. var i, l, o;
  5813. for (i = 2, l = arguments.length; i < l; i++) {
  5814. o = arguments[i];
  5815. if (typeof o === "function") {
  5816. o = o.prototype;
  5817. }
  5818. SuperMap.Util.extend(C.prototype, o);
  5819. }
  5820. };
  5821. /**
  5822. * @function SuperMap.mixin
  5823. * @description 实现多重继承。
  5824. * @memberOf SuperMap
  5825. * @param {Class|Object} ...mixins - 继承的类。
  5826. */
  5827. SuperMap.mixin = function () {
  5828. for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {
  5829. mixins[_key] = arguments[_key];
  5830. }
  5831. var Mix = function Mix(options) {
  5832. BaseTypes_classCallCheck(this, Mix);
  5833. for (var index = 0; index < mixins.length; index++) {
  5834. copyProperties(this, new mixins[index](options));
  5835. }
  5836. };
  5837. for (var index = 0; index < mixins.length; index++) {
  5838. var mixin = mixins[index];
  5839. copyProperties(Mix, mixin);
  5840. copyProperties(Mix.prototype, mixin.prototype);
  5841. copyProperties(Mix.prototype, new mixin());
  5842. }
  5843. return Mix;
  5844. function copyProperties(target, source) {
  5845. var ownKeys = Object.getOwnPropertyNames(source);
  5846. if (Object.getOwnPropertySymbols) {
  5847. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source));
  5848. }
  5849. for (var index = 0; index < ownKeys.length; index++) {
  5850. var key = ownKeys[index];
  5851. if (key !== "constructor" && key !== "prototype" && key !== "name" && key !== "length") {
  5852. var desc = Object.getOwnPropertyDescriptor(source, key);
  5853. if (window["ActiveXObject"]) {
  5854. Object.defineProperty(target, key, desc || {});
  5855. } else {
  5856. Object.defineProperty(target, key, desc);
  5857. }
  5858. }
  5859. }
  5860. }
  5861. };
  5862. /**
  5863. * @name String
  5864. * @namespace
  5865. * @memberOf SuperMap
  5866. * @category BaseTypes Util
  5867. * @description 字符串操作的一系列常用扩展函数。
  5868. */
  5869. var StringExt = SuperMap.String = {
  5870. /**
  5871. * @function SuperMap.String.startsWith
  5872. * @description 判断目标字符串是否以指定的子字符串开头。
  5873. * @param {string} str - 目标字符串。
  5874. * @param {string} sub - 查找的子字符串。
  5875. * @returns {boolean} 目标字符串以指定的子字符串开头,则返回 true;否则返回 false。
  5876. */
  5877. startsWith: function startsWith(str, sub) {
  5878. return str.indexOf(sub) == 0;
  5879. },
  5880. /**
  5881. * @function SuperMap.String.contains
  5882. * @description 判断目标字符串是否包含指定的子字符串。
  5883. * @param {string} str - 目标字符串。
  5884. * @param {string} sub - 查找的子字符串。
  5885. * @returns {boolean} 目标字符串中包含指定的子字符串,则返回 true;否则返回 false。
  5886. */
  5887. contains: function contains(str, sub) {
  5888. return str.indexOf(sub) != -1;
  5889. },
  5890. /**
  5891. * @function SuperMap.String.trim
  5892. * @description 删除一个字符串的开头和结尾处的所有空白字符。
  5893. * @param {string} str - (可能)存在空白字符填塞的字符串。
  5894. * @returns {string} 删除开头和结尾处空白字符后的字符串。
  5895. */
  5896. trim: function trim(str) {
  5897. return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  5898. },
  5899. /**
  5900. * @function SuperMap.String.camelize
  5901. * @description 骆驼式("-")连字符的字符串处理。
  5902. * 例如:"chicken-head" becomes "chickenHead",
  5903. * "-chicken-head" becomes "ChickenHead"。
  5904. * @param {string} str - 要处理的字符串,原始内容不应被修改。
  5905. * @returns {string}
  5906. */
  5907. camelize: function camelize(str) {
  5908. var oStringList = str.split('-');
  5909. var camelizedString = oStringList[0];
  5910. for (var i = 1, len = oStringList.length; i < len; i++) {
  5911. var s = oStringList[i];
  5912. camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
  5913. }
  5914. return camelizedString;
  5915. },
  5916. /**
  5917. * @function SuperMap.String.format
  5918. * @description 提供带 ${token} 标记的字符串, 返回 context 对象属性中指定标记的属性值。
  5919. * @example
  5920. * 示例:
  5921. * (code)
  5922. * 1、template = "${value,getValue}";
  5923. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  5924. * args = [2,23,12,36,21];
  5925. * 返回值:36
  5926. * (end)
  5927. * 示例:
  5928. * (code)
  5929. * 2、template = "$${{value,getValue}}";
  5930. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  5931. * args = [2,23,12,36,21];
  5932. * 返回值:"${36}"
  5933. * (end)
  5934. * 示例:
  5935. * (code)
  5936. * 3、template = "${a,b}";
  5937. * context = {a: {b:"format"}};
  5938. * args = null;
  5939. * 返回值:"format"
  5940. * (end)
  5941. * 示例:
  5942. * (code)
  5943. * 3、template = "${a,b}";
  5944. * context = null;
  5945. * args = null;
  5946. * 返回值:"${a.b}"
  5947. * (end)
  5948. * @param {string} template - 带标记的字符串将要被替换。参数 template 格式为"${token}",此处的 token 标记会替换为 context["token"] 属性的值。
  5949. * @param {Object} [context=window] - 带有属性的可选对象的属性用于匹配格式化字符串中的标记。如果该参数为空,将使用 window 对象。
  5950. * @param {Array} [args] - 可选参数传递给在 context 对象上找到的函数。
  5951. * @returns {string} 从 context 对象属性中替换字符串标记位的字符串。
  5952. */
  5953. format: function format(template, context, args) {
  5954. if (!context) {
  5955. context = window;
  5956. } // Example matching:
  5957. // str = ${foo.bar}
  5958. // match = foo.bar
  5959. var replacer = function replacer(str, match) {
  5960. var replacement; // Loop through all subs. Example: ${a.b.c}
  5961. // 0 -> replacement = context[a];
  5962. // 1 -> replacement = context[a][b];
  5963. // 2 -> replacement = context[a][b][c];
  5964. var subs = match.split(/\.+/);
  5965. for (var i = 0; i < subs.length; i++) {
  5966. if (i == 0) {
  5967. replacement = context;
  5968. }
  5969. replacement = replacement[subs[i]];
  5970. }
  5971. if (typeof replacement === "function") {
  5972. replacement = args ? replacement.apply(null, args) : replacement();
  5973. } // If replacement is undefined, return the string 'undefined'.
  5974. // This is a workaround for a bugs in browsers not properly
  5975. // dealing with non-participating groups in regular expressions:
  5976. // http://blog.stevenlevithan.com/archives/npcg-javascript
  5977. if (typeof replacement == 'undefined') {
  5978. return 'undefined';
  5979. } else {
  5980. return replacement;
  5981. }
  5982. };
  5983. return template.replace(SuperMap.String.tokenRegEx, replacer);
  5984. },
  5985. /**
  5986. * @member {RegExp} [SuperMap.String.tokenRegEx]
  5987. * @description 寻找带 token 的字符串,默认为 tokenRegEx=/\$\{([\w.]+?)\}/g。
  5988. * @example
  5989. * Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
  5990. */
  5991. tokenRegEx: /\$\{([\w.]+?)\}/g,
  5992. /**
  5993. * @member {RegExp} [SuperMap.String.numberRegEx]
  5994. * @description 判断一个字符串是否只包含一个数值,默认为 numberRegEx=/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/。
  5995. */
  5996. numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
  5997. /**
  5998. * @function SuperMap.String.isNumeric
  5999. * @description 判断一个字符串是否只包含一个数值。
  6000. * @example
  6001. * (code)
  6002. * SuperMap.String.isNumeric("6.02e23") // true
  6003. * SuperMap.String.isNumeric("12 dozen") // false
  6004. * SuperMap.String.isNumeric("4") // true
  6005. * SuperMap.String.isNumeric(" 4 ") // false
  6006. * (end)
  6007. * @returns {boolean} 字符串包含唯一的数值,返回 true;否则返回 false。
  6008. */
  6009. isNumeric: function isNumeric(value) {
  6010. return SuperMap.String.numberRegEx.test(value);
  6011. },
  6012. /**
  6013. * @function SuperMap.String.numericIf
  6014. * @description 把一个看似数值型的字符串转化为一个数值。
  6015. * @returns {(number|string)} 如果能转换为数值则返回数值,否则返回字符串本身。
  6016. */
  6017. numericIf: function numericIf(value) {
  6018. return SuperMap.String.isNumeric(value) ? parseFloat(value) : value;
  6019. }
  6020. };
  6021. /**
  6022. * @name Number
  6023. * @memberOf SuperMap
  6024. * @namespace
  6025. * @category BaseTypes Util
  6026. * @description 数值操作的一系列常用扩展函数。
  6027. */
  6028. var NumberExt = SuperMap.Number = {
  6029. /**
  6030. * @member {string} [SuperMap.Number.decimalSeparator='.']
  6031. * @description 格式化数字时默认的小数点分隔符。
  6032. * @constant
  6033. */
  6034. decimalSeparator: ".",
  6035. /**
  6036. * @member {string} [SuperMap.Number.thousandsSeparator=',']
  6037. * @description 格式化数字时默认的千位分隔符。
  6038. * @constant
  6039. */
  6040. thousandsSeparator: ",",
  6041. /**
  6042. * @function SuperMap.Number.limitSigDigs
  6043. * @description 限制浮点数的有效数字位数。
  6044. * @param {number} num - 浮点数。
  6045. * @param {integer} sig - 有效位数。
  6046. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  6047. */
  6048. limitSigDigs: function limitSigDigs(num, sig) {
  6049. var fig = 0;
  6050. if (sig > 0) {
  6051. fig = parseFloat(num.toPrecision(sig));
  6052. }
  6053. return fig;
  6054. },
  6055. /**
  6056. * @function SuperMap.Number.format
  6057. * @description 数字格式化输出。
  6058. * @param {number} num - 数字。
  6059. * @param {integer} [dec=0] - 数字的小数部分四舍五入到指定的位数。设置为 null 值时小数部分不变。
  6060. * @param {string} [tsep=','] - 千位分隔符。
  6061. * @param {string} [dsep='.'] - 小数点分隔符。
  6062. * @returns {string} 数字格式化后的字符串。
  6063. */
  6064. format: function format(num, dec, tsep, dsep) {
  6065. dec = typeof dec != "undefined" ? dec : 0;
  6066. tsep = typeof tsep != "undefined" ? tsep : SuperMap.Number.thousandsSeparator;
  6067. dsep = typeof dsep != "undefined" ? dsep : SuperMap.Number.decimalSeparator;
  6068. if (dec != null) {
  6069. num = parseFloat(num.toFixed(dec));
  6070. }
  6071. var parts = num.toString().split(".");
  6072. if (parts.length === 1 && dec == null) {
  6073. // integer where we do not want to touch the decimals
  6074. dec = 0;
  6075. }
  6076. var integer = parts[0];
  6077. if (tsep) {
  6078. var thousands = /(-?[0-9]+)([0-9]{3})/;
  6079. while (thousands.test(integer)) {
  6080. integer = integer.replace(thousands, "$1" + tsep + "$2");
  6081. }
  6082. }
  6083. var str;
  6084. if (dec == 0) {
  6085. str = integer;
  6086. } else {
  6087. var rem = parts.length > 1 ? parts[1] : "0";
  6088. if (dec != null) {
  6089. rem = rem + new Array(dec - rem.length + 1).join("0");
  6090. }
  6091. str = integer + dsep + rem;
  6092. }
  6093. return str;
  6094. }
  6095. };
  6096. if (!Number.prototype.limitSigDigs) {
  6097. /**
  6098. * APIMethod: Number.limitSigDigs
  6099. * 限制浮点数的有效数字位数.
  6100. * @param {integer} sig -有效位数。
  6101. * @returns {integer} 将数字四舍五入到指定数量的有效位数。
  6102. * 如果传入值 为 null、0、或者是负数, 返回值 0。
  6103. */
  6104. Number.prototype.limitSigDigs = function (sig) {
  6105. return NumberExt.limitSigDigs(this, sig);
  6106. };
  6107. }
  6108. /**
  6109. * @name Function
  6110. * @memberOf SuperMap
  6111. * @namespace
  6112. * @category BaseTypes Util
  6113. * @description 函数操作的一系列常用扩展函数。
  6114. */
  6115. var FunctionExt = SuperMap.Function = {
  6116. /**
  6117. * @function SuperMap.Function.bind
  6118. * @description 绑定函数到对象。方便创建 this 的作用域。
  6119. * @param {function} func - 输入函数。
  6120. * @param {Object} object - 对象绑定到输入函数(作为输入函数的 this 对象)。
  6121. * @returns {function} object 参数作为 func 函数的 this 对象。
  6122. */
  6123. bind: function bind(func, object) {
  6124. // create a reference to all arguments past the second one
  6125. var args = Array.prototype.slice.apply(arguments, [2]);
  6126. return function () {
  6127. // Push on any additional arguments from the actual function call.
  6128. // These will come after those sent to the bind call.
  6129. var newArgs = args.concat(Array.prototype.slice.apply(arguments, [0]));
  6130. return func.apply(object, newArgs);
  6131. };
  6132. },
  6133. /**
  6134. * @function SuperMap.Function.bindAsEventListener
  6135. * @description 绑定函数到对象,在调用该函数时配置并使用事件对象作为第一个参数。
  6136. * @param {function} func - 用于监听事件的函数。
  6137. * @param {Object} object - this 对象的引用。
  6138. * @returns {function}
  6139. */
  6140. bindAsEventListener: function bindAsEventListener(func, object) {
  6141. return function (event) {
  6142. return func.call(object, event || window.event);
  6143. };
  6144. },
  6145. /**
  6146. * @function SuperMap.Function.False
  6147. * @description 该函数仅仅返回 false。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  6148. * @example
  6149. * document.onclick = SuperMap.Function.False;
  6150. * @returns {boolean}
  6151. */
  6152. False: function False() {
  6153. return false;
  6154. },
  6155. /**
  6156. * @function SuperMap.Function.True
  6157. * @description 该函数仅仅返回 true。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  6158. * @example
  6159. * document.onclick = SuperMap.Function.True;
  6160. * @returns {boolean}
  6161. */
  6162. True: function True() {
  6163. return true;
  6164. },
  6165. /**
  6166. * @function SuperMap.Function.Void
  6167. * @description 可重用函数,仅仅返回 "undefined"。
  6168. * @returns {undefined}
  6169. */
  6170. Void: function Void() {}
  6171. };
  6172. /**
  6173. * @name Array
  6174. * @memberOf SuperMap
  6175. * @namespace
  6176. * @category BaseTypes Util
  6177. * @description 数组操作的一系列常用扩展函数。
  6178. */
  6179. var ArrayExt = SuperMap.Array = {
  6180. /**
  6181. * @function SuperMap.Array.filter
  6182. * @description 过滤数组,提供了 ECMA-262 标准中 Array.prototype.filter 函数的扩展。详见:{@link http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter}
  6183. * @param {Array} array - 要过滤的数组。
  6184. * @param {function} callback - 数组中的每一个元素调用该函数。</br>
  6185. * 如果函数的返回值为 true,该元素将包含在返回的数组中。该函数有三个参数: 数组中的元素,元素的索引,数组自身。</br>
  6186. * 如果设置了可选参数 caller,在调用 callback 时,使用可选参数 caller 设置为 callback 的参数。</br>
  6187. * @param {Object} [caller] - 在调用 callback 时,使用参数 caller 设置为 callback 的参数。
  6188. * @returns {Array} callback 函数返回 true 时的元素将作为返回数组中的元素。
  6189. */
  6190. filter: function filter(array, callback, caller) {
  6191. var selected = [];
  6192. if (Array.prototype.filter) {
  6193. selected = array.filter(callback, caller);
  6194. } else {
  6195. var len = array.length;
  6196. if (typeof callback != "function") {
  6197. throw new TypeError();
  6198. }
  6199. for (var i = 0; i < len; i++) {
  6200. if (i in array) {
  6201. var val = array[i];
  6202. if (callback.call(caller, val, i, array)) {
  6203. selected.push(val);
  6204. }
  6205. }
  6206. }
  6207. }
  6208. return selected;
  6209. }
  6210. };
  6211. ;// CONCATENATED MODULE: ./src/common/commontypes/Util.js
  6212. function Util_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Util_typeof = function _typeof(obj) { return typeof obj; }; } else { Util_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Util_typeof(obj); }
  6213. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6214. * This program are made available under the terms of the Apache License, Version 2.0
  6215. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6216. var Util = SuperMap.Util = SuperMap.Util || {};
  6217. /**
  6218. * @name Util
  6219. * @memberOf SuperMap
  6220. * @namespace
  6221. * @category BaseTypes Util
  6222. * @description common 工具类。
  6223. */
  6224. /**
  6225. * @description 复制源对象的所有属性到目标对象上,源对象上的没有定义的属性在目标对象上也不会被设置。
  6226. * @example
  6227. * 要复制 SuperMap.Size 对象的所有属性到自定义对象上,使用方法如下:
  6228. * var size = new SuperMap.Size(100, 100);
  6229. * var obj = {};
  6230. * SuperMap.Util.extend(obj, size);
  6231. * @param {Object} [destination] - 目标对象。
  6232. * @param {Object} source - 源对象,其属性将被设置到目标对象上。
  6233. * @returns {Object} 目标对象。
  6234. */
  6235. SuperMap.Util.extend = function (destination, source) {
  6236. destination = destination || {};
  6237. if (source) {
  6238. for (var property in source) {
  6239. var value = source[property];
  6240. if (value !== undefined) {
  6241. destination[property] = value;
  6242. }
  6243. }
  6244. /**
  6245. * IE doesn't include the toString property when iterating over an object's
  6246. * properties with the for(property in object) syntax. Explicitly check if
  6247. * the source has its own toString property.
  6248. */
  6249. /*
  6250. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  6251. * prototype object" when calling hawOwnProperty if the source object
  6252. * is an instance of window.Event.
  6253. */
  6254. var sourceIsEvt = typeof window.Event === "function" && source instanceof window.Event;
  6255. if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty("toString")) {
  6256. destination.toString = source.toString;
  6257. }
  6258. }
  6259. return destination;
  6260. };
  6261. /**
  6262. * @description 对象拷贝。
  6263. * @param {Object} [des] - 目标对象。
  6264. * @param {Object} soc - 源对象。
  6265. */
  6266. SuperMap.Util.copy = function (des, soc) {
  6267. des = des || {};
  6268. var v;
  6269. if (soc) {
  6270. for (var p in des) {
  6271. v = soc[p];
  6272. if (typeof v !== 'undefined') {
  6273. des[p] = v;
  6274. }
  6275. }
  6276. }
  6277. };
  6278. /**
  6279. * @description 销毁对象,将其属性置空。
  6280. * @param {Object} [obj] - 目标对象。
  6281. */
  6282. SuperMap.Util.reset = function (obj) {
  6283. obj = obj || {};
  6284. for (var p in obj) {
  6285. if (obj.hasOwnProperty(p)) {
  6286. if (Util_typeof(obj[p]) === "object" && obj[p] instanceof Array) {
  6287. for (var i in obj[p]) {
  6288. if (obj[p][i].destroy) {
  6289. obj[p][i].destroy();
  6290. }
  6291. }
  6292. obj[p].length = 0;
  6293. } else if (Util_typeof(obj[p]) === "object" && obj[p] instanceof Object) {
  6294. if (obj[p].destroy) {
  6295. obj[p].destroy();
  6296. }
  6297. }
  6298. obj[p] = null;
  6299. }
  6300. }
  6301. };
  6302. /**
  6303. * @description 获取 HTML 元素数组。
  6304. * @returns {Array.<HTMLElement>} HTML 元素数组。
  6305. */
  6306. SuperMap.Util.getElement = function () {
  6307. var elements = [];
  6308. for (var i = 0, len = arguments.length; i < len; i++) {
  6309. var element = arguments[i];
  6310. if (typeof element === 'string') {
  6311. element = document.getElementById(element);
  6312. }
  6313. if (arguments.length === 1) {
  6314. return element;
  6315. }
  6316. elements.push(element);
  6317. }
  6318. return elements;
  6319. };
  6320. /**
  6321. * @description instance of 的跨浏览器实现。
  6322. * @param {Object} o - 对象。
  6323. * @returns {boolean} 是否是页面元素。
  6324. */
  6325. SuperMap.Util.isElement = function (o) {
  6326. return !!(o && o.nodeType === 1);
  6327. };
  6328. /**
  6329. * @description 判断一个对象是否是数组。
  6330. * @param {Object} a - 对象。
  6331. * @returns {boolean} 是否是数组。
  6332. */
  6333. SuperMap.Util.isArray = function (a) {
  6334. return Object.prototype.toString.call(a) === '[object Array]';
  6335. };
  6336. /**
  6337. * @description 从数组中删除某一项。
  6338. * @param {Array} array - 数组。
  6339. * @param {Object} item - 数组中要删除的一项。
  6340. * @returns {Array} 执行删除操作后的数组。
  6341. */
  6342. SuperMap.Util.removeItem = function (array, item) {
  6343. for (var i = array.length - 1; i >= 0; i--) {
  6344. if (array[i] === item) {
  6345. array.splice(i, 1); //break;more than once??
  6346. }
  6347. }
  6348. return array;
  6349. };
  6350. /**
  6351. * @description 获取某对象再数组中的索引值。
  6352. * @param {Array} array - 数组。
  6353. * @param {Object} obj - 对象。
  6354. * @returns {number} 某对象再数组中的索引值。
  6355. */
  6356. SuperMap.Util.indexOf = function (array, obj) {
  6357. if (array == null) {
  6358. return -1;
  6359. } else {
  6360. // use the build-in function if available.
  6361. if (typeof array.indexOf === "function") {
  6362. return array.indexOf(obj);
  6363. } else {
  6364. for (var i = 0, len = array.length; i < len; i++) {
  6365. if (array[i] === obj) {
  6366. return i;
  6367. }
  6368. }
  6369. return -1;
  6370. }
  6371. }
  6372. };
  6373. /**
  6374. * @description 修改某 DOM 元素的许多属性。
  6375. * @param {HTMLElement} element - 待修改的 DOM 元素。
  6376. * @param {string} [id] - DOM 元素的 ID。
  6377. * @param {SuperMap.Pixel} [px] - 包含 DOM 元素的 style 属性的 left 和 top 属性。
  6378. * @param {SuperMap.Size} [sz] - 包含 DOM 元素的 width 和 height 属性。
  6379. * @param {string} [position] - DOM 元素的 position 属性。
  6380. * @param {string} [border] - DOM 元素的 style 属性的 border 属性。
  6381. * @param {string} [overflow] - DOM 元素的 style 属性的 overflow 属性。
  6382. * @param {number} [opacity] - 不透明度值。取值范围为(0.0 - 1.0)。
  6383. */
  6384. SuperMap.Util.modifyDOMElement = function (element, id, px, sz, position, border, overflow, opacity) {
  6385. if (id) {
  6386. element.id = id;
  6387. }
  6388. if (px) {
  6389. element.style.left = px.x + "px";
  6390. element.style.top = px.y + "px";
  6391. }
  6392. if (sz) {
  6393. element.style.width = sz.w + "px";
  6394. element.style.height = sz.h + "px";
  6395. }
  6396. if (position) {
  6397. element.style.position = position;
  6398. }
  6399. if (border) {
  6400. element.style.border = border;
  6401. }
  6402. if (overflow) {
  6403. element.style.overflow = overflow;
  6404. }
  6405. if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) {
  6406. element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
  6407. element.style.opacity = opacity;
  6408. } else if (parseFloat(opacity) === 1.0) {
  6409. element.style.filter = '';
  6410. element.style.opacity = '';
  6411. }
  6412. };
  6413. /**
  6414. * @description Takes an object and copies any properties that don't exist from
  6415. * another properties, by analogy with SuperMap.Util.extend() from
  6416. * Prototype.js.
  6417. *
  6418. * @param {Object} [to] - 目标对象。
  6419. * @param {Object} from - 源对象。Any properties of this object that
  6420. * are undefined in the to object will be set on the to object.
  6421. *
  6422. * @returns {Object} A reference to the to object. Note that the to argument is modified
  6423. * in place and returned by this function.
  6424. */
  6425. SuperMap.Util.applyDefaults = function (to, from) {
  6426. to = to || {};
  6427. /*
  6428. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  6429. * prototype object" when calling hawOwnProperty if the source object is an
  6430. * instance of window.Event.
  6431. */
  6432. var fromIsEvt = typeof window.Event === "function" && from instanceof window.Event;
  6433. for (var key in from) {
  6434. if (to[key] === undefined || !fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key)) {
  6435. to[key] = from[key];
  6436. }
  6437. }
  6438. /**
  6439. * IE doesn't include the toString property when iterating over an object's
  6440. * properties with the for(property in object) syntax. Explicitly check if
  6441. * the source has its own toString property.
  6442. */
  6443. if (!fromIsEvt && from && from.hasOwnProperty && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) {
  6444. to.toString = from.toString;
  6445. }
  6446. return to;
  6447. };
  6448. /**
  6449. * @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
  6450. * @param {Object} params - 参数对象。
  6451. * @returns {string} HTTP 的 GET 请求中的参数字符串。
  6452. */
  6453. SuperMap.Util.getParameterString = function (params) {
  6454. var paramsArray = [];
  6455. for (var key in params) {
  6456. var value = params[key];
  6457. if (value != null && typeof value !== 'function') {
  6458. var encodedValue;
  6459. if (Array.isArray(value) || value.toString() === '[object Object]') {
  6460. encodedValue = encodeURIComponent(JSON.stringify(value));
  6461. } else {
  6462. /* value is a string; simply encode */
  6463. encodedValue = encodeURIComponent(value);
  6464. }
  6465. paramsArray.push(encodeURIComponent(key) + "=" + encodedValue);
  6466. }
  6467. }
  6468. return paramsArray.join("&");
  6469. };
  6470. /**
  6471. * @description 给 URL 追加查询参数。
  6472. * @param {string} url - 待追加参数的 URL 字符串。
  6473. * @param {string} paramStr - 待追加的查询参数。
  6474. * @returns {string} 新的 URL。
  6475. */
  6476. SuperMap.Util.urlAppend = function (url, paramStr) {
  6477. var newUrl = url;
  6478. if (paramStr) {
  6479. if (paramStr.indexOf('?') === 0) {
  6480. paramStr = paramStr.substring(1);
  6481. }
  6482. var parts = (url + " ").split(/[?&]/);
  6483. newUrl += parts.pop() === " " ? paramStr : parts.length ? "&" + paramStr : "?" + paramStr;
  6484. }
  6485. return newUrl;
  6486. };
  6487. /**
  6488. * @description 给 URL 追加 path 参数。
  6489. * @param {string} url - 待追加参数的 URL 字符串。
  6490. * @param {string} paramStr - 待追加的path参数。
  6491. * @returns {string} 新的 URL。
  6492. */
  6493. SuperMap.Util.urlPathAppend = function (url, pathStr) {
  6494. var newUrl = url;
  6495. if (!pathStr) {
  6496. return newUrl;
  6497. }
  6498. if (pathStr.indexOf('/') === 0) {
  6499. pathStr = pathStr.substring(1);
  6500. }
  6501. var parts = url.split('?');
  6502. if (parts[0].indexOf('/', parts[0].length - 1) < 0) {
  6503. parts[0] += '/';
  6504. }
  6505. newUrl = "".concat(parts[0]).concat(pathStr).concat(parts.length > 1 ? "?".concat(parts[1]) : '');
  6506. return newUrl;
  6507. };
  6508. /**
  6509. * @description 为了避免浮点精度错误而保留的有效位数。
  6510. * @type {number}
  6511. * @default 14
  6512. */
  6513. SuperMap.Util.DEFAULT_PRECISION = 14;
  6514. /**
  6515. * @description 将字符串以接近的精度转换为数字。
  6516. * @param {string} number - 字符串。
  6517. * @param {number} [precision=14] - 精度。
  6518. * @returns {number} 数字。
  6519. */
  6520. SuperMap.Util.toFloat = function (number, precision) {
  6521. if (precision == null) {
  6522. precision = SuperMap.Util.DEFAULT_PRECISION;
  6523. }
  6524. if (typeof number !== "number") {
  6525. number = parseFloat(number);
  6526. }
  6527. return precision === 0 ? number : parseFloat(number.toPrecision(precision));
  6528. };
  6529. /**
  6530. * @description 角度转弧度。
  6531. * @param {number} x - 角度。
  6532. * @returns {number} 弧度。
  6533. */
  6534. SuperMap.Util.rad = function (x) {
  6535. return x * Math.PI / 180;
  6536. };
  6537. /**
  6538. * @description 从 URL 字符串中解析出参数对象。
  6539. * @param {string} url - URL。
  6540. * @returns {Object} 解析出的参数对象。
  6541. */
  6542. SuperMap.Util.getParameters = function (url) {
  6543. // if no url specified, take it from the location bar
  6544. url = url === null || url === undefined ? window.location.href : url; //parse out parameters portion of url string
  6545. var paramsString = "";
  6546. if (SuperMap.String.contains(url, '?')) {
  6547. var start = url.indexOf('?') + 1;
  6548. var end = SuperMap.String.contains(url, "#") ? url.indexOf('#') : url.length;
  6549. paramsString = url.substring(start, end);
  6550. }
  6551. var parameters = {};
  6552. var pairs = paramsString.split(/[&;]/);
  6553. for (var i = 0, len = pairs.length; i < len; ++i) {
  6554. var keyValue = pairs[i].split('=');
  6555. if (keyValue[0]) {
  6556. var key = keyValue[0];
  6557. try {
  6558. key = decodeURIComponent(key);
  6559. } catch (err) {
  6560. key = unescape(key);
  6561. } // being liberal by replacing "+" with " "
  6562. var value = (keyValue[1] || '').replace(/\+/g, " ");
  6563. try {
  6564. value = decodeURIComponent(value);
  6565. } catch (err) {
  6566. value = unescape(value);
  6567. } // follow OGC convention of comma delimited values
  6568. value = value.split(","); //if there's only one value, do not return as array
  6569. if (value.length == 1) {
  6570. value = value[0];
  6571. }
  6572. parameters[key] = value;
  6573. }
  6574. }
  6575. return parameters;
  6576. };
  6577. /**
  6578. * @description 不断递增计数变量,用于生成唯一 ID。
  6579. * @type {number}
  6580. * @default 0
  6581. */
  6582. SuperMap.Util.lastSeqID = 0;
  6583. /**
  6584. * @description 创建唯一 ID 值。
  6585. * @param {string} [prefix] - 前缀。
  6586. * @returns {string} 唯一的 ID 值。
  6587. */
  6588. SuperMap.Util.createUniqueID = function (prefix) {
  6589. if (prefix == null) {
  6590. prefix = "id_";
  6591. }
  6592. SuperMap.Util.lastSeqID += 1;
  6593. return prefix + SuperMap.Util.lastSeqID;
  6594. };
  6595. /**
  6596. * @memberOf SuperMap
  6597. * @description 每单位的英尺数。
  6598. * @type {Object}
  6599. * @constant
  6600. */
  6601. SuperMap.INCHES_PER_UNIT = {
  6602. 'inches': 1.0,
  6603. 'ft': 12.0,
  6604. 'mi': 63360.0,
  6605. 'm': 39.3701,
  6606. 'km': 39370.1,
  6607. 'dd': 4374754,
  6608. 'yd': 36
  6609. };
  6610. SuperMap.INCHES_PER_UNIT.in = SuperMap.INCHES_PER_UNIT.inches;
  6611. SuperMap.INCHES_PER_UNIT.degrees = SuperMap.INCHES_PER_UNIT.dd;
  6612. SuperMap.INCHES_PER_UNIT.nmi = 1852 * SuperMap.INCHES_PER_UNIT.m; // Units from CS-Map
  6613. SuperMap.METERS_PER_INCH = 0.02540005080010160020;
  6614. SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
  6615. "Inch": SuperMap.INCHES_PER_UNIT.inches,
  6616. "Meter": 1.0 / SuperMap.METERS_PER_INCH,
  6617. //EPSG:9001
  6618. "Foot": 0.30480060960121920243 / SuperMap.METERS_PER_INCH,
  6619. //EPSG:9003
  6620. "IFoot": 0.30480000000000000000 / SuperMap.METERS_PER_INCH,
  6621. //EPSG:9002
  6622. "ClarkeFoot": 0.3047972651151 / SuperMap.METERS_PER_INCH,
  6623. //EPSG:9005
  6624. "SearsFoot": 0.30479947153867624624 / SuperMap.METERS_PER_INCH,
  6625. //EPSG:9041
  6626. "GoldCoastFoot": 0.30479971018150881758 / SuperMap.METERS_PER_INCH,
  6627. //EPSG:9094
  6628. "IInch": 0.02540000000000000000 / SuperMap.METERS_PER_INCH,
  6629. "MicroInch": 0.00002540000000000000 / SuperMap.METERS_PER_INCH,
  6630. "Mil": 0.00000002540000000000 / SuperMap.METERS_PER_INCH,
  6631. "Centimeter": 0.01000000000000000000 / SuperMap.METERS_PER_INCH,
  6632. "Kilometer": 1000.00000000000000000000 / SuperMap.METERS_PER_INCH,
  6633. //EPSG:9036
  6634. "Yard": 0.91440182880365760731 / SuperMap.METERS_PER_INCH,
  6635. "SearsYard": 0.914398414616029 / SuperMap.METERS_PER_INCH,
  6636. //EPSG:9040
  6637. "IndianYard": 0.91439853074444079983 / SuperMap.METERS_PER_INCH,
  6638. //EPSG:9084
  6639. "IndianYd37": 0.91439523 / SuperMap.METERS_PER_INCH,
  6640. //EPSG:9085
  6641. "IndianYd62": 0.9143988 / SuperMap.METERS_PER_INCH,
  6642. //EPSG:9086
  6643. "IndianYd75": 0.9143985 / SuperMap.METERS_PER_INCH,
  6644. //EPSG:9087
  6645. "IndianFoot": 0.30479951 / SuperMap.METERS_PER_INCH,
  6646. //EPSG:9080
  6647. "IndianFt37": 0.30479841 / SuperMap.METERS_PER_INCH,
  6648. //EPSG:9081
  6649. "IndianFt62": 0.3047996 / SuperMap.METERS_PER_INCH,
  6650. //EPSG:9082
  6651. "IndianFt75": 0.3047995 / SuperMap.METERS_PER_INCH,
  6652. //EPSG:9083
  6653. "Mile": 1609.34721869443738887477 / SuperMap.METERS_PER_INCH,
  6654. "IYard": 0.91440000000000000000 / SuperMap.METERS_PER_INCH,
  6655. //EPSG:9096
  6656. "IMile": 1609.34400000000000000000 / SuperMap.METERS_PER_INCH,
  6657. //EPSG:9093
  6658. "NautM": 1852.00000000000000000000 / SuperMap.METERS_PER_INCH,
  6659. //EPSG:9030
  6660. "Lat-66": 110943.316488932731 / SuperMap.METERS_PER_INCH,
  6661. "Lat-83": 110946.25736872234125 / SuperMap.METERS_PER_INCH,
  6662. "Decimeter": 0.10000000000000000000 / SuperMap.METERS_PER_INCH,
  6663. "Millimeter": 0.00100000000000000000 / SuperMap.METERS_PER_INCH,
  6664. "Dekameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
  6665. "Decameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
  6666. "Hectometer": 100.00000000000000000000 / SuperMap.METERS_PER_INCH,
  6667. "GermanMeter": 1.0000135965 / SuperMap.METERS_PER_INCH,
  6668. //EPSG:9031
  6669. "CaGrid": 0.999738 / SuperMap.METERS_PER_INCH,
  6670. "ClarkeChain": 20.1166194976 / SuperMap.METERS_PER_INCH,
  6671. //EPSG:9038
  6672. "GunterChain": 20.11684023368047 / SuperMap.METERS_PER_INCH,
  6673. //EPSG:9033
  6674. "BenoitChain": 20.116782494375872 / SuperMap.METERS_PER_INCH,
  6675. //EPSG:9062
  6676. "SearsChain": 20.11676512155 / SuperMap.METERS_PER_INCH,
  6677. //EPSG:9042
  6678. "ClarkeLink": 0.201166194976 / SuperMap.METERS_PER_INCH,
  6679. //EPSG:9039
  6680. "GunterLink": 0.2011684023368047 / SuperMap.METERS_PER_INCH,
  6681. //EPSG:9034
  6682. "BenoitLink": 0.20116782494375872 / SuperMap.METERS_PER_INCH,
  6683. //EPSG:9063
  6684. "SearsLink": 0.2011676512155 / SuperMap.METERS_PER_INCH,
  6685. //EPSG:9043
  6686. "Rod": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  6687. "IntnlChain": 20.1168 / SuperMap.METERS_PER_INCH,
  6688. //EPSG:9097
  6689. "IntnlLink": 0.201168 / SuperMap.METERS_PER_INCH,
  6690. //EPSG:9098
  6691. "Perch": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  6692. "Pole": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  6693. "Furlong": 201.1684023368046 / SuperMap.METERS_PER_INCH,
  6694. "Rood": 3.778266898 / SuperMap.METERS_PER_INCH,
  6695. "CapeFoot": 0.3047972615 / SuperMap.METERS_PER_INCH,
  6696. "Brealey": 375.00000000000000000000 / SuperMap.METERS_PER_INCH,
  6697. "ModAmFt": 0.304812252984505969011938 / SuperMap.METERS_PER_INCH,
  6698. "Fathom": 1.8288 / SuperMap.METERS_PER_INCH,
  6699. "NautM-UK": 1853.184 / SuperMap.METERS_PER_INCH,
  6700. "50kilometers": 50000.0 / SuperMap.METERS_PER_INCH,
  6701. "150kilometers": 150000.0 / SuperMap.METERS_PER_INCH
  6702. }); //unit abbreviations supported by PROJ.4
  6703. SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
  6704. "mm": SuperMap.INCHES_PER_UNIT.Meter / 1000.0,
  6705. "cm": SuperMap.INCHES_PER_UNIT.Meter / 100.0,
  6706. "dm": SuperMap.INCHES_PER_UNIT.Meter * 100.0,
  6707. "km": SuperMap.INCHES_PER_UNIT.Meter * 1000.0,
  6708. "kmi": SuperMap.INCHES_PER_UNIT.nmi,
  6709. //International Nautical Mile
  6710. "fath": SuperMap.INCHES_PER_UNIT.Fathom,
  6711. //International Fathom
  6712. "ch": SuperMap.INCHES_PER_UNIT.IntnlChain,
  6713. //International Chain
  6714. "link": SuperMap.INCHES_PER_UNIT.IntnlLink,
  6715. //International Link
  6716. "us-in": SuperMap.INCHES_PER_UNIT.inches,
  6717. //U.S. Surveyor's Inch
  6718. "us-ft": SuperMap.INCHES_PER_UNIT.Foot,
  6719. //U.S. Surveyor's Foot
  6720. "us-yd": SuperMap.INCHES_PER_UNIT.Yard,
  6721. //U.S. Surveyor's Yard
  6722. "us-ch": SuperMap.INCHES_PER_UNIT.GunterChain,
  6723. //U.S. Surveyor's Chain
  6724. "us-mi": SuperMap.INCHES_PER_UNIT.Mile,
  6725. //U.S. Surveyor's Statute Mile
  6726. "ind-yd": SuperMap.INCHES_PER_UNIT.IndianYd37,
  6727. //Indian Yard
  6728. "ind-ft": SuperMap.INCHES_PER_UNIT.IndianFt37,
  6729. //Indian Foot
  6730. "ind-ch": 20.11669506 / SuperMap.METERS_PER_INCH //Indian Chain
  6731. });
  6732. /**
  6733. * @memberOf SuperMap
  6734. * @member [SuperMap.DOTS_PER_INCH=96]
  6735. * @description 分辨率与比例尺之间转换的常量。
  6736. * @type {Object}
  6737. */
  6738. SuperMap.DOTS_PER_INCH = 96;
  6739. /**
  6740. * @param {number} scale - 比例尺。
  6741. * @returns {number} 返回正常的 scale 值。
  6742. */
  6743. SuperMap.Util.normalizeScale = function (scale) {
  6744. var normScale = scale > 1.0 ? 1.0 / scale : scale;
  6745. return normScale;
  6746. };
  6747. /**
  6748. * @description 比例尺转分辨率。
  6749. * @param {number} scale - 比例尺。
  6750. * @param {string} [units='degrees'] - 比例尺单位。
  6751. * @returns {number} 分辨率。
  6752. */
  6753. SuperMap.Util.getResolutionFromScale = function (scale, units) {
  6754. var resolution;
  6755. if (scale) {
  6756. if (units == null) {
  6757. units = "degrees";
  6758. }
  6759. var normScale = SuperMap.Util.normalizeScale(scale);
  6760. resolution = 1 / (normScale * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH);
  6761. }
  6762. return resolution;
  6763. };
  6764. /**
  6765. * @description 分辨率转比例尺。
  6766. * @param {number} resolution - 分辨率。
  6767. * @param {string} [units='degrees'] - 分辨率单位。
  6768. * @returns {number} 比例尺。
  6769. */
  6770. SuperMap.Util.getScaleFromResolution = function (resolution, units) {
  6771. if (units == null) {
  6772. units = "degrees";
  6773. }
  6774. var scale = resolution * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH;
  6775. return scale;
  6776. };
  6777. /**
  6778. * @memberOf SuperMap
  6779. * @description 如果 userAgent 捕获到浏览器使用的是 Gecko 引擎则返回 true。
  6780. * @constant
  6781. */
  6782. SuperMap.IS_GECKO = function () {
  6783. var ua = navigator.userAgent.toLowerCase();
  6784. return ua.indexOf("webkit") === -1 && ua.indexOf("gecko") !== -1;
  6785. }();
  6786. /**
  6787. * @memberOf SuperMap
  6788. * @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:
  6789. * * "opera" -- Opera
  6790. * * "msie" -- Internet Explorer
  6791. * * "safari" -- Safari
  6792. * * "firefox" -- Firefox
  6793. * * "mozilla" -- Mozilla
  6794. * @constant
  6795. */
  6796. SuperMap.Browser = function () {
  6797. var name = '',
  6798. version = '',
  6799. device = 'pc',
  6800. uaMatch; //以下进行测试
  6801. var ua = navigator.userAgent.toLowerCase();
  6802. if (ua.indexOf("msie") > -1 || ua.indexOf("trident") > -1 && ua.indexOf("rv") > -1) {
  6803. name = 'msie';
  6804. uaMatch = ua.match(/msie ([\d.]+)/) || ua.match(/rv:([\d.]+)/);
  6805. } else if (ua.indexOf("chrome") > -1) {
  6806. name = 'chrome';
  6807. uaMatch = ua.match(/chrome\/([\d.]+)/);
  6808. } else if (ua.indexOf("firefox") > -1) {
  6809. name = 'firefox';
  6810. uaMatch = ua.match(/firefox\/([\d.]+)/);
  6811. } else if (ua.indexOf("opera") > -1) {
  6812. name = 'opera';
  6813. uaMatch = ua.match(/version\/([\d.]+)/);
  6814. } else if (ua.indexOf("safari") > -1) {
  6815. name = 'safari';
  6816. uaMatch = ua.match(/version\/([\d.]+)/);
  6817. }
  6818. version = uaMatch ? uaMatch[1] : '';
  6819. if (ua.indexOf("ipad") > -1 || ua.indexOf("ipod") > -1 || ua.indexOf("iphone") > -1) {
  6820. device = 'apple';
  6821. } else if (ua.indexOf("android") > -1) {
  6822. uaMatch = ua.match(/version\/([\d.]+)/);
  6823. version = uaMatch ? uaMatch[1] : '';
  6824. device = 'android';
  6825. }
  6826. return {
  6827. name: name,
  6828. version: version,
  6829. device: device
  6830. };
  6831. }();
  6832. /**
  6833. * @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
  6834. * @returns {Object} 获取浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
  6835. */
  6836. SuperMap.Util.getBrowser = function () {
  6837. return SuperMap.Browser;
  6838. };
  6839. /**
  6840. * @description 浏览器是否支持 Canvas。
  6841. * @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas。
  6842. */
  6843. SuperMap.Util.isSupportCanvas = function () {
  6844. var checkRes = true,
  6845. broz = SuperMap.Util.getBrowser();
  6846. if (document.createElement("canvas").getContext) {
  6847. if (broz.name === 'firefox' && parseFloat(broz.version) < 5) {
  6848. checkRes = false;
  6849. }
  6850. if (broz.name === 'safari' && parseFloat(broz.version) < 4) {
  6851. checkRes = false;
  6852. }
  6853. if (broz.name === 'opera' && parseFloat(broz.version) < 10) {
  6854. checkRes = false;
  6855. }
  6856. if (broz.name === 'msie' && parseFloat(broz.version) < 9) {
  6857. checkRes = false;
  6858. }
  6859. } else {
  6860. checkRes = false;
  6861. }
  6862. return checkRes;
  6863. }();
  6864. /**
  6865. * @description 判断;浏览器是否支持 Canvas。
  6866. * @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas 。
  6867. */
  6868. SuperMap.Util.supportCanvas = function () {
  6869. return SuperMap.Util.isSupportCanvas;
  6870. }; //将服务端的地图单位转成SuperMap的地图单位
  6871. SuperMap.INCHES_PER_UNIT.degree = SuperMap.INCHES_PER_UNIT.dd;
  6872. SuperMap.INCHES_PER_UNIT.meter = SuperMap.INCHES_PER_UNIT.m;
  6873. SuperMap.INCHES_PER_UNIT.foot = SuperMap.INCHES_PER_UNIT.ft;
  6874. SuperMap.INCHES_PER_UNIT.inch = SuperMap.INCHES_PER_UNIT.inches;
  6875. SuperMap.INCHES_PER_UNIT.mile = SuperMap.INCHES_PER_UNIT.mi;
  6876. SuperMap.INCHES_PER_UNIT.kilometer = SuperMap.INCHES_PER_UNIT.km;
  6877. SuperMap.INCHES_PER_UNIT.yard = SuperMap.INCHES_PER_UNIT.yd;
  6878. /**
  6879. * @description 判断一个 URL 请求是否在当前域中。
  6880. * @param {string} url - URL 请求字符串。
  6881. * @returns {boolean} URL 请求是否在当前域中。
  6882. */
  6883. SuperMap.Util.isInTheSameDomain = function (url) {
  6884. if (!url) {
  6885. return true;
  6886. }
  6887. var index = url.indexOf("//");
  6888. var documentUrl = document.location.toString();
  6889. var documentIndex = documentUrl.indexOf("//");
  6890. if (index === -1) {
  6891. return true;
  6892. } else {
  6893. var protocol;
  6894. var substring = protocol = url.substring(0, index);
  6895. var documentSubString = documentUrl.substring(documentIndex + 2);
  6896. documentIndex = documentSubString.indexOf("/");
  6897. var documentPortIndex = documentSubString.indexOf(":");
  6898. var documentDomainWithPort = documentSubString.substring(0, documentIndex); //var documentPort;
  6899. var documentprotocol = document.location.protocol;
  6900. if (documentPortIndex !== -1) {// documentPort = +documentSubString.substring(documentPortIndex, documentIndex);
  6901. } else {
  6902. documentDomainWithPort += ':' + (documentprotocol.toLowerCase() === 'http:' ? 80 : 443);
  6903. }
  6904. if (documentprotocol.toLowerCase() !== substring.toLowerCase()) {
  6905. return false;
  6906. }
  6907. substring = url.substring(index + 2);
  6908. var portIndex = substring.indexOf(":");
  6909. index = substring.indexOf("/");
  6910. var domainWithPort = substring.substring(0, index);
  6911. var domain;
  6912. if (portIndex !== -1) {
  6913. domain = substring.substring(0, portIndex);
  6914. } else {
  6915. domain = substring.substring(0, index);
  6916. domainWithPort += ':' + (protocol.toLowerCase() === 'http:' ? 80 : 443);
  6917. }
  6918. var documentDomain = document.domain;
  6919. if (domain === documentDomain && domainWithPort === documentDomainWithPort) {
  6920. return true;
  6921. }
  6922. }
  6923. return false;
  6924. };
  6925. /**
  6926. * @description 计算 iServer 服务的 REST 图层的显示分辨率,需要从 iServer 的 REST 图层表述中获取 viewBounds、viewer、scale、coordUnit、datumAxis 五个参数,来进行计算。
  6927. * @param {SuperMap.Bounds} viewBounds - 地图的参照可视范围,即地图初始化时默认的地图显示范围。
  6928. * @param {SuperMap.Size} viewer - 地图初始化时默认的地图图片的尺寸。
  6929. * @param {number} scale - 地图初始化时默认的显示比例尺。
  6930. * @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
  6931. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则系统默认为 WGS84 参考系的椭球体长半轴 6378137。
  6932. * @returns {number} 返回图层显示分辨率。
  6933. */
  6934. SuperMap.Util.calculateDpi = function (viewBounds, viewer, scale, coordUnit, datumAxis) {
  6935. //10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
  6936. if (!viewBounds || !viewer || !scale) {
  6937. return;
  6938. }
  6939. var ratio = 10000,
  6940. rvbWidth = viewBounds.getWidth(),
  6941. rvbHeight = viewBounds.getHeight(),
  6942. rvWidth = viewer.w,
  6943. rvHeight = viewer.h; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  6944. datumAxis = datumAxis || 6378137;
  6945. coordUnit = coordUnit || "degrees";
  6946. var dpi;
  6947. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  6948. var num1 = rvbWidth / rvWidth,
  6949. num2 = rvbHeight / rvHeight,
  6950. resolution = num1 > num2 ? num1 : num2;
  6951. dpi = 0.0254 * ratio / resolution / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  6952. } else {
  6953. var _resolution = rvbWidth / rvWidth;
  6954. dpi = 0.0254 * ratio / _resolution / scale / ratio;
  6955. }
  6956. return dpi;
  6957. };
  6958. /**
  6959. * @description 将对象转换成 JSON 字符串。
  6960. * @param {Object} obj - 要转换成 JSON 的 Object 对象。
  6961. * @returns {string} 返回转换后的 JSON 对象。
  6962. */
  6963. SuperMap.Util.toJSON = function (obj) {
  6964. var objInn = obj;
  6965. if (objInn == null) {
  6966. return null;
  6967. }
  6968. switch (objInn.constructor) {
  6969. case String:
  6970. //s = "'" + str.replace(/(["\\])/g, "\\$1") + "'"; string含有单引号出错
  6971. objInn = '"' + objInn.replace(/(["\\])/g, '\\$1') + '"';
  6972. objInn = objInn.replace(/\n/g, "\\n");
  6973. objInn = objInn.replace(/\r/g, "\\r");
  6974. objInn = objInn.replace("<", "&lt;");
  6975. objInn = objInn.replace(">", "&gt;");
  6976. objInn = objInn.replace(/%/g, "%25");
  6977. objInn = objInn.replace(/&/g, "%26");
  6978. return objInn;
  6979. case Array:
  6980. var arr = [];
  6981. for (var i = 0, len = objInn.length; i < len; i++) {
  6982. arr.push(SuperMap.Util.toJSON(objInn[i]));
  6983. }
  6984. return "[" + arr.join(",") + "]";
  6985. case Number:
  6986. return isFinite(objInn) ? String(objInn) : null;
  6987. case Boolean:
  6988. return String(objInn);
  6989. case Date:
  6990. 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() + "}";
  6991. return dateStr;
  6992. default:
  6993. if (objInn["toJSON"] != null && typeof objInn["toJSON"] === "function") {
  6994. return objInn.toJSON();
  6995. }
  6996. if (Util_typeof(objInn) === "object") {
  6997. if (objInn.length) {
  6998. var _arr2 = [];
  6999. for (var _i = 0, _len = objInn.length; _i < _len; _i++) {
  7000. _arr2.push(SuperMap.Util.toJSON(objInn[_i]));
  7001. }
  7002. return "[" + _arr2.join(",") + "]";
  7003. }
  7004. var _arr = [];
  7005. for (var attr in objInn) {
  7006. //为解决SuperMap.Geometry类型头json时堆栈溢出的问题,attr == "parent"时不进行json转换
  7007. if (typeof objInn[attr] !== "function" && attr !== "CLASS_NAME" && attr !== "parent") {
  7008. _arr.push("'" + attr + "':" + SuperMap.Util.toJSON(objInn[attr]));
  7009. }
  7010. }
  7011. if (_arr.length > 0) {
  7012. return "{" + _arr.join(",") + "}";
  7013. } else {
  7014. return "{}";
  7015. }
  7016. }
  7017. return objInn.toString();
  7018. }
  7019. };
  7020. /**
  7021. * @description 根据比例尺和 dpi 计算屏幕分辨率。
  7022. * @param {number} scale - 比例尺。
  7023. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  7024. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  7025. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  7026. * @returns {number} 返回当前比例尺下的屏幕分辨率。
  7027. */
  7028. SuperMap.Util.getResolutionFromScaleDpi = function (scale, dpi, coordUnit, datumAxis) {
  7029. var resolution = null,
  7030. ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  7031. datumAxis = datumAxis || 6378137;
  7032. coordUnit = coordUnit || "";
  7033. if (scale > 0 && dpi > 0) {
  7034. scale = SuperMap.Util.normalizeScale(scale);
  7035. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  7036. //scale = SuperMap.Util.normalizeScale(scale);
  7037. resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  7038. return resolution;
  7039. } else {
  7040. resolution = 0.0254 * ratio / dpi / scale / ratio;
  7041. return resolution;
  7042. }
  7043. }
  7044. return -1;
  7045. };
  7046. /**
  7047. * @description 根据 resolution、dpi、coordUnit 和 datumAxis 计算比例尺。
  7048. * @param {number} resolution - 用于计算比例尺的地图分辨率。
  7049. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  7050. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  7051. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  7052. * @returns {number} 返回当前屏幕分辨率下的比例尺。
  7053. */
  7054. SuperMap.Util.getScaleFromResolutionDpi = function (resolution, dpi, coordUnit, datumAxis) {
  7055. var scale = null,
  7056. ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  7057. datumAxis = datumAxis || 6378137;
  7058. coordUnit = coordUnit || "";
  7059. if (resolution > 0 && dpi > 0) {
  7060. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  7061. scale = 0.0254 * ratio / dpi / resolution / (Math.PI * 2 * datumAxis / 360) / ratio;
  7062. return scale;
  7063. } else {
  7064. scale = 0.0254 * ratio / dpi / resolution / ratio;
  7065. return scale;
  7066. }
  7067. }
  7068. return -1;
  7069. };
  7070. /**
  7071. * @description 转换查询结果。
  7072. * @param {Object} result - 查询结果。
  7073. * @returns {Object} 转换后的查询结果。
  7074. */
  7075. SuperMap.Util.transformResult = function (result) {
  7076. if (result.responseText && typeof result.responseText === "string") {
  7077. result = JSON.parse(result.responseText);
  7078. }
  7079. return result;
  7080. };
  7081. /**
  7082. * @description 属性拷贝,不拷贝方法类名(CLASS_NAME)等。
  7083. * @param {Object} [destination] - 拷贝目标。
  7084. * @param {Object} source - 源对象。
  7085. *
  7086. */
  7087. SuperMap.Util.copyAttributes = function (destination, source) {
  7088. destination = destination || {};
  7089. if (source) {
  7090. for (var property in source) {
  7091. var value = source[property];
  7092. if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
  7093. destination[property] = value;
  7094. }
  7095. }
  7096. }
  7097. return destination;
  7098. };
  7099. /**
  7100. * @description 将源对象上的属性拷贝到目标对象上。(不拷贝 CLASS_NAME 和方法)
  7101. * @param {Object} [destination] - 目标对象。
  7102. * @param {Object} source - 源对象。
  7103. * @param {Array.<string>} clip - 源对象中禁止拷贝到目标对象的属性,目的是防止目标对象上不可修改的属性被篡改。
  7104. *
  7105. */
  7106. SuperMap.Util.copyAttributesWithClip = function (destination, source, clip) {
  7107. destination = destination || {};
  7108. if (source) {
  7109. for (var property in source) {
  7110. //去掉禁止拷贝的属性
  7111. var isInClip = false;
  7112. if (clip && clip.length) {
  7113. for (var i = 0, len = clip.length; i < len; i++) {
  7114. if (property === clip[i]) {
  7115. isInClip = true;
  7116. break;
  7117. }
  7118. }
  7119. }
  7120. if (isInClip === true) {
  7121. continue;
  7122. }
  7123. var value = source[property];
  7124. if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
  7125. destination[property] = value;
  7126. }
  7127. }
  7128. }
  7129. return destination;
  7130. };
  7131. /**
  7132. * @description 克隆一个 Object 对象
  7133. * @param {Object} obj - 需要克隆的对象。
  7134. * @returns {Object} 返回对象的拷贝对象,注意是新的对象,不是指向。
  7135. */
  7136. SuperMap.Util.cloneObject = function (obj) {
  7137. // Handle the 3 simple types, and null or undefined
  7138. if (null === obj || "object" !== Util_typeof(obj)) {
  7139. return obj;
  7140. } // Handle Date
  7141. if (obj instanceof Date) {
  7142. var copy = new Date();
  7143. copy.setTime(obj.getTime());
  7144. return copy;
  7145. } // Handle Array
  7146. if (obj instanceof Array) {
  7147. var _copy = obj.slice(0);
  7148. return _copy;
  7149. } // Handle Object
  7150. if (obj instanceof Object) {
  7151. var _copy2 = {};
  7152. for (var attr in obj) {
  7153. if (obj.hasOwnProperty(attr)) {
  7154. _copy2[attr] = SuperMap.Util.cloneObject(obj[attr]);
  7155. }
  7156. }
  7157. return _copy2;
  7158. }
  7159. throw new Error("Unable to copy obj! Its type isn't supported.");
  7160. };
  7161. /**
  7162. * @description 判断两条线段是不是有交点。
  7163. * @param {SuperMap.Geometry.Point} a1 - 第一条线段的起始节点。
  7164. * @param {SuperMap.Geometry.Point} a2 - 第一条线段的结束节点。
  7165. * @param {SuperMap.Geometry.Point} b1 - 第二条线段的起始节点。
  7166. * @param {SuperMap.Geometry.Point} b2 - 第二条线段的结束节点。
  7167. * @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
  7168. */
  7169. SuperMap.Util.lineIntersection = function (a1, a2, b1, b2) {
  7170. var intersectValue = null;
  7171. var k1;
  7172. var k2;
  7173. var b = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
  7174. var a = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x);
  7175. var ab = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y); //ab==0代表两条线断的斜率一样
  7176. if (ab != 0) {
  7177. k1 = b / ab;
  7178. k2 = a / ab;
  7179. if (k1 >= 0 && k2 <= 1 && k1 <= 1 && k2 >= 0) {
  7180. intersectValue = new SuperMap.Geometry.Point(a1.x + k1 * (a2.x - a1.x), a1.y + k1 * (a2.y - a1.y));
  7181. } else {
  7182. intersectValue = "No Intersection";
  7183. }
  7184. } else {
  7185. if (b == 0 && a == 0) {
  7186. var maxy = Math.max(a1.y, a2.y);
  7187. var miny = Math.min(a1.y, a2.y);
  7188. var maxx = Math.max(a1.x, a2.x);
  7189. var minx = Math.min(a1.x, a2.x);
  7190. 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) {
  7191. intersectValue = "Coincident"; //重合
  7192. } else {
  7193. intersectValue = "Parallel"; //平行
  7194. }
  7195. } else {
  7196. intersectValue = "Parallel"; //平行
  7197. }
  7198. }
  7199. return intersectValue;
  7200. };
  7201. /**
  7202. * @description 获取文本外接矩形宽度与高度。
  7203. * @param {SuperMap.ThemeStyle} style - 文本样式。
  7204. * @param {string} text - 文本内容。
  7205. * @param {Object} element - DOM 元素。
  7206. * @returns {Object} 返回裁剪后的宽度,高度信息。
  7207. */
  7208. SuperMap.Util.getTextBounds = function (style, text, element) {
  7209. document.body.appendChild(element);
  7210. element.style.width = 'auto';
  7211. element.style.height = 'auto';
  7212. if (style.fontSize) {
  7213. element.style.fontSize = style.fontSize;
  7214. }
  7215. if (style.fontFamily) {
  7216. element.style.fontFamily = style.fontFamily;
  7217. }
  7218. if (style.fontWeight) {
  7219. element.style.fontWeight = style.fontWeight;
  7220. }
  7221. element.style.position = 'relative';
  7222. element.style.visibility = 'hidden'; //fix 在某些情况下,element内的文本变成竖起排列,导致宽度计算不正确的bug
  7223. element.style.display = 'inline-block';
  7224. element.innerHTML = text;
  7225. var textWidth = element.clientWidth;
  7226. var textHeight = element.clientHeight;
  7227. document.body.removeChild(element);
  7228. return {
  7229. textWidth: textWidth,
  7230. textHeight: textHeight
  7231. };
  7232. };
  7233. ;// CONCATENATED MODULE: ./src/common/commontypes/LonLat.js
  7234. function LonLat_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7235. 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); } }
  7236. function LonLat_createClass(Constructor, protoProps, staticProps) { if (protoProps) LonLat_defineProperties(Constructor.prototype, protoProps); if (staticProps) LonLat_defineProperties(Constructor, staticProps); return Constructor; }
  7237. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7238. * This program are made available under the terms of the Apache License, Version 2.0
  7239. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7240. /**
  7241. * @class SuperMap.LonLat
  7242. * @category BaseTypes Geometry
  7243. * @classdesc 这个类用来表示经度和纬度对。
  7244. * @param {number} [lon=0.0] - 地图单位上的 X 轴坐标,如果地图是地理投影,则此值是经度,否则,此值是地图地理位置的 x 坐标。
  7245. * @param {number} [lat=0.0] - 地图单位上的 Y 轴坐标,如果地图是地理投影,则此值是纬度,否则,此值是地图地理位置的 y 坐标。
  7246. * @param {Array.<float>} [location] - 如果要同时设置,则使用传入横纵坐标组成的数组。
  7247. * @example
  7248. * var lonLat = new SuperMap.LonLat(30,45);
  7249. */
  7250. var LonLat = /*#__PURE__*/function () {
  7251. function LonLat(lon, lat) {
  7252. LonLat_classCallCheck(this, LonLat);
  7253. if (Util.isArray(lon)) {
  7254. lat = lon[1];
  7255. lon = lon[0];
  7256. }
  7257. /**
  7258. * @member {float} [SuperMap.LonLat.prototype.lon=0.0]
  7259. * @description 地图的单位的 X 轴(横轴)坐标。
  7260. */
  7261. this.lon = lon ? Util.toFloat(lon) : 0.0;
  7262. /**
  7263. * @member {float} [SuperMap.LonLat.prototype.lat=0.0]
  7264. * @description 地图的单位的 Y 轴(纵轴)坐标。
  7265. */
  7266. this.lat = lat ? Util.toFloat(lat) : 0.0;
  7267. this.CLASS_NAME = "SuperMap.LonLat";
  7268. }
  7269. /**
  7270. * @function SuperMap.LonLat.prototype.toString
  7271. * @description 返回此对象的字符串形式
  7272. * @example
  7273. * var lonLat = new SuperMap.LonLat(100,50);
  7274. * var str = lonLat.toString();
  7275. * @returns {string} 例如: "lon=100,lat=50"
  7276. */
  7277. LonLat_createClass(LonLat, [{
  7278. key: "toString",
  7279. value: function toString() {
  7280. return "lon=" + this.lon + ",lat=" + this.lat;
  7281. }
  7282. /**
  7283. * @function SuperMap.LonLat.prototype.toShortString
  7284. * @description 将经度纬度转换成简单字符串。
  7285. * @example
  7286. * var lonLat = new SuperMap.LonLat(100,50);
  7287. * var str = lonLat.toShortString();
  7288. * @returns {string} 返回处理后的经纬度字符串。例如:"100,50"
  7289. */
  7290. }, {
  7291. key: "toShortString",
  7292. value: function toShortString() {
  7293. return this.lon + "," + this.lat;
  7294. }
  7295. /**
  7296. * @function SuperMap.LonLat.prototype.clone
  7297. * @description 复制坐标对象,并返回复制后的新对象。
  7298. * @example
  7299. * var lonLat1 = new SuperMap.LonLat(100,50);
  7300. * var lonLat2 = lonLat1.clone();
  7301. * @returns {SuperMap.LonLat} 返回相同坐标值的新的坐标对象。
  7302. */
  7303. }, {
  7304. key: "clone",
  7305. value: function clone() {
  7306. return new LonLat(this.lon, this.lat);
  7307. }
  7308. /**
  7309. * @function SuperMap.LonLat.prototype.add
  7310. * @description 在已有坐标对象的经纬度基础上加上新的坐标经纬度,并返回新的坐标对象。
  7311. * @example
  7312. * var lonLat1 = new SuperMap.LonLat(100,50);
  7313. * //lonLat2 是新的对象
  7314. * var lonLat2 = lonLat1.add(100,50);
  7315. * @param {float} lon - 传入的经度参数。
  7316. * @param {float} lat - 传入的纬度参数。
  7317. * @returns {SuperMap.LonLat} 返回一个新的 LonLat 对象,此对象的经纬度是由传入的经纬度与当前的经纬度相加所得。
  7318. */
  7319. }, {
  7320. key: "add",
  7321. value: function add(lon, lat) {
  7322. if (lon == null || lat == null) {
  7323. throw new TypeError('LonLat.add cannot receive null values');
  7324. }
  7325. return new LonLat(this.lon + Util.toFloat(lon), this.lat + Util.toFloat(lat));
  7326. }
  7327. /**
  7328. * @function SuperMap.LonLat.prototype.equals
  7329. * @description 判断两个坐标对象是否相等。
  7330. * @example
  7331. * var lonLat1 = new SuperMap.LonLat(100,50);
  7332. * var lonLat2 = new SuperMap.LonLat(100,50);
  7333. * var isEquals = lonLat1.equals(lonLat2);
  7334. * @param {SuperMap.LonLat} ll - 需要进行比较的坐标对象。
  7335. * @returns {boolean} 如果LonLat对象的经纬度和传入的经纬度一致则返回true,不一
  7336. * 致或传入的ll参数为NULL则返回false。
  7337. */
  7338. }, {
  7339. key: "equals",
  7340. value: function equals(ll) {
  7341. var equals = false;
  7342. if (ll != null) {
  7343. equals = this.lon === ll.lon && this.lat === ll.lat || isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat);
  7344. }
  7345. return equals;
  7346. }
  7347. /**
  7348. * @function SuperMap.LonLat.prototype.wrapDateLine
  7349. * @description 通过传入的范围对象对坐标对象转换到该范围内。
  7350. * 如果经度小于给定范围最小精度,则在原经度基础上加上范围宽度,直到精度在范围内为止,如果经度大于给定范围则在原经度基础上减去范围宽度。
  7351. * 即指将不在经度范围内的坐标转换到范围以内(只会转换 lon,不会转换 lat,主要用于转移到日界线以内)。
  7352. * @example
  7353. * var lonLat1 = new SuperMap.LonLat(420,50);
  7354. * var lonLat2 = lonLat1.wrapDateLine(
  7355. * new SuperMap.Bounds(-180,-90,180,90)
  7356. * );
  7357. * @param {SuperMap.Bounds} maxExtent - 最大边界的范围。
  7358. * @returns {SuperMap.LonLat} 将坐标转换到范围对象以内,并返回新的坐标。
  7359. */
  7360. }, {
  7361. key: "wrapDateLine",
  7362. value: function wrapDateLine(maxExtent) {
  7363. var newLonLat = this.clone();
  7364. if (maxExtent) {
  7365. //shift right?
  7366. while (newLonLat.lon < maxExtent.left) {
  7367. newLonLat.lon += maxExtent.getWidth();
  7368. } //shift left?
  7369. while (newLonLat.lon > maxExtent.right) {
  7370. newLonLat.lon -= maxExtent.getWidth();
  7371. }
  7372. }
  7373. return newLonLat;
  7374. }
  7375. /**
  7376. *
  7377. * @function SuperMap.LonLat.prototype.destroy
  7378. * @description 销毁此对象。
  7379. * 销毁后此对象的所有属性为 null,而不是初始值。
  7380. * @example
  7381. * var lonLat = new SuperMap.LonLat(100,50);
  7382. * lonLat.destroy();
  7383. */
  7384. }, {
  7385. key: "destroy",
  7386. value: function destroy() {
  7387. this.lon = null;
  7388. this.lat = null;
  7389. }
  7390. /**
  7391. * @function SuperMap.LonLat.fromString
  7392. * @description 通过字符串生成一个 {@link SuperMap.LonLat} 对象。
  7393. * @example
  7394. * var str = "100,50";
  7395. * var lonLat = SuperMap.LonLat.fromString(str);
  7396. * @param {string} str - 字符串的格式:Lon+","+Lat。如:"100,50"。
  7397. * @returns {SuperMap.LonLat} 返回一个 {@link SuperMap.LonLat} 对象。
  7398. */
  7399. }], [{
  7400. key: "fromString",
  7401. value: function fromString(str) {
  7402. var pair = str.split(",");
  7403. return new LonLat(pair[0], pair[1]);
  7404. }
  7405. /**
  7406. * @function SuperMap.LonLat.fromArray
  7407. * @description 通过数组生成一个 <SuperMap.LonLat> 对象。
  7408. * @param {Array.<float>} arr - 数组的格式,长度只能为2,:[Lon,Lat]。如:[5,-42]。
  7409. * @returns {SuperMap.LonLat} 返回一个 <SuperMap.LonLat> 对象。
  7410. */
  7411. }, {
  7412. key: "fromArray",
  7413. value: function fromArray(arr) {
  7414. var gotArr = Util.isArray(arr),
  7415. lon = gotArr && arr[0],
  7416. lat = gotArr && arr[1];
  7417. return new LonLat(lon, lat);
  7418. }
  7419. }]);
  7420. return LonLat;
  7421. }();
  7422. ;// CONCATENATED MODULE: ./src/common/commontypes/Bounds.js
  7423. function Bounds_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7424. 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); } }
  7425. function Bounds_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bounds_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bounds_defineProperties(Constructor, staticProps); return Constructor; }
  7426. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7427. * This program are made available under the terms of the Apache License, Version 2.0
  7428. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7429. /**
  7430. * @class SuperMap.Bounds
  7431. * @category BaseTypes Geometry
  7432. * @classdesc 表示边界类实例。使用 bounds 之前需要设置 left,bottom,right,top 四个属性,这些属性的初始值为 null。
  7433. * @param {number} [left] - 左边界,注意考虑宽度,理论上小于 right 值。
  7434. * @param {number} [bottom] - 下边界。考虑高度,理论上小于 top 值。
  7435. * @param {number} [right] - 右边界。
  7436. * @param {number} [top] - 上边界。
  7437. * @param {Array.<number>} [array] - [left, bottom, right, top],如果同时传多个参数,则使用左下右上组成的数组。
  7438. * @example
  7439. * var bounds = new SuperMap.Bounds();
  7440. * bounds.extend(new SuperMap.LonLat(4,5));
  7441. * bounds.extend(new SuperMap.LonLat(5,6));
  7442. * bounds.toBBOX(); // returns 4,5,5,6
  7443. */
  7444. var Bounds = /*#__PURE__*/function () {
  7445. function Bounds(left, bottom, right, top) {
  7446. Bounds_classCallCheck(this, Bounds);
  7447. if (Util.isArray(left)) {
  7448. top = left[3];
  7449. right = left[2];
  7450. bottom = left[1];
  7451. left = left[0];
  7452. }
  7453. /**
  7454. * @member {number} SuperMap.Bounds.prototype.left
  7455. * @description 最小的水平坐标系。
  7456. */
  7457. this.left = left != null ? Util.toFloat(left) : this.left;
  7458. /**
  7459. * @member {number} SuperMap.Bounds.prototype.bottom
  7460. * @description 最小的垂直坐标系。
  7461. */
  7462. this.bottom = bottom != null ? Util.toFloat(bottom) : this.bottom;
  7463. /**
  7464. * @member {number} SuperMap.Bounds.prototype.right
  7465. * @description 最大的水平坐标系。
  7466. */
  7467. this.right = right != null ? Util.toFloat(right) : this.right;
  7468. /**
  7469. * @member {number} SuperMap.Bounds.prototype.top
  7470. * @description 最大的垂直坐标系。
  7471. */
  7472. this.top = top != null ? Util.toFloat(top) : this.top;
  7473. /**
  7474. * @member {SuperMap.LonLat} SuperMap.Bounds.prototype.centerLonLat
  7475. * @description bounds 的地图空间的中心点。用 getCenterLonLat() 获得。
  7476. */
  7477. this.centerLonLat = null;
  7478. this.CLASS_NAME = "SuperMap.Bounds";
  7479. }
  7480. /**
  7481. * @function SuperMap.Bounds.prototype.clone
  7482. * @description 复制当前 bounds 对象。
  7483. * @example
  7484. * var bounds1 = new SuperMap.Bounds(-180,-90,180,90);
  7485. * var bounds2 = bounds1.clone();
  7486. * @returns {SuperMap.Bounds} 返回一个克隆的 bounds。
  7487. */
  7488. Bounds_createClass(Bounds, [{
  7489. key: "clone",
  7490. value: function clone() {
  7491. return new Bounds(this.left, this.bottom, this.right, this.top);
  7492. }
  7493. /**
  7494. * @function SuperMap.Bounds.prototype.equals
  7495. * @description 判断两个 bounds 对象是否相等。
  7496. * @example
  7497. * var bounds1 = new SuperMap.Bounds(-180,-90,180,90);
  7498. * var bounds2 = new SuperMap.Bounds(-180,-90,180,90);
  7499. * var isEquals = bounds1.equals(bounds2);
  7500. * @param {SuperMap.Bounds} bounds - 需要进行计较的 bounds。
  7501. * @returns {boolean} 如果 bounds 对象的边和传入的 bounds 一致则返回 true,不一致或传入的 bounds 参数为 NULL 则返回 false。
  7502. */
  7503. }, {
  7504. key: "equals",
  7505. value: function equals(bounds) {
  7506. var equals = false;
  7507. if (bounds != null) {
  7508. equals = this.left === bounds.left && this.right === bounds.right && this.top === bounds.top && this.bottom === bounds.bottom;
  7509. }
  7510. return equals;
  7511. }
  7512. /**
  7513. * @function SuperMap.Bounds.prototype.toString
  7514. * @description 返回此对象的字符串形式。
  7515. * @example
  7516. * var bounds = new SuperMap.Bounds(-180,-90,180,90);
  7517. * var str = bounds.toString();
  7518. * @returns {string} 边界对象的字符串表示形式(left,bottom,right,top),例如: "-180,-90,180,90"。
  7519. */
  7520. }, {
  7521. key: "toString",
  7522. value: function toString() {
  7523. return [this.left, this.bottom, this.right, this.top].join(",");
  7524. }
  7525. /**
  7526. * @function SuperMap.Bounds.prototype.toArray
  7527. * @description 边界对象的数组表示形式。
  7528. * @example
  7529. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  7530. * //array1 = [-180,-90,100,80];
  7531. * var array1 = bounds.toArray();
  7532. * //array1 = [-90,-180,80,100];
  7533. * var array2 = bounds.toArray(true);
  7534. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  7535. * 如果设为 true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  7536. * @returns {Array.<number>} left, bottom, right, top 数组。
  7537. */
  7538. }, {
  7539. key: "toArray",
  7540. value: function toArray(reverseAxisOrder) {
  7541. if (reverseAxisOrder === true) {
  7542. return [this.bottom, this.left, this.top, this.right];
  7543. } else {
  7544. return [this.left, this.bottom, this.right, this.top];
  7545. }
  7546. }
  7547. /**
  7548. * @function SuperMap.Bounds.prototype.toBBOX
  7549. * @description 取小数点后 decimal 位数字进行四舍五入再转换为 BBOX 字符串。
  7550. * @example
  7551. * var bounds = new SuperMap.Bounds(-1.1234567,-1.7654321,1.4444444,1.5555555);
  7552. * //str1 = "-1.123457,-1.765432,1.444444,1.555556";
  7553. * var str1 = bounds.toBBOX();
  7554. * //str2 = "-1.1,-1.8,1.4,1.6";
  7555. * var str2 = bounds.toBBOX(1);
  7556. * //str2 = "-1.8,-1.1,1.6,1.4";
  7557. * var str2 = bounds.toBBOX(1,true);
  7558. * @param {integer} [decimal=6] - 边界方位坐标的有效数字个数。
  7559. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。
  7560. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  7561. * @returns {string} 边界对象的字符串表示形式,如:"5,42,10,45"。
  7562. */
  7563. }, {
  7564. key: "toBBOX",
  7565. value: function toBBOX(decimal, reverseAxisOrder) {
  7566. if (decimal == null) {
  7567. decimal = 6;
  7568. }
  7569. var mult = Math.pow(10, decimal);
  7570. var xmin = Math.round(this.left * mult) / mult;
  7571. var ymin = Math.round(this.bottom * mult) / mult;
  7572. var xmax = Math.round(this.right * mult) / mult;
  7573. var ymax = Math.round(this.top * mult) / mult;
  7574. if (reverseAxisOrder === true) {
  7575. return ymin + "," + xmin + "," + ymax + "," + xmax;
  7576. } else {
  7577. return xmin + "," + ymin + "," + xmax + "," + ymax;
  7578. }
  7579. }
  7580. /**
  7581. * @function SuperMap.Bounds.prototype.toGeometry
  7582. * @description 基于当前边界范围创建一个新的多边形对象。
  7583. * @example
  7584. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  7585. * //SuperMap.Geometry.Polygon对象
  7586. * var geo = bounds.toGeometry();
  7587. * @returns {SuperMap.Geometry.Polygon} 基于当前 bounds 坐标创建的新的多边形。
  7588. */
  7589. // toGeometry() {
  7590. // return new Polygon([
  7591. // new LinearRing([
  7592. // new Point(this.left, this.bottom),
  7593. // new Point(this.right, this.bottom),
  7594. // new Point(this.right, this.top),
  7595. // new Point(this.left, this.top)
  7596. // ])
  7597. // ]);
  7598. // }
  7599. /**
  7600. * @function SuperMap.Bounds.prototype.getWidth
  7601. * @description 获取 bounds 的宽度。
  7602. * @example
  7603. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  7604. * //width = 280;
  7605. * var width = bounds.getWidth();
  7606. * @returns {float} 获取当前 bounds 的宽度(right 减去 left)。
  7607. */
  7608. }, {
  7609. key: "getWidth",
  7610. value: function getWidth() {
  7611. return this.right - this.left;
  7612. }
  7613. /**
  7614. * @function SuperMap.Bounds.prototype.getHeight
  7615. * @description 获取 bounds 的高度。
  7616. * @example
  7617. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  7618. * //height = 170;
  7619. * var height = bounds.getHeight();
  7620. * @returns {float} 返回边界高度(top 减去 bottom)。
  7621. */
  7622. }, {
  7623. key: "getHeight",
  7624. value: function getHeight() {
  7625. return this.top - this.bottom;
  7626. }
  7627. /**
  7628. * @function SuperMap.Bounds.prototype.getSize
  7629. * @description 获取边框大小。
  7630. * @example
  7631. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  7632. * var size = bounds.getSize();
  7633. * @returns {SuperMap.Size} 返回边框大小。
  7634. */
  7635. }, {
  7636. key: "getSize",
  7637. value: function getSize() {
  7638. return new Size(this.getWidth(), this.getHeight());
  7639. }
  7640. /**
  7641. * @function SuperMap.Bounds.prototype.getCenterPixel
  7642. * @description 获取像素格式的范围中心点。
  7643. * @example
  7644. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  7645. * var pixel = bounds.getCenterPixel();
  7646. * @returns {SuperMap.Pixel} 返回像素格式的当前范围的中心点。
  7647. */
  7648. }, {
  7649. key: "getCenterPixel",
  7650. value: function getCenterPixel() {
  7651. return new Pixel((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  7652. }
  7653. /**
  7654. * @function SuperMap.Bounds.prototype.getCenterLonLat
  7655. * @description 获取地理格式的范围中心点。
  7656. * @example
  7657. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  7658. * var lonlat = bounds.getCenterLonLat();
  7659. * @returns {SuperMap.LonLat} 返回当前地理范围的中心点。
  7660. */
  7661. }, {
  7662. key: "getCenterLonLat",
  7663. value: function getCenterLonLat() {
  7664. if (!this.centerLonLat) {
  7665. this.centerLonLat = new LonLat((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  7666. }
  7667. return this.centerLonLat;
  7668. }
  7669. /**
  7670. * @function SuperMap.Bounds.prototype.scale
  7671. * @description 按照比例扩大/缩小出一个新的 bounds。
  7672. * @example
  7673. * var bounds = new SuperMap.Bounds(-50,-50,40,40);
  7674. * var bounds2 = bounds.scale(2);
  7675. * @param {float} [ratio=1] - 需要扩大的比例。
  7676. * @param {(SuperMap.Pixel|SuperMap.LonLat)} [origin] - 扩大时的基准点,默认为当前 bounds 的中心点。
  7677. * @returns {SuperMap.Bounds} 返回通过 ratio、origin 计算得到的新的边界范围。
  7678. */
  7679. }, {
  7680. key: "scale",
  7681. value: function scale(ratio, origin) {
  7682. ratio = ratio ? ratio : 1;
  7683. if (origin == null) {
  7684. origin = this.getCenterLonLat();
  7685. }
  7686. var origx, origy; // get origin coordinates
  7687. if (origin.CLASS_NAME === "SuperMap.LonLat") {
  7688. origx = origin.lon;
  7689. origy = origin.lat;
  7690. } else {
  7691. origx = origin.x;
  7692. origy = origin.y;
  7693. }
  7694. var left = (this.left - origx) * ratio + origx;
  7695. var bottom = (this.bottom - origy) * ratio + origy;
  7696. var right = (this.right - origx) * ratio + origx;
  7697. var top = (this.top - origy) * ratio + origy;
  7698. return new Bounds(left, bottom, right, top);
  7699. }
  7700. /**
  7701. * @function SuperMap.Bounds.prototype.add
  7702. * @description 在当前的 Bounds 上按照传入的坐标点进行平移,返回新的范围。
  7703. * @example
  7704. * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
  7705. * //bounds2 是新的 bounds
  7706. * var bounds2 = bounds.add(20,10);
  7707. * @param {float} x - 传入坐标点的 x 坐标。
  7708. * @param {float} y - 传入坐标点的 y 坐标。
  7709. * @returns {SuperMap.Bounds} 返回一个新的 bounds,此 bounds 的坐标是由传入的 x,y 参数与当前 bounds 坐标计算所得。
  7710. */
  7711. }, {
  7712. key: "add",
  7713. value: function add(x, y) {
  7714. if (x == null || y == null) {
  7715. throw new TypeError('Bounds.add cannot receive null values');
  7716. }
  7717. return new Bounds(this.left + x, this.bottom + y, this.right + x, this.top + y);
  7718. }
  7719. /**
  7720. * @function SuperMap.Bounds.prototype.extend
  7721. * @description 在当前 bounds 上扩展 bounds,支持 point,lanlat 和 bounds。扩展后的 bounds 的范围是两者的结合。
  7722. * @example
  7723. * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
  7724. * //bounds 改变
  7725. * bounds.extend(new SuperMap.LonLat(50,60));
  7726. * @param {(SuperMap.Geometry.Point|SuperMap.LonLat|SuperMap.Bounds)} object - 可以是 point、lonlat 和 bounds。
  7727. */
  7728. }, {
  7729. key: "extend",
  7730. value: function extend(object) {
  7731. var bounds = null;
  7732. if (object) {
  7733. // clear cached center location
  7734. switch (object.CLASS_NAME) {
  7735. case "SuperMap.LonLat":
  7736. bounds = new Bounds(object.lon, object.lat, object.lon, object.lat);
  7737. break;
  7738. case "SuperMap.Geometry.Point":
  7739. bounds = new Bounds(object.x, object.y, object.x, object.y);
  7740. break;
  7741. case "SuperMap.Bounds":
  7742. bounds = object;
  7743. break;
  7744. }
  7745. if (bounds) {
  7746. this.centerLonLat = null;
  7747. if (this.left == null || bounds.left < this.left) {
  7748. this.left = bounds.left;
  7749. }
  7750. if (this.bottom == null || bounds.bottom < this.bottom) {
  7751. this.bottom = bounds.bottom;
  7752. }
  7753. if (this.right == null || bounds.right > this.right) {
  7754. this.right = bounds.right;
  7755. }
  7756. if (this.top == null || bounds.top > this.top) {
  7757. this.top = bounds.top;
  7758. }
  7759. }
  7760. }
  7761. }
  7762. /**
  7763. * @function SuperMap.Bounds.prototype.containsLonLat
  7764. * @description 判断传入的坐标是否在范围内。
  7765. * @example
  7766. * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
  7767. * //isContains1 = true
  7768. * //这里的第二个参数可以直接为 boolean 类型,也就是inclusive
  7769. * var isContains1 = bounds.containsLonLat(new SuperMap.LonLat(40,40),true);
  7770. *
  7771. * //(40,40)在范围内,同样(40+360,40)也在范围内
  7772. * var bounds2 = new SuperMap.Bounds(-50,-50,40,40);
  7773. * //isContains2 = true;
  7774. * var isContains2 = bounds2.containsLonLat(
  7775. * new SuperMap.LonLat(400,40),
  7776. * {
  7777. * inclusive:true,
  7778. * //全球的范围
  7779. * worldBounds: new SuperMap.Bounds(-180,-90,180,90)
  7780. * }
  7781. * );
  7782. * @param {(SuperMap.LonLat|Object)} ll - <SuperMap.LonLat> 对象或者是一个包含 'lon' 与 'lat' 属性的对象。
  7783. * @param {Object} options - 可选参数。
  7784. * @param {boolean} [options.inclusive=true] - 是否包含边界。
  7785. * @param {SuperMap.Bounds} [options.worldBounds] - 如果提供 worldBounds 参数, 如果 ll 参数提供的坐标超出了世界边界(worldBounds),
  7786. * 但是通过日界线的转化可以被包含, 它将被认为是包含在该范围内的。
  7787. * @returns {boolean} 传入坐标是否包含在范围内。
  7788. */
  7789. }, {
  7790. key: "containsLonLat",
  7791. value: function containsLonLat(ll, options) {
  7792. if (typeof options === "boolean") {
  7793. options = {
  7794. inclusive: options
  7795. };
  7796. }
  7797. options = options || {};
  7798. var contains = this.contains(ll.lon, ll.lat, options.inclusive),
  7799. worldBounds = options.worldBounds; //日界线以外的也有可能算包含,
  7800. if (worldBounds && !contains) {
  7801. var worldWidth = worldBounds.getWidth();
  7802. var worldCenterX = (worldBounds.left + worldBounds.right) / 2; //这一步很关键
  7803. var worldsAway = Math.round((ll.lon - worldCenterX) / worldWidth);
  7804. contains = this.containsLonLat({
  7805. lon: ll.lon - worldsAway * worldWidth,
  7806. lat: ll.lat
  7807. }, {
  7808. inclusive: options.inclusive
  7809. });
  7810. }
  7811. return contains;
  7812. }
  7813. /**
  7814. * @function SuperMap.Bounds.prototype.containsPixel
  7815. * @description 判断传入的像素是否在范围内。直接匹配大小,不涉及像素和地理转换。
  7816. * @example
  7817. * var bounds = new SuperMap.Bounds(-50,-50,40,40);
  7818. * //isContains = true
  7819. * var isContains = bounds.containsPixel(new SuperMap.Pixel(40,40),true);
  7820. * @param {SuperMap.Pixel} px - 提供的像素参数。
  7821. * @param {boolean} [inclusive=true] - 是否包含边界。
  7822. * @returns {boolean} 传入的 pixel 在当前边界范围之内。
  7823. */
  7824. }, {
  7825. key: "containsPixel",
  7826. value: function containsPixel(px, inclusive) {
  7827. return this.contains(px.x, px.y, inclusive);
  7828. }
  7829. /**
  7830. * @function SuperMap.Bounds.prototype.contains
  7831. * @description 判断传入的 x,y 坐标值是否在范围内。
  7832. * @example
  7833. * var bounds = new SuperMap.Bounds(-50,-50,40,40);
  7834. * //isContains = true
  7835. * var isContains = bounds.contains(40,40,true);
  7836. * @param {float} x - 传入的 x 坐标值。
  7837. * @param {float} y - 传入的 y 坐标值。
  7838. * @param {boolean} [inclusive=true] - 是否包含边界。
  7839. * @returns {boolean} 传入的 x,y 坐标是否在当前范围内。
  7840. */
  7841. }, {
  7842. key: "contains",
  7843. value: function contains(x, y, inclusive) {
  7844. //set default
  7845. if (inclusive == null) {
  7846. inclusive = true;
  7847. }
  7848. if (x == null || y == null) {
  7849. return false;
  7850. } //x = Util.toFloat(x);
  7851. //y = Util.toFloat(y);
  7852. var contains = false;
  7853. if (inclusive) {
  7854. contains = x >= this.left && x <= this.right && y >= this.bottom && y <= this.top;
  7855. } else {
  7856. contains = x > this.left && x < this.right && y > this.bottom && y < this.top;
  7857. }
  7858. return contains;
  7859. }
  7860. /**
  7861. * @function SuperMap.Bounds.prototype.intersectsBounds
  7862. * @description 判断目标边界范围是否与当前边界范围相交。如果两个边界范围中的任意
  7863. * 边缘相交或者一个边界包含了另外一个就认为这两个边界相交。
  7864. * @example
  7865. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  7866. * var isIntersects = bounds.intersectsBounds(
  7867. * new SuperMap.Bounds(-170,-90,120,80)
  7868. * );
  7869. * @param {SuperMap.Bounds} bounds - 目标边界。
  7870. * @param {Object} options - 参数。
  7871. * @param {boolean} [options.inclusive=true] - 边缘重合也看成相交。如果是false,
  7872. * 两个边界范围没有重叠部分仅仅是在边缘相接(重合),
  7873. * 这种情况被认为没有相交。
  7874. * @param {SuperMap.Bounds} [options.worldBounds] - 提供了 worldBounds 参数, 如果他们相交时
  7875. * 是在全球范围内, 两个边界将被视为相交。这仅适用于交叉或完全不在世界范围的边界。
  7876. * @returns {boolean} 传入的 bounds 对象与当前 bounds 相交。
  7877. */
  7878. }, {
  7879. key: "intersectsBounds",
  7880. value: function intersectsBounds(bounds, options) {
  7881. if (typeof options === "boolean") {
  7882. options = {
  7883. inclusive: options
  7884. };
  7885. }
  7886. options = options || {};
  7887. if (options.worldBounds) {
  7888. var self = this.wrapDateLine(options.worldBounds);
  7889. bounds = bounds.wrapDateLine(options.worldBounds);
  7890. } else {
  7891. self = this;
  7892. }
  7893. if (options.inclusive == null) {
  7894. options.inclusive = true;
  7895. }
  7896. var intersects = false;
  7897. var mightTouch = self.left === bounds.right || self.right === bounds.left || self.top === bounds.bottom || self.bottom === bounds.top; // if the two bounds only touch at an edge, and inclusive is false,
  7898. // then the bounds don't *really* intersect.
  7899. if (options.inclusive || !mightTouch) {
  7900. // otherwise, if one of the boundaries even partially contains another,
  7901. // inclusive of the edges, then they do intersect.
  7902. var inBottom = bounds.bottom >= self.bottom && bounds.bottom <= self.top || self.bottom >= bounds.bottom && self.bottom <= bounds.top;
  7903. var inTop = bounds.top >= self.bottom && bounds.top <= self.top || self.top > bounds.bottom && self.top < bounds.top;
  7904. var inLeft = bounds.left >= self.left && bounds.left <= self.right || self.left >= bounds.left && self.left <= bounds.right;
  7905. var inRight = bounds.right >= self.left && bounds.right <= self.right || self.right >= bounds.left && self.right <= bounds.right;
  7906. intersects = (inBottom || inTop) && (inLeft || inRight);
  7907. } // document me
  7908. if (options.worldBounds && !intersects) {
  7909. var world = options.worldBounds;
  7910. var width = world.getWidth();
  7911. var selfCrosses = !world.containsBounds(self);
  7912. var boundsCrosses = !world.containsBounds(bounds);
  7913. if (selfCrosses && !boundsCrosses) {
  7914. bounds = bounds.add(-width, 0);
  7915. intersects = self.intersectsBounds(bounds, {
  7916. inclusive: options.inclusive
  7917. });
  7918. } else if (boundsCrosses && !selfCrosses) {
  7919. self = self.add(-width, 0);
  7920. intersects = bounds.intersectsBounds(self, {
  7921. inclusive: options.inclusive
  7922. });
  7923. }
  7924. }
  7925. return intersects;
  7926. }
  7927. /**
  7928. * @function SuperMap.Bounds.prototype.containsBounds
  7929. * @description 判断目标边界是否被当前边界包含在内。
  7930. * @example
  7931. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  7932. * var isContains = bounds.containsBounds(
  7933. * new SuperMap.Bounds(-170,-90,100,80),true,true
  7934. * );
  7935. * @param {SuperMap.Bounds} bounds - 目标边界。
  7936. * @param {boolean} [partial=false] - 目标边界的任意部分都包含在当前边界中则被认为是包含关系。
  7937. * 如果设为 false,整个目标边界全部被包含在当前边界范围内。
  7938. * @param {boolean} [inclusive=true] - 边缘共享被视为包含。
  7939. * @returns {boolean} 传入的边界被当前边界包含。
  7940. */
  7941. }, {
  7942. key: "containsBounds",
  7943. value: function containsBounds(bounds, partial, inclusive) {
  7944. if (partial == null) {
  7945. partial = false;
  7946. }
  7947. if (inclusive == null) {
  7948. inclusive = true;
  7949. }
  7950. var bottomLeft = this.contains(bounds.left, bounds.bottom, inclusive);
  7951. var bottomRight = this.contains(bounds.right, bounds.bottom, inclusive);
  7952. var topLeft = this.contains(bounds.left, bounds.top, inclusive);
  7953. var topRight = this.contains(bounds.right, bounds.top, inclusive);
  7954. return partial ? bottomLeft || bottomRight || topLeft || topRight : bottomLeft && bottomRight && topLeft && topRight;
  7955. }
  7956. /**
  7957. * @function SuperMap.Bounds.prototype.determineQuadrant
  7958. * @description 判断传入坐标是否在 bounds 范围内的象限。以 bounds 中心点为坐标原点。
  7959. * @example
  7960. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  7961. * //str = "tr";
  7962. * var str = bounds.determineQuadrant(
  7963. * new SuperMap.LonLat(20,20)
  7964. * );
  7965. * @param {SuperMap.LonLat} lonlat - 传入的坐标对象。
  7966. * @returns {string} 传入坐标所在的象限("br" "tr" "tl" "bl" 分别对应"右下","右上","左上" "左下")。
  7967. */
  7968. }, {
  7969. key: "determineQuadrant",
  7970. value: function determineQuadrant(lonlat) {
  7971. var quadrant = "";
  7972. var center = this.getCenterLonLat();
  7973. quadrant += lonlat.lat < center.lat ? "b" : "t";
  7974. quadrant += lonlat.lon < center.lon ? "l" : "r";
  7975. return quadrant;
  7976. }
  7977. /**
  7978. * @function SuperMap.Bounds.prototype.wrapDateLine
  7979. * @description 将当前 bounds 移动到最大边界范围内部(所谓的内部是相交或者内部)。
  7980. * @example
  7981. * var bounds = new SuperMap.Bounds(380,-40,400,-20);
  7982. * var maxExtent = new SuperMap.Bounds(-180,-90,100,80);
  7983. * //新的bounds
  7984. * var newBounds = bounds.wrapDateLine(maxExtent);
  7985. * @param {SuperMap.Bounds} maxExtent - 最大的边界范围(一般是全球范围)。
  7986. * @param {Object} options - 可选选项参数。
  7987. * @param {float} [options.leftTolerance=0] - left 允许的误差。
  7988. * @param {float} [options.rightTolerance=0] - right 允许的误差。
  7989. * @returns {SuperMap.Bounds} 克隆当前边界。如果当前边界完全在最大范围之外此函数则返回一个不同值的边界,
  7990. * 若落在最大边界的左边,则给当前的bounds值加上最大范围的宽度,即向右移动,
  7991. * 若落在右边,则向左移动,即给当前的bounds值加上负的最大范围的宽度。
  7992. */
  7993. }, {
  7994. key: "wrapDateLine",
  7995. value: function wrapDateLine(maxExtent, options) {
  7996. options = options || {};
  7997. var leftTolerance = options.leftTolerance || 0;
  7998. var rightTolerance = options.rightTolerance || 0;
  7999. var newBounds = this.clone();
  8000. if (maxExtent) {
  8001. var width = maxExtent.getWidth(); //如果 newBounds 在 maxExtent 的左边,那么一直向右移动,直到相交或者包含为止,每次移动width
  8002. //shift right?
  8003. while (newBounds.left < maxExtent.left && newBounds.right - rightTolerance <= maxExtent.left) {
  8004. newBounds = newBounds.add(width, 0);
  8005. } //如果 newBounds 在 maxExtent 的右边,那么一直向左移动,直到相交或者包含为止,每次移动width
  8006. //shift left?
  8007. while (newBounds.left + leftTolerance >= maxExtent.right && newBounds.right > maxExtent.right) {
  8008. newBounds = newBounds.add(-width, 0);
  8009. } //如果和右边相交,左边又在内部,那么再次向左边移动一次
  8010. // crosses right only? force left
  8011. var newLeft = newBounds.left + leftTolerance;
  8012. if (newLeft < maxExtent.right && newLeft > maxExtent.left && newBounds.right - rightTolerance > maxExtent.right) {
  8013. newBounds = newBounds.add(-width, 0);
  8014. }
  8015. }
  8016. return newBounds;
  8017. }
  8018. /**
  8019. * @function SuperMap.Bounds.prototype.toServerJSONObject
  8020. * @description 转换成对应的 JSON 格式对象。
  8021. * @example
  8022. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  8023. * var obj = bounds.toServerJSONObject();
  8024. * @returns {Object} 返回 JSON 格式的 Object 对象。
  8025. */
  8026. }, {
  8027. key: "toServerJSONObject",
  8028. value: function toServerJSONObject() {
  8029. var jsonObject = {
  8030. rightTop: {
  8031. x: this.right,
  8032. y: this.top
  8033. },
  8034. leftBottom: {
  8035. x: this.left,
  8036. y: this.bottom
  8037. },
  8038. left: this.left,
  8039. right: this.right,
  8040. top: this.top,
  8041. bottom: this.bottom
  8042. };
  8043. return jsonObject;
  8044. }
  8045. /**
  8046. *
  8047. * @function SuperMap.Bounds.prototype.destroy
  8048. * @description 销毁此对象。
  8049. * 销毁后此对象的所有属性为 null,而不是初始值。
  8050. * @example
  8051. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  8052. * bounds.destroy();
  8053. */
  8054. }, {
  8055. key: "destroy",
  8056. value: function destroy() {
  8057. this.left = null;
  8058. this.right = null;
  8059. this.top = null;
  8060. this.bottom = null;
  8061. this.centerLonLat = null;
  8062. }
  8063. /**
  8064. * @function SuperMap.Bounds.fromString
  8065. * @description 通过字符串参数创建新的 bounds 的构造函数。
  8066. * @example
  8067. * var bounds = SuperMap.Bounds.fromString("-180,-90,100,80");
  8068. * @param {string} str - 边界字符串,用逗号隔开(e.g. <i>"5,42,10,45"</i>)。
  8069. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  8070. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  8071. * @returns {SuperMap.Bounds} 返回给定的字符串创建的新的边界对象。
  8072. */
  8073. }], [{
  8074. key: "fromString",
  8075. value: function fromString(str, reverseAxisOrder) {
  8076. var bounds = str.split(",");
  8077. return Bounds.fromArray(bounds, reverseAxisOrder);
  8078. }
  8079. /**
  8080. * @function SuperMap.Bounds.fromArray
  8081. * @description 通过边界框数组创建 Bounds。
  8082. * @example
  8083. * var bounds = SuperMap.Bounds.fromArray([-180,-90,100,80]);
  8084. * @param {Array.<float>} bbox - 边界值数组。(e.g. <i>[5,42,10,45]</i>)。
  8085. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  8086. * @returns {SuperMap.Bounds} 返回根据传入的数组创建的新的边界对象。
  8087. */
  8088. }, {
  8089. key: "fromArray",
  8090. value: function fromArray(bbox, reverseAxisOrder) {
  8091. return reverseAxisOrder === true ? new Bounds(bbox[1], bbox[0], bbox[3], bbox[2]) : new Bounds(bbox[0], bbox[1], bbox[2], bbox[3]);
  8092. }
  8093. /**
  8094. * @function SuperMap.Bounds.fromSize
  8095. * @description 通过传入的边界大小来创建新的边界。
  8096. * @example
  8097. * var bounds = SuperMap.Bounds.fromSize(new SuperMap.Size(20,10));
  8098. * @param {SuperMap.Size} size - 传入的边界大小。
  8099. * @returns {SuperMap.Bounds} 返回根据传入的边界大小的创建新的边界。
  8100. */
  8101. }, {
  8102. key: "fromSize",
  8103. value: function fromSize(size) {
  8104. return new Bounds(0, size.h, size.w, 0);
  8105. }
  8106. /**
  8107. * @function SuperMap.Bounds.oppositeQuadrant
  8108. * @description 反转象限。"t"和"b" 交换,"r"和"l"交换, 如:"tl"变为"br"。
  8109. * @param {string} quadrant - 代表象限的字符串,如:"tl"。
  8110. * @returns {string} 反转后的象限。
  8111. */
  8112. }, {
  8113. key: "oppositeQuadrant",
  8114. value: function oppositeQuadrant(quadrant) {
  8115. var opp = "";
  8116. opp += quadrant.charAt(0) === 't' ? 'b' : 't';
  8117. opp += quadrant.charAt(1) === 'l' ? 'r' : 'l';
  8118. return opp;
  8119. }
  8120. }]);
  8121. return Bounds;
  8122. }();
  8123. SuperMap.Bounds = Bounds;
  8124. ;// CONCATENATED MODULE: ./src/common/commontypes/Geometry.js
  8125. function Geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8126. 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); } }
  8127. function Geometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) Geometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) Geometry_defineProperties(Constructor, staticProps); return Constructor; }
  8128. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8129. * This program are made available under the terms of the Apache License, Version 2.0
  8130. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8131. // import {WKT} from '../format/WKT';
  8132. // import {Vector} from './Vector';
  8133. /**
  8134. * @class SuperMap.Geometry
  8135. * @category BaseTypes Geometry
  8136. * @classdesc 几何对象类,描述地理对象的几何图形。
  8137. */
  8138. var Geometry = /*#__PURE__*/function () {
  8139. function Geometry() {
  8140. Geometry_classCallCheck(this, Geometry);
  8141. this.CLASS_NAME = "SuperMap.Geometry";
  8142. /**
  8143. * @member {string} SuperMap.Geometry.prototype.id
  8144. * @description 此几何对象的唯一标示符。
  8145. *
  8146. */
  8147. this.id = Util.createUniqueID(this.CLASS_NAME + "_");
  8148. /**
  8149. * @member {SuperMap.Geometry} SuperMap.Geometry.prototype.parent
  8150. * @description This is set when a Geometry is added as component
  8151. * of another geometry
  8152. */
  8153. this.parent = null;
  8154. /**
  8155. * @member {SuperMap.Bounds} SuperMap.Geometry.prototype.bounds
  8156. * @description 几何对象的范围。
  8157. *
  8158. */
  8159. this.bounds = null;
  8160. /**
  8161. * @member {interger} SuperMap.Geometry.prototype.SRID
  8162. * @description 投影坐标参数。通过该参数,服务器判断 Geometry 对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。
  8163. * @example
  8164. * var geometry= new SuperMap.Geometry();
  8165. * geometry. SRID=4326;
  8166. *
  8167. */
  8168. this.SRID = null;
  8169. }
  8170. /**
  8171. * @function SuperMap.Geometry.prototype.destroy
  8172. * @description 解构 Geometry 类,释放资源。
  8173. */
  8174. Geometry_createClass(Geometry, [{
  8175. key: "destroy",
  8176. value: function destroy() {
  8177. this.id = null;
  8178. this.bounds = null;
  8179. this.SRID = null;
  8180. }
  8181. /**
  8182. * @function SuperMap.Geometry.prototype.clone
  8183. * @description 创建克隆的几何图形。克隆的几何图形不设置非标准的属性。
  8184. * @returns {SuperMap.Geometry} 克隆的几何图形。
  8185. */
  8186. }, {
  8187. key: "clone",
  8188. value: function clone() {
  8189. return new Geometry();
  8190. }
  8191. /**
  8192. * @function SuperMap.Geometry.prototype.setBounds
  8193. * @description 设置此几何对象的 bounds。
  8194. * @param {SuperMap.Bounds} bounds - 范围。
  8195. */
  8196. }, {
  8197. key: "setBounds",
  8198. value: function setBounds(bounds) {
  8199. if (bounds) {
  8200. this.bounds = bounds.clone();
  8201. }
  8202. }
  8203. /**
  8204. * @function SuperMap.Geometry.prototype.clearBounds
  8205. * @description 清除几何对象的 bounds。
  8206. * 如果该对象有父类,也会清除父类几何对象的 bounds。
  8207. */
  8208. }, {
  8209. key: "clearBounds",
  8210. value: function clearBounds() {
  8211. this.bounds = null;
  8212. if (this.parent) {
  8213. this.parent.clearBounds();
  8214. }
  8215. }
  8216. /**
  8217. * @function SuperMap.Geometry.prototype.extendBounds
  8218. * @description Extend the existing bounds to include the new bounds.
  8219. * If geometry's bounds is not yet set, then set a new Bounds.
  8220. *
  8221. * @param {SuperMap.Bounds} newBounds - 范围。
  8222. */
  8223. }, {
  8224. key: "extendBounds",
  8225. value: function extendBounds(newBounds) {
  8226. var bounds = this.getBounds();
  8227. if (!bounds) {
  8228. this.setBounds(newBounds);
  8229. } else {
  8230. this.bounds.extend(newBounds);
  8231. }
  8232. }
  8233. /**
  8234. * @function SuperMap.Geometry.prototype.getBounds
  8235. * @description 获得几何图形的边界。如果没有设置边界,可通过计算获得。
  8236. * @returns {SuperMap.Bounds} 返回的几何对象的边界。
  8237. */
  8238. }, {
  8239. key: "getBounds",
  8240. value: function getBounds() {
  8241. if (this.bounds == null) {
  8242. this.calculateBounds();
  8243. }
  8244. return this.bounds;
  8245. }
  8246. /**
  8247. * @function SuperMap.Geometry.prototype.calculateBounds
  8248. * @description 重新计算几何图形的边界(需要在子类中实现此方法)。
  8249. */
  8250. }, {
  8251. key: "calculateBounds",
  8252. value: function calculateBounds() {//
  8253. // This should be overridden by subclasses.
  8254. //
  8255. }
  8256. /**
  8257. * @function SuperMap.Geometry.prototype.getVertices
  8258. * @description 返回几何图形的所有顶点的列表(需要在子类中实现此方法)。
  8259. * @param {boolean} [nodes] - 如果是 true,线则只返回线的末端点,如果 false,仅仅返回顶点,如果没有设置,则返回顶点。
  8260. * @returns {Array} 几何图形的顶点列表。
  8261. */
  8262. }, {
  8263. key: "getVertices",
  8264. value: function getVertices(nodes) {// eslint-disable-line no-unused-vars
  8265. }
  8266. /**
  8267. * @function SuperMap.Geometry.prototype.getArea
  8268. * @description 计算几何对象的面积 ,此方法需要在子类中定义。
  8269. * @returns {float} The area of the collection by summing its parts
  8270. */
  8271. }, {
  8272. key: "getArea",
  8273. value: function getArea() {
  8274. //to be overridden by geometries that actually have an area
  8275. //
  8276. return 0.0;
  8277. } // /**
  8278. // * @function SuperMap.Geometry.prototype.toString
  8279. // * @description 返回geometry对象的字符串表述,需要引入{@link SuperMap.Format.WKT}。此方法只能在子类实现,在父类使用会报错。
  8280. // * @returns {string} geometry对象的字符串表述(Well-Known Text)
  8281. // */
  8282. // toString() {
  8283. // var string;
  8284. // if (WKT) {
  8285. // var wkt = new WKT();
  8286. // string = wkt.write(new Vector(this));
  8287. // } else {
  8288. // string = Object.prototype.toString.call(this);
  8289. // }
  8290. // return string;
  8291. // }
  8292. }]);
  8293. return Geometry;
  8294. }();
  8295. SuperMap.Geometry = Geometry;
  8296. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Collection.js
  8297. function Collection_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Collection_typeof = function _typeof(obj) { return typeof obj; }; } else { Collection_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Collection_typeof(obj); }
  8298. function Collection_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8299. 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); } }
  8300. function Collection_createClass(Constructor, protoProps, staticProps) { if (protoProps) Collection_defineProperties(Constructor.prototype, protoProps); if (staticProps) Collection_defineProperties(Constructor, staticProps); return Constructor; }
  8301. function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
  8302. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Collection_getPrototypeOf(object); if (object === null) break; } return object; }
  8303. function Collection_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Collection_setPrototypeOf(subClass, superClass); }
  8304. function Collection_setPrototypeOf(o, p) { Collection_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Collection_setPrototypeOf(o, p); }
  8305. function Collection_createSuper(Derived) { var hasNativeReflectConstruct = Collection_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Collection_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Collection_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Collection_possibleConstructorReturn(this, result); }; }
  8306. function Collection_possibleConstructorReturn(self, call) { if (call && (Collection_typeof(call) === "object" || typeof call === "function")) { return call; } return Collection_assertThisInitialized(self); }
  8307. function Collection_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8308. function Collection_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  8309. function Collection_getPrototypeOf(o) { Collection_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Collection_getPrototypeOf(o); }
  8310. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8311. * This program are made available under the terms of the Apache License, Version 2.0
  8312. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8313. /**
  8314. * @class SuperMap.Geometry.Collection
  8315. * @classdesc 几何对象集合类,存储在本地的 components 属性中(可作为参数传递给构造函数)。<br>
  8316. * 随着新的几何图形添加到集合中,将不能被克隆,当移动几何图形时,需要指定参照物。<br>
  8317. * getArea 和 getLength 函数只能通过遍历存储几何对象的 components 数组,总计所有几何图形的面积和长度。
  8318. * @category BaseTypes Geometry
  8319. * @extends {SuperMap.Geometry}
  8320. * @param {Array.<SuperMap.Geometry>} components - 几何对象数组。
  8321. * @example
  8322. * var point1 = new SuperMap.Geometry.Point(10,20);
  8323. * var point2 = new SuperMap.Geometry.Point(30,40);
  8324. * var col = new SuperMap.Geometry.Collection([point1,point2]);
  8325. */
  8326. var Collection = /*#__PURE__*/function (_Geometry) {
  8327. Collection_inherits(Collection, _Geometry);
  8328. var _super = Collection_createSuper(Collection);
  8329. function Collection(components) {
  8330. var _this;
  8331. Collection_classCallCheck(this, Collection);
  8332. _this = _super.call(this);
  8333. /**
  8334. * @description 存储几何对象的数组。
  8335. * @member {Array.<SuperMap.Geometry>} SuperMap.Geometry.Collection.prototype.components
  8336. */
  8337. _this.components = [];
  8338. /**
  8339. * @member {Array.<string>} SuperMap.Geometry.Collection.prototype.componentTypes
  8340. * @description components 存储的的几何对象所支持的几何类型数组,为空表示类型不受限制。
  8341. */
  8342. _this.componentTypes = null;
  8343. if (components != null) {
  8344. _this.addComponents(components);
  8345. }
  8346. _this.CLASS_NAME = "SuperMap.Geometry.Collection";
  8347. _this.geometryType = "Collection";
  8348. return _this;
  8349. }
  8350. /**
  8351. * @function SuperMap.Geometry.Collection.prototype.destroy
  8352. * @description 销毁几何图形。
  8353. */
  8354. Collection_createClass(Collection, [{
  8355. key: "destroy",
  8356. value: function destroy() {
  8357. this.components.length = 0;
  8358. this.components = null;
  8359. _get(Collection_getPrototypeOf(Collection.prototype), "destroy", this).call(this);
  8360. }
  8361. /**
  8362. * @function SuperMap.Geometry.Collection.prototype.clone
  8363. * @description 克隆当前几何对象。
  8364. * @returns {SuperMap.Geometry.Collection} 克隆的几何对象集合。
  8365. */
  8366. }, {
  8367. key: "clone",
  8368. value: function clone() {
  8369. var geometry = new Collection();
  8370. for (var i = 0, len = this.components.length; i < len; i++) {
  8371. geometry.addComponent(this.components[i].clone());
  8372. } // catch any randomly tagged-on properties
  8373. Util.applyDefaults(geometry, this);
  8374. return geometry;
  8375. }
  8376. /**
  8377. * @function SuperMap.Geometry.Collection.prototype.getComponentsString
  8378. * @description 获取 components 字符串。
  8379. * @returns {string} components 字符串。
  8380. */
  8381. }, {
  8382. key: "getComponentsString",
  8383. value: function getComponentsString() {
  8384. var strings = [];
  8385. for (var i = 0, len = this.components.length; i < len; i++) {
  8386. strings.push(this.components[i].toShortString());
  8387. }
  8388. return strings.join(",");
  8389. }
  8390. /**
  8391. * @function SuperMap.Geometry.Collection.prototype.calculateBounds
  8392. * @description 通过遍历数组重新计算边界,在遍历每一子项中时调用 extend 方法。
  8393. */
  8394. }, {
  8395. key: "calculateBounds",
  8396. value: function calculateBounds() {
  8397. this.bounds = null;
  8398. var bounds = new Bounds();
  8399. var components = this.components;
  8400. if (components) {
  8401. for (var i = 0, len = components.length; i < len; i++) {
  8402. bounds.extend(components[i].getBounds());
  8403. }
  8404. } // to preserve old behavior, we only set bounds if non-null
  8405. // in the future, we could add bounds.isEmpty()
  8406. if (bounds.left != null && bounds.bottom != null && bounds.right != null && bounds.top != null) {
  8407. this.setBounds(bounds);
  8408. }
  8409. }
  8410. /**
  8411. * @function SuperMap.Geometry.Collection.prototype.addComponents
  8412. * @description 给几何图形对象添加元素。
  8413. * @param {Array.<SuperMap.Geometry>} components - 几何对象组件。
  8414. * @example
  8415. * var collection = new SuperMap.Geometry.Collection();
  8416. * collection.addComponents(new SuerpMap.Geometry.Point(10,10));
  8417. */
  8418. }, {
  8419. key: "addComponents",
  8420. value: function addComponents(components) {
  8421. if (!Util.isArray(components)) {
  8422. components = [components];
  8423. }
  8424. for (var i = 0, len = components.length; i < len; i++) {
  8425. this.addComponent(components[i]);
  8426. }
  8427. }
  8428. /**
  8429. * @function SuperMap.Geometry.Collection.prototype.addComponent
  8430. * @description 添加一个几何对象到集合中。如果设置了 componentTypes 类型,则添加的几何对象必须是 componentTypes 中的类型。
  8431. * @param {SuperMap.Geometry} component - 待添加的几何对象。
  8432. * @param {int} [index] - 几何对象插入的位置。
  8433. * @returns {boolean} 是否添加成功。
  8434. */
  8435. }, {
  8436. key: "addComponent",
  8437. value: function addComponent(component, index) {
  8438. var added = false;
  8439. if (component) {
  8440. if (this.componentTypes == null || Util.indexOf(this.componentTypes, component.CLASS_NAME) > -1) {
  8441. if (index != null && index < this.components.length) {
  8442. var components1 = this.components.slice(0, index);
  8443. var components2 = this.components.slice(index, this.components.length);
  8444. components1.push(component);
  8445. this.components = components1.concat(components2);
  8446. } else {
  8447. this.components.push(component);
  8448. }
  8449. component.parent = this;
  8450. this.clearBounds();
  8451. added = true;
  8452. }
  8453. }
  8454. return added;
  8455. }
  8456. /**
  8457. * @function SuperMap.Geometry.Collection.prototype.removeComponents
  8458. * @description 清除几何对象。
  8459. * @param {Array.<SuperMap.Geometry>} components - 需要清除的几何对象。
  8460. * @returns {boolean} 元素是否被删除。
  8461. */
  8462. }, {
  8463. key: "removeComponents",
  8464. value: function removeComponents(components) {
  8465. var removed = false;
  8466. if (!Util.isArray(components)) {
  8467. components = [components];
  8468. }
  8469. for (var i = components.length - 1; i >= 0; --i) {
  8470. removed = this.removeComponent(components[i]) || removed;
  8471. }
  8472. return removed;
  8473. }
  8474. /**
  8475. * @function SuperMap.Geometry.Collection.prototype.removeComponent
  8476. * @description 从集合中移除一个几何对象。
  8477. * @param {SuperMap.Geometry} component - 要移除的几何对象。
  8478. * @returns {boolean} 几何对象是否移除成功。
  8479. */
  8480. }, {
  8481. key: "removeComponent",
  8482. value: function removeComponent(component) {
  8483. Util.removeItem(this.components, component); // clearBounds() so that it gets recalculated on the next call
  8484. // to this.getBounds();
  8485. this.clearBounds();
  8486. return true;
  8487. }
  8488. /**
  8489. * @function SuperMap.Geometry.Collection.prototype.getArea
  8490. * @description 计算几何对象的面积。注意,这个方法在 {@link SuperMap.Geometry.Polygon} 类中需要重写。
  8491. * @returns {number} 几何图形的面积,是几何对象中所有组成部分的面积之和。
  8492. */
  8493. }, {
  8494. key: "getArea",
  8495. value: function getArea() {
  8496. var area = 0.0;
  8497. for (var i = 0, len = this.components.length; i < len; i++) {
  8498. area += this.components[i].getArea();
  8499. }
  8500. return area;
  8501. }
  8502. /**
  8503. * @function SuperMap.Geometry.Collection.prototype.equals
  8504. * @description 判断两个几何图形是否相等。如果所有的 components 具有相同的坐标,则认为是相等的。
  8505. * @param {SuperMap.Geometry} geometry - 需要判断的几何图形。
  8506. * @returns {boolean} 输入的几何图形与当前几何图形是否相等。
  8507. */
  8508. }, {
  8509. key: "equals",
  8510. value: function equals(geometry) {
  8511. var equivalent = true;
  8512. if (!geometry || !geometry.CLASS_NAME || this.CLASS_NAME !== geometry.CLASS_NAME) {
  8513. equivalent = false;
  8514. } else if (!Util.isArray(geometry.components) || geometry.components.length !== this.components.length) {
  8515. equivalent = false;
  8516. } else {
  8517. for (var i = 0, len = this.components.length; i < len; ++i) {
  8518. if (!this.components[i].equals(geometry.components[i])) {
  8519. equivalent = false;
  8520. break;
  8521. }
  8522. }
  8523. }
  8524. return equivalent;
  8525. }
  8526. /**
  8527. * @function SuperMap.Geometry.Collection.prototype.getVertices
  8528. * @description 返回几何对象的所有结点的列表。
  8529. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点如果没有设置此参数,则返回所有顶点。
  8530. * @returns {Array} 几何对象的顶点列表。
  8531. */
  8532. }, {
  8533. key: "getVertices",
  8534. value: function getVertices(nodes) {
  8535. var vertices = [];
  8536. for (var i = 0, len = this.components.length; i < len; ++i) {
  8537. Array.prototype.push.apply(vertices, this.components[i].getVertices(nodes));
  8538. }
  8539. return vertices;
  8540. }
  8541. }]);
  8542. return Collection;
  8543. }(Geometry);
  8544. SuperMap.Geometry.Collection = Collection;
  8545. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPoint.js
  8546. function MultiPoint_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MultiPoint_typeof = function _typeof(obj) { return typeof obj; }; } else { MultiPoint_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MultiPoint_typeof(obj); }
  8547. function MultiPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8548. 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); } }
  8549. function MultiPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiPoint_defineProperties(Constructor, staticProps); return Constructor; }
  8550. function MultiPoint_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MultiPoint_setPrototypeOf(subClass, superClass); }
  8551. function MultiPoint_setPrototypeOf(o, p) { MultiPoint_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPoint_setPrototypeOf(o, p); }
  8552. 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); }; }
  8553. function MultiPoint_possibleConstructorReturn(self, call) { if (call && (MultiPoint_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiPoint_assertThisInitialized(self); }
  8554. function MultiPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8555. function MultiPoint_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  8556. function MultiPoint_getPrototypeOf(o) { MultiPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPoint_getPrototypeOf(o); }
  8557. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8558. * This program are made available under the terms of the Apache License, Version 2.0
  8559. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8560. /**
  8561. * @class SuperMap.Geometry.MultiPoint
  8562. * @classdesc 几何对象多点类。
  8563. * @category BaseTypes Geometry
  8564. * @extends {SuperMap.Geometry.Collection}
  8565. * @param {Array.<SuperMap.Geometry.Point>} components - 点对象数组。
  8566. * @example
  8567. * var point1 = new SuperMap.Geometry.Point(5,6);
  8568. * var poine2 = new SuperMap.Geometry.Point(7,8);
  8569. * var multiPoint = new SuperMap.Geometry.MultiPoint([point1,point2]);
  8570. */
  8571. var MultiPoint = /*#__PURE__*/function (_Collection) {
  8572. MultiPoint_inherits(MultiPoint, _Collection);
  8573. var _super = MultiPoint_createSuper(MultiPoint);
  8574. function MultiPoint(components) {
  8575. var _this;
  8576. MultiPoint_classCallCheck(this, MultiPoint);
  8577. _this = _super.call(this, components);
  8578. /**
  8579. * @member {Array.<string>} [SuperMap.Geometry.MultiPoint.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  8580. * @description components 存储的的几何对象所支持的几何类型数组。
  8581. * @readonly
  8582. */
  8583. _this.componentTypes = ["SuperMap.Geometry.Point"];
  8584. _this.CLASS_NAME = "SuperMap.Geometry.MultiPoint";
  8585. _this.geometryType = "MultiPoint";
  8586. return _this;
  8587. }
  8588. /**
  8589. * @function SuperMap.Geometry.MultiPoint.prototype.addPoint
  8590. * @description 添加点,封装了 {@link SuperMap.Geometry.Collection|SuperMap.Geometry.Collection.addComponent} 方法。
  8591. * @param {SuperMap.Geometry.Point} point - 添加的点。
  8592. * @param {integer} [index] - 下标。
  8593. */
  8594. MultiPoint_createClass(MultiPoint, [{
  8595. key: "addPoint",
  8596. value: function addPoint(point, index) {
  8597. this.addComponent(point, index);
  8598. }
  8599. /**
  8600. * @function SuperMap.Geometry.MultiPoint.prototype.removePoint
  8601. * @description 移除点,封装了 {@link SuperMap.Geometry.Collection|SuperMap.Geometry.Collection.removeComponent} 方法。
  8602. * @param {SuperMap.Geometry.Point} point - 移除的点对象。
  8603. */
  8604. }, {
  8605. key: "removePoint",
  8606. value: function removePoint(point) {
  8607. this.removeComponent(point);
  8608. }
  8609. }]);
  8610. return MultiPoint;
  8611. }(Collection);
  8612. SuperMap.Geometry.MultiPoint = MultiPoint;
  8613. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Curve.js
  8614. function Curve_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Curve_typeof = function _typeof(obj) { return typeof obj; }; } else { Curve_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Curve_typeof(obj); }
  8615. function Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8616. function Curve_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Curve_setPrototypeOf(subClass, superClass); }
  8617. function Curve_setPrototypeOf(o, p) { Curve_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Curve_setPrototypeOf(o, p); }
  8618. 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); }; }
  8619. function Curve_possibleConstructorReturn(self, call) { if (call && (Curve_typeof(call) === "object" || typeof call === "function")) { return call; } return Curve_assertThisInitialized(self); }
  8620. function Curve_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8621. function Curve_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  8622. function Curve_getPrototypeOf(o) { Curve_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Curve_getPrototypeOf(o); }
  8623. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8624. * This program are made available under the terms of the Apache License, Version 2.0
  8625. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8626. /**
  8627. * @class SuperMap.Geometry.Curve
  8628. * @classdesc 几何对象曲线类。
  8629. * @category BaseTypes Geometry
  8630. * @extends {SuperMap.Geometry.MultiPoint}
  8631. * @param {Array.<SuperMap.Geometry.Point>} components - 几何对象数组。
  8632. * @example
  8633. * var point1 = new SuperMap.Geometry.Point(10,20);
  8634. * var point2 = new SuperMap.Geometry.Point(30,40);
  8635. * var curve = new SuperMap.Geometry.Curve([point1,point2]);
  8636. */
  8637. var Curve = /*#__PURE__*/function (_MultiPoint) {
  8638. Curve_inherits(Curve, _MultiPoint);
  8639. var _super = Curve_createSuper(Curve);
  8640. function Curve(components) {
  8641. var _this;
  8642. Curve_classCallCheck(this, Curve);
  8643. _this = _super.call(this, components);
  8644. /**
  8645. * @member {Array.<string>} [SuperMap.Geometry.Curve.prototype.componentType=["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"]]
  8646. * @description components 存储的的几何对象所支持的几何类型数组。
  8647. * @readonly
  8648. */
  8649. _this.componentTypes = ["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"];
  8650. _this.CLASS_NAME = "SuperMap.Geometry.Curve";
  8651. _this.geometryType = "Curve";
  8652. return _this;
  8653. }
  8654. return Curve;
  8655. }(MultiPoint);
  8656. SuperMap.Geometry.Curve = Curve;
  8657. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Point.js
  8658. function Point_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Point_typeof = function _typeof(obj) { return typeof obj; }; } else { Point_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Point_typeof(obj); }
  8659. function Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8660. 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); } }
  8661. function Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) Point_defineProperties(Constructor, staticProps); return Constructor; }
  8662. function Point_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Point_get = Reflect.get; } else { Point_get = function _get(target, property, receiver) { var base = Point_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Point_get(target, property, receiver || target); }
  8663. function Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Point_getPrototypeOf(object); if (object === null) break; } return object; }
  8664. function Point_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Point_setPrototypeOf(subClass, superClass); }
  8665. function Point_setPrototypeOf(o, p) { Point_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Point_setPrototypeOf(o, p); }
  8666. 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); }; }
  8667. function Point_possibleConstructorReturn(self, call) { if (call && (Point_typeof(call) === "object" || typeof call === "function")) { return call; } return Point_assertThisInitialized(self); }
  8668. function Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8669. function Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  8670. function Point_getPrototypeOf(o) { Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Point_getPrototypeOf(o); }
  8671. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8672. * This program are made available under the terms of the Apache License, Version 2.0
  8673. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8674. /**
  8675. * @class SuperMap.Geometry.Point
  8676. * @classdesc 点几何对象类。
  8677. * @category BaseTypes Geometry
  8678. * @extends {SuperMap.Geometry}
  8679. * @param {float} x - x 坐标。
  8680. * @param {float} y - y 坐标。
  8681. * @param {string} [type = 'Point'] - 用来存储点的类型。
  8682. * @param {float} [tag] - 用来存储额外的属性,比如差值分析中的 Z 值。
  8683. * @example
  8684. * var point = new SuperMap.Geometry.Point(-111.04, 45.68);
  8685. */
  8686. var Point = /*#__PURE__*/function (_Geometry) {
  8687. Point_inherits(Point, _Geometry);
  8688. var _super = Point_createSuper(Point);
  8689. function Point(x, y, type, tag) {
  8690. var _this;
  8691. Point_classCallCheck(this, Point);
  8692. _this = _super.call(this, x, y, type, tag);
  8693. /**
  8694. * @member {float} SuperMap.Geometry.Point.prototype.x
  8695. * @description 横坐标。
  8696. */
  8697. _this.x = parseFloat(x);
  8698. /**
  8699. * @member {float} SuperMap.Geometry.Point.prototype.y
  8700. * @description 纵坐标。
  8701. */
  8702. _this.y = parseFloat(y);
  8703. /**
  8704. * @member {string} SuperMap.Geometry.Point.prototype.tag
  8705. * @description 用来存储额外的属性,比如差值分析中的 Z 值。
  8706. */
  8707. _this.tag = tag || tag == 0 ? parseFloat(tag) : null;
  8708. /**
  8709. * @member {string} SuperMap.Geometry.Point.prototype.tag
  8710. * @description 用来存储点的类型
  8711. */
  8712. _this.type = type || "Point";
  8713. _this.CLASS_NAME = "SuperMap.Geometry.Point";
  8714. _this.geometryType = "Point";
  8715. return _this;
  8716. }
  8717. /**
  8718. * @function SuperMap.Geometry.Point.prototype.clone
  8719. * @description 克隆点对象。
  8720. * @returns {SuperMap.Geometry.Point} 克隆后的点对象。
  8721. */
  8722. Point_createClass(Point, [{
  8723. key: "clone",
  8724. value: function clone(obj) {
  8725. if (obj == null) {
  8726. obj = new Point(this.x, this.y);
  8727. } // catch any randomly tagged-on properties
  8728. Util.applyDefaults(obj, this);
  8729. return obj;
  8730. }
  8731. /**
  8732. * @function SuperMap.Geometry.Point.prototype.calculateBounds
  8733. * @description 计算点对象的范围。
  8734. */
  8735. }, {
  8736. key: "calculateBounds",
  8737. value: function calculateBounds() {
  8738. this.bounds = new Bounds(this.x, this.y, this.x, this.y);
  8739. }
  8740. /**
  8741. * @function SuperMap.Geometry.Point.prototype.equals
  8742. * @description 判断两个点对象是否相等。如果两个点对象具有相同的坐标,则认为是相等的。
  8743. * @example
  8744. * var point= new SuperMap.Geometry.Point(0,0);
  8745. * var point1={x:0,y:0};
  8746. * var result= point.equals(point1);
  8747. * @param {SuperMap.Geometry.Point} geom - 需要判断的点对象。
  8748. * @returns {boolean} 两个点对象是否相等(true 为相等,false 为不等)。
  8749. */
  8750. }, {
  8751. key: "equals",
  8752. value: function equals(geom) {
  8753. var equals = false;
  8754. if (geom != null) {
  8755. equals = this.x === geom.x && this.y === geom.y || isNaN(this.x) && isNaN(this.y) && isNaN(geom.x) && isNaN(geom.y);
  8756. }
  8757. return equals;
  8758. }
  8759. /**
  8760. * @function SuperMap.Geometry.Point.prototype.move
  8761. * @description 沿着 x、y 轴的正方向上按照给定的位移移动点对象,move 不仅改变了几何对象的位置并且清理了边界缓存。
  8762. * @param {float} x - x 轴正方向上的偏移量。
  8763. * @param {float} y - y 轴正方向上偏移量。
  8764. */
  8765. }, {
  8766. key: "move",
  8767. value: function move(x, y) {
  8768. this.x = this.x + x;
  8769. this.y = this.y + y;
  8770. this.clearBounds();
  8771. }
  8772. /**
  8773. * @function SuperMap.Geometry.Point.prototype.toShortString
  8774. * @returns {string} 字符串代表点对象。(ex. <i>"5, 42"</i>)
  8775. */
  8776. }, {
  8777. key: "toShortString",
  8778. value: function toShortString() {
  8779. return this.x + ", " + this.y;
  8780. }
  8781. /**
  8782. * @function SuperMap.Geometry.Point.prototype.destroy
  8783. * @description 释放点对象的资源。
  8784. */
  8785. }, {
  8786. key: "destroy",
  8787. value: function destroy() {
  8788. this.x = null;
  8789. this.y = null;
  8790. this.tag = null;
  8791. Point_get(Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  8792. }
  8793. /**
  8794. * @function SuperMap.Geometry.Point.prototype.getVertices
  8795. * @description 返回点对象的所有顶点的列表。
  8796. * @param {boolean} [nodes] - 对于点对象此参数不起作用,直接返回点。
  8797. * @returns {Array} 几何图形的顶点列表。
  8798. */
  8799. }, {
  8800. key: "getVertices",
  8801. value: function getVertices(nodes) {
  8802. // eslint-disable-line no-unused-vars
  8803. return [this];
  8804. }
  8805. }]);
  8806. return Point;
  8807. }(Geometry);
  8808. SuperMap.Geometry.Point = Point;
  8809. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LineString.js
  8810. function LineString_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LineString_typeof = function _typeof(obj) { return typeof obj; }; } else { LineString_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LineString_typeof(obj); }
  8811. function LineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8812. 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); } }
  8813. function LineString_createClass(Constructor, protoProps, staticProps) { if (protoProps) LineString_defineProperties(Constructor.prototype, protoProps); if (staticProps) LineString_defineProperties(Constructor, staticProps); return Constructor; }
  8814. function LineString_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { LineString_get = Reflect.get; } else { LineString_get = function _get(target, property, receiver) { var base = LineString_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return LineString_get(target, property, receiver || target); }
  8815. function LineString_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LineString_getPrototypeOf(object); if (object === null) break; } return object; }
  8816. function LineString_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) LineString_setPrototypeOf(subClass, superClass); }
  8817. function LineString_setPrototypeOf(o, p) { LineString_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LineString_setPrototypeOf(o, p); }
  8818. 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); }; }
  8819. function LineString_possibleConstructorReturn(self, call) { if (call && (LineString_typeof(call) === "object" || typeof call === "function")) { return call; } return LineString_assertThisInitialized(self); }
  8820. function LineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8821. function LineString_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  8822. function LineString_getPrototypeOf(o) { LineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LineString_getPrototypeOf(o); }
  8823. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8824. * This program are made available under the terms of the Apache License, Version 2.0
  8825. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8826. /**
  8827. * @class SuperMap.Geometry.LineString
  8828. * @classdesc 几何对象线串类。
  8829. * @category BaseTypes Geometry
  8830. * @param {Array.<SuperMap.Geometry.Point>} points - 用来生成线串的点数组。
  8831. * @extends {SuperMap.Geometry.Curve}
  8832. * @example
  8833. * var points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
  8834. * new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
  8835. * new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
  8836. * new SuperMap.Geometry.Point(5075.3145648369318, -3378.0037556404409),
  8837. * new SuperMap.Geometry.Point(5305.19551436013, -3376.9669111768926)],
  8838. * var roadLine = new SuperMap.Geometry.LineString(points);
  8839. */
  8840. var LineString = /*#__PURE__*/function (_Curve) {
  8841. LineString_inherits(LineString, _Curve);
  8842. var _super = LineString_createSuper(LineString);
  8843. function LineString(points) {
  8844. var _this;
  8845. LineString_classCallCheck(this, LineString);
  8846. _this = _super.call(this, points);
  8847. _this.CLASS_NAME = "SuperMap.Geometry.LineString";
  8848. _this.geometryType = "LineString";
  8849. return _this;
  8850. }
  8851. /**
  8852. * @function SuperMap.Geometry.LineString.prototype.removeComponent
  8853. * @description 只有在线串上有三个或更多的点的时候,才会允许移除点(否则结果将会是单一的点)。
  8854. * @param {SuperMap.Geometry.Point} point - 将被删除的点。
  8855. * @returns {boolean} 删除的点。
  8856. */
  8857. LineString_createClass(LineString, [{
  8858. key: "removeComponent",
  8859. value: function removeComponent(point) {
  8860. // eslint-disable-line no-unused-vars
  8861. var removed = this.components && this.components.length > 2;
  8862. if (removed) {
  8863. LineString_get(LineString_getPrototypeOf(LineString.prototype), "removeComponent", this).apply(this, arguments);
  8864. }
  8865. return removed;
  8866. }
  8867. /**
  8868. * @function SuperMap.Geometry.LineString.prototype.getSortedSegments
  8869. * @returns {Array} An array of segment objects. Segment objects have properties
  8870. * x1, y1, x2, and y2. The start point is represented by x1 and y1.
  8871. * The end point is represented by x2 and y2. Start and end are
  8872. * ordered so that x1 < x2.
  8873. */
  8874. }, {
  8875. key: "getSortedSegments",
  8876. value: function getSortedSegments() {
  8877. var numSeg = this.components.length - 1;
  8878. var segments = new Array(numSeg),
  8879. point1,
  8880. point2;
  8881. for (var i = 0; i < numSeg; ++i) {
  8882. point1 = this.components[i];
  8883. point2 = this.components[i + 1];
  8884. if (point1.x < point2.x) {
  8885. segments[i] = {
  8886. x1: point1.x,
  8887. y1: point1.y,
  8888. x2: point2.x,
  8889. y2: point2.y
  8890. };
  8891. } else {
  8892. segments[i] = {
  8893. x1: point2.x,
  8894. y1: point2.y,
  8895. x2: point1.x,
  8896. y2: point1.y
  8897. };
  8898. }
  8899. } // more efficient to define this somewhere static
  8900. function byX1(seg1, seg2) {
  8901. return seg1.x1 - seg2.x1;
  8902. }
  8903. return segments.sort(byX1);
  8904. }
  8905. /**
  8906. * @function SuperMap.Geometry.LineString.prototype.getVertices
  8907. * @description 返回几何图形的所有顶点的列表。
  8908. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点。如果没有设置此参数,则返回所有顶点。
  8909. * @returns {Array} 几何图形的顶点列表。
  8910. */
  8911. }, {
  8912. key: "getVertices",
  8913. value: function getVertices(nodes) {
  8914. var vertices;
  8915. if (nodes === true) {
  8916. vertices = [this.components[0], this.components[this.components.length - 1]];
  8917. } else if (nodes === false) {
  8918. vertices = this.components.slice(1, this.components.length - 1);
  8919. } else {
  8920. vertices = this.components.slice();
  8921. }
  8922. return vertices;
  8923. }
  8924. /**
  8925. * @function SuperMap.Geometry.LineString.calculateCircle
  8926. * @description 三点画圆弧。
  8927. * @param {Array.<SuperMap.Geometry.Point>} points - 传入的待计算的初始点串。
  8928. * @returns {Array.<SuperMap.Geometry.Point>} 计算出相应的圆弧控制点。
  8929. * @example
  8930. * var points = [];
  8931. * points.push(new SuperMap.Geometry.Point(-50,30));
  8932. * points.push(new SuperMap.Geometry.Point(-30,50));
  8933. * points.push(new SuperMap.Geometry.Point(2,60));
  8934. * var circle = SuperMap.Geometry.LineString.calculateCircle(points);
  8935. */
  8936. }], [{
  8937. key: "calculateCircle",
  8938. value: function calculateCircle(points) {
  8939. if (points.length < 3) {
  8940. return points;
  8941. }
  8942. var centerPoint = {},
  8943. p1 = points[0],
  8944. p2 = points[1],
  8945. p3 = points[2];
  8946. var R = 0,
  8947. dStep = 0,
  8948. direc = true,
  8949. dRotation = 0,
  8950. dRotationBegin = 0,
  8951. dRotationAngle = 0,
  8952. nSegmentCount = 72,
  8953. circlePoints = [];
  8954. var KTan13 = (p3.y - p1.y) / (p3.x - p1.x);
  8955. var B13 = p3.y - KTan13 * p3.x;
  8956. 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) {
  8957. circlePoints.push(p1);
  8958. circlePoints.push(p2);
  8959. circlePoints.push(p3);
  8960. } else {
  8961. 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));
  8962. 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));
  8963. var F = 4 * ((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y));
  8964. centerPoint.x = D / F;
  8965. centerPoint.y = E / F;
  8966. R = Math.sqrt((p1.x - centerPoint.x) * (p1.x - centerPoint.x) + (p1.y - centerPoint.y) * (p1.y - centerPoint.y));
  8967. var dis = (p1.x - p3.x) * (p1.x - p3.x) + (p1.y - p3.y) * (p1.y - p3.y);
  8968. var cons = (2 * R * R - dis) / (2 * R * R);
  8969. cons = cons >= 1 ? 1 : cons;
  8970. cons = cons <= -1 ? -1 : cons;
  8971. dRotationAngle = Math.acos(cons) * 180 / Math.PI;
  8972. if (p3.x == p1.x) {
  8973. dRotationAngle = centerPoint.x > p1.x && p2.x > p1.x || centerPoint.x < p1.x && p2.x < p1.x ? 360 - dRotationAngle : dRotationAngle;
  8974. } else {
  8975. 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;
  8976. }
  8977. dStep = dRotationAngle / 72;
  8978. if (p3.y != p1.y) {
  8979. if (p3.x == p1.x) {
  8980. if (p3.y > p1.y) {
  8981. if (p2.x < p1.x) {
  8982. direc = false;
  8983. }
  8984. } else {
  8985. if (p2.x > p1.x) {
  8986. direc = false;
  8987. }
  8988. }
  8989. } else if (p3.x < p1.x) {
  8990. if (p2.y < KTan13 * p2.x + B13) {
  8991. direc = false;
  8992. }
  8993. } else {
  8994. if (p2.y > KTan13 * p2.x + B13) {
  8995. direc = false;
  8996. }
  8997. }
  8998. } else {
  8999. if (p3.x > p1.x) {
  9000. if (p2.y > p1.y) {
  9001. direc = false;
  9002. }
  9003. } else {
  9004. if (p2.y < p1.y) {
  9005. direc = false;
  9006. }
  9007. }
  9008. }
  9009. var K10 = (p1.y - centerPoint.y) / (p1.x - centerPoint.x);
  9010. var atan10 = K10 >= 0 ? Math.atan(K10) * 180 / Math.PI : Math.abs(Math.atan(K10) * 180 / Math.PI) + 90;
  9011. var CY = Math.abs(centerPoint.y);
  9012. if (p1.y == CY && CY == p3.y) {
  9013. if (p1.x < p3.x) {
  9014. atan10 = atan10 + 180;
  9015. }
  9016. }
  9017. var newPY = p1.y - centerPoint.y;
  9018. circlePoints.push(p1);
  9019. for (var i = 1; i < nSegmentCount; i++) {
  9020. dRotation = dStep * i;
  9021. dRotationBegin = atan10;
  9022. if (direc) {
  9023. if (newPY >= 0) {
  9024. if (K10 >= 0) {
  9025. dRotationBegin = dRotationBegin + dRotation;
  9026. } else {
  9027. dRotationBegin = 180 - (dRotationBegin - 90) + dRotation;
  9028. }
  9029. } else {
  9030. if (K10 > 0) {
  9031. dRotationBegin = dRotationBegin - 180 + dRotation;
  9032. } else {
  9033. dRotationBegin = 90 - dRotationBegin + dRotation;
  9034. }
  9035. }
  9036. } else {
  9037. if (newPY >= 0) {
  9038. if (K10 >= 0) {
  9039. dRotationBegin = dRotationBegin - dRotation;
  9040. } else {
  9041. dRotationBegin = 180 - (dRotationBegin - 90) - dRotation;
  9042. }
  9043. } else {
  9044. if (K10 >= 0) {
  9045. dRotationBegin = dRotationBegin - 180 - dRotation;
  9046. } else {
  9047. dRotationBegin = 90 - dRotationBegin - dRotation;
  9048. }
  9049. }
  9050. }
  9051. dRotationBegin = dRotationBegin * Math.PI / 180;
  9052. var x = centerPoint.x + R * Math.cos(dRotationBegin);
  9053. var y = centerPoint.y + R * Math.sin(dRotationBegin);
  9054. circlePoints.push(new Point(x, y));
  9055. }
  9056. circlePoints.push(p3);
  9057. }
  9058. return circlePoints;
  9059. }
  9060. /**
  9061. * @function SuperMap.Geometry.LineString.createLineEPS
  9062. * @description 根据点的类型画出不同类型的曲线。
  9063. * 点的类型有三种:LTypeArc,LTypeCurve,NONE。
  9064. * @param {Array.<SuperMap.Geometry.Point>} points - 传入的待计算的初始点串。
  9065. * @returns {Array.<SuperMap.Geometry.Point>} 计算出相应的 lineEPS 控制点。
  9066. * @example
  9067. * var points = [];
  9068. * points.push(new SuperMap.Geometry.Point(-50,30));
  9069. * points.push(new SuperMap.Geometry.Point(-30,50,"LTypeArc"));
  9070. * points.push(new SuperMap.Geometry.Point(2,60));
  9071. * points.push(new SuperMap.Geometry.Point(8,20));
  9072. * var lineEPS = SuperMap.Geometry.LineString.createLineEPS(points);
  9073. */
  9074. }, {
  9075. key: "createLineEPS",
  9076. value: function createLineEPS(points) {
  9077. var list = [],
  9078. len = points.length;
  9079. if (len < 2) {
  9080. return points;
  9081. }
  9082. for (var i = 0; i < len;) {
  9083. var type = points[i].type;
  9084. if (type == 'LTypeArc') {
  9085. var listObj = LineString.createLineArc(list, i, len, points);
  9086. list = listObj[0];
  9087. i = listObj[1];
  9088. } else {
  9089. list.push(points[i]);
  9090. i++;
  9091. }
  9092. }
  9093. return list;
  9094. }
  9095. }, {
  9096. key: "createLineArc",
  9097. value: function createLineArc(list, i, len, points) {
  9098. if (i == 0) {
  9099. var bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  9100. Array.prototype.push.apply(list, bezierPtsObj[0]);
  9101. i = bezierPtsObj[1] + 1;
  9102. } else if (i == len - 1) {
  9103. var bezierP = [points[i - 1], points[i]],
  9104. bezierPts = LineString.calculateCircle(bezierP);
  9105. Array.prototype.push.apply(list, bezierPts);
  9106. i++;
  9107. } else {
  9108. var _bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  9109. list.pop();
  9110. Array.prototype.push.apply(list, _bezierPtsObj[0]);
  9111. i = _bezierPtsObj[1] + 1;
  9112. }
  9113. return [list, i];
  9114. }
  9115. }, {
  9116. key: "addPointEPS",
  9117. value: function addPointEPS(points, i, len, type) {
  9118. var bezierP = [],
  9119. j = i + 1;
  9120. if (i == 0) {
  9121. Array.prototype.push.apply(bezierP, [points[i], points[i + 1]]);
  9122. } else if (i == len - 1) {
  9123. Array.prototype.push.apply(bezierP, [points[i - 1], points[i]]);
  9124. } else {
  9125. Array.prototype.push.apply(bezierP, [points[i - 1], points[i], points[i + 1]]);
  9126. }
  9127. var bezierPts;
  9128. if (type == 'LTypeCurve') {
  9129. bezierPts = LineString.calculatePointsFBZN(bezierP);
  9130. } else if (type == 'LTypeArc') {
  9131. bezierPts = LineString.calculateCircle(bezierP);
  9132. }
  9133. return [bezierPts, j];
  9134. }
  9135. }]);
  9136. return LineString;
  9137. }(Curve);
  9138. SuperMap.Geometry.LineString = LineString;
  9139. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/GeoText.js
  9140. function GeoText_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoText_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoText_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoText_typeof(obj); }
  9141. function GeoText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9142. 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); } }
  9143. function GeoText_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoText_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoText_defineProperties(Constructor, staticProps); return Constructor; }
  9144. function GeoText_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoText_get = Reflect.get; } else { GeoText_get = function _get(target, property, receiver) { var base = GeoText_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeoText_get(target, property, receiver || target); }
  9145. function GeoText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoText_getPrototypeOf(object); if (object === null) break; } return object; }
  9146. function GeoText_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeoText_setPrototypeOf(subClass, superClass); }
  9147. function GeoText_setPrototypeOf(o, p) { GeoText_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoText_setPrototypeOf(o, p); }
  9148. 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); }; }
  9149. function GeoText_possibleConstructorReturn(self, call) { if (call && (GeoText_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoText_assertThisInitialized(self); }
  9150. function GeoText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9151. function GeoText_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9152. function GeoText_getPrototypeOf(o) { GeoText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoText_getPrototypeOf(o); }
  9153. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9154. * This program are made available under the terms of the Apache License, Version 2.0
  9155. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9156. /**
  9157. * @class SuperMap.Geometry.GeoText
  9158. * @classdesc 文本标签类。
  9159. * @category BaseTypes Geometry
  9160. * @extends {SuperMap.Geometry}
  9161. * @param {float} x - x 坐标。
  9162. * @param {float} y - y 坐标。
  9163. * @param {string} text - 标签中的文本内容。
  9164. */
  9165. var GeoText = /*#__PURE__*/function (_Geometry) {
  9166. GeoText_inherits(GeoText, _Geometry);
  9167. var _super = GeoText_createSuper(GeoText);
  9168. function GeoText(x, y, text) {
  9169. var _this;
  9170. GeoText_classCallCheck(this, GeoText);
  9171. _this = _super.call(this, x, y, text);
  9172. /**
  9173. * @member {float} SuperMap.Geometry.GeoText.prototype.x
  9174. * @description 横坐标。
  9175. */
  9176. _this.x = parseFloat(x);
  9177. /**
  9178. * @member {float} SuperMap.Geometry.GeoText.prototype.y
  9179. * @description 纵坐标。
  9180. */
  9181. _this.y = parseFloat(y);
  9182. /**
  9183. * @member {string} SuperMap.Geometry.GeoText.prototype.text
  9184. * @description 标签中的文本内容。
  9185. */
  9186. _this.text = text.toString();
  9187. /**
  9188. * @member {Object} SuperMap.Geometry.GeoText.prototype.bsInfo
  9189. * @description 标签范围的基础信息。
  9190. * @property {number} w - bounds 的宽。
  9191. * @property {number} h - bounds 的高度。
  9192. */
  9193. _this.bsInfo = {
  9194. "h": null,
  9195. "w": null
  9196. };
  9197. _this.element = document.createElement('span');
  9198. _this.CLASS_NAME = "SuperMap.Geometry.GeoText";
  9199. _this.geometryType = "GeoText";
  9200. return _this;
  9201. }
  9202. /**
  9203. * @function SuperMap.Geometry.GeoText.prototype.destroy
  9204. * @description 销毁文本标签类。
  9205. */
  9206. GeoText_createClass(GeoText, [{
  9207. key: "destroy",
  9208. value: function destroy() {
  9209. GeoText_get(GeoText_getPrototypeOf(GeoText.prototype), "destroy", this).call(this);
  9210. this.x = null;
  9211. this.y = null;
  9212. this.text = null;
  9213. }
  9214. /**
  9215. * @function SuperMap.Geometry.GeoText.prototype.getCentroid
  9216. * @description 获取标签对象的质心。
  9217. * @returns {SuperMap.Geometry.Point} 标签对象的质心。
  9218. */
  9219. }, {
  9220. key: "getCentroid",
  9221. value: function getCentroid() {
  9222. return new Point(this.x, this.y);
  9223. }
  9224. /**
  9225. * @function SuperMap.Geometry.GeoText.prototype.clone
  9226. * @description 克隆标签对象。
  9227. * @returns {SuperMap.Geometry.GeoText} 克隆后的标签对象。
  9228. */
  9229. }, {
  9230. key: "clone",
  9231. value: function clone(obj) {
  9232. if (obj == null) {
  9233. obj = new GeoText(this.x, this.y, this.text);
  9234. }
  9235. Util.applyDefaults(obj, this);
  9236. return obj;
  9237. }
  9238. /**
  9239. * @function SuperMap.Geometry.GeoText.prototype.calculateBounds
  9240. * @description 计算标签对象的范围。
  9241. */
  9242. }, {
  9243. key: "calculateBounds",
  9244. value: function calculateBounds() {
  9245. this.bounds = new Bounds(this.x, this.y, this.x, this.y);
  9246. }
  9247. /**
  9248. * @function SuperMap.Geometry.GeoText.prototype.getLabelPxBoundsByLabel
  9249. * @description 根据绘制好的标签获取文字标签的像素范围,参数的单位是像素;此方法相对于 getLabelPxBoundsByText 效率较低,但支持所有格式的文本。
  9250. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  9251. * @param {string} labelWidth - 标签的宽度,如:“90px”。
  9252. * @param {string} labelHeight - 标签的高度。
  9253. * @param {Object} style - 标签的 style。
  9254. * @returns {SuperMap.Bounds} 标签的像素范围。
  9255. */
  9256. }, {
  9257. key: "getLabelPxBoundsByLabel",
  9258. value: function getLabelPxBoundsByLabel(locationPixel, labelWidth, labelHeight, style) {
  9259. var labelPxBounds, left, bottom, top, right;
  9260. var locationPx = Util.cloneObject(locationPixel); //计算文本行数
  9261. var theText = style.label || this.text;
  9262. var textRows = theText.split('\n');
  9263. var laberRows = textRows.length; //处理文字对齐
  9264. labelWidth = parseFloat(labelWidth);
  9265. labelHeight = parseFloat(labelHeight);
  9266. if (laberRows > 1) {
  9267. labelHeight = parseFloat(labelHeight) * laberRows;
  9268. }
  9269. if (style.labelAlign && style.labelAlign !== "cm") {
  9270. switch (style.labelAlign) {
  9271. case "lt":
  9272. locationPx.x += labelWidth / 2;
  9273. locationPx.y += labelHeight / 2;
  9274. break;
  9275. case "lm":
  9276. locationPx.x += labelWidth / 2;
  9277. break;
  9278. case "lb":
  9279. locationPx.x += labelWidth / 2;
  9280. locationPx.y -= labelHeight / 2;
  9281. break;
  9282. case "ct":
  9283. locationPx.y += labelHeight / 2;
  9284. break;
  9285. case "cb":
  9286. locationPx.y -= labelHeight / 2;
  9287. break;
  9288. case "rt":
  9289. locationPx.x -= labelWidth / 2;
  9290. locationPx.y += labelHeight / 2;
  9291. break;
  9292. case "rm":
  9293. locationPx.x -= labelWidth / 2;
  9294. break;
  9295. case "rb":
  9296. locationPx.x -= labelWidth / 2;
  9297. locationPx.y -= labelHeight / 2;
  9298. break;
  9299. default:
  9300. break;
  9301. }
  9302. }
  9303. this.bsInfo.h = labelHeight;
  9304. this.bsInfo.w = labelWidth; //bounds的四边
  9305. left = locationPx.x - parseFloat(labelWidth) / 2;
  9306. bottom = locationPx.y + parseFloat(labelHeight) / 2;
  9307. right = locationPx.x + parseFloat(labelWidth) / 2;
  9308. top = locationPx.y - parseFloat(labelHeight) / 2;
  9309. labelPxBounds = new Bounds(left, bottom, right, top);
  9310. return labelPxBounds;
  9311. }
  9312. /**
  9313. * @function SuperMap.Geometry.GeoText.prototype.getLabelPxBoundsByText
  9314. * @description 根据文本内容获取文字标签的像素范围。
  9315. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  9316. * @param {Object} style - 标签的样式。
  9317. * @returns {SuperMap.Bounds} 标签的像素范围。
  9318. */
  9319. }, {
  9320. key: "getLabelPxBoundsByText",
  9321. value: function getLabelPxBoundsByText(locationPixel, style) {
  9322. var labelPxBounds, left, bottom, top, right;
  9323. var labelSize = this.getLabelPxSize(style);
  9324. var locationPx = Util.cloneObject(locationPixel); //处理文字对齐
  9325. if (style.labelAlign && style.labelAlign !== "cm") {
  9326. switch (style.labelAlign) {
  9327. case "lt":
  9328. locationPx.x += labelSize.w / 2;
  9329. locationPx.y += labelSize.h / 2;
  9330. break;
  9331. case "lm":
  9332. locationPx.x += labelSize.w / 2;
  9333. break;
  9334. case "lb":
  9335. locationPx.x += labelSize.w / 2;
  9336. locationPx.y -= labelSize.h / 2;
  9337. break;
  9338. case "ct":
  9339. locationPx.y += labelSize.h / 2;
  9340. break;
  9341. case "cb":
  9342. locationPx.y -= labelSize.h / 2;
  9343. break;
  9344. case "rt":
  9345. locationPx.x -= labelSize.w / 2;
  9346. locationPx.y += labelSize.h / 2;
  9347. break;
  9348. case "rm":
  9349. locationPx.x -= labelSize.w / 2;
  9350. break;
  9351. case "rb":
  9352. locationPx.x -= labelSize.w / 2;
  9353. locationPx.y -= labelSize.h / 2;
  9354. break;
  9355. default:
  9356. break;
  9357. }
  9358. }
  9359. this.bsInfo.h = labelSize.h;
  9360. this.bsInfo.w = labelSize.w;
  9361. left = locationPx.x - labelSize.w / 2;
  9362. bottom = locationPx.y + labelSize.h / 2; //处理斜体字
  9363. if (style.fontStyle && style.fontStyle === "italic") {
  9364. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  9365. } else {
  9366. right = locationPx.x + labelSize.w / 2;
  9367. }
  9368. top = locationPx.y - labelSize.h / 2;
  9369. labelPxBounds = new Bounds(left, bottom, right, top);
  9370. return labelPxBounds;
  9371. }
  9372. /**
  9373. * @function SuperMap.Geometry.GeoText.prototype.getLabelPxSize
  9374. * @description 获取 label 的像素大小。
  9375. * @param {Object} style - 标签样式。
  9376. * @returns {Object} 标签大小对象,属性 w 表示标签的宽度,属性 h 表示标签的高度。
  9377. */
  9378. }, {
  9379. key: "getLabelPxSize",
  9380. value: function getLabelPxSize(style) {
  9381. var text,
  9382. //文本内容
  9383. fontSize,
  9384. //字体大小
  9385. spacing = 1,
  9386. //两个字符间的间距(单位:px)
  9387. lineSpacing = 0.2,
  9388. bgstrokeWidth = parseFloat(style.strokeWidth); //标签背景框边框的宽度
  9389. text = style.label || this.text;
  9390. if (style.fontSize) {
  9391. fontSize = parseFloat(style.fontSize);
  9392. } else {
  9393. fontSize = parseFloat("12px");
  9394. } //标签宽高
  9395. var labelW, labelH;
  9396. var textRows = text.split('\n');
  9397. var numRows = textRows.length;
  9398. if (numRows > 1) {
  9399. labelH = fontSize * numRows + numRows + bgstrokeWidth + lineSpacing * fontSize;
  9400. } else {
  9401. labelH = fontSize + bgstrokeWidth + lineSpacing * fontSize + 1;
  9402. } //取最大宽度
  9403. labelW = 0;
  9404. if (this.labelWTmp && labelW < this.labelWTmp) {
  9405. labelW = this.labelWTmp;
  9406. }
  9407. for (var i = 0; i < numRows; i++) {
  9408. var textCharC = this.getTextCount(textRows[i]);
  9409. var labelWTmp = this.labelWTmp = Util.getTextBounds(style, textRows[i], this.element).textWidth + textCharC.textC * spacing + bgstrokeWidth;
  9410. if (labelW < labelWTmp) {
  9411. labelW = labelWTmp;
  9412. }
  9413. }
  9414. var labelSize = new Object(); //标签大小
  9415. labelSize.h = labelH;
  9416. labelSize.w = labelW;
  9417. return labelSize;
  9418. }
  9419. /**
  9420. * @function SuperMap.Geometry.GeoText.prototype.getTextCount
  9421. * @description 获取 text 中的字符个数。
  9422. * @param {string} text - 字符串。
  9423. * @returns {Object} 字符个数统计结果,属性 cnC 表示中文字符个数,属性 enC 表示英文字符个数,属性 textC 表示字符总个数。
  9424. */
  9425. }, {
  9426. key: "getTextCount",
  9427. value: function getTextCount(text) {
  9428. var textCharCount = {};
  9429. var cnCount = 0;
  9430. var enCount = 0;
  9431. for (var i = 0; i < text.length; i++) {
  9432. if (text.charCodeAt(i) > 255) {
  9433. //遍历判断字符串中每个字符的Unicode码,大于255则为中文
  9434. cnCount++;
  9435. } else {
  9436. enCount++;
  9437. }
  9438. } //中午字符个数
  9439. textCharCount.cnC = cnCount; //英文字符个数
  9440. textCharCount.enC = enCount; //字符总个数
  9441. textCharCount.textC = text.length;
  9442. return textCharCount;
  9443. }
  9444. }]);
  9445. return GeoText;
  9446. }(Geometry);
  9447. SuperMap.Geometry.GeoText = GeoText;
  9448. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LinearRing.js
  9449. function LinearRing_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LinearRing_typeof = function _typeof(obj) { return typeof obj; }; } else { LinearRing_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LinearRing_typeof(obj); }
  9450. function LinearRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9451. 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); } }
  9452. function LinearRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinearRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinearRing_defineProperties(Constructor, staticProps); return Constructor; }
  9453. function LinearRing_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { LinearRing_get = Reflect.get; } else { LinearRing_get = function _get(target, property, receiver) { var base = LinearRing_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return LinearRing_get(target, property, receiver || target); }
  9454. function LinearRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LinearRing_getPrototypeOf(object); if (object === null) break; } return object; }
  9455. function LinearRing_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) LinearRing_setPrototypeOf(subClass, superClass); }
  9456. function LinearRing_setPrototypeOf(o, p) { LinearRing_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LinearRing_setPrototypeOf(o, p); }
  9457. 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); }; }
  9458. function LinearRing_possibleConstructorReturn(self, call) { if (call && (LinearRing_typeof(call) === "object" || typeof call === "function")) { return call; } return LinearRing_assertThisInitialized(self); }
  9459. function LinearRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9460. function LinearRing_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9461. function LinearRing_getPrototypeOf(o) { LinearRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LinearRing_getPrototypeOf(o); }
  9462. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9463. * This program are made available under the terms of the Apache License, Version 2.0
  9464. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9465. /**
  9466. * @class SuperMap.Geometry.LinearRing
  9467. * @classdesc 几何对象线环类,是一个特殊的封闭的线串,在每次 addPoint/removePoint 之后会通过添加一个点(此点是复制的第一个点得到的)
  9468. * 作为最后的一个点来自动关闭线环。
  9469. * @category BaseTypes Geometry
  9470. * @extends {SuperMap.Geometry.LineString}
  9471. * @param {Array.<SuperMap.Geometry.Point>} points - 组成线性环的点。
  9472. * @example
  9473. * var points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
  9474. * new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
  9475. * new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
  9476. * new SuperMap.Geometry.Point(5075.3145648369318, -3378.0037556404409),
  9477. * new SuperMap.Geometry.Point(5305.19551436013, -3376.9669111768926)],
  9478. * var linearRing = new SuperMap.Geometry.LinearRing(points);
  9479. */
  9480. var LinearRing = /*#__PURE__*/function (_LineString) {
  9481. LinearRing_inherits(LinearRing, _LineString);
  9482. var _super = LinearRing_createSuper(LinearRing);
  9483. function LinearRing(points) {
  9484. var _this;
  9485. LinearRing_classCallCheck(this, LinearRing);
  9486. _this = _super.call(this, points);
  9487. /**
  9488. * @member {Array.<string>} [SuperMap.Geometry.LinearRing.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  9489. * @description components 存储的的几何对象所支持的几何类型数组,为空表示类型不受限制。
  9490. * @readonly
  9491. */
  9492. _this.componentTypes = ["SuperMap.Geometry.Point"];
  9493. _this.CLASS_NAME = "SuperMap.Geometry.LinearRing";
  9494. _this.geometryType = "LinearRing";
  9495. return _this;
  9496. }
  9497. /**
  9498. * @function SuperMap.Geometry.LinearRing.prototype.addComponent
  9499. * @description 添加一个点到几何图形数组中,如果这个点将要被添加到组件数组的末端,并且与数组中已经存在的最后一个点相同,
  9500. * 重复的点是不能被添加的。这将影响未关闭环的关闭。
  9501. * 这个方法可以通过将非空索引(组件数组的下标)作为第二个参数重写。
  9502. * @param {SuperMap.Geometry.Point} point - 点对象。
  9503. * @param {integer} [index] - 插入组件数组的下标。
  9504. * @returns {boolean} 点对象是否添加成功。
  9505. */
  9506. LinearRing_createClass(LinearRing, [{
  9507. key: "addComponent",
  9508. value: function addComponent(point, index) {
  9509. var added = false; //remove last point
  9510. var lastPoint = this.components.pop(); // given an index, add the point
  9511. // without an index only add non-duplicate points
  9512. if (index != null || !point.equals(lastPoint)) {
  9513. added = LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, arguments);
  9514. } //append copy of first point
  9515. var firstPoint = this.components[0];
  9516. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  9517. return added;
  9518. }
  9519. /**
  9520. * @function SuperMap.Geometry.LinearRing.prototype.removeComponent
  9521. * @description 从几何组件中删除一个点。
  9522. * @param {SuperMap.Geometry.Point} point - 点对象。
  9523. * @returns {boolean} 点对象是否删除。
  9524. */
  9525. }, {
  9526. key: "removeComponent",
  9527. value: function removeComponent(point) {
  9528. // eslint-disable-line no-unused-vars
  9529. var removed = this.components && this.components.length > 3;
  9530. if (removed) {
  9531. //remove last point
  9532. this.components.pop(); //remove our point
  9533. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "removeComponent", this).apply(this, arguments); //append copy of first point
  9534. var firstPoint = this.components[0];
  9535. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  9536. }
  9537. return removed;
  9538. }
  9539. /**
  9540. * @function SuperMap.Geometry.LinearRing.prototype.getArea
  9541. * @description 获得当前几何对象区域大小,如果是沿顺时针方向的环则是正值,否则为负值。
  9542. * @returns {float} 环的面积。
  9543. */
  9544. }, {
  9545. key: "getArea",
  9546. value: function getArea() {
  9547. var area = 0.0;
  9548. if (this.components && this.components.length > 2) {
  9549. var sum = 0.0;
  9550. for (var i = 0, len = this.components.length; i < len - 1; i++) {
  9551. var b = this.components[i];
  9552. var c = this.components[i + 1];
  9553. sum += (b.x + c.x) * (c.y - b.y);
  9554. }
  9555. area = -sum / 2.0;
  9556. }
  9557. return area;
  9558. }
  9559. /**
  9560. * @function SuperMap.Geometry.LinearRing.prototype.getVertices
  9561. * @description 返回几何图形的所有点的列表。
  9562. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false ,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  9563. * @returns {Array} 几何对象所有点的列表。
  9564. */
  9565. }, {
  9566. key: "getVertices",
  9567. value: function getVertices(nodes) {
  9568. return nodes === true ? [] : this.components.slice(0, this.components.length - 1);
  9569. }
  9570. }]);
  9571. return LinearRing;
  9572. }(LineString);
  9573. SuperMap.Geometry.LinearRing = LinearRing;
  9574. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiLineString.js
  9575. function MultiLineString_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MultiLineString_typeof = function _typeof(obj) { return typeof obj; }; } else { MultiLineString_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MultiLineString_typeof(obj); }
  9576. function MultiLineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9577. function MultiLineString_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MultiLineString_setPrototypeOf(subClass, superClass); }
  9578. function MultiLineString_setPrototypeOf(o, p) { MultiLineString_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiLineString_setPrototypeOf(o, p); }
  9579. 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); }; }
  9580. function MultiLineString_possibleConstructorReturn(self, call) { if (call && (MultiLineString_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiLineString_assertThisInitialized(self); }
  9581. function MultiLineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9582. function MultiLineString_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9583. function MultiLineString_getPrototypeOf(o) { MultiLineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiLineString_getPrototypeOf(o); }
  9584. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9585. * This program are made available under the terms of the Apache License, Version 2.0
  9586. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9587. /**
  9588. * @class SuperMap.Geometry.MultiLineString
  9589. * @classdesc 几何对象多线类。
  9590. * @category BaseTypes Geometry
  9591. * @extends {SuperMap.Geometry.Collection}
  9592. * @param {Array.<SuperMap.Geometry.LineString>} components - LineString 数组。
  9593. * @example
  9594. * var multi = new SuperMap.Geometry.MultiLineString([
  9595. * new SuperMap.Geometry.LineString([
  9596. * new SuperMap.Geometry.Point(1, 0),
  9597. * new SuperMap.Geometry.Point(0, 1)
  9598. * ])
  9599. * ]);
  9600. */
  9601. var MultiLineString = /*#__PURE__*/function (_Collection) {
  9602. MultiLineString_inherits(MultiLineString, _Collection);
  9603. var _super = MultiLineString_createSuper(MultiLineString);
  9604. function MultiLineString(components) {
  9605. var _this;
  9606. MultiLineString_classCallCheck(this, MultiLineString);
  9607. _this = _super.call(this, components);
  9608. /**
  9609. * @member {Array.<string>} [SuperMap.Geometry.MultiLineString.prototype.componentTypes=["SuperMap.Geometry.LineString"]]
  9610. * @description components 存储的的几何对象所支持的几何类型数组。
  9611. * @readonly
  9612. */
  9613. _this.componentTypes = ["SuperMap.Geometry.LineString"];
  9614. _this.CLASS_NAME = "SuperMap.Geometry.MultiLineString";
  9615. _this.geometryType = "MultiLineString";
  9616. return _this;
  9617. }
  9618. return MultiLineString;
  9619. }(Collection);
  9620. SuperMap.Geometry.MultiLineString = MultiLineString;
  9621. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPolygon.js
  9622. function MultiPolygon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MultiPolygon_typeof = function _typeof(obj) { return typeof obj; }; } else { MultiPolygon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MultiPolygon_typeof(obj); }
  9623. function MultiPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9624. function MultiPolygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MultiPolygon_setPrototypeOf(subClass, superClass); }
  9625. function MultiPolygon_setPrototypeOf(o, p) { MultiPolygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPolygon_setPrototypeOf(o, p); }
  9626. 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); }; }
  9627. function MultiPolygon_possibleConstructorReturn(self, call) { if (call && (MultiPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiPolygon_assertThisInitialized(self); }
  9628. function MultiPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9629. function MultiPolygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9630. function MultiPolygon_getPrototypeOf(o) { MultiPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPolygon_getPrototypeOf(o); }
  9631. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9632. * This program are made available under the terms of the Apache License, Version 2.0
  9633. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9634. /**
  9635. * @class SuperMap.Geometry.MultiPolygon
  9636. * @classdesc 几何对象多多边形类。
  9637. * @category BaseTypes Geometry
  9638. * @extends {SuperMap.Geometry.Collection}
  9639. * @param {Array.<SuperMap.Geometry.Polygon>} components - 形成 MultiPolygon 的多边形数组。
  9640. * @example
  9641. * var points1 = [new SuperMap.Geometry.Point(10,10),new SuperMap.Geometry.Point(0,0)];
  9642. * var points2 = [new SuperMap.Geometry.Point(10,10),new SuperMap.Geometry.Point(0,0),new SuperMap.Geometry.Point(3,3),new SuperMap.Geometry.Point(10,10)];
  9643. *
  9644. * var linearRing1 = new SuperMap.Geometry.LinearRing(points1);
  9645. * var linearRing2 = new SuperMap.Geometry.LinearRing(points2);
  9646. *
  9647. * var polygon1 = new SuperMap.Geometry.Polygon([linearRing1]);
  9648. * var polygon2 = new SuperMap.Geometry.Polygon([linearRing2]);
  9649. *
  9650. * var multiPolygon1 = new SuperMap.Geometry.MultiPolygon([polygon1,polygon2]);
  9651. */
  9652. var MultiPolygon = /*#__PURE__*/function (_Collection) {
  9653. MultiPolygon_inherits(MultiPolygon, _Collection);
  9654. var _super = MultiPolygon_createSuper(MultiPolygon);
  9655. function MultiPolygon(components) {
  9656. var _this;
  9657. MultiPolygon_classCallCheck(this, MultiPolygon);
  9658. _this = _super.call(this, components);
  9659. /**
  9660. * @member {Array.<string>} [SuperMap.Geometry.MultiPolygon.prototype.componentTypes=["SuperMap.Geometry.Polygon"]]
  9661. * @description components 存储的的几何对象所支持的几何类型数组。
  9662. * @readonly
  9663. */
  9664. _this.componentTypes = ["SuperMap.Geometry.Polygon"];
  9665. _this.CLASS_NAME = "SuperMap.Geometry.MultiPolygon";
  9666. _this.geometryType = "MultiPolygon";
  9667. return _this;
  9668. }
  9669. return MultiPolygon;
  9670. }(Collection);
  9671. SuperMap.Geometry.MultiPolygon = MultiPolygon;
  9672. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Polygon.js
  9673. function Polygon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Polygon_typeof = function _typeof(obj) { return typeof obj; }; } else { Polygon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Polygon_typeof(obj); }
  9674. function Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9675. 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); } }
  9676. function Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) Polygon_defineProperties(Constructor, staticProps); return Constructor; }
  9677. function Polygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Polygon_setPrototypeOf(subClass, superClass); }
  9678. function Polygon_setPrototypeOf(o, p) { Polygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Polygon_setPrototypeOf(o, p); }
  9679. 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); }; }
  9680. function Polygon_possibleConstructorReturn(self, call) { if (call && (Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } return Polygon_assertThisInitialized(self); }
  9681. function Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9682. function Polygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9683. function Polygon_getPrototypeOf(o) { Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Polygon_getPrototypeOf(o); }
  9684. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9685. * This program are made available under the terms of the Apache License, Version 2.0
  9686. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9687. /**
  9688. * @class SuperMap.Geometry.Polygon
  9689. * @classdesc 多边形几何对象类。
  9690. * @category BaseTypes Geometry
  9691. * @extends {SuperMap.Geometry.Collection}
  9692. * @param {Array.<SuperMap.Geometry.LinearRing>} components - 用来生成多边形的线环数组。
  9693. * @example
  9694. * var points =[new SuperMap.Geometry.Point(0,4010338),
  9695. * new SuperMap.Geometry.Point(1063524,4010338),
  9696. * new SuperMap.Geometry.Point(1063524,3150322),
  9697. * new SuperMap.Geometry.Point(0,3150322)
  9698. * ],
  9699. * var linearRings = new SuperMap.Geometry.LinearRing(points),
  9700. * var region = new SuperMap.Geometry.Polygon([linearRings]);
  9701. */
  9702. var Polygon = /*#__PURE__*/function (_Collection) {
  9703. Polygon_inherits(Polygon, _Collection);
  9704. var _super = Polygon_createSuper(Polygon);
  9705. function Polygon(components) {
  9706. var _this;
  9707. Polygon_classCallCheck(this, Polygon);
  9708. _this = _super.call(this, components);
  9709. /**
  9710. * @member {Array.<string>} [SuperMap.Geometry.Polygon.prototype.componentTypes=["SuperMap.Geometry.LinearRing"]]
  9711. * @description components 存储的的几何对象所支持的几何类型数组。
  9712. * @readonly
  9713. */
  9714. _this.componentTypes = ["SuperMap.Geometry.LinearRing"];
  9715. _this.CLASS_NAME = "SuperMap.Geometry.Polygon";
  9716. _this.geometryType = "Polygon";
  9717. return _this;
  9718. }
  9719. /**
  9720. * @function SuperMap.Geometry.Polygon.prototype.getArea
  9721. * @description 获得区域面积,从区域的外部口径减去计此区域内部口径算所得的面积。
  9722. * @returns {float} 几何对象的面积。
  9723. */
  9724. Polygon_createClass(Polygon, [{
  9725. key: "getArea",
  9726. value: function getArea() {
  9727. var area = 0.0;
  9728. if (this.components && this.components.length > 0) {
  9729. area += Math.abs(this.components[0].getArea());
  9730. for (var i = 1, len = this.components.length; i < len; i++) {
  9731. area -= Math.abs(this.components[i].getArea());
  9732. }
  9733. }
  9734. return area;
  9735. }
  9736. }]);
  9737. return Polygon;
  9738. }(Collection);
  9739. SuperMap.Geometry.Polygon = Polygon;
  9740. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Rectangle.js
  9741. function Rectangle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Rectangle_typeof = function _typeof(obj) { return typeof obj; }; } else { Rectangle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Rectangle_typeof(obj); }
  9742. function Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9743. 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); } }
  9744. function Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Rectangle_defineProperties(Constructor, staticProps); return Constructor; }
  9745. function Rectangle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Rectangle_setPrototypeOf(subClass, superClass); }
  9746. function Rectangle_setPrototypeOf(o, p) { Rectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Rectangle_setPrototypeOf(o, p); }
  9747. 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); }; }
  9748. function Rectangle_possibleConstructorReturn(self, call) { if (call && (Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return Rectangle_assertThisInitialized(self); }
  9749. function Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9750. function Rectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9751. function Rectangle_getPrototypeOf(o) { Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Rectangle_getPrototypeOf(o); }
  9752. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9753. * This program are made available under the terms of the Apache License, Version 2.0
  9754. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9755. /**
  9756. * @class SuperMap.Geometry.Rectangle
  9757. * @classdesc 矩形几何对象类。
  9758. * @category BaseTypes Geometry
  9759. * @param {float} x - 矩形左下角点的横坐标。
  9760. * @param {float} y - 矩形左下角点的纵坐标。
  9761. * @param {float} width - 矩形的宽度。
  9762. * @param {float} height - 矩形的高度。
  9763. * @extends {SuperMap.Geometry}
  9764. * @example
  9765. * //x 为矩形左下角点的横坐标;y 为矩形左下角点的纵坐标;w 为矩形的宽度;h 为矩形的高度
  9766. * var x = 1;
  9767. * var y = 2;
  9768. * var w = 10;
  9769. * var h = 20;
  9770. * var recttangle = new SuperMap.Geometry.Rectangle(x, y, w, h);
  9771. */
  9772. var Rectangle = /*#__PURE__*/function (_Geometry) {
  9773. Rectangle_inherits(Rectangle, _Geometry);
  9774. var _super = Rectangle_createSuper(Rectangle);
  9775. function Rectangle(x, y, width, height) {
  9776. var _this;
  9777. Rectangle_classCallCheck(this, Rectangle);
  9778. _this = _super.call(this, x, y, width, height);
  9779. /**
  9780. * @member {float} SuperMap.Geometry.Rectangle.prototype.x
  9781. * @description 矩形左下角点的横坐标。
  9782. */
  9783. _this.x = x;
  9784. /**
  9785. * @member {float} SuperMap.Geometry.Rectangle.prototype.y
  9786. * @description 矩形左下角点的纵坐标。
  9787. */
  9788. _this.y = y;
  9789. /**
  9790. * @member {float} SuperMap.Geometry.Rectangle.prototype.width
  9791. * @description 矩形的宽度。
  9792. */
  9793. _this.width = width;
  9794. /**
  9795. * @member {float} SuperMap.Geometry.Rectangle.prototype.height
  9796. * @description 矩形的高度。
  9797. */
  9798. _this.height = height;
  9799. _this.CLASS_NAME = "SuperMap.Geometry.Rectangle";
  9800. _this.geometryType = "Rectangle";
  9801. return _this;
  9802. }
  9803. /**
  9804. * @function SuperMap.Geometry.Rectangle.prototype.calculateBounds
  9805. * @description 计算出此矩形对象的 bounds。
  9806. */
  9807. Rectangle_createClass(Rectangle, [{
  9808. key: "calculateBounds",
  9809. value: function calculateBounds() {
  9810. this.bounds = new Bounds(this.x, this.y, this.x + this.width, this.y + this.height);
  9811. }
  9812. /**
  9813. * @function SuperMap.Geometry.Rectangle.prototype.getArea
  9814. * @description 获取矩形对象的面积。
  9815. * @returns {float} 矩形对象面积。
  9816. */
  9817. }, {
  9818. key: "getArea",
  9819. value: function getArea() {
  9820. var area = this.width * this.height;
  9821. return area;
  9822. }
  9823. }]);
  9824. return Rectangle;
  9825. }(Geometry);
  9826. SuperMap.Geometry.Rectangle = Rectangle;
  9827. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/index.js
  9828. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9829. * This program are made available under the terms of the Apache License, Version 2.0
  9830. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9831. ;// CONCATENATED MODULE: ./src/common/commontypes/Credential.js
  9832. function Credential_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9833. 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); } }
  9834. function Credential_createClass(Constructor, protoProps, staticProps) { if (protoProps) Credential_defineProperties(Constructor.prototype, protoProps); if (staticProps) Credential_defineProperties(Constructor, staticProps); return Constructor; }
  9835. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9836. * This program are made available under the terms of the Apache License, Version 2.0
  9837. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9838. /**
  9839. * @class SuperMap.Credential
  9840. * @category Security
  9841. * @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。</br>
  9842. * 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。</br>
  9843. * 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。</br>
  9844. * 目前支持的功能包括:地图服务、专题图、量算、查询、公交换乘、空间分析、网络分析,不支持轮询功能。</br>
  9845. * @param {string} value - 访问受安全限制的服务时用于通过安全认证的验证信息。
  9846. * @param {string} [name='token'] - 验证信息前缀,name=value 部分的 name 部分。
  9847. * @example
  9848. * var pixcel = new SuperMap.Credential("valueString","token");
  9849. * pixcel.destroy();
  9850. */
  9851. var Credential = /*#__PURE__*/function () {
  9852. function Credential(value, name) {
  9853. Credential_classCallCheck(this, Credential);
  9854. /**
  9855. * @member {string} SuperMap.Bounds.prototype.value
  9856. * @description 访问受安全限制的服务时用于通过安全认证的验证信息。
  9857. */
  9858. this.value = value ? value : "";
  9859. /**
  9860. * @member {string} [SuperMap.Bounds.prototype.name='token']
  9861. * @description 验证信息前缀,name=value 部分的 name 部分。
  9862. */
  9863. this.name = name ? name : "token";
  9864. this.CLASS_NAME = "SuperMap.Credential";
  9865. }
  9866. /**
  9867. * @function SuperMap.Credential.prototype.getUrlParameters
  9868. * @example
  9869. * var credential = new SuperMap.Credential("valueString","token");
  9870. * //这里 str = "token=valueString";
  9871. * var str = credential.getUrlParameters();
  9872. * @returns {string} 返回安全信息组成的 url 片段。
  9873. */
  9874. Credential_createClass(Credential, [{
  9875. key: "getUrlParameters",
  9876. value: function getUrlParameters() {
  9877. //当需要其他安全信息的时候,则需要return this.name + "=" + this.value + "&" + "...";的形式添加。
  9878. return this.name + "=" + this.value;
  9879. }
  9880. /**
  9881. * @function SuperMap.Bounds.prototype.getValue
  9882. * @description 获取 value。
  9883. * @example
  9884. * var credential = new SuperMap.Credential("2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..","token");
  9885. * //这里 str = "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..";
  9886. * var str = credential.getValue();
  9887. * @returns {string} 返回 value 字符串,在 iServer 服务下该 value 值即为 token 值。
  9888. */
  9889. }, {
  9890. key: "getValue",
  9891. value: function getValue() {
  9892. return this.value;
  9893. }
  9894. /**
  9895. *
  9896. * @function SuperMap.Credential.prototype.destroy
  9897. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  9898. * @example
  9899. * var credential = new SuperMap.Credential("valueString","token");
  9900. * credential.destroy();
  9901. */
  9902. }, {
  9903. key: "destroy",
  9904. value: function destroy() {
  9905. this.value = null;
  9906. this.name = null;
  9907. }
  9908. }]);
  9909. return Credential;
  9910. }();
  9911. /**
  9912. * @member {SuperMap.Credential} SuperMap.Credential.CREDENTIAL
  9913. * @description 这个对象保存一个安全类的实例,在服务端需要安全验证的时候必须进行设置。
  9914. * @constant
  9915. * @example
  9916. * 代码实例:
  9917. * // 当iServer启用服务安全的时候,下边的代码是必须的。安全证书类能够接收一个value和一个name参数。
  9918. * var value = "(以iServer为例,这里是申请的token值)";
  9919. * var name = "token";
  9920. * // 默认name参数为token,所以当使用iServer服务的时候可以不进行设置。
  9921. * SuperMap.Credential.CREDENTIAL = new SuperMap.Credential(value, name);
  9922. *
  9923. */
  9924. Credential.CREDENTIAL = null;
  9925. SuperMap.Credential = Credential;
  9926. ;// CONCATENATED MODULE: ./src/common/commontypes/Date.js
  9927. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9928. * This program are made available under the terms of the Apache License, Version 2.0
  9929. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9930. /**
  9931. * @name Date
  9932. * @memberOf SuperMap
  9933. * @namespace
  9934. * @category BaseTypes Util
  9935. * @description 包含 parse、toISOString 方法的实现,两个方法用来解析 RFC 3339 日期,遵循 ECMAScript 5 规范。
  9936. */
  9937. var DateExt = SuperMap.Date = {
  9938. /**
  9939. * @description 生成代表一个具体的日期字符串,该日期遵循 ISO 8601 标准(详情查看{@link http://tools.ietf.org/html/rfc3339})。
  9940. * @example
  9941. * var dateString = SuperMap.Date.toISOString(new Date());
  9942. * @param {Date} date - 日期对象。
  9943. * @returns {string} 一个代表日期的字符串。(例如 "2010-08-07T16:58:23.123Z")。
  9944. */
  9945. toISOString: function () {
  9946. //标准的Date会存在toISOString方法,可以直接调用
  9947. if ("toISOString" in Date.prototype) {
  9948. return function (date) {
  9949. return date.toISOString();
  9950. };
  9951. } else {
  9952. // 部分浏览器没有,就得自己组合,组合后的字符串规则不变
  9953. var pad = function pad(num, len) {
  9954. var str = num + "";
  9955. while (str.length < len) {
  9956. str = "0" + str;
  9957. }
  9958. return str;
  9959. };
  9960. return function (date) {
  9961. var str;
  9962. if (isNaN(date.getTime())) {
  9963. // ECMA-262 says throw RangeError, Firefox returns
  9964. // "Invalid Date"
  9965. str = "Invalid Date";
  9966. } else {
  9967. 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";
  9968. }
  9969. return str;
  9970. };
  9971. }
  9972. }(),
  9973. /**
  9974. * @description 从一个字符串生成一个日期对象。
  9975. * @example
  9976. * var date = SuperMap.Date.parse("2010-08-07");
  9977. * @param {string} str - 代表日期的字符串。(例如: "2010", "2010-08", "2010-08-07", "2010-08-07T16:58:23.123Z","2010-08-07T11:58:23.123-06")。
  9978. * @returns {Date} 日期对象,如果字符串无法被解析,则返回一个无效的日期。(例如 isNaN(date.getTime()))。
  9979. */
  9980. parse: function parse(str) {
  9981. var date;
  9982. 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)?$/);
  9983. if (match && (match[1] || match[7])) {
  9984. // must have at least year or time
  9985. var year = parseInt(match[1], 10) || 0;
  9986. var month = parseInt(match[2], 10) - 1 || 0;
  9987. var day = parseInt(match[3], 10) || 1;
  9988. date = new Date(Date.UTC(year, month, day)); // optional time
  9989. var type = match[7];
  9990. if (type) {
  9991. var hours = parseInt(match[4], 10);
  9992. var minutes = parseInt(match[5], 10);
  9993. var secFrac = parseFloat(match[6]);
  9994. var seconds = secFrac | 0;
  9995. var milliseconds = Math.round(1000 * (secFrac - seconds));
  9996. date.setUTCHours(hours, minutes, seconds, milliseconds); // check offset
  9997. if (type !== "Z") {
  9998. var hoursOffset = parseInt(type, 10);
  9999. var minutesOffset = parseInt(match[8], 10) || 0;
  10000. var offset = -1000 * (60 * (hoursOffset * 60) + minutesOffset * 60);
  10001. date = new Date(date.getTime() + offset);
  10002. }
  10003. }
  10004. } else {
  10005. date = new Date("invalid");
  10006. }
  10007. return date;
  10008. }
  10009. };
  10010. ;// CONCATENATED MODULE: ./src/common/commontypes/Event.js
  10011. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  10012. * This program are made available under the terms of the Apache License, Version 2.0
  10013. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10014. /**
  10015. * @name Event
  10016. * @memberOf SuperMap
  10017. * @namespace
  10018. * @description 事件处理函数.
  10019. */
  10020. var Event = SuperMap.Event = {
  10021. /**
  10022. * @description A hash table cache of the event observers. Keyed by element._eventCacheID
  10023. * @type {boolean}
  10024. * @default false
  10025. */
  10026. observers: false,
  10027. /**
  10028. * @description KEY_SPACE
  10029. * @type {number}
  10030. * @default 32
  10031. */
  10032. KEY_SPACE: 32,
  10033. /**
  10034. * @description KEY_BACKSPACE
  10035. * @type {number}
  10036. * @default 8
  10037. */
  10038. KEY_BACKSPACE: 8,
  10039. /**
  10040. * @description KEY_TAB
  10041. * @type {number}
  10042. * @default 9
  10043. */
  10044. KEY_TAB: 9,
  10045. /**
  10046. * @description KEY_RETURN
  10047. * @type {number}
  10048. * @default 13
  10049. */
  10050. KEY_RETURN: 13,
  10051. /**
  10052. * @description KEY_ESC
  10053. * @type {number}
  10054. * @default 27
  10055. */
  10056. KEY_ESC: 27,
  10057. /**
  10058. * @description KEY_LEFT
  10059. * @type {number}
  10060. * @default 37
  10061. */
  10062. KEY_LEFT: 37,
  10063. /**
  10064. * @description KEY_UP
  10065. * @type {number}
  10066. * @default 38
  10067. */
  10068. KEY_UP: 38,
  10069. /**
  10070. * @description KEY_RIGHT
  10071. * @type {number}
  10072. * @default 39
  10073. */
  10074. KEY_RIGHT: 39,
  10075. /**
  10076. * @description KEY_DOWN
  10077. * @type {number}
  10078. * @default 40
  10079. */
  10080. KEY_DOWN: 40,
  10081. /**
  10082. * @description KEY_DELETE
  10083. * @type {number}
  10084. * @default 46
  10085. */
  10086. KEY_DELETE: 46,
  10087. /**
  10088. * @description Cross browser event element detection.
  10089. * @param {Event} event - The event
  10090. * @returns {HTMLElement} The element that caused the event
  10091. */
  10092. element: function element(event) {
  10093. return event.target || event.srcElement;
  10094. },
  10095. /**
  10096. * @description Determine whether event was caused by a single touch
  10097. * @param {Event} event - The event
  10098. * @returns {boolean}
  10099. */
  10100. isSingleTouch: function isSingleTouch(event) {
  10101. return event.touches && event.touches.length === 1;
  10102. },
  10103. /**
  10104. * @description Determine whether event was caused by a multi touch
  10105. * @param {Event} event - The event
  10106. * @returns {boolean}
  10107. */
  10108. isMultiTouch: function isMultiTouch(event) {
  10109. return event.touches && event.touches.length > 1;
  10110. },
  10111. /**
  10112. * @description Determine whether event was caused by a left click.
  10113. * @param {Event} event - The event
  10114. * @returns {boolean}
  10115. */
  10116. isLeftClick: function isLeftClick(event) {
  10117. return event.which && event.which === 1 || event.button && event.button === 1;
  10118. },
  10119. /**
  10120. * @description Determine whether event was caused by a right mouse click.
  10121. * @param {Event} event - The event
  10122. * @returns {boolean}
  10123. */
  10124. isRightClick: function isRightClick(event) {
  10125. return event.which && event.which === 3 || event.button && event.button === 2;
  10126. },
  10127. /**
  10128. * @description Stops an event from propagating.
  10129. * @param {Event} event - The event
  10130. * @param {boolean} allowDefault - If true, we stop the event chain but still allow the default browser behaviour (text selection, radio-button clicking, etc) Default false
  10131. */
  10132. stop: function stop(event, allowDefault) {
  10133. if (!allowDefault) {
  10134. if (event.preventDefault) {
  10135. event.preventDefault();
  10136. } else {
  10137. event.returnValue = false;
  10138. }
  10139. }
  10140. if (event.stopPropagation) {
  10141. event.stopPropagation();
  10142. } else {
  10143. event.cancelBubble = true;
  10144. }
  10145. },
  10146. /**
  10147. * @param {Event} event - The event。
  10148. * @param {string} tagName - html 标签名。
  10149. * @returns {HTMLElement} The first node with the given tagName, starting from the node the event was triggered on and traversing the DOM upwards
  10150. */
  10151. findElement: function findElement(event, tagName) {
  10152. var element = SuperMap.Event.element(event);
  10153. while (element.parentNode && (!element.tagName || element.tagName.toUpperCase() != tagName.toUpperCase())) {
  10154. element = element.parentNode;
  10155. }
  10156. return element;
  10157. },
  10158. /**
  10159. * @description 监听事件,注册事件处理方法。
  10160. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  10161. * @param {string} name - 监听事件的类别名称。
  10162. * @param {function} observer - 注册的事件处理方法。
  10163. * @param {boolean} [useCapture=false] - 是否捕获。
  10164. */
  10165. observe: function observe(elementParam, name, observer, useCapture) {
  10166. var element = Util.getElement(elementParam);
  10167. useCapture = useCapture || false;
  10168. if (name === 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) {
  10169. name = 'keydown';
  10170. } //if observers cache has not yet been created, create it
  10171. if (!this.observers) {
  10172. this.observers = {};
  10173. } //if not already assigned, make a new unique cache ID
  10174. if (!element._eventCacheID) {
  10175. var idPrefix = "eventCacheID_";
  10176. if (element.id) {
  10177. idPrefix = element.id + "_" + idPrefix;
  10178. }
  10179. element._eventCacheID = Util.createUniqueID(idPrefix);
  10180. }
  10181. var cacheID = element._eventCacheID; //if there is not yet a hash entry for this element, add one
  10182. if (!this.observers[cacheID]) {
  10183. this.observers[cacheID] = [];
  10184. } //add a new observer to this element's list
  10185. this.observers[cacheID].push({
  10186. 'element': element,
  10187. 'name': name,
  10188. 'observer': observer,
  10189. 'useCapture': useCapture
  10190. }); //add the actual browser event listener
  10191. if (element.addEventListener) {
  10192. if (name === 'mousewheel') {
  10193. // https://www.chromestatus.com/features/6662647093133312
  10194. element.addEventListener(name, observer, {
  10195. useCapture: useCapture,
  10196. passive: false
  10197. });
  10198. } else {
  10199. element.addEventListener(name, observer, useCapture);
  10200. }
  10201. } else if (element.attachEvent) {
  10202. element.attachEvent('on' + name, observer);
  10203. }
  10204. },
  10205. /**
  10206. * @description Given the id of an element to stop observing, cycle through the
  10207. * element's cached observers, calling stopObserving on each one,
  10208. * skipping those entries which can no longer be removed.
  10209. *
  10210. * @param {(HTMLElement|string)} elementParam -
  10211. */
  10212. stopObservingElement: function stopObservingElement(elementParam) {
  10213. var element = Util.getElement(elementParam);
  10214. var cacheID = element._eventCacheID;
  10215. this._removeElementObservers(SuperMap.Event.observers[cacheID]);
  10216. },
  10217. /**
  10218. * @param {Array.<Object>} elementObservers - Array of (element, name,
  10219. * observer, usecapture) objects,
  10220. * taken directly from hashtable
  10221. */
  10222. _removeElementObservers: function _removeElementObservers(elementObservers) {
  10223. if (elementObservers) {
  10224. for (var i = elementObservers.length - 1; i >= 0; i--) {
  10225. var entry = elementObservers[i];
  10226. var args = new Array(entry.element, entry.name, entry.observer, entry.useCapture);
  10227. SuperMap.Event.stopObserving.apply(this, args);
  10228. }
  10229. }
  10230. },
  10231. /**
  10232. * @description 移除事件监听和注册的事件处理方法。注意:事件的移除和监听相对应,移除时的各属性信息必须监听时
  10233. * 保持一致才能确保事件移除成功。
  10234. * @param {(HTMLElement|string)} elementParam - 被监听的 DOM 元素或者其 ID。
  10235. * @param {string} name - 需要移除的被监听事件名称。
  10236. * @param {function} observer - 需要移除的事件处理方法。
  10237. * @param {boolean} [useCapture=false] - 是否捕获。
  10238. * @returns {boolean} Whether or not the event observer was removed
  10239. */
  10240. stopObserving: function stopObserving(elementParam, name, observer, useCapture) {
  10241. useCapture = useCapture || false;
  10242. var element = Util.getElement(elementParam);
  10243. var cacheID = element._eventCacheID;
  10244. if (name === 'keypress') {
  10245. if (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent) {
  10246. name = 'keydown';
  10247. }
  10248. } // find element's entry in this.observers cache and remove it
  10249. var foundEntry = false;
  10250. var elementObservers = SuperMap.Event.observers[cacheID];
  10251. if (elementObservers) {
  10252. // find the specific event type in the element's list
  10253. var i = 0;
  10254. while (!foundEntry && i < elementObservers.length) {
  10255. var cacheEntry = elementObservers[i];
  10256. if (cacheEntry.name === name && cacheEntry.observer === observer && cacheEntry.useCapture === useCapture) {
  10257. elementObservers.splice(i, 1);
  10258. if (elementObservers.length == 0) {
  10259. delete SuperMap.Event.observers[cacheID];
  10260. }
  10261. foundEntry = true;
  10262. break;
  10263. }
  10264. i++;
  10265. }
  10266. } //actually remove the event listener from browser
  10267. if (foundEntry) {
  10268. if (element.removeEventListener) {
  10269. element.removeEventListener(name, observer, useCapture);
  10270. } else if (element && element.detachEvent) {
  10271. element.detachEvent('on' + name, observer);
  10272. }
  10273. }
  10274. return foundEntry;
  10275. },
  10276. /**
  10277. * @description Cycle through all the element entries in the events cache and call
  10278. * stopObservingElement on each.
  10279. */
  10280. unloadCache: function unloadCache() {
  10281. // check for SuperMap.Event before checking for observers, because
  10282. // SuperMap.Event may be undefined in IE if no map instance was
  10283. // created
  10284. if (SuperMap.Event && SuperMap.Event.observers) {
  10285. for (var cacheID in SuperMap.Event.observers) {
  10286. var elementObservers = SuperMap.Event.observers[cacheID];
  10287. SuperMap.Event._removeElementObservers.apply(this, [elementObservers]);
  10288. }
  10289. SuperMap.Event.observers = false;
  10290. }
  10291. },
  10292. CLASS_NAME: "SuperMap.Event"
  10293. };
  10294. SuperMap.Event = Event;
  10295. /* prevent memory leaks in IE */
  10296. SuperMap.Event.observe(window, 'unload', SuperMap.Event.unloadCache, false);
  10297. ;// CONCATENATED MODULE: ./src/common/commontypes/Events.js
  10298. function Events_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Events_typeof = function _typeof(obj) { return typeof obj; }; } else { Events_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Events_typeof(obj); }
  10299. function Events_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10300. 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); } }
  10301. function Events_createClass(Constructor, protoProps, staticProps) { if (protoProps) Events_defineProperties(Constructor.prototype, protoProps); if (staticProps) Events_defineProperties(Constructor, staticProps); return Constructor; }
  10302. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  10303. * This program are made available under the terms of the Apache License, Version 2.0
  10304. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10305. /**
  10306. * @class SuperMap.Events
  10307. * @classdesc 事件类。
  10308. * @param {Object} object - 当前事件对象被添加到的 JS 对象。
  10309. * @param {HTMLElement} element - 响应浏览器事件的 DOM 元素。
  10310. * @param {Array.<string>} eventTypes - 自定义应用事件的数组。
  10311. * @param {boolean} [fallThrough=false] - 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  10312. * @param {Object} options - 事件对象选项。
  10313. */
  10314. var Events = /*#__PURE__*/function () {
  10315. function Events(object, element, eventTypes, fallThrough, options) {
  10316. Events_classCallCheck(this, Events);
  10317. /**
  10318. * @member {Array.<string>} SuperMap.Events.prototype.BROWSER_EVENTS
  10319. * @description 支持的事件。
  10320. * @constant
  10321. * @default [
  10322. "mouseover", "mouseout","mousedown", "mouseup", "mousemove",
  10323. "click", "dblclick", "rightclick", "dblrightclick","resize",
  10324. "focus", "blur","touchstart", "touchmove", "touchend","keydown",
  10325. "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
  10326. "MSGestureStart", "MSGestureChange", "MSGestureEnd","contextmenu"
  10327. ]
  10328. */
  10329. 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"];
  10330. /**
  10331. * @member {Object} SuperMap.Events.prototype.listeners
  10332. * @description Hashtable of Array(function): events listener functions
  10333. */
  10334. this.listeners = {};
  10335. /**
  10336. * @member {Object} SuperMap.Events.prototype.object
  10337. * @description 发布应用程序事件的对象。
  10338. */
  10339. this.object = object;
  10340. /**
  10341. * @member {HTMLElement} SuperMap.Events.prototype.element
  10342. * @description 接受浏览器事件的 DOM 节点。
  10343. */
  10344. this.element = null;
  10345. /**
  10346. * @member {Array.<string>} SuperMap.Events.prototype.eventTypes
  10347. * @description 支持的事件类型列表。
  10348. */
  10349. this.eventTypes = [];
  10350. /**
  10351. * @member {function} SuperMap.Events.prototype.eventHandler
  10352. * @description 绑定在元素上的事件处理器对象。
  10353. */
  10354. this.eventHandler = null;
  10355. /**
  10356. * @member {boolean} [SuperMap.Events.prototype.fallThrough=false]
  10357. * @description 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  10358. */
  10359. this.fallThrough = fallThrough;
  10360. /**
  10361. * @member {boolean} [SuperMap.Events.prototype.includeXY=false]
  10362. * @description 判断是否让 xy 属性自动创建到浏览器上的鼠标事件,一般设置为 false,如果设置为 true,鼠标事件将会在事件传递过程中自动产生 xy 属性。
  10363. * 可根据事件对象的 'evt.object' 属性在相关的事件句柄上调用 getMousePosition 函数。这个选项习惯默认为 false 的原因在于,当创建一个
  10364. * 事件对象,其主要目的是管理。在一个 div 的相对定位的鼠标事件,将其设为 true 也是有意义的。这个选项也可以用来控制是否抵消缓存。如果
  10365. * 设为 false 不抵消,如果设为 true,用 this.clearMouseCache() 清除缓存偏移(边界元素偏移,元素在页面的位置偏移)。
  10366. * @example
  10367. * function named(evt) {
  10368. * this.xy = this.object.events.getMousePosition(evt);
  10369. * }
  10370. */
  10371. this.includeXY = false;
  10372. /**
  10373. * @member {Object} SuperMap.Events.prototype.extensions
  10374. * @description 事件扩展。Keys 代表事件类型,values 代表事件对象。
  10375. * @example
  10376. * 以扩展 "foostart" 和 "fooend" 事件为例。展示替换 css 属性为 foo 的元素的 click 事件。
  10377. *
  10378. * SuperMap.Events.foostart = SuperMap.Class({
  10379. * initialize: function(target) {
  10380. * this.target = target;
  10381. * this.target.register("click", this, this.doStuff, {extension: true});
  10382. * // only required if extension provides more than one event type
  10383. * this.target.extensions["foostart"] = true;
  10384. * this.target.extensions["fooend"] = true;
  10385. * },
  10386. * destroy: function() {
  10387. * var target = this.target;
  10388. * target.unregister("click", this, this.doStuff);
  10389. * delete this.target;
  10390. * // only required if extension provides more than one event type
  10391. * delete target.extensions["foostart"];
  10392. * delete target.extensions["fooend"];
  10393. * },
  10394. * doStuff: function(evt) {
  10395. * var propagate = true;
  10396. * if (SuperMap.Event.element(evt).className === "foo") {
  10397. * propagate = false;
  10398. * var target = this.target;
  10399. * target.triggerEvent("foostart");
  10400. * window.setTimeout(function() {
  10401. * target.triggerEvent("fooend");
  10402. * }, 1000);
  10403. * }
  10404. * return propagate;
  10405. * }
  10406. * });
  10407. * // only required if extension provides more than one event type
  10408. * SuperMap.Events.fooend = SuperMap.Events.foostart;
  10409. */
  10410. this.extensions = {};
  10411. /**
  10412. * @member {Object} SuperMap.Events.prototype.extensionCount
  10413. */
  10414. this.extensionCount = {};
  10415. /**
  10416. * @member {Object} SuperMap.Events.prototype.clearMouseListener
  10417. */
  10418. this.clearMouseListener = null;
  10419. Util.extend(this, options);
  10420. if (eventTypes != null) {
  10421. for (var i = 0, len = eventTypes.length; i < len; i++) {
  10422. this.addEventType(eventTypes[i]);
  10423. }
  10424. }
  10425. if (element != null) {
  10426. this.attachToElement(element);
  10427. }
  10428. this.CLASS_NAME = "SuperMap.Events";
  10429. }
  10430. /**
  10431. * @function SuperMap.Events.prototype.destroy
  10432. * @description 移除当前要素 element 上的所有事件监听和处理。
  10433. */
  10434. Events_createClass(Events, [{
  10435. key: "destroy",
  10436. value: function destroy() {
  10437. for (var e in this.extensions) {
  10438. if (typeof this.extensions[e] !== "boolean") {
  10439. this.extensions[e].destroy();
  10440. }
  10441. }
  10442. this.extensions = null;
  10443. if (this.element) {
  10444. Event.stopObservingElement(this.element);
  10445. if (this.element.hasScrollEvent) {
  10446. Event.stopObserving(window, "scroll", this.clearMouseListener);
  10447. }
  10448. }
  10449. this.element = null;
  10450. this.listeners = null;
  10451. this.object = null;
  10452. this.eventTypes = null;
  10453. this.fallThrough = null;
  10454. this.eventHandler = null;
  10455. }
  10456. /**
  10457. * @function SuperMap.Events.prototype.addEventType
  10458. * @description 在此事件对象中添加新的事件类型,如果这个事件类型已经添加过了,则不做任何事情。
  10459. * @param {string} eventName - 事件名。
  10460. */
  10461. }, {
  10462. key: "addEventType",
  10463. value: function addEventType(eventName) {
  10464. if (!this.listeners[eventName]) {
  10465. this.eventTypes.push(eventName);
  10466. this.listeners[eventName] = [];
  10467. }
  10468. }
  10469. /**
  10470. * @function SuperMap.Events.prototype.attachToElement
  10471. * @description 给 DOM 元素绑定浏览器事件。
  10472. * @param {HTMLDOMElement} element - 绑定浏览器事件的 DOM 元素。
  10473. */
  10474. }, {
  10475. key: "attachToElement",
  10476. value: function attachToElement(element) {
  10477. if (this.element) {
  10478. Event.stopObservingElement(this.element);
  10479. } else {
  10480. // keep a bound copy of handleBrowserEvent() so that we can
  10481. // pass the same function to both Event.observe() and .stopObserving()
  10482. this.eventHandler = FunctionExt.bindAsEventListener(this.handleBrowserEvent, this); // to be used with observe and stopObserving
  10483. this.clearMouseListener = FunctionExt.bind(this.clearMouseCache, this);
  10484. }
  10485. this.element = element;
  10486. for (var i = 0, len = this.BROWSER_EVENTS.length; i < len; i++) {
  10487. var eventType = this.BROWSER_EVENTS[i]; // every browser event has a corresponding application event
  10488. // (whether it's listened for or not).
  10489. this.addEventType(eventType); // use Prototype to register the event cross-browser
  10490. Event.observe(element, eventType, this.eventHandler);
  10491. } // disable dragstart in IE so that mousedown/move/up works normally
  10492. Event.observe(element, "dragstart", Event.stop);
  10493. }
  10494. /**
  10495. * @function SuperMap.Events.prototype.on
  10496. * @description 在一个相同的范围内注册监听器的方法,此方法调用 register 函数。
  10497. * @example
  10498. * // 注册一个 "loadstart" 监听事件
  10499. * events.on({"loadstart": loadStartListener});
  10500. *
  10501. * // 同样注册一个 "loadstart" 监听事件
  10502. * events.register("loadstart", undefined, loadStartListener);
  10503. *
  10504. * // 同时为对象注册多个监听事件
  10505. * events.on({
  10506. * "loadstart": loadStartListener,
  10507. * "loadend": loadEndListener,
  10508. * scope: object
  10509. * });
  10510. *
  10511. * // 同时为对象注册多个监听事件,多次调用 register 方法
  10512. * events.register("loadstart", object, loadStartListener);
  10513. * events.register("loadend", object, loadEndListener);
  10514. *
  10515. *
  10516. * @param {Object} object - 添加监听的对象。
  10517. */
  10518. }, {
  10519. key: "on",
  10520. value: function on(object) {
  10521. for (var type in object) {
  10522. if (type !== "scope" && object.hasOwnProperty(type)) {
  10523. this.register(type, object.scope, object[type]);
  10524. }
  10525. }
  10526. }
  10527. /**
  10528. * @function SuperMap.Events.prototype.register
  10529. * @description 在事件对象上注册一个事件。当事件被触发时,'func' 函数被调用,假设我们触发一个事件,
  10530. * 指定 SuperMap.Bounds 作为 "obj",当事件被触发时,回调函数的上下文作为 Bounds 对象。
  10531. * @param {string} type - 事件注册者的名字。
  10532. * @param {Object} [obj=this.object] - 对象绑定的回调。
  10533. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  10534. * @param {(boolean|Object)} [priority] - 当为 true 时将新的监听加在事件队列的前面。
  10535. */
  10536. }, {
  10537. key: "register",
  10538. value: function register(type, obj, func, priority) {
  10539. if (type in Events && !this.extensions[type]) {
  10540. this.extensions[type] = new Events[type](this);
  10541. }
  10542. if (func != null && Util.indexOf(this.eventTypes, type) !== -1) {
  10543. if (obj == null) {
  10544. obj = this.object;
  10545. }
  10546. var listeners = this.listeners[type];
  10547. if (!listeners) {
  10548. listeners = [];
  10549. this.listeners[type] = listeners;
  10550. this.extensionCount[type] = 0;
  10551. }
  10552. var listener = {
  10553. obj: obj,
  10554. func: func
  10555. };
  10556. if (priority) {
  10557. listeners.splice(this.extensionCount[type], 0, listener);
  10558. if (Events_typeof(priority) === "object" && priority.extension) {
  10559. this.extensionCount[type]++;
  10560. }
  10561. } else {
  10562. listeners.push(listener);
  10563. }
  10564. }
  10565. }
  10566. /**
  10567. * @function SuperMap.Events.prototype.registerPriority
  10568. * @description 相同的注册方法,但是在前面增加新的监听者事件查询而代替到方法的结束。
  10569. * @param {string} type - 事件注册者的名字。
  10570. * @param {Object} [obj=this.object] - 对象绑定方面的回调。
  10571. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  10572. */
  10573. }, {
  10574. key: "registerPriority",
  10575. value: function registerPriority(type, obj, func) {
  10576. this.register(type, obj, func, true);
  10577. }
  10578. /**
  10579. * @function SuperMap.Events.prototype.un
  10580. * @description 在一个相同的范围内取消注册监听器的方法,此方法调用 unregister 函数。
  10581. * @example
  10582. * // 移除 "loadstart" 事件监听
  10583. * events.un({"loadstart": loadStartListener});
  10584. *
  10585. * // 使用 "unregister" 方法移除 "loadstart" 事件监听
  10586. * events.unregister("loadstart", undefined, loadStartListener);
  10587. *
  10588. * // 取消对象多个事件监听
  10589. * events.un({
  10590. * "loadstart": loadStartListener,
  10591. * "loadend": loadEndListener,
  10592. * scope: object
  10593. * });
  10594. *
  10595. * // 取消对象多个事件监听,多次调用unregister方法。
  10596. * events.unregister("loadstart", object, loadStartListener);
  10597. * events.unregister("loadend", object, loadEndListener);
  10598. *
  10599. * @param {Object} object - 移除监听的对象。
  10600. */
  10601. }, {
  10602. key: "un",
  10603. value: function un(object) {
  10604. for (var type in object) {
  10605. if (type !== "scope" && object.hasOwnProperty(type)) {
  10606. this.unregister(type, object.scope, object[type]);
  10607. }
  10608. }
  10609. }
  10610. /**
  10611. * @function SuperMap.Events.prototype.unregister
  10612. * @description 取消注册。
  10613. * @param {string} type - 事件类型。
  10614. * @param {Object} [obj=this.object] - 对象绑定方面的回调。
  10615. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  10616. */
  10617. }, {
  10618. key: "unregister",
  10619. value: function unregister(type, obj, func) {
  10620. if (obj == null) {
  10621. obj = this.object;
  10622. }
  10623. var listeners = this.listeners[type];
  10624. if (listeners != null) {
  10625. for (var i = 0, len = listeners.length; i < len; i++) {
  10626. if (listeners[i].obj === obj && listeners[i].func === func) {
  10627. listeners.splice(i, 1);
  10628. break;
  10629. }
  10630. }
  10631. }
  10632. }
  10633. /**
  10634. * @function SuperMap.Events.prototype.remove
  10635. * @description 删除某个事件类型的所有监听,如果该事件类型没有注册,则不做任何操作。
  10636. * @param {string} type - 事件类型。
  10637. */
  10638. }, {
  10639. key: "remove",
  10640. value: function remove(type) {
  10641. if (this.listeners[type] != null) {
  10642. this.listeners[type] = [];
  10643. }
  10644. }
  10645. /**
  10646. * @function SuperMap.Events.prototype.triggerEvent
  10647. * @description 触发一个特定的注册事件。
  10648. * @param {string} type - 触发事件类型。
  10649. * @param {Event} evt - 事件对象。
  10650. * @returns {boolean} 返回监听对象,如果返回是 false,则停止监听。
  10651. */
  10652. }, {
  10653. key: "triggerEvent",
  10654. value: function triggerEvent(type, evt) {
  10655. var listeners = this.listeners[type]; // fast path
  10656. if (!listeners || listeners.length == 0) {
  10657. return undefined;
  10658. } // prep evt object with object & div references
  10659. if (evt == null) {
  10660. evt = {};
  10661. }
  10662. evt.object = this.object;
  10663. evt.element = this.element;
  10664. if (!evt.type) {
  10665. evt.type = type;
  10666. } // execute all callbacks registered for specified type
  10667. // get a clone of the listeners array to
  10668. // allow for splicing during callbacks
  10669. listeners = listeners.slice();
  10670. var continueChain;
  10671. for (var i = 0, len = listeners.length; i < len; i++) {
  10672. var callback = listeners[i]; // bind the context to callback.obj
  10673. continueChain = callback.func.apply(callback.obj, [evt]);
  10674. if (continueChain != undefined && continueChain === false) {
  10675. // if callback returns false, execute no more callbacks.
  10676. break;
  10677. }
  10678. } // don't fall through to other DOM elements
  10679. if (!this.fallThrough) {
  10680. Event.stop(evt, true);
  10681. }
  10682. return continueChain;
  10683. }
  10684. /**
  10685. * @function SuperMap.Events.prototype.handleBrowserEvent
  10686. * @description 对 triggerEvent 函数的包装,给事件对象设置了 xy 属性(即当前鼠标点的 xy 坐标)。
  10687. * @param {Event} evt - 事件对象。
  10688. */
  10689. }, {
  10690. key: "handleBrowserEvent",
  10691. value: function handleBrowserEvent(evt) {
  10692. var type = evt.type,
  10693. listeners = this.listeners[type];
  10694. if (!listeners || listeners.length == 0) {
  10695. // noone's listening, bail out
  10696. return;
  10697. } // add clientX & clientY to all events - corresponds to average x, y
  10698. var touches = evt.touches;
  10699. if (touches && touches[0]) {
  10700. var x = 0;
  10701. var y = 0;
  10702. var num = touches.length;
  10703. var touch;
  10704. for (var i = 0; i < num; ++i) {
  10705. touch = touches[i];
  10706. x += touch.clientX;
  10707. y += touch.clientY;
  10708. }
  10709. evt.clientX = x / num;
  10710. evt.clientY = y / num;
  10711. }
  10712. if (this.includeXY) {
  10713. evt.xy = this.getMousePosition(evt);
  10714. }
  10715. this.triggerEvent(type, evt);
  10716. }
  10717. /**
  10718. * @function SuperMap.Events.prototype.clearMouseCache
  10719. * @description 清除鼠标缓存。
  10720. */
  10721. }, {
  10722. key: "clearMouseCache",
  10723. value: function clearMouseCache() {
  10724. this.element.scrolls = null;
  10725. this.element.lefttop = null;
  10726. var body = document.body;
  10727. if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) && navigator.userAgent.match(/iPhone/i))) {
  10728. this.element.offsets = null;
  10729. }
  10730. }
  10731. /**
  10732. * @function SuperMap.Events.prototype.getMousePosition
  10733. * @param {Event} evt - 事件对象。
  10734. * @returns {SuperMap.Pixel} 当前的鼠标的 xy 坐标点。
  10735. */
  10736. }, {
  10737. key: "getMousePosition",
  10738. value: function getMousePosition(evt) {
  10739. if (!this.includeXY) {
  10740. this.clearMouseCache();
  10741. } else if (!this.element.hasScrollEvent) {
  10742. Event.observe(window, "scroll", this.clearMouseListener);
  10743. this.element.hasScrollEvent = true;
  10744. }
  10745. if (!this.element.scrolls) {
  10746. var viewportElement = Util.getViewportElement();
  10747. this.element.scrolls = [viewportElement.scrollLeft, viewportElement.scrollTop];
  10748. }
  10749. if (!this.element.lefttop) {
  10750. this.element.lefttop = [document.documentElement.clientLeft || 0, document.documentElement.clientTop || 0];
  10751. }
  10752. if (!this.element.offsets) {
  10753. this.element.offsets = Util.pagePosition(this.element);
  10754. }
  10755. 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]);
  10756. }
  10757. }]);
  10758. return Events;
  10759. }();
  10760. SuperMap.Events = Events;
  10761. SuperMap.Events.prototype.BROWSER_EVENTS = ["mouseover", "mouseout", "mousedown", "mouseup", "mousemove", "click", "dblclick", "rightclick", "dblrightclick", "resize", "focus", "blur", "touchstart", "touchmove", "touchend", "keydown", "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup", "MSGestureStart", "MSGestureChange", "MSGestureEnd", "contextmenu"];
  10762. ;// CONCATENATED MODULE: ./src/common/commontypes/Feature.js
  10763. function Feature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10764. 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); } }
  10765. function Feature_createClass(Constructor, protoProps, staticProps) { if (protoProps) Feature_defineProperties(Constructor.prototype, protoProps); if (staticProps) Feature_defineProperties(Constructor, staticProps); return Constructor; }
  10766. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  10767. * This program are made available under the terms of the Apache License, Version 2.0
  10768. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10769. /**
  10770. * @class SuperMap.Feature
  10771. * @category BaseTypes Geometry
  10772. * @classdesc 要素类组合了地理和属性,Feature 类同时具有 marker 和 lonlat 属性。
  10773. * @param {SuperMap.Layer} layer - 图层。
  10774. * @param {SuperMap.LonLat} lonlat - 经纬度。
  10775. * @param {Object} data - 数据对象。
  10776. */
  10777. var Feature = /*#__PURE__*/function () {
  10778. function Feature(layer, lonlat, data) {
  10779. Feature_classCallCheck(this, Feature);
  10780. this.CLASS_NAME = "SuperMap.Feature";
  10781. /**
  10782. * @deprecated
  10783. * @member {SuperMap.Layer} SuperMap.Feature.prototype.layer
  10784. * @description 图层。
  10785. */
  10786. this.layer = layer;
  10787. /**
  10788. * @member {string} SuperMap.Feature.prototype.id
  10789. * @description 要素 ID。
  10790. */
  10791. this.id = Util.createUniqueID(this.CLASS_NAME + "_");
  10792. /**
  10793. * @member {SuperMap.LonLat} SuperMap.Feature.prototype.lonlat
  10794. * @description 经纬度。
  10795. *
  10796. */
  10797. this.lonlat = lonlat;
  10798. /**
  10799. * @member {Object} SuperMap.Feature.prototype.data
  10800. * @description 数据对象。
  10801. */
  10802. this.data = data != null ? data : {};
  10803. }
  10804. /**
  10805. * @function SuperMap.Feature.prototype.destroy
  10806. * @description 释放相关资源。
  10807. */
  10808. Feature_createClass(Feature, [{
  10809. key: "destroy",
  10810. value: function destroy() {
  10811. this.id = null;
  10812. this.lonlat = null;
  10813. this.data = null;
  10814. }
  10815. }]);
  10816. return Feature;
  10817. }();
  10818. SuperMap.Feature = Feature;
  10819. ;// CONCATENATED MODULE: ./src/common/commontypes/Vector.js
  10820. function Vector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Vector_typeof = function _typeof(obj) { return typeof obj; }; } else { Vector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Vector_typeof(obj); }
  10821. function Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10822. 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); } }
  10823. function Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Vector_defineProperties(Constructor, staticProps); return Constructor; }
  10824. function Vector_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Vector_get = Reflect.get; } else { Vector_get = function _get(target, property, receiver) { var base = Vector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Vector_get(target, property, receiver || target); }
  10825. function Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  10826. function Vector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Vector_setPrototypeOf(subClass, superClass); }
  10827. function Vector_setPrototypeOf(o, p) { Vector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Vector_setPrototypeOf(o, p); }
  10828. 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); }; }
  10829. function Vector_possibleConstructorReturn(self, call) { if (call && (Vector_typeof(call) === "object" || typeof call === "function")) { return call; } return Vector_assertThisInitialized(self); }
  10830. function Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  10831. function Vector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  10832. function Vector_getPrototypeOf(o) { Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Vector_getPrototypeOf(o); }
  10833. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  10834. * This program are made available under the terms of the Apache License, Version 2.0
  10835. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10836. /**
  10837. * @class SuperMap.Feature.Vector
  10838. * @category BaseTypes Geometry
  10839. * @classdesc 矢量要素类。该类具有 Geometry 属性存放几何信息,
  10840. * attributes 属性存放非几何信息,另外还包含了 style 属性,用来定义矢量要素的样式,
  10841. * 其中,默认的样式在 {@link SuperMap.Feature.Vector.style} 类中定义,如果没有特别的指定将使用默认的样式。
  10842. * @extends {SuperMap.Feature}
  10843. * @param {SuperMap.Geometry} geometry - 代表要素的几何形状。
  10844. * @param {Object} [attributes] - 描述要素的任意的可序列化属性,将要映射到 attributes 属性中的对象。
  10845. * @param {Object} [style] - 样式对象。
  10846. * @example
  10847. * var geometry = new SuperMap.Geometry.Point(-115,10);
  10848. * var style = {
  10849. * strokeColor:"#339933",
  10850. * strokeOpacity:1,
  10851. * strokeWidth:3,
  10852. * pointRadius:6
  10853. * }
  10854. * var pointFeature = new SuperMap.Feature.Vector(geometry,null,style);
  10855. * vectorLayer.addFeatures(pointFeature);
  10856. */
  10857. var Vector = /*#__PURE__*/function (_Feature) {
  10858. Vector_inherits(Vector, _Feature);
  10859. var _super = Vector_createSuper(Vector);
  10860. function Vector(geometry, attributes, style) {
  10861. var _this;
  10862. Vector_classCallCheck(this, Vector);
  10863. _this = _super.call(this, null, null, attributes);
  10864. /**
  10865. * @member {string} SuperMap.Feature.Vector.prototype.fid
  10866. * @description fid
  10867. */
  10868. _this.fid = null;
  10869. /**
  10870. * @member {SuperMap.Geometry} SuperMap.Feature.Vector.prototype.geometry
  10871. * @description 该属性用于存放几何信息。
  10872. */
  10873. _this.geometry = geometry ? geometry : null;
  10874. /**
  10875. * @member {Object} SuperMap.Feature.Vector.prototype.attributes
  10876. * @description 描述要素的任意的可序列化属性。
  10877. */
  10878. _this.attributes = {};
  10879. if (attributes) {
  10880. _this.attributes = Util.extend(_this.attributes, attributes);
  10881. }
  10882. /**
  10883. * @member {SuperMap.Bounds} SuperMap.Feature.Vector.prototype.bounds
  10884. * @description The box bounding that feature's geometry, that
  10885. * property can be set by an <SuperMap.Format> object when
  10886. * deserializing the feature, so in most cases it represents an
  10887. * information set by the server.
  10888. */
  10889. _this.bounds = null;
  10890. /**
  10891. * @member {string} SuperMap.Feature.Vector.prototype.state
  10892. * @description state
  10893. */
  10894. _this.state = null;
  10895. /**
  10896. * @member {Object} SuperMap.Feature.Vector.prototype.style
  10897. * @description 要素的样式属性,地图查询返回的 feature 的 style,8C 变为null。
  10898. */
  10899. _this.style = style ? style : null;
  10900. /**
  10901. * @member {string} SuperMap.Feature.Vector.prototype.url
  10902. * @description 如果设置了这个属性,在更新或者删除要素时需要考虑 {@link SuperMap.HTTP} 。
  10903. */
  10904. _this.url = null;
  10905. _this.lonlat = null;
  10906. _this.CLASS_NAME = "SuperMap.Feature.Vector"; // TRASH THIS
  10907. SuperMap.State = {
  10908. /** states */
  10909. UNKNOWN: 'Unknown',
  10910. INSERT: 'Insert',
  10911. UPDATE: 'Update',
  10912. DELETE: 'Delete'
  10913. };
  10914. Vector.style = {
  10915. 'default': {
  10916. fillColor: "#ee9900",
  10917. fillOpacity: 0.4,
  10918. hoverFillColor: "white",
  10919. hoverFillOpacity: 0.8,
  10920. strokeColor: "#ee9900",
  10921. strokeOpacity: 1,
  10922. strokeWidth: 1,
  10923. strokeLinecap: "round",
  10924. strokeDashstyle: "solid",
  10925. hoverStrokeColor: "red",
  10926. hoverStrokeOpacity: 1,
  10927. hoverStrokeWidth: 0.2,
  10928. pointRadius: 6,
  10929. hoverPointRadius: 1,
  10930. hoverPointUnit: "%",
  10931. pointerEvents: "visiblePainted",
  10932. cursor: "inherit",
  10933. fontColor: "#000000",
  10934. labelAlign: "cm",
  10935. labelOutlineColor: "white",
  10936. labelOutlineWidth: 3
  10937. },
  10938. 'select': {
  10939. fillColor: "blue",
  10940. fillOpacity: 0.4,
  10941. hoverFillColor: "white",
  10942. hoverFillOpacity: 0.8,
  10943. strokeColor: "blue",
  10944. strokeOpacity: 1,
  10945. strokeWidth: 2,
  10946. strokeLinecap: "round",
  10947. strokeDashstyle: "solid",
  10948. hoverStrokeColor: "red",
  10949. hoverStrokeOpacity: 1,
  10950. hoverStrokeWidth: 0.2,
  10951. pointRadius: 6,
  10952. hoverPointRadius: 1,
  10953. hoverPointUnit: "%",
  10954. pointerEvents: "visiblePainted",
  10955. cursor: "pointer",
  10956. fontColor: "#000000",
  10957. labelAlign: "cm",
  10958. labelOutlineColor: "white",
  10959. labelOutlineWidth: 3
  10960. },
  10961. 'temporary': {
  10962. fillColor: "#66cccc",
  10963. fillOpacity: 0.2,
  10964. hoverFillColor: "white",
  10965. hoverFillOpacity: 0.8,
  10966. strokeColor: "#66cccc",
  10967. strokeOpacity: 1,
  10968. strokeLinecap: "round",
  10969. strokeWidth: 2,
  10970. strokeDashstyle: "solid",
  10971. hoverStrokeColor: "red",
  10972. hoverStrokeOpacity: 1,
  10973. hoverStrokeWidth: 0.2,
  10974. pointRadius: 6,
  10975. hoverPointRadius: 1,
  10976. hoverPointUnit: "%",
  10977. pointerEvents: "visiblePainted",
  10978. //cursor:"inherit",
  10979. cursor: "default",
  10980. fontColor: "#000000",
  10981. labelAlign: "cm",
  10982. labelOutlineColor: "white",
  10983. labelOutlineWidth: 3
  10984. },
  10985. 'delete': {
  10986. display: "none"
  10987. }
  10988. };
  10989. return _this;
  10990. }
  10991. /**
  10992. * @function SuperMap.Feature.Vector.prototype.destroy
  10993. * @description nullify references to prevent circular references and memory leaks
  10994. */
  10995. Vector_createClass(Vector, [{
  10996. key: "destroy",
  10997. value: function destroy() {
  10998. if (this.layer) {
  10999. this.layer.removeFeatures(this);
  11000. this.layer = null;
  11001. }
  11002. this.geometry = null;
  11003. Vector_get(Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  11004. }
  11005. /**
  11006. * @function SuperMap.Feature.Vector.prototype.clone
  11007. * @description Create a clone of this vector feature. Does not set any non-standard
  11008. * properties.
  11009. * @returns {SuperMap.Feature.Vector} An exact clone of this vector feature.
  11010. */
  11011. }, {
  11012. key: "clone",
  11013. value: function clone() {
  11014. return new Vector(this.geometry ? this.geometry.clone() : null, this.attributes, this.style);
  11015. }
  11016. /**
  11017. * @function SuperMap.Feature.Vector.prototype.toState
  11018. * @description 设置新状态。
  11019. * @param {string} state - 状态。
  11020. */
  11021. }, {
  11022. key: "toState",
  11023. value: function toState(state) {
  11024. if (state === SuperMap.State.UPDATE) {
  11025. switch (this.state) {
  11026. case SuperMap.State.UNKNOWN:
  11027. case SuperMap.State.DELETE:
  11028. this.state = state;
  11029. break;
  11030. case SuperMap.State.UPDATE:
  11031. case SuperMap.State.INSERT:
  11032. break;
  11033. }
  11034. } else if (state === SuperMap.State.INSERT) {
  11035. switch (this.state) {
  11036. case SuperMap.State.UNKNOWN:
  11037. break;
  11038. default:
  11039. this.state = state;
  11040. break;
  11041. }
  11042. } else if (state === SuperMap.State.DELETE) {
  11043. switch (this.state) {
  11044. case SuperMap.State.INSERT:
  11045. // the feature should be destroyed
  11046. break;
  11047. case SuperMap.State.DELETE:
  11048. break;
  11049. case SuperMap.State.UNKNOWN:
  11050. case SuperMap.State.UPDATE:
  11051. this.state = state;
  11052. break;
  11053. }
  11054. } else if (state === SuperMap.State.UNKNOWN) {
  11055. this.state = state;
  11056. }
  11057. }
  11058. }]);
  11059. return Vector;
  11060. }(Feature);
  11061. /**
  11062. *
  11063. * @typedef {Object} SuperMap.Feature.Vector.style
  11064. * @description SuperMap.features 有大量的样式属性,如果没有特别的指定将使用默认的样式,
  11065. * 大部分样式通过 SVG 标准定义属性。
  11066. * - fill properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#FillProperties}
  11067. * - stroke properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#StrokeProperties}
  11068. * @property {boolean} [fill] - 不需要填充则设置为 false。
  11069. * @property {string} [fillColor='#ee9900'] - 十六进制填充颜色。
  11070. * @property {number} [fillOpacity=0.4] - 填充不透明度。
  11071. * @property {boolean} [stroke] - 不需要描边则设为 false。
  11072. * @property {string} [strokeColor='#ee9900'] - 十六进制描边颜色。
  11073. * @property {number} [strokeOpacity=0.4] - 描边的不透明度(0-1)。
  11074. * @property {number} [strokeWidth=1] - 像素描边宽度。
  11075. * @property {string} [strokeLinecap='round'] - strokeLinecap 有三种类型 butt,round,square。
  11076. * @property {string} [strokeDashstyle='solid'] - 有 dot,dash,dashdot,longdash,longdashdot,solid 几种样式。
  11077. * @property {boolean} [graphic] - 不需要则设置为 false。
  11078. * @property {number} [pointRadius=6] - 像素点半径。
  11079. * @property {string} [pointerEvents='visiblePainted'] - pointerEvents。
  11080. * @property {string} [cursor] - cursor。
  11081. * @property {boolean} [allowRotate='false'] - 是否允许图标随着运行方向旋转。用于时空数据图层。
  11082. * @property {string} [externalGraphic] - 连接到用来渲染点的外部的图形。
  11083. * @property {number} [graphicWidth] - 外部图表的像素宽度。
  11084. * @property {number} [graphicHeight] - 外部图表的高宽度。
  11085. * @property {number} [graphicOpacity] - 外部图表的不透明度(0-1)。
  11086. * @property {number} [graphicXOffset] - 外部图表沿着x方向的偏移量。
  11087. * @property {number} [graphicYOffset] - 外部图表沿着y方向的偏移量 Pixel。
  11088. * @property {number} [rotation] - 一个图表沿着其中心点(或者偏移中心指定点)在顺时针方向旋转。
  11089. * @property {number} [graphicZIndex] - 渲染时使用的索引值。
  11090. * @property {string} [graphicName='circle'] - 渲染点时图标使用的名字。支持"circle" , "square", "star", "x", "cross", "triangle"。
  11091. * @property {string} [graphicTitle] - 外部图表的提示框。
  11092. * @property {string} [backgroundGraphic] - 外部图表的背景。
  11093. * @property {number} [backgroundGraphicZIndex] - 背景图渲染时使用的索引值。
  11094. * @property {number} [backgroundXOffset] - 背景图在 x 轴的偏移量。
  11095. * @property {number} [backgroundYOffset] - 背景图在 y 轴的偏移量。
  11096. * @property {number} [backgroundHeight] - 背景图的高度。如果没有设置,将用 graphicHeight。
  11097. * @property {number} [backgroundWidth] - 背景图的宽度。如果没有设置,将用 graphicWidth。
  11098. * @property {boolean} [isUnicode=false] - 这个属性要配合 label 属性来用,当为 true时,label 就可以使用 unicode 编码,
  11099. * 比如 "a" 的 unicode 十六进制编码为 61,则 label 属性可以为 "&#x61;",其中 "&#" 为前缀,标志这个为 unicode 编码,
  11100. * "x" 是指 16 进制,这时页面显示的是 "a";当此值为 false 的时候,label 的内容会被直接输出,
  11101. * 比如,label 为 "&#x61;",这时页面显示的也是 "&#x61;"。
  11102. * @property {string} [label] - 可选的标签文本。
  11103. * @property {string} [labelAlign='cm'] - 标签对齐,是由两个字符组成的字符串,如:"lt", "cm", "rb",
  11104. * 其中第一个字符代表水平方向上的对齐,"l"=left, "c"=center, "r"=right;
  11105. * 第二个字符代表垂直方向上的对齐,"t"=top, "m"=middle, "b"=bottom。
  11106. * @property {number} [labelXOffset] - 标签在 x 轴方向的偏移量。
  11107. * @property {number} [labelYOffset] - 标签在 y 轴方向的偏移量。
  11108. * @property {boolean} [labelSelect=false] - 如果设为 true,标签可以选用 SelectFeature 或者 similar 控件。
  11109. * @property {string} [fontColor='#000000'] - 标签字体颜色。
  11110. * @property {number} [fontOpacity] - 标签透明度 (0-1)。
  11111. * @property {string} [fontFamily] - 标签的字体类型。
  11112. * @property {string} [fontSize] - 标签的字体大小。
  11113. * @property {string} [fontStyle] - 标签的字体样式。
  11114. * @property {string} [fontWeight] - 标签的字体粗细。
  11115. * @property {string} [display] - 如果 display 属性设置为 “none”,符号将没有任何效果。
  11116. * @example
  11117. * // label的用法如下:
  11118. * function addGeoTest(){
  11119. * var geometry = new SuperMap.Geometry.Point(105, 35);
  11120. * var pointFeature = new SuperMap.Feature.Vector(geometry);
  11121. * var styleTest = {
  11122. * label:"supermap",
  11123. * fontColor:"#0000ff",
  11124. * fontOpacity:"0.5",
  11125. * fontFamily:"隶书",
  11126. * fontSize:"8em",
  11127. * fontWeight:"bold",
  11128. * fontStyle:"italic",
  11129. * labelSelect:"true",
  11130. * }
  11131. * pointFeature.style = styleTest;
  11132. * vectorLayer.addFeatures([pointFeature]);
  11133. * }
  11134. */
  11135. SuperMap.Feature.Vector = Vector;
  11136. ;// CONCATENATED MODULE: ./src/common/commontypes/index.js
  11137. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11138. * This program are made available under the terms of the Apache License, Version 2.0
  11139. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11140. ;// CONCATENATED MODULE: ./src/common/format/Format.js
  11141. function Format_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11142. 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); } }
  11143. function Format_createClass(Constructor, protoProps, staticProps) { if (protoProps) Format_defineProperties(Constructor.prototype, protoProps); if (staticProps) Format_defineProperties(Constructor, staticProps); return Constructor; }
  11144. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11145. * This program are made available under the terms of the Apache License, Version 2.0
  11146. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11147. /**
  11148. * @class SuperMap.Format
  11149. * @classdesc 读写各种格式的格式类基类。其子类应该包含并实现 read 和 write 方法。
  11150. * @category BaseTypes Format
  11151. * @param {Object} options - 可选参数。
  11152. * @param {boolean} [options.keepData=false] - 如果设置为 true, data 属性会指向被解析的对象(例如 JSON 或 xml 数据对象)。
  11153. * @param {Object} [options.data] - 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  11154. */
  11155. var Format = /*#__PURE__*/function () {
  11156. function Format(options) {
  11157. Format_classCallCheck(this, Format);
  11158. /**
  11159. * @member {Object} SuperMap.Format.prototype.data
  11160. * @description 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  11161. */
  11162. this.data = null;
  11163. /**
  11164. * APIProperty: keepData
  11165. * @member {Object} [SuperMap.Format.prototype.keepData=false]
  11166. * @description 保持最近读到的数据的引用(通过 <data> 属性)。
  11167. */
  11168. this.keepData = false;
  11169. Util.extend(this, options);
  11170. this.options = options;
  11171. this.CLASS_NAME = "SuperMap.Format";
  11172. }
  11173. /**
  11174. * @function SuperMap.Format.prototype.destroy
  11175. * @description 销毁该格式类,释放相关资源。
  11176. */
  11177. Format_createClass(Format, [{
  11178. key: "destroy",
  11179. value: function destroy() {//用来销毁该格式类,释放相关资源
  11180. }
  11181. /**
  11182. * @function SuperMap.Format.prototype.read
  11183. * @description 来从字符串中读取数据。
  11184. * @param {string} data - 读取的数据。
  11185. */
  11186. }, {
  11187. key: "read",
  11188. value: function read(data) {// eslint-disable-line no-unused-vars
  11189. //用来从字符串中读取数据
  11190. }
  11191. /**
  11192. * @function SuperMap.Format.prototype.write
  11193. * @description 将对象写成字符串。
  11194. * @param {Object} object - 可序列化的对象。
  11195. * @returns {string} 对象被写成字符串。
  11196. */
  11197. }, {
  11198. key: "write",
  11199. value: function write(object) {// eslint-disable-line no-unused-vars
  11200. //用来写字符串
  11201. }
  11202. }]);
  11203. return Format;
  11204. }();
  11205. SuperMap.Format = SuperMap.Format || Format;
  11206. ;// CONCATENATED MODULE: ./src/common/format/JSON.js
  11207. function JSON_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { JSON_typeof = function _typeof(obj) { return typeof obj; }; } else { JSON_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return JSON_typeof(obj); }
  11208. function JSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11209. 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); } }
  11210. function JSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) JSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) JSON_defineProperties(Constructor, staticProps); return Constructor; }
  11211. function JSON_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) JSON_setPrototypeOf(subClass, superClass); }
  11212. function JSON_setPrototypeOf(o, p) { JSON_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return JSON_setPrototypeOf(o, p); }
  11213. 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); }; }
  11214. function JSON_possibleConstructorReturn(self, call) { if (call && (JSON_typeof(call) === "object" || typeof call === "function")) { return call; } return JSON_assertThisInitialized(self); }
  11215. function JSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11216. function JSON_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  11217. function JSON_getPrototypeOf(o) { JSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return JSON_getPrototypeOf(o); }
  11218. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11219. * This program are made available under the terms of the Apache License, Version 2.0
  11220. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11221. /**
  11222. * @class SuperMap.Format.JSON
  11223. * @classdesc 安全的读写 JSON 的解析类。使用 {@link SuperMap.Format.JSON} 构造函数创建新实例。
  11224. * @category BaseTypes Format
  11225. * @param {Object} [options] - 参数。
  11226. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  11227. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  11228. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  11229. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  11230. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  11231. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  11232. * @extends {SuperMap.Format}
  11233. */
  11234. var JSONFormat = /*#__PURE__*/function (_Format) {
  11235. JSON_inherits(JSONFormat, _Format);
  11236. var _super = JSON_createSuper(JSONFormat);
  11237. function JSONFormat(options) {
  11238. var _this;
  11239. JSON_classCallCheck(this, JSONFormat);
  11240. _this = _super.call(this, options);
  11241. /**
  11242. * @member {string} [SuperMap.Format.JSON.prototype.indent=" "]
  11243. * @description 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  11244. */
  11245. _this.indent = " ";
  11246. /**
  11247. * @member {string} [SuperMap.Format.JSON.prototype.space=" "]
  11248. * @description 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  11249. */
  11250. _this.space = " ";
  11251. /**
  11252. * @member {string} [SuperMap.Format.JSON.prototype.newline="\n"]
  11253. * @description 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  11254. */
  11255. _this.newline = "\n";
  11256. /**
  11257. * @member {integer} [SuperMap.Format.JSON.prototype.level=0]
  11258. * @description 用于格式化输出, 表示的是缩进级别。
  11259. */
  11260. _this.level = 0;
  11261. /**
  11262. * @member {boolean} [SuperMap.Format.JSON.prototype.pretty=false]
  11263. * @description 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  11264. */
  11265. _this.pretty = false;
  11266. /**
  11267. * @member {boolean} SuperMap.Format.JSON.prototype.nativeJSON
  11268. * @description 判断浏览器是否原生支持 JSON 格式数据。
  11269. */
  11270. _this.nativeJSON = function () {
  11271. return !!(window.JSON && typeof JSON.parse === "function" && typeof JSON.stringify === "function");
  11272. }();
  11273. _this.CLASS_NAME = "SuperMap.Format.JSON";
  11274. /**
  11275. * @member SuperMap.Format.JSON.prototype.serialize
  11276. * @description 提供一些类型对象转 JSON 字符串的方法。
  11277. */
  11278. _this.serialize = {
  11279. /**
  11280. * @function SuperMap.Format.JSON.serialize.object
  11281. * @description 把对象转换为 JSON 字符串。
  11282. * @param {Object} object - 可序列化的对象。
  11283. * @returns {string} JSON 字符串。
  11284. */
  11285. 'object': function object(_object) {
  11286. // three special objects that we want to treat differently
  11287. if (_object == null) {
  11288. return "null";
  11289. }
  11290. if (_object.constructor === Date) {
  11291. return this.serialize.date.apply(this, [_object]);
  11292. }
  11293. if (_object.constructor === Array) {
  11294. return this.serialize.array.apply(this, [_object]);
  11295. }
  11296. var pieces = ['{'];
  11297. this.level += 1;
  11298. var key, keyJSON, valueJSON;
  11299. var addComma = false;
  11300. for (key in _object) {
  11301. if (_object.hasOwnProperty(key)) {
  11302. // recursive calls need to allow for sub-classing
  11303. keyJSON = this.write.apply(this, [key, this.pretty]);
  11304. valueJSON = this.write.apply(this, [_object[key], this.pretty]);
  11305. if (keyJSON != null && valueJSON != null) {
  11306. if (addComma) {
  11307. pieces.push(',');
  11308. }
  11309. pieces.push(this.writeNewline(), this.writeIndent(), keyJSON, ':', this.writeSpace(), valueJSON);
  11310. addComma = true;
  11311. }
  11312. }
  11313. }
  11314. this.level -= 1;
  11315. pieces.push(this.writeNewline(), this.writeIndent(), '}');
  11316. return pieces.join('');
  11317. },
  11318. /**
  11319. * @function SuperMap.Format.JSON.serialize.array
  11320. * @description 把数组转换成 JSON 字符串。
  11321. * @param {Array} array - 可序列化的数组。
  11322. * @returns {string} JSON 字符串。
  11323. */
  11324. 'array': function array(_array) {
  11325. var json;
  11326. var pieces = ['['];
  11327. this.level += 1;
  11328. for (var i = 0, len = _array.length; i < len; ++i) {
  11329. // recursive calls need to allow for sub-classing
  11330. json = this.write.apply(this, [_array[i], this.pretty]);
  11331. if (json != null) {
  11332. if (i > 0) {
  11333. pieces.push(',');
  11334. }
  11335. pieces.push(this.writeNewline(), this.writeIndent(), json);
  11336. }
  11337. }
  11338. this.level -= 1;
  11339. pieces.push(this.writeNewline(), this.writeIndent(), ']');
  11340. return pieces.join('');
  11341. },
  11342. /**
  11343. * @function SuperMap.Format.JSON.serialize.string
  11344. * @description 把字符串转换成 JSON 字符串。
  11345. * @param {string} string - 可序列化的字符串。
  11346. * @returns {string} JSON 字符串。
  11347. */
  11348. 'string': function string(_string) {
  11349. // If the string contains no control characters, no quote characters, and no
  11350. // backslash characters, then we can simply slap some quotes around it.
  11351. // Otherwise we must also replace the offending characters with safe
  11352. // sequences.
  11353. var m = {
  11354. '\b': '\\b',
  11355. '\t': '\\t',
  11356. '\n': '\\n',
  11357. '\f': '\\f',
  11358. '\r': '\\r',
  11359. '"': '\\"',
  11360. '\\': '\\\\'
  11361. };
  11362. /*eslint-disable no-control-regex*/
  11363. if (/["\\\x00-\x1f]/.test(_string)) {
  11364. return '"' + _string.replace(/([\x00-\x1f\\"])/g, function (a, b) {
  11365. var c = m[b];
  11366. if (c) {
  11367. return c;
  11368. }
  11369. c = b.charCodeAt();
  11370. return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
  11371. }) + '"';
  11372. }
  11373. return '"' + _string + '"';
  11374. },
  11375. /**
  11376. * @function SuperMap.Format.JSON.serialize.number
  11377. * @description 把数字转换成 JSON 字符串。
  11378. * @param {number} number - 可序列化的数字。
  11379. * @returns {string} JSON 字符串。
  11380. */
  11381. 'number': function number(_number) {
  11382. return isFinite(_number) ? String(_number) : "null";
  11383. },
  11384. /**
  11385. * @function SuperMap.Format.JSON.serialize.boolean
  11386. * @description Transform a boolean into a JSON string.
  11387. * @param {boolean} bool - The boolean to be serialized.
  11388. * @returns {string} A JSON string representing the boolean.
  11389. */
  11390. 'boolean': function boolean(bool) {
  11391. return String(bool);
  11392. },
  11393. /**
  11394. * @function SuperMap.Format.JSON.serialize.object
  11395. * @description 将日期对象转换成 JSON 字符串。
  11396. * @param {Date} date - 可序列化的日期对象。
  11397. * @returns {string} JSON 字符串。
  11398. */
  11399. 'date': function date(_date) {
  11400. function format(number) {
  11401. // Format integers to have at least two digits.
  11402. return number < 10 ? '0' + number : number;
  11403. }
  11404. return '"' + _date.getFullYear() + '-' + format(_date.getMonth() + 1) + '-' + format(_date.getDate()) + 'T' + format(_date.getHours()) + ':' + format(_date.getMinutes()) + ':' + format(_date.getSeconds()) + '"';
  11405. }
  11406. };
  11407. return _this;
  11408. }
  11409. /**
  11410. * @function SuperMap.Format.JSON.prototype.read
  11411. * @description 将一个符合 JSON 结构的字符串进行解析。
  11412. * @param {string} json - 符合 JSON 结构的字符串。
  11413. * @param {function} filter - 过滤方法,最终结果的每一个键值对都会调用该过滤方法,并在对应的值的位置替换成该方法返回的值。
  11414. * @returns {Object} 对象,数组,字符串或数字。
  11415. */
  11416. JSON_createClass(JSONFormat, [{
  11417. key: "read",
  11418. value: function read(json, filter) {
  11419. var object;
  11420. if (this.nativeJSON) {
  11421. try {
  11422. object = JSON.parse(json, filter);
  11423. } catch (e) {// Fall through if the regexp test fails.
  11424. }
  11425. }
  11426. if (this.keepData) {
  11427. this.data = object;
  11428. }
  11429. return object;
  11430. }
  11431. /**
  11432. * @function SuperMap.Format.JSON.prototype.write
  11433. * @description 序列化一个对象到一个符合 JSON 格式的字符串。
  11434. * @param {(object|string|Array|number|boolean)} value - 需要被序列化的对象,数组,字符串,数字,布尔值。
  11435. * @param {boolean} [pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  11436. * @returns {string} 符合 JSON 格式的字符串。
  11437. *
  11438. */
  11439. }, {
  11440. key: "write",
  11441. value: function write(value, pretty) {
  11442. this.pretty = !!pretty;
  11443. var json = null;
  11444. var type = JSON_typeof(value);
  11445. if (this.serialize[type]) {
  11446. try {
  11447. json = !this.pretty && this.nativeJSON ? JSON.stringify(value) : this.serialize[type].apply(this, [value]);
  11448. } catch (err) {//SuperMap.Console.error("Trouble serializing: " + err);
  11449. }
  11450. }
  11451. return json;
  11452. }
  11453. /**
  11454. * @function SuperMap.Format.JSON.prototype.writeIndent
  11455. * @description 根据缩进级别输出一个缩进字符串。
  11456. * @private
  11457. * @returns {string} 一个适当的缩进字符串。
  11458. */
  11459. }, {
  11460. key: "writeIndent",
  11461. value: function writeIndent() {
  11462. var pieces = [];
  11463. if (this.pretty) {
  11464. for (var i = 0; i < this.level; ++i) {
  11465. pieces.push(this.indent);
  11466. }
  11467. }
  11468. return pieces.join('');
  11469. }
  11470. /**
  11471. * @function SuperMap.Format.JSON.prototype.writeNewline
  11472. * @description 在格式化输出模式情况下输出代表新一行的字符串。
  11473. * @private
  11474. * @returns {string} 代表新的一行的字符串。
  11475. */
  11476. }, {
  11477. key: "writeNewline",
  11478. value: function writeNewline() {
  11479. return this.pretty ? this.newline : '';
  11480. }
  11481. /**
  11482. * @function SuperMap.Format.JSON.prototype.writeSpace
  11483. * @private
  11484. * @description 在格式化输出模式情况下输出一个代表空格的字符串。
  11485. * @returns {string} 一个空格。
  11486. */
  11487. }, {
  11488. key: "writeSpace",
  11489. value: function writeSpace() {
  11490. return this.pretty ? this.space : '';
  11491. }
  11492. }]);
  11493. return JSONFormat;
  11494. }(Format);
  11495. SuperMap.Format.JSON = JSONFormat;
  11496. ;// CONCATENATED MODULE: ./src/common/iServer/ServerColor.js
  11497. function ServerColor_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11498. 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); } }
  11499. function ServerColor_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerColor_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerColor_defineProperties(Constructor, staticProps); return Constructor; }
  11500. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11501. * This program are made available under the terms of the Apache License, Version 2.0
  11502. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11503. /**
  11504. * @class SuperMap.ServerColor
  11505. * @category iServer Map Theme
  11506. * @classdesc 颜色类。该类使用三原色( RGB )来表达颜色。
  11507. * @param {Object} options - 参数。
  11508. * @param {number} [options.red=255] - 获取或设置红色值。
  11509. * @param {number} [options.green=0] - 获取或设置绿色值。
  11510. * @param {number} [options.blue=0] - 获取或设置蓝色值。
  11511. */
  11512. var ServerColor = /*#__PURE__*/function () {
  11513. function ServerColor(red, green, blue) {
  11514. ServerColor_classCallCheck(this, ServerColor);
  11515. /**
  11516. * @member {number} [SuperMap.ServerColor.prototype.red=255]
  11517. * @description 获取或设置红色值。
  11518. */
  11519. this.red = !red && red != 0 ? 255 : red;
  11520. /**
  11521. * @member {number} [SuperMap.ServerColor.prototype.green=0]
  11522. * @description 获取或设置绿色值。
  11523. */
  11524. this.green = green || 0;
  11525. /**
  11526. * @member {number} [SuperMap.ServerColor.prototype.blue=0]
  11527. * @description 获取或设置蓝色值。
  11528. */
  11529. this.blue = blue || 0;
  11530. this.CLASS_NAME = "SuperMap.ServerColor";
  11531. }
  11532. /**
  11533. * @function SuperMap.ServerColor.prototype.destroy
  11534. * @description 释放资源,将引用资源的属性置空。
  11535. */
  11536. ServerColor_createClass(ServerColor, [{
  11537. key: "destroy",
  11538. value: function destroy() {
  11539. var me = this;
  11540. me.red = null;
  11541. me.green = null;
  11542. me.blue = null;
  11543. }
  11544. /**
  11545. * @function SuperMap.ServerColor.formJson
  11546. * @description 将 JSON 对象转化为 ServerColor 对象。
  11547. * @param {Object} jsonObject - 要转换的 JSON 对象。
  11548. * @returns {SuperMap.ServerColor} 转化后的 ServerColor 对象。
  11549. */
  11550. }], [{
  11551. key: "fromJson",
  11552. value: function fromJson(jsonObject) {
  11553. if (!jsonObject) {
  11554. return;
  11555. }
  11556. var color = new ServerColor();
  11557. var red = 255;
  11558. if (jsonObject.red !== null) {
  11559. red = Number(jsonObject.red);
  11560. }
  11561. color.red = red;
  11562. var green = 0;
  11563. if (jsonObject.green !== null) {
  11564. green = Number(jsonObject.green);
  11565. }
  11566. color.green = green;
  11567. var blue = 0;
  11568. if (jsonObject.blue !== null) {
  11569. blue = Number(jsonObject.blue);
  11570. }
  11571. color.blue = blue;
  11572. return color;
  11573. }
  11574. }]);
  11575. return ServerColor;
  11576. }();
  11577. SuperMap.ServerColor = ServerColor;
  11578. ;// CONCATENATED MODULE: ./src/common/iServer/ServerStyle.js
  11579. function ServerStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11580. 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); } }
  11581. function ServerStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerStyle_defineProperties(Constructor, staticProps); return Constructor; }
  11582. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11583. * This program are made available under the terms of the Apache License, Version 2.0
  11584. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11585. /**
  11586. * @class SuperMap.ServerStyle
  11587. * @category iServer Map Theme
  11588. * @classdesc 服务端矢量要素风格类。
  11589. * @description 该类用于定义点状符号、线状符号、填充符号风格及其相关属性。
  11590. * @param {Object} options - 参数。
  11591. * @param {SuperMap.FillGradientMode} options.fillGradientMode - 渐变填充风格的渐变类型。
  11592. * @param {SuperMap.ServerColor} [options.fillBackColor=[255,255,255]] - 填充背景颜色。
  11593. * @param {boolean} [options.fillBackOpaque=false] - 背景是否不透明。
  11594. * @param {SuperMap.ServerColor} [options.fillForeColor=[255,0,0]] - 填充颜色。
  11595. * @param {number} [options.fillGradientAngle=0] - 渐变填充的旋转角度。
  11596. * @param {number} [options.fillGradientOffsetRatioX=0] - 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。
  11597. * @param {number} [options.fillGradientOffsetRatioY=0] - 填充中心点相对于填充区域范围中心点的垂直偏移百分比。
  11598. * @param {number} [options.fillOpaqueRate=100] - 填充不透明度。
  11599. * @param {number} [options.fillSymbolID=0] - 填充符号的编码。
  11600. * @param {SuperMap.ServerColor} [options.lineColor] - 矢量要素的边线颜色。默认 lineColor = new ServerColor(0, 0, 0)。
  11601. * @param {number} [options.lineSymbolID=0] - 线状符号的编码。
  11602. * @param {number} [options.lineWidth=1] - 边线的宽度。
  11603. * @param {number} [options.markerAngle=0] - 点状符号的旋转角度。
  11604. * @param {number} [options.markerSize=1] - 点状符号的大小。
  11605. * @param {number} [options.markerSymbolID=-1] - 点状符号的编码。
  11606. */
  11607. var ServerStyle = /*#__PURE__*/function () {
  11608. function ServerStyle(options) {
  11609. ServerStyle_classCallCheck(this, ServerStyle);
  11610. /**
  11611. * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.fillBackColor
  11612. * @description 填充背景颜色。当填充模式为渐变填充时,该颜色为填充终止色。
  11613. */
  11614. this.fillBackColor = new ServerColor(255, 255, 255);
  11615. /**
  11616. * @member {boolean} [SuperMap.ServerStyle.prototype.fillBackOpaque=false]
  11617. * @description 背景是否不透明。false 表示透明。
  11618. */
  11619. this.fillBackOpaque = false;
  11620. /**
  11621. * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.fillForeColor
  11622. * @description 填充颜色。当填充模式为渐变填充时,该颜色为填充起始颜色。
  11623. */
  11624. this.fillForeColor = new ServerColor(255, 0, 0);
  11625. /**
  11626. * @member {SuperMap.FillGradientMode} SuperMap.ServerStyle.prototype.fillGradientMode
  11627. * @description 渐变填充风格的渐变类型。
  11628. */
  11629. this.fillGradientMode = null;
  11630. /**
  11631. * @member {number} SuperMap.ServerStyle.prototype.fillGradientAngle -
  11632. * @description 渐变填充的旋转角度。单位为度,精确到 0.1 度,逆时针方向为正方向。
  11633. */
  11634. this.fillGradientAngle = 0;
  11635. /**
  11636. * @member {number} SuperMap.ServerStyle.prototype.fillGradientOffsetRatioX
  11637. * @description 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。它们的关系如下:设填充区域范围中心点的坐标为(x0, y0),
  11638. * 填充中心点的坐标为(x, y),填充区域范围的宽度为 a,水平偏移百分比为 dx,则 x=x0 + a*dx/100。
  11639. */
  11640. this.fillGradientOffsetRatioX = 0;
  11641. /**
  11642. * @member {number} SuperMap.ServerStyle.prototype.fillGradientOffsetRatioY
  11643. * @description 填充中心点相对于填充区域范围中心点的垂直偏移百分比。它们的关系如下:<br>
  11644. * 设填充区域范围中心点的坐标为(x0, y0),填充中心点的坐标为(x, y),填充区域范围的高度为 b,垂直偏移百分比为 dy,则 y=y0 + b*dx/100。
  11645. */
  11646. this.fillGradientOffsetRatioY = 0;
  11647. /**
  11648. * @member {number} [SuperMap.ServerStyle.prototype.fillOpaqueRate=100]
  11649. * @description 填充不透明度。合法值为 0 - 100 的数值。其中为 0 表示完全透明;
  11650. * 100 表示完全不透明。赋值小于 0 时按照 0 处理,大于 100 时按照 100 处理。
  11651. */
  11652. this.fillOpaqueRate = 100;
  11653. /**
  11654. * @member {number} SuperMap.ServerStyle.prototype.fillSymbolID
  11655. * @description 填充符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  11656. * 关于填充符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  11657. */
  11658. this.fillSymbolID = 0;
  11659. /**
  11660. * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.lineColor
  11661. * @description 矢量要素的边线颜色。如果等级符号是点符号,点符号的颜色由 lineColor 控制。
  11662. */
  11663. this.lineColor = new ServerColor(0, 0, 0);
  11664. /**
  11665. * @member {number} [SuperMap.ServerStyle.prototype.lineSymbolID=0]
  11666. * @description 线状符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  11667. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  11668. */
  11669. this.lineSymbolID = 0;
  11670. /**
  11671. * @member {number} [SuperMap.ServerStyle.prototype.lineWidth=1.0]
  11672. * @description 边线的宽度。单位为毫米,精度到 0.1。
  11673. */
  11674. this.lineWidth = 1;
  11675. /**
  11676. * @member {number} [SuperMap.ServerStyle.prototype.markerAngle=0]
  11677. * @description 点状符号的旋转角度。以度为单位,精确到 0.1 度,逆时针方向为正方向。
  11678. */
  11679. this.markerAngle = 0;
  11680. /**
  11681. * @member {number} [SuperMap.ServerStyle.prototype.markerSize=1.0]
  11682. * @description 点状符号的大小。单位为毫米,精度为 0.1。当该属性设置为0时,采用符号默认大小 1.0 显示。
  11683. * 当该属性设置为非法值时,交由服务器默认处理。
  11684. */
  11685. this.markerSize = 1;
  11686. /**
  11687. * @member {number} [SuperMap.ServerStyle.prototype.markerSymbolID=-1]
  11688. * @description 点状符号的编码。此编码用于唯一标识各点状符号。
  11689. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  11690. */
  11691. this.markerSymbolID = -1;
  11692. if (options) {
  11693. Util.extend(this, options);
  11694. }
  11695. this.CLASS_NAME = "SuperMap.ServerStyle";
  11696. }
  11697. /**
  11698. * @function SuperMap.ServerStyle.prototype.destroy
  11699. * @description 释放资源,将引用资源的属性置空。
  11700. */
  11701. ServerStyle_createClass(ServerStyle, [{
  11702. key: "destroy",
  11703. value: function destroy() {
  11704. var me = this;
  11705. if (me.fillBackColor) {
  11706. me.fillBackColor.destroy();
  11707. me.fillBackColor = null;
  11708. }
  11709. me.fillBackOpaque = null;
  11710. if (me.fillForeColor) {
  11711. me.fillForeColor.destroy();
  11712. me.fillForeColor = null;
  11713. }
  11714. me.fillGradientMode = null;
  11715. me.fillGradientAngle = null;
  11716. me.fillGradientOffsetRatioX = null;
  11717. me.fillGradientOffsetRatioY = null;
  11718. me.fillOpaqueRate = null;
  11719. me.fillSymbolID = null;
  11720. if (me.lineColor) {
  11721. me.lineColor.destroy();
  11722. me.lineColor = null;
  11723. }
  11724. me.lineSymbolID = null;
  11725. me.lineWidth = null;
  11726. me.markerAngle = null;
  11727. me.markerSize = null;
  11728. me.markerSymbolID = null;
  11729. }
  11730. /**
  11731. * @function SuperMap.ServerStyle.prototype.toServerJSONObject
  11732. * @description 转换成对应的 JSON 格式对象。
  11733. * @returns {Object} 对应的 JSON 格式对象.
  11734. */
  11735. }, {
  11736. key: "toServerJSONObject",
  11737. value: function toServerJSONObject() {
  11738. var styleObj = {};
  11739. styleObj = Util.copyAttributes(styleObj, this); //暂时先忽略serverColor往Json的转换
  11740. return styleObj;
  11741. }
  11742. /**
  11743. * @function SuperMap.ServerStyle.fromJson
  11744. * @description 将JSON对象转换为 SuperMap.ServerStyle 对象。
  11745. * @param jsonObject - {Object} 要转换的 JSON 对象。
  11746. * @returns {SuperMap.ServerStyle} 转化后的 SuperMap.ServerStyle 对象。
  11747. */
  11748. }], [{
  11749. key: "fromJson",
  11750. value: function fromJson(jsonObject) {
  11751. if (!jsonObject) {
  11752. return;
  11753. }
  11754. return new ServerStyle({
  11755. fillBackColor: ServerColor.fromJson(jsonObject.fillBackColor),
  11756. fillBackOpaque: jsonObject.fillBackOpaque,
  11757. fillForeColor: ServerColor.fromJson(jsonObject.fillForeColor),
  11758. fillGradientMode: jsonObject.fillGradientMode,
  11759. fillGradientAngle: jsonObject.fillGradientAngle,
  11760. fillGradientOffsetRatioX: jsonObject.fillGradientOffsetRatioX,
  11761. fillGradientOffsetRatioY: jsonObject.fillGradientOffsetRatioY,
  11762. fillOpaqueRate: jsonObject.fillOpaqueRate,
  11763. fillSymbolID: jsonObject.fillSymbolID,
  11764. lineColor: ServerColor.fromJson(jsonObject.lineColor),
  11765. lineSymbolID: jsonObject.lineSymbolID,
  11766. lineWidth: jsonObject.lineWidth,
  11767. markerAngle: jsonObject.markerAngle,
  11768. markerSize: jsonObject.markerSize,
  11769. markerSymbolID: jsonObject.markerSymbolID
  11770. });
  11771. }
  11772. }]);
  11773. return ServerStyle;
  11774. }();
  11775. SuperMap.ServerStyle = ServerStyle;
  11776. ;// CONCATENATED MODULE: ./src/common/iServer/PointWithMeasure.js
  11777. function PointWithMeasure_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { PointWithMeasure_typeof = function _typeof(obj) { return typeof obj; }; } else { PointWithMeasure_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return PointWithMeasure_typeof(obj); }
  11778. function PointWithMeasure_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11779. 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); } }
  11780. function PointWithMeasure_createClass(Constructor, protoProps, staticProps) { if (protoProps) PointWithMeasure_defineProperties(Constructor.prototype, protoProps); if (staticProps) PointWithMeasure_defineProperties(Constructor, staticProps); return Constructor; }
  11781. function PointWithMeasure_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) PointWithMeasure_setPrototypeOf(subClass, superClass); }
  11782. function PointWithMeasure_setPrototypeOf(o, p) { PointWithMeasure_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PointWithMeasure_setPrototypeOf(o, p); }
  11783. 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); }; }
  11784. function PointWithMeasure_possibleConstructorReturn(self, call) { if (call && (PointWithMeasure_typeof(call) === "object" || typeof call === "function")) { return call; } return PointWithMeasure_assertThisInitialized(self); }
  11785. function PointWithMeasure_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11786. function PointWithMeasure_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  11787. function PointWithMeasure_getPrototypeOf(o) { PointWithMeasure_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PointWithMeasure_getPrototypeOf(o); }
  11788. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11789. * This program are made available under the terms of the Apache License, Version 2.0
  11790. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11791. /**
  11792. * @class SuperMap.PointWithMeasure
  11793. * @category iServer SpatialAnalyst
  11794. * @classdesc 路由点类。路由点是指具有线性度量值 (Measure) 的二维地理坐标点。
  11795. * @param {Object} options - 参数。
  11796. * @param {number} options.measure - 度量值,即路由对象属性值 M。
  11797. * @param {number} options.x - 获取当前点对象在地理坐标系下的 X 坐标值。
  11798. * @param {number} options.y - 获取当前点对象在地理坐标系下的 Y 坐标值。
  11799. * @extends {SuperMap.Geometry.Point}
  11800. */
  11801. var PointWithMeasure = /*#__PURE__*/function (_Point) {
  11802. PointWithMeasure_inherits(PointWithMeasure, _Point);
  11803. var _super = PointWithMeasure_createSuper(PointWithMeasure);
  11804. function PointWithMeasure(options) {
  11805. var _this;
  11806. PointWithMeasure_classCallCheck(this, PointWithMeasure);
  11807. _this = _super.call(this, options);
  11808. /**
  11809. * @member {number} SuperMap.PointWithMeasure.prototype.measure
  11810. * @description 度量值,即路由对象属性值 M。
  11811. */
  11812. _this.measure = null;
  11813. if (options) {
  11814. Util.extend(PointWithMeasure_assertThisInitialized(_this), options);
  11815. }
  11816. _this.CLASS_NAME = "SuperMap.PointWithMeasure";
  11817. return _this;
  11818. }
  11819. /**
  11820. * @function SuperMap.PointWithMeasure.prototype.equals
  11821. * @description 判断两个路由点对象是否相等。如果两个路由点对象具有相同的坐标以及度量值,则认为是相等的。
  11822. * @param {SuperMap.PointWithMeasure} geom - 需要判断的路由点对象。
  11823. * @returns {boolean} 两个路由点对象是否相等(true 为相等,false 为不等)。
  11824. */
  11825. PointWithMeasure_createClass(PointWithMeasure, [{
  11826. key: "equals",
  11827. value: function equals(geom) {
  11828. var equals = false;
  11829. if (geom != null) {
  11830. var isValueEquals = this.x === geom.x && this.y === geom.y && this.measure === geom.measure;
  11831. var isNaNValue = isNaN(this.x) && isNaN(this.y) && isNaN(this.measure);
  11832. var isNaNGeometry = isNaN(geom.x) && isNaN(geom.y) && isNaN(geom.measure);
  11833. equals = isValueEquals || isNaNValue && isNaNGeometry;
  11834. }
  11835. return equals;
  11836. }
  11837. /**
  11838. * @function SuperMap.PointWithMeasure.prototype.toJson
  11839. * @description 转换为 JSON 对象。
  11840. * */
  11841. }, {
  11842. key: "toJson",
  11843. value: function toJson() {
  11844. var result = "{";
  11845. if (this.measure != null && this.measure != undefined) {
  11846. result += "\"measure\":" + this.measure + ",";
  11847. }
  11848. result += "\"x\":" + this.x + ",";
  11849. result += "\"y\":" + this.y;
  11850. result += "}";
  11851. return result;
  11852. }
  11853. /**
  11854. * @function SuperMap.PointWithMeasure.prototype.destroy
  11855. * @description 释放资源,将引用资源的属性置空。
  11856. */
  11857. }, {
  11858. key: "destroy",
  11859. value: function destroy() {
  11860. var me = this;
  11861. me.measure = null;
  11862. me.x = null;
  11863. me.y = null;
  11864. }
  11865. /**
  11866. * @function SuperMap.PointWithMeasure.fromJson
  11867. * @description 将 JSON 对象转换为{@link SuperMap.PointWithMeasure} 对象。
  11868. * @param {Object} jsonObject - JSON 对象表示的路由点。
  11869. * @returns {SuperMap.PointWithMeasure} 转化后的 PointWithMeasure 对象。
  11870. */
  11871. }], [{
  11872. key: "fromJson",
  11873. value: function fromJson(jsonObject) {
  11874. if (!jsonObject) {
  11875. return;
  11876. }
  11877. return new PointWithMeasure({
  11878. x: jsonObject.x,
  11879. y: jsonObject.y,
  11880. measure: jsonObject.measure
  11881. });
  11882. }
  11883. }]);
  11884. return PointWithMeasure;
  11885. }(Point);
  11886. SuperMap.PointWithMeasure = PointWithMeasure;
  11887. ;// CONCATENATED MODULE: ./src/common/iServer/Route.js
  11888. function Route_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Route_typeof = function _typeof(obj) { return typeof obj; }; } else { Route_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Route_typeof(obj); }
  11889. function Route_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11890. 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); } }
  11891. function Route_createClass(Constructor, protoProps, staticProps) { if (protoProps) Route_defineProperties(Constructor.prototype, protoProps); if (staticProps) Route_defineProperties(Constructor, staticProps); return Constructor; }
  11892. function Route_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Route_setPrototypeOf(subClass, superClass); }
  11893. function Route_setPrototypeOf(o, p) { Route_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Route_setPrototypeOf(o, p); }
  11894. 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); }; }
  11895. function Route_possibleConstructorReturn(self, call) { if (call && (Route_typeof(call) === "object" || typeof call === "function")) { return call; } return Route_assertThisInitialized(self); }
  11896. function Route_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11897. function Route_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  11898. function Route_getPrototypeOf(o) { Route_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Route_getPrototypeOf(o); }
  11899. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11900. * This program are made available under the terms of the Apache License, Version 2.0
  11901. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11902. /**
  11903. * @class SuperMap.Route
  11904. * @category iServer SpatialAnalyst
  11905. * @classdesc 路由对象类。路由对象为一系列有序的带有属性值 M 的 x,y 坐标对,其中 M 值为该结点的距离属性(到已知点的距离)。
  11906. * @param {Array.<SuperMap.Geometry>} points - 形成路由对象的线数组。
  11907. * @param {Object} options - 参数。
  11908. * @param {number} options.id - 路由对象在数据库中的 id。
  11909. * @param {number} options.length - 路由对象的长度。单位与数据集的单位相同。
  11910. * @param {number} [options.maxM] - 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  11911. * @param {number} [options.minM] - 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  11912. * @param {string} [options.type] - 数据类型,如:"LINEM"。
  11913. * @extends {SuperMap.Geometry.Collection}
  11914. */
  11915. var Route = /*#__PURE__*/function (_Collection) {
  11916. Route_inherits(Route, _Collection);
  11917. var _super = Route_createSuper(Route);
  11918. function Route(points, options) {
  11919. var _this;
  11920. Route_classCallCheck(this, Route);
  11921. _this = _super.call(this, points, options);
  11922. /**
  11923. * @member {number} SuperMap.Route.prototype.id
  11924. * @description 路由对象在数据库中的 ID。
  11925. */
  11926. _this.id = null;
  11927. /**
  11928. * @member {number} SuperMap.Route.prototype.center
  11929. * @description 路由对象的中心点。
  11930. */
  11931. _this.center = null;
  11932. /**
  11933. * @member {string} SuperMap.Route.prototype.style
  11934. * @description 路由对象的样式。
  11935. */
  11936. _this.style = null;
  11937. /**
  11938. * @member {number} SuperMap.Route.prototype.length
  11939. * @description 路由对象的长度。单位与数据集的单位相同。
  11940. */
  11941. _this.length = null;
  11942. /**
  11943. * @member {number} SuperMap.Route.prototype.maxM
  11944. * @description 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  11945. */
  11946. _this.maxM = null;
  11947. /**
  11948. * @member {number} SuperMap.Route.prototype.minM
  11949. * @description 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  11950. */
  11951. _this.minM = null;
  11952. /**
  11953. * @member {Array.<number>} SuperMap.Route.prototype.parts
  11954. * @description 服务端几何对象中各个子对象所包含的节点个数。
  11955. */
  11956. _this.parts = null;
  11957. /**
  11958. * @member {Array.<Object>} SuperMap.Route.prototype.points
  11959. * @description 路由对象的所有路由点。
  11960. * @example
  11961. * (start code)
  11962. * [
  11963. * {
  11964. * "measure": 0,
  11965. * "y": -4377.027184298267,
  11966. * "x": 4020.0045221720466
  11967. * },
  11968. * {
  11969. * "measure": 37.33288381391519,
  11970. * "y": -4381.569363260499,
  11971. * "x": 4057.0600591960642
  11972. * }
  11973. * ]
  11974. * (end)
  11975. */
  11976. _this.points = null;
  11977. /**
  11978. * @member {string} SuperMap.Route.prototype.type
  11979. * @description 服务端几何对象类型。
  11980. */
  11981. _this.type = null;
  11982. /**
  11983. * @member {Array.<string>} [SuperMap.Route.prototype.componentTypes=SuperMap.Geometry.LineString]
  11984. * @description components 存储的的几何对象所支持的几何类型数组。
  11985. */
  11986. _this.componentTypes = ["SuperMap.Geometry.LinearRing", "SuperMap.Geometry.LineString"];
  11987. if (options) {
  11988. Util.extend(Route_assertThisInitialized(_this), options);
  11989. }
  11990. _this.CLASS_NAME = "SuperMap.Route";
  11991. _this.geometryType = "LINEM";
  11992. return _this;
  11993. }
  11994. /**
  11995. *
  11996. * @function SuperMap.Route.prototype.toJson
  11997. * @description 转换为 JSON 对象。
  11998. * @returns {Object} JSON 对象。
  11999. */
  12000. Route_createClass(Route, [{
  12001. key: "toJson",
  12002. value: function toJson() {
  12003. var result = "{";
  12004. if (this.id != null && this.id != undefined) {
  12005. result += "\"id\":" + this.id + ",";
  12006. }
  12007. if (this.center != null && this.center != undefined) {
  12008. result += "\"center\":" + this.center + ",";
  12009. }
  12010. if (this.style != null && this.style != undefined) {
  12011. result += "\"style\":" + this.style + ",";
  12012. }
  12013. if (this.length != null && this.length != undefined) {
  12014. result += "\"length\":" + this.length + ",";
  12015. }
  12016. if (this.maxM != null && this.maxM != undefined) {
  12017. result += "\"maxM\":" + this.maxM + ",";
  12018. }
  12019. if (this.minM != null && this.minM != undefined) {
  12020. result += "\"minM\":" + this.minM + ",";
  12021. }
  12022. if (this.type != null && this.type != undefined) {
  12023. result += "\"type\":\"" + this.type + "\",";
  12024. }
  12025. if (this.parts != null && this.parts != undefined) {
  12026. result += "\"parts\":[" + this.parts[0];
  12027. for (var i = 1; i < this.parts.length; i++) {
  12028. result += "," + this.parts[i];
  12029. }
  12030. result += "],";
  12031. }
  12032. if (this.components != null && this.components.length > 0) {
  12033. result += "\"points\":[";
  12034. for (var j = 0, len = this.components.length; j < len; j++) {
  12035. for (var k = 0, len2 = this.components[j].components.length; k < len2; k++) {
  12036. result += this.components[j].components[k].toJson() + ",";
  12037. }
  12038. }
  12039. result = result.replace(/,$/g, '');
  12040. result += "]";
  12041. }
  12042. result = result.replace(/,$/g, '');
  12043. result += "}";
  12044. return result;
  12045. }
  12046. /**
  12047. * @function SuperMap.Route.prototype.destroy
  12048. * @override
  12049. */
  12050. }, {
  12051. key: "destroy",
  12052. value: function destroy() {
  12053. var me = this;
  12054. me.id = null;
  12055. me.center = null;
  12056. me.style = null;
  12057. me.length = null;
  12058. me.maxM = null;
  12059. me.minM = null;
  12060. me.type = null;
  12061. me.parts = null;
  12062. me.components.length = 0;
  12063. me.components = null;
  12064. me.componentTypes = null;
  12065. }
  12066. /**
  12067. * @function SuperMap.Route.fromJson
  12068. * @description 将 JSON 对象转换为 SuperMap.Route 对象。
  12069. * @param {Object} [jsonObject] - JSON 对象表示的路由对象。
  12070. * @returns {SuperMap.Route} 转化后的 Route 对象。
  12071. */
  12072. }], [{
  12073. key: "fromJson",
  12074. value: function fromJson(jsonObject) {
  12075. if (!jsonObject) {
  12076. return;
  12077. }
  12078. var geoParts = jsonObject.parts || [],
  12079. geoPoints = jsonObject.points || [],
  12080. len = geoParts.length,
  12081. lineList = [];
  12082. if (len > 0) {
  12083. for (var i = 0, pointIndex = 0, pointList = []; i < len; i++) {
  12084. for (var j = 0; j < geoParts[i]; j++) {
  12085. pointList.push(PointWithMeasure.fromJson(geoPoints[pointIndex + j]));
  12086. }
  12087. pointIndex += geoParts[i]; //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  12088. if (pointList[0].equals(pointList[geoParts[i] - 1])) {
  12089. lineList.push(new LinearRing(pointList));
  12090. } else {
  12091. lineList.push(new LineString(pointList));
  12092. }
  12093. pointList = [];
  12094. }
  12095. } else {
  12096. return null;
  12097. }
  12098. return new Route(lineList, {
  12099. id: jsonObject.id,
  12100. center: jsonObject.center,
  12101. style: jsonObject.style,
  12102. length: jsonObject.length,
  12103. maxM: jsonObject.maxM,
  12104. minM: jsonObject.minM,
  12105. type: jsonObject.type,
  12106. parts: jsonObject.parts
  12107. });
  12108. }
  12109. }]);
  12110. return Route;
  12111. }(Collection);
  12112. SuperMap.Route = Route;
  12113. ;// CONCATENATED MODULE: ./src/common/iServer/ServerGeometry.js
  12114. function ServerGeometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12115. 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); } }
  12116. function ServerGeometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerGeometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerGeometry_defineProperties(Constructor, staticProps); return Constructor; }
  12117. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12118. * This program are made available under the terms of the Apache License, Version 2.0
  12119. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12120. /**
  12121. * @class SuperMap.ServerGeometry
  12122. * @category iServer
  12123. * @classdesc 服务端几何对象类。该类描述几何对象(矢量)的特征数据(坐标点对、几何对象的类型等)。基于服务端的空间分析、空间关系运算、查询等 GIS 服务功能使用服务端几何对象。
  12124. * @param {Object} options - 参数。
  12125. * @param {string} options.id - 服务端几何对象唯一标识符。
  12126. * @param {Array.<number>} options.parts - 服务端几何对象中各个子对象所包含的节点个数。
  12127. * @param {Array.<SuperMap.Geometry.Point>} options.points - 组成几何对象的节点的坐标对数组。
  12128. * @param {SuperMap.GeometryType} options.type - 几何对象的类型。
  12129. * @param {SuperMap.ServerStyle} [options.style] - 服务端几何对象的风格。
  12130. */
  12131. var ServerGeometry = /*#__PURE__*/function () {
  12132. function ServerGeometry(options) {
  12133. ServerGeometry_classCallCheck(this, ServerGeometry);
  12134. /**
  12135. * @member {string} SuperMap.ServerGeometry.prototype.id
  12136. * @description 服务端几何对象唯一标识符。
  12137. */
  12138. this.id = 0;
  12139. /**
  12140. * @member {SuperMap.ServerStyle} [SuperMap.ServerGeometry.prototype.style]
  12141. * @description 服务端几何对象的风格(ServerStyle)。
  12142. */
  12143. this.style = null;
  12144. /**
  12145. * @member {Array.<number>} SuperMap.ServerGeometry.prototype.parts
  12146. * @description 服务端几何对象中各个子对象所包含的节点个数。<br>
  12147. * 1.几何对象从结构上可以分为简单几何对象和复杂几何对象。
  12148. * 简单几何对象与复杂几何对象的区别:简单的几何对象一般为单一对象,
  12149. * 而复杂的几何对象由多个简单对象组成或经过一定的空间运算之后产生,
  12150. * 如:矩形为简单的区域对象,而中空的矩形为复杂的区域对象。<br>
  12151. * 2.通常情况,一个简单几何对象的子对象就是它本身,
  12152. * 因此对于简单对象来说的该字段为长度为1的整型数组,
  12153. * 该字段的值就是这个简单对象节点的个数。
  12154. * 如果一个几何对象是由几个简单对象组合而成的,
  12155. * 例如,一个岛状几何对象由 3 个简单的多边形组成而成,
  12156. * 那么这个岛状的几何对象的 Parts 字段值就是一个长度为 3 的整型数组,
  12157. * 数组中每个成员的值分别代表这三个多边形所包含的节点个数。
  12158. */
  12159. this.parts = null;
  12160. /**
  12161. * @member {Array.<SuperMap.Geometry.Point>} SuperMap.ServerGeometry.prototype.points
  12162. * @description 组成几何对象的节点的坐标对数组。<br>
  12163. * 1.所有几何对象(点、线、面)都是由一些简单的点坐标组成的,
  12164. * 该字段存放了组成几何对象的点坐标的数组。
  12165. * 对于简单的面对象,他的起点和终点的坐标点相同。<br>
  12166. * 2.对于复杂的几何对象,根据 Parts 属性来确定每一个组成复杂几何对象的简单对象所对应的节点的个数,
  12167. * 从而确定 Points 字段中坐标对的分配归属问题。
  12168. */
  12169. this.points = null;
  12170. /**
  12171. * @member {SuperMap.GeometryType} SuperMap.ServerGeometry.prototype.type
  12172. * @description 几何对象的类型(GeometryType)。
  12173. */
  12174. this.type = null;
  12175. /**
  12176. * @member {Object} SuperMap.ServerGeometry.prototype.prjCoordSys
  12177. * @description 投影坐标参数,现仅在缓冲区分析中有效。
  12178. */
  12179. this.prjCoordSys = null;
  12180. if (options) {
  12181. Util.extend(this, options);
  12182. }
  12183. this.CLASS_NAME = 'SuperMap.ServerGeometry';
  12184. }
  12185. /**
  12186. * @function SuperMap.ServerGeometry.prototype.destroy
  12187. * @description 释放资源,将引用资源的属性置空。
  12188. */
  12189. ServerGeometry_createClass(ServerGeometry, [{
  12190. key: "destroy",
  12191. value: function destroy() {
  12192. var me = this;
  12193. me.id = null;
  12194. me.style = null;
  12195. me.parts = null;
  12196. me.partTopo = null;
  12197. me.points = null;
  12198. me.type = null;
  12199. me.prjCoordSys = null;
  12200. }
  12201. /**
  12202. * @function SuperMap.ServerGeometry.prototype.toGeometry
  12203. * @description 将服务端几何对象 ServerGeometry 转换为客户端几何对象 Geometry。
  12204. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  12205. */
  12206. }, {
  12207. key: "toGeometry",
  12208. value: function toGeometry() {
  12209. var me = this,
  12210. geoType = me.type;
  12211. switch (geoType.toUpperCase()) {
  12212. case GeometryType.POINT:
  12213. return me.toGeoPoint();
  12214. case GeometryType.LINE:
  12215. return me.toGeoLine();
  12216. case GeometryType.LINEM:
  12217. return me.toGeoLinem();
  12218. case GeometryType.REGION:
  12219. return me.toGeoRegion();
  12220. case GeometryType.POINTEPS:
  12221. return me.toGeoPoint();
  12222. case GeometryType.LINEEPS:
  12223. return me.toGeoLineEPS();
  12224. case GeometryType.REGIONEPS:
  12225. return me.toGeoRegionEPS();
  12226. case GeometryType.GEOCOMPOUND:
  12227. return me.transformGeoCompound();
  12228. }
  12229. }
  12230. /**
  12231. * @function SuperMap.ServerGeometry.prototype.toGeoPoint
  12232. * @description 将服务端的点几何对象转换为客户端几何对象。包括 Point、MultiPoint。
  12233. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  12234. */
  12235. }, {
  12236. key: "toGeoPoint",
  12237. value: function toGeoPoint() {
  12238. var me = this,
  12239. geoParts = me.parts || [],
  12240. geoPoints = me.points || [],
  12241. len = geoParts.length;
  12242. if (len > 0) {
  12243. if (len === 1) {
  12244. return new Point(geoPoints[0].x, geoPoints[0].y);
  12245. } else {
  12246. var pointList = [];
  12247. for (var i = 0; i < len; i++) {
  12248. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  12249. }
  12250. return new MultiPoint(pointList);
  12251. }
  12252. } else {
  12253. return null;
  12254. }
  12255. }
  12256. /**
  12257. * @function SuperMap.ServerGeometry.prototype.toGeoLine
  12258. * @description 将服务端的线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  12259. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  12260. */
  12261. }, {
  12262. key: "toGeoLine",
  12263. value: function toGeoLine() {
  12264. var me = this,
  12265. geoParts = me.parts || [],
  12266. geoPoints = me.points || [],
  12267. len = geoParts.length;
  12268. if (len > 0) {
  12269. if (len === 1) {
  12270. var pointList = [];
  12271. for (var i = 0; i < geoParts[0]; i++) {
  12272. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  12273. } //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  12274. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  12275. return new LinearRing(pointList);
  12276. } else {
  12277. return new LineString(pointList);
  12278. }
  12279. } else {
  12280. var lineList = [];
  12281. for (var _i = 0; _i < len; _i++) {
  12282. var _pointList = [];
  12283. for (var j = 0; j < geoParts[_i]; j++) {
  12284. _pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
  12285. }
  12286. lineList.push(new LineString(_pointList));
  12287. geoPoints.splice(0, geoParts[_i]);
  12288. }
  12289. return new MultiLineString(lineList);
  12290. }
  12291. } else {
  12292. return null;
  12293. }
  12294. }
  12295. /**
  12296. * @function SuperMap.ServerGeometry.prototype.toGeoLineEPS
  12297. * @description 将服务端的线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  12298. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  12299. */
  12300. }, {
  12301. key: "toGeoLineEPS",
  12302. value: function toGeoLineEPS() {
  12303. var me = this,
  12304. geoParts = me.parts || [],
  12305. geoPoints = me.points || [],
  12306. i,
  12307. j,
  12308. pointList,
  12309. lineList,
  12310. lineEPS,
  12311. len = geoParts.length;
  12312. if (len > 0) {
  12313. if (len === 1) {
  12314. for (i = 0, pointList = []; i < geoParts[0]; i++) {
  12315. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y, geoPoints[i].type));
  12316. } //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  12317. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  12318. lineEPS = LineString.createLineEPS(pointList);
  12319. return new LinearRing(lineEPS);
  12320. } else {
  12321. lineEPS = LineString.createLineEPS(pointList);
  12322. return new LineString(lineEPS);
  12323. }
  12324. } else {
  12325. for (i = 0, lineList = []; i < len; i++) {
  12326. for (j = 0, pointList = []; j < geoParts[i]; j++) {
  12327. pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
  12328. }
  12329. lineEPS = LineString.createLineEPS(pointList);
  12330. lineList.push(new LineString(lineEPS));
  12331. geoPoints.splice(0, geoParts[i]);
  12332. }
  12333. return new MultiLineString(lineList);
  12334. }
  12335. } else {
  12336. return null;
  12337. }
  12338. }
  12339. /**
  12340. * @function SuperMap.ServerGeometry.prototype.toGeoLine
  12341. * @description 将服务端的路由线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  12342. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  12343. */
  12344. }, {
  12345. key: "toGeoLinem",
  12346. value: function toGeoLinem() {
  12347. var me = this;
  12348. return Route.fromJson(me);
  12349. }
  12350. /**
  12351. * @function SuperMap.ServerGeometry.prototype.toGeoRegion
  12352. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
  12353. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  12354. */
  12355. }, {
  12356. key: "toGeoRegion",
  12357. value: function toGeoRegion() {
  12358. var me = this,
  12359. geoParts = me.parts || [],
  12360. geoTopo = me.partTopo || [],
  12361. geoPoints = me.points || [],
  12362. len = geoParts.length;
  12363. if (len <= 0) {
  12364. return null;
  12365. }
  12366. var polygonArray = [];
  12367. var pointList = [];
  12368. if (len == 1) {
  12369. for (var i = 0; i < geoPoints.length; i++) {
  12370. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  12371. }
  12372. polygonArray.push(new Polygon([new LinearRing(pointList)]));
  12373. return new MultiPolygon(polygonArray);
  12374. } //处理复杂面
  12375. var CCWArray = [];
  12376. var areaArray = [];
  12377. var polygonArrayTemp = [];
  12378. var polygonBounds = []; //polyon岛洞标识数组,初始都是岛。
  12379. var CCWIdent = [];
  12380. for (var _i2 = 0, pointIndex = 0; _i2 < len; _i2++) {
  12381. for (var j = 0; j < geoParts[_i2]; j++) {
  12382. pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  12383. }
  12384. pointIndex += geoParts[_i2];
  12385. var polygon = new Polygon([new LinearRing(pointList)]);
  12386. pointList = [];
  12387. polygonArrayTemp.push(polygon);
  12388. if (geoTopo.length === 0) {
  12389. polygonBounds.push(polygon.getBounds());
  12390. }
  12391. CCWIdent.push(1);
  12392. areaArray.push(polygon.getArea());
  12393. } //根据面积排序
  12394. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds); //iServer 9D新增字段
  12395. if (geoTopo.length === 0) {
  12396. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  12397. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  12398. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  12399. //目标polygon索引列表 -1标示没有被任何polygon包含,
  12400. var targetArray = [];
  12401. for (var _i3 = 1; _i3 < polygonArrayTemp.length; _i3++) {
  12402. for (var _j = _i3 - 1; _j >= 0; _j--) {
  12403. targetArray[_i3] = -1;
  12404. if (polygonBounds[_j].containsBounds(polygonBounds[_i3])) {
  12405. CCWIdent[_i3] = CCWIdent[_j] * -1;
  12406. if (CCWIdent[_i3] < 0) {
  12407. targetArray[_i3] = _j;
  12408. }
  12409. break;
  12410. }
  12411. }
  12412. }
  12413. for (var _i4 = 0; _i4 < polygonArrayTemp.length; _i4++) {
  12414. if (CCWIdent[_i4] > 0) {
  12415. polygonArray.push(polygonArrayTemp[_i4]);
  12416. } else {
  12417. polygonArray[targetArray[_i4]].components = polygonArray[targetArray[_i4]].components.concat(polygonArrayTemp[_i4].components); //占位
  12418. polygonArray.push('');
  12419. }
  12420. }
  12421. } else {
  12422. //根据面积排序
  12423. //ServerGeometry.bubbleSort(areaArray, polygonArrayTemp,geoTopo);
  12424. polygonArray = new Array();
  12425. for (var _i5 = 0; _i5 < polygonArrayTemp.length; _i5++) {
  12426. if (geoTopo[_i5] && geoTopo[_i5] == -1) {
  12427. CCWArray = CCWArray.concat(polygonArrayTemp[_i5].components);
  12428. } else {
  12429. if (CCWArray.length > 0 && polygonArray.length > 0) {
  12430. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  12431. CCWArray = [];
  12432. }
  12433. polygonArray.push(polygonArrayTemp[_i5]);
  12434. }
  12435. if (_i5 == len - 1) {
  12436. var polyLength = polygonArray.length;
  12437. if (polyLength) {
  12438. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  12439. } else {
  12440. for (var k = 0, length = CCWArray.length; k < length; k++) {
  12441. polygonArray.push(new Polygon(CCWArray));
  12442. }
  12443. }
  12444. }
  12445. }
  12446. }
  12447. return new MultiPolygon(polygonArray);
  12448. }
  12449. /**
  12450. * @function SuperMap.ServerGeometry.prototype.toGeoRegionEPS
  12451. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
  12452. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  12453. */
  12454. }, {
  12455. key: "toGeoRegionEPS",
  12456. value: function toGeoRegionEPS() {
  12457. var me = this,
  12458. geoParts = me.parts || [],
  12459. geoTopo = me.partTopo || [],
  12460. geoPoints = me.points || [],
  12461. len = geoParts.length;
  12462. if (len <= 0) {
  12463. return null;
  12464. }
  12465. var polygonArray = [];
  12466. var pointList = [];
  12467. var lineEPS;
  12468. if (len == 1) {
  12469. for (var i = 0; i < geoPoints.length; i++) {
  12470. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  12471. }
  12472. lineEPS = LineString.createLineEPS(pointList);
  12473. polygonArray.push(new Polygon([new LinearRing(lineEPS)]));
  12474. return new MultiPolygon(polygonArray);
  12475. } //处理复杂面
  12476. var CCWArray = [];
  12477. var areaArray = [];
  12478. var polygonArrayTemp = [];
  12479. var polygonBounds = []; //polyon岛洞标识数组,初始都是岛。
  12480. var CCWIdent = [];
  12481. for (var _i6 = 0, pointIndex = 0; _i6 < len; _i6++) {
  12482. for (var j = 0; j < geoParts[_i6]; j++) {
  12483. pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  12484. }
  12485. pointIndex += geoParts[_i6];
  12486. lineEPS = LineString.createLineEPS(pointList);
  12487. var polygon = new Polygon([new LinearRing(lineEPS)]);
  12488. pointList = [];
  12489. polygonArrayTemp.push(polygon);
  12490. if (geoTopo.length === 0) {
  12491. polygonBounds.push(polygon.getBounds());
  12492. }
  12493. CCWIdent.push(1);
  12494. areaArray.push(polygon.getArea());
  12495. } //根据面积排序
  12496. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds); //iServer 9D新增字段
  12497. if (geoTopo.length === 0) {
  12498. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  12499. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  12500. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  12501. //目标polygon索引列表 -1标示没有被任何polygon包含,
  12502. var targetArray = [];
  12503. for (var _i7 = 1; _i7 < polygonArrayTemp.length; _i7++) {
  12504. for (var _j2 = _i7 - 1; _j2 >= 0; _j2--) {
  12505. targetArray[_i7] = -1;
  12506. if (polygonBounds[_j2].containsBounds(polygonBounds[_i7])) {
  12507. CCWIdent[_i7] = CCWIdent[_j2] * -1;
  12508. if (CCWIdent[_i7] < 0) {
  12509. targetArray[_i7] = _j2;
  12510. }
  12511. break;
  12512. }
  12513. }
  12514. }
  12515. for (var _i8 = 0; _i8 < polygonArrayTemp.length; _i8++) {
  12516. if (CCWIdent[_i8] > 0) {
  12517. polygonArray.push(polygonArrayTemp[_i8]);
  12518. } else {
  12519. polygonArray[targetArray[_i8]].components = polygonArray[targetArray[_i8]].components.concat(polygonArrayTemp[_i8].components); //占位
  12520. polygonArray.push('');
  12521. }
  12522. }
  12523. } else {
  12524. //根据面积排序
  12525. polygonArray = new Array();
  12526. for (var _i9 = 0; _i9 < polygonArrayTemp.length; _i9++) {
  12527. if (geoTopo[_i9] && geoTopo[_i9] == -1) {
  12528. CCWArray = CCWArray.concat(polygonArrayTemp[_i9].components);
  12529. } else {
  12530. if (CCWArray.length > 0 && polygonArray.length > 0) {
  12531. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  12532. CCWArray = [];
  12533. }
  12534. polygonArray.push(polygonArrayTemp[_i9]);
  12535. }
  12536. if (_i9 == len - 1) {
  12537. var polyLength = polygonArray.length;
  12538. if (polyLength) {
  12539. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  12540. } else {
  12541. for (var k = 0, length = CCWArray.length; k < length; k++) {
  12542. polygonArray.push(new Polygon(CCWArray));
  12543. }
  12544. }
  12545. }
  12546. }
  12547. }
  12548. return new MultiPolygon(polygonArray);
  12549. }
  12550. }, {
  12551. key: "transformGeoCompound",
  12552. value: function transformGeoCompound() {
  12553. var me = this,
  12554. geoParts = me.geoParts || [],
  12555. len = geoParts.length;
  12556. if (len <= 0) {
  12557. return null;
  12558. }
  12559. var geometryList = [];
  12560. for (var index = 0; index < len; index++) {
  12561. var geometry = geoParts[index];
  12562. geometryList.push(new ServerGeometry(geometry).toGeometry());
  12563. }
  12564. return new Collection(geometryList);
  12565. }
  12566. /**
  12567. * @function SuperMap.ServerGeometry.prototype.fromJson
  12568. * @description 将 JSON 对象表示服务端几何对象转换为 ServerGeometry。
  12569. * @param {Object} jsonObject - 要转换的 JSON 对象。
  12570. * @returns {SuperMap.ServerGeometry} 转换后的 ServerGeometry 对象。
  12571. */
  12572. }], [{
  12573. key: "fromJson",
  12574. value: function fromJson(jsonObject) {
  12575. if (!jsonObject) {
  12576. return;
  12577. }
  12578. return new ServerGeometry({
  12579. id: jsonObject.id,
  12580. style: ServerStyle.fromJson(jsonObject.style),
  12581. parts: jsonObject.parts,
  12582. partTopo: jsonObject.partTopo,
  12583. points: jsonObject.points,
  12584. center: jsonObject.center,
  12585. length: jsonObject.length,
  12586. maxM: jsonObject.maxM,
  12587. minM: jsonObject.minM,
  12588. type: jsonObject.type
  12589. });
  12590. }
  12591. /**
  12592. * @function SuperMap.ServerGeometry.prototype.fromGeometry
  12593. * @description 将客户端 Geometry 转换成服务端 ServerGeometry。
  12594. * @param {SuperMap.Geometry} geometry - 要转换的客户端 Geometry 对象。
  12595. * @returns {SuperMap.ServerGeometry} 转换后的 ServerGeometry 对象。
  12596. */
  12597. }, {
  12598. key: "fromGeometry",
  12599. value: function fromGeometry(geometry) {
  12600. if (!geometry) {
  12601. return;
  12602. }
  12603. var id = 0,
  12604. parts = [],
  12605. points = [],
  12606. type = null,
  12607. icomponents = geometry.components,
  12608. className = geometry.CLASS_NAME,
  12609. prjCoordSys = {
  12610. epsgCode: geometry.SRID
  12611. };
  12612. if (!isNaN(geometry.id)) {
  12613. id = geometry.id;
  12614. } //坑爹的改法,没法,为了支持态势标绘,有时间就得全改
  12615. if (className != 'SuperMap.Geometry.LinearRing' && className != 'SuperMap.Geometry.LineString' && (geometry instanceof MultiPoint || geometry instanceof MultiLineString)) {
  12616. var ilen = icomponents.length;
  12617. for (var i = 0; i < ilen; i++) {
  12618. var partPointsCount = icomponents[i].getVertices().length;
  12619. parts.push(partPointsCount);
  12620. for (var j = 0; j < partPointsCount; j++) {
  12621. points.push(new Point(icomponents[i].getVertices()[j].x, icomponents[i].getVertices()[j].y));
  12622. }
  12623. } //这里className不是多点就全部是算线
  12624. type = className == 'SuperMap.Geometry.MultiPoint' ? GeometryType.POINT : GeometryType.LINE;
  12625. } else if (geometry instanceof MultiPolygon) {
  12626. var _ilen = icomponents.length;
  12627. for (var _i10 = 0; _i10 < _ilen; _i10++) {
  12628. var polygon = icomponents[_i10],
  12629. linearRingOfPolygon = polygon.components,
  12630. linearRingOfPolygonLen = linearRingOfPolygon.length;
  12631. for (var _j3 = 0; _j3 < linearRingOfPolygonLen; _j3++) {
  12632. var _partPointsCount = linearRingOfPolygon[_j3].getVertices().length + 1;
  12633. parts.push(_partPointsCount);
  12634. for (var k = 0; k < _partPointsCount - 1; k++) {
  12635. points.push(new Point(linearRingOfPolygon[_j3].getVertices()[k].x, linearRingOfPolygon[_j3].getVertices()[k].y));
  12636. }
  12637. points.push(new Point(linearRingOfPolygon[_j3].getVertices()[0].x, linearRingOfPolygon[_j3].getVertices()[0].y));
  12638. }
  12639. }
  12640. type = GeometryType.REGION;
  12641. } else if (geometry instanceof Polygon) {
  12642. var _ilen2 = icomponents.length;
  12643. for (var _i11 = 0; _i11 < _ilen2; _i11++) {
  12644. var _partPointsCount2 = icomponents[_i11].getVertices().length + 1;
  12645. parts.push(_partPointsCount2);
  12646. for (var _j4 = 0; _j4 < _partPointsCount2 - 1; _j4++) {
  12647. points.push(new Point(icomponents[_i11].getVertices()[_j4].x, icomponents[_i11].getVertices()[_j4].y));
  12648. }
  12649. points.push(new Point(icomponents[_i11].getVertices()[0].x, icomponents[_i11].getVertices()[0].y));
  12650. }
  12651. type = GeometryType.REGION;
  12652. } else {
  12653. var geometryVerticesCount = geometry.getVertices().length;
  12654. for (var _j5 = 0; _j5 < geometryVerticesCount; _j5++) {
  12655. points.push(new Point(geometry.getVertices()[_j5].x, geometry.getVertices()[_j5].y));
  12656. }
  12657. if (geometry instanceof LinearRing) {
  12658. points.push(new Point(geometry.getVertices()[0].x, geometry.getVertices()[0].y));
  12659. geometryVerticesCount++;
  12660. }
  12661. parts.push(geometryVerticesCount);
  12662. type = geometry instanceof Point ? GeometryType.POINT : GeometryType.LINE;
  12663. }
  12664. return new ServerGeometry({
  12665. id: id,
  12666. style: null,
  12667. parts: parts,
  12668. points: points,
  12669. type: type,
  12670. prjCoordSys: prjCoordSys
  12671. });
  12672. }
  12673. /**
  12674. * @function SuperMap.ServerGeometry.prototype.IsClockWise
  12675. * @description 判断 linearRing 中的点的顺序。返回值大于 0,逆时针;小于 0,顺时针。
  12676. * @param {SuperMap.Geometry} geometry - 要转换的客户端 Geometry 对象。
  12677. * @returns {number} 返回值大于 0,逆时针;小于 0,顺时针。
  12678. */
  12679. }, {
  12680. key: "IsClockWise",
  12681. value: function IsClockWise(points) {
  12682. var length = points.length;
  12683. if (length < 3) {
  12684. return 0.0;
  12685. }
  12686. var s = points[0].y * (points[length - 1].x - points[1].x);
  12687. points.push(points[0]);
  12688. for (var i = 1; i < length; i++) {
  12689. s += points[i].y * (points[i - 1].x - points[i + 1].x);
  12690. }
  12691. return s * 0.5;
  12692. }
  12693. }, {
  12694. key: "bubbleSort",
  12695. value: function bubbleSort(areaArray, pointList, geoTopo, polygonBounds) {
  12696. for (var i = 0; i < areaArray.length; i++) {
  12697. for (var j = 0; j < areaArray.length; j++) {
  12698. if (areaArray[i] > areaArray[j]) {
  12699. var d = areaArray[j];
  12700. areaArray[j] = areaArray[i];
  12701. areaArray[i] = d;
  12702. var b = pointList[j];
  12703. pointList[j] = pointList[i];
  12704. pointList[i] = b;
  12705. if (geoTopo && geoTopo.length > 0) {
  12706. var c = geoTopo[j];
  12707. geoTopo[j] = geoTopo[i];
  12708. geoTopo[i] = c;
  12709. }
  12710. if (polygonBounds && polygonBounds.length > 0) {
  12711. var f = polygonBounds[j];
  12712. polygonBounds[j] = polygonBounds[i];
  12713. polygonBounds[i] = f;
  12714. }
  12715. }
  12716. }
  12717. }
  12718. }
  12719. }]);
  12720. return ServerGeometry;
  12721. }();
  12722. SuperMap.ServerGeometry = ServerGeometry;
  12723. ;// CONCATENATED MODULE: ./src/common/format/GeoJSON.js
  12724. function GeoJSON_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoJSON_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoJSON_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoJSON_typeof(obj); }
  12725. function GeoJSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12726. 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); } }
  12727. function GeoJSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoJSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoJSON_defineProperties(Constructor, staticProps); return Constructor; }
  12728. function GeoJSON_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoJSON_get = Reflect.get; } else { GeoJSON_get = function _get(target, property, receiver) { var base = GeoJSON_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeoJSON_get(target, property, receiver || target); }
  12729. function GeoJSON_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoJSON_getPrototypeOf(object); if (object === null) break; } return object; }
  12730. function GeoJSON_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeoJSON_setPrototypeOf(subClass, superClass); }
  12731. function GeoJSON_setPrototypeOf(o, p) { GeoJSON_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoJSON_setPrototypeOf(o, p); }
  12732. 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); }; }
  12733. function GeoJSON_possibleConstructorReturn(self, call) { if (call && (GeoJSON_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoJSON_assertThisInitialized(self); }
  12734. function GeoJSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  12735. function GeoJSON_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  12736. function GeoJSON_getPrototypeOf(o) { GeoJSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoJSON_getPrototypeOf(o); }
  12737. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12738. * This program are made available under the terms of the Apache License, Version 2.0
  12739. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12740. /**
  12741. * @class SuperMap.Format.GeoJSON
  12742. * @classdesc GeoJSON 的读和写。使用 {@link SuperMap.Format.GeoJSON} 构造器创建一个 GeoJSON 解析器。
  12743. * @category BaseTypes Format
  12744. * @param {Object} [options] - 参数。
  12745. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  12746. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  12747. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  12748. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  12749. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  12750. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  12751. * @param {boolean} [options.ignoreExtraDims=true] - 忽略维度超过 2 的几何要素。
  12752. * @extends {SuperMap.Format.JSON}
  12753. */
  12754. var GeoJSON = /*#__PURE__*/function (_JSONFormat) {
  12755. GeoJSON_inherits(GeoJSON, _JSONFormat);
  12756. var _super = GeoJSON_createSuper(GeoJSON);
  12757. function GeoJSON(options) {
  12758. var _this;
  12759. GeoJSON_classCallCheck(this, GeoJSON);
  12760. _this = _super.call(this, options);
  12761. /**
  12762. * @member {boolean} [SuperMap.Format.GeoJSON.prototype.ignoreExtraDims=true]
  12763. * @description 忽略维度超过 2 的几何要素。
  12764. */
  12765. _this.ignoreExtraDims = true;
  12766. _this.CLASS_NAME = "SuperMap.Format.GeoJSON";
  12767. /**
  12768. * @member {Object} SuperMap.Format.GeoJSON.prototype.parseCoords
  12769. * @private
  12770. * @description 一个属性名对应着 GeoJSON 对象的几何类型的对象。每个属性其实都是一个实际上做解析用的方法。
  12771. */
  12772. _this.parseCoords = {
  12773. /**
  12774. * @function SuperMap.Format.GeoJSON.parseCoords.point
  12775. * @description 将一组坐标转成一个 {@link SuperMap.Geometry} 对象。
  12776. * @param {Object} array - GeoJSON 片段中的一组坐标。
  12777. * @returns {SuperMap.Geometry} 一个几何对象。
  12778. */
  12779. "point": function point(array) {
  12780. if (this.ignoreExtraDims === false && array.length != 2) {
  12781. throw "Only 2D points are supported: " + array;
  12782. }
  12783. return new Point(array[0], array[1]);
  12784. },
  12785. /**
  12786. * @function SuperMap.Format.GeoJSON.parseCoords.multipoint
  12787. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  12788. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  12789. * @returns {SuperMap.Geometry} 一个几何对象。
  12790. */
  12791. "multipoint": function multipoint(array) {
  12792. var points = [];
  12793. var p = null;
  12794. for (var i = 0, len = array.length; i < len; ++i) {
  12795. try {
  12796. p = this.parseCoords["point"].apply(this, [array[i]]);
  12797. } catch (err) {
  12798. throw err;
  12799. }
  12800. points.push(p);
  12801. }
  12802. return new MultiPoint(points);
  12803. },
  12804. /**
  12805. * @function SuperMap.Format.GeoJSON.parseCoords.linestring
  12806. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  12807. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  12808. * @returns {SuperMap.Geometry} 一个几何对象。
  12809. */
  12810. "linestring": function linestring(array) {
  12811. var points = [];
  12812. var p = null;
  12813. for (var i = 0, len = array.length; i < len; ++i) {
  12814. try {
  12815. p = this.parseCoords["point"].apply(this, [array[i]]);
  12816. } catch (err) {
  12817. throw err;
  12818. }
  12819. points.push(p);
  12820. }
  12821. return new LineString(points);
  12822. },
  12823. /**
  12824. * @function SuperMap.Format.GeoJSON.parseCoords.multilinestring
  12825. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  12826. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  12827. * @returns {SuperMap.Geometry} 一个几何对象。
  12828. */
  12829. "multilinestring": function multilinestring(array) {
  12830. var lines = [];
  12831. var l = null;
  12832. for (var i = 0, len = array.length; i < len; ++i) {
  12833. try {
  12834. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  12835. } catch (err) {
  12836. throw err;
  12837. }
  12838. lines.push(l);
  12839. }
  12840. return new MultiLineString(lines);
  12841. },
  12842. /**
  12843. * @function SuperMap.Format.GeoJSON.parseCoords.polygon
  12844. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  12845. * @returns {SuperMap.Geometry} 一个几何对象。
  12846. */
  12847. "polygon": function polygon(array) {
  12848. var rings = [];
  12849. var r, l;
  12850. for (var i = 0, len = array.length; i < len; ++i) {
  12851. try {
  12852. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  12853. } catch (err) {
  12854. throw err;
  12855. }
  12856. r = new LinearRing(l.components);
  12857. rings.push(r);
  12858. }
  12859. return new Polygon(rings);
  12860. },
  12861. /**
  12862. * @function SuperMap.Format.GeoJSON.parseCoords.multipolygon
  12863. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  12864. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  12865. * @returns {SuperMap.Geometry} 一个几何对象。
  12866. */
  12867. "multipolygon": function multipolygon(array) {
  12868. var polys = [];
  12869. var p = null;
  12870. for (var i = 0, len = array.length; i < len; ++i) {
  12871. try {
  12872. p = this.parseCoords["polygon"].apply(this, [array[i]]);
  12873. } catch (err) {
  12874. throw err;
  12875. }
  12876. polys.push(p);
  12877. }
  12878. return new MultiPolygon(polys);
  12879. },
  12880. /**
  12881. * @function SuperMap.Format.GeoJSON.parseCoords.box
  12882. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  12883. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  12884. * @returns {SuperMap.Geometry} 一个几何对象。
  12885. */
  12886. "box": function box(array) {
  12887. if (array.length != 2) {
  12888. throw "GeoJSON box coordinates must have 2 elements";
  12889. }
  12890. return new Polygon([new 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])])]);
  12891. }
  12892. };
  12893. /**
  12894. * @member {Object} SuperMap.Format.GeoJSON.prototype.extract
  12895. * @private
  12896. * @description 一个属性名对应着GeoJSON类型的对象。其值为相应的实际的解析方法。
  12897. */
  12898. _this.extract = {
  12899. /**
  12900. * @function SuperMap.Format.GeoJSON.extract.feature
  12901. * @description 返回一个表示单个要素对象的 GeoJSON 的一部分。
  12902. * @param {SuperMap.ServerFeature} feature - iServer 要素对象。
  12903. * @returns {Object} 一个表示点的对象。
  12904. */
  12905. 'feature': function feature(_feature) {
  12906. var geom = this.extract.geometry.apply(this, [_feature.geometry]);
  12907. var json = {
  12908. "type": "Feature",
  12909. "properties": this.createAttributes(_feature),
  12910. "geometry": geom
  12911. };
  12912. if (_feature.geometry && _feature.geometry.type === 'TEXT') {
  12913. json.properties.texts = _feature.geometry.texts;
  12914. json.properties.textStyle = _feature.geometry.textStyle;
  12915. }
  12916. if (_feature.fid) {
  12917. json.id = _feature.fid;
  12918. }
  12919. if (_feature.ID) {
  12920. json.id = _feature.ID;
  12921. }
  12922. return json;
  12923. },
  12924. /**
  12925. * @function SuperMap.Format.GeoJSON.extract.geometry
  12926. * @description 返回一个表示单个几何对象的 GeoJSON 的一部分。
  12927. * @param {Object} geometry - iServer 几何对象。
  12928. * @returns {Object} 一个表示几何体的对象。
  12929. */
  12930. 'geometry': function geometry(_geometry) {
  12931. if (_geometry == null) {
  12932. return null;
  12933. }
  12934. if (!_geometry.parts && _geometry.points) {
  12935. _geometry.parts = [_geometry.points.length];
  12936. }
  12937. var geo = _geometry.hasOwnProperty('geometryType') ? _geometry : new ServerGeometry(_geometry).toGeometry() || _geometry;
  12938. var geometryType = geo.geometryType || geo.type;
  12939. var data;
  12940. if (geometryType === "LinearRing") {
  12941. geometryType = "LineString";
  12942. }
  12943. if (geometryType === "LINEM") {
  12944. geometryType = "MultiLineString";
  12945. }
  12946. data = this.extract[geometryType.toLowerCase()].apply(this, [geo]);
  12947. geometryType = geometryType === 'TEXT' ? 'Point' : geometryType;
  12948. var json;
  12949. if (geometryType === "Collection") {
  12950. json = {
  12951. "type": "GeometryCollection",
  12952. "geometries": data
  12953. };
  12954. } else {
  12955. json = {
  12956. "type": geometryType,
  12957. "coordinates": data
  12958. };
  12959. }
  12960. return json;
  12961. },
  12962. /**
  12963. * @function SuperMap.Format.GeoJSON.extract.point
  12964. * @description 从一个点对象中返回一个坐标组。
  12965. * @param {SuperMap.Geometry.Point} point - 一个点对象。
  12966. * @returns {Array} 一个表示一个点的坐标组。
  12967. */
  12968. 'point': function point(_point) {
  12969. var p = [_point.x, _point.y];
  12970. for (var name in _point) {
  12971. if (name !== "x" && name !== "y" && _point[name] !== null && !isNaN(_point[name])) {
  12972. p.push(_point[name]);
  12973. }
  12974. }
  12975. return p;
  12976. },
  12977. /**
  12978. * @function SuperMap.Format.GeoJSON.extract.point
  12979. * @description 从一个文本对象中返回一个坐标组。
  12980. * @param {Object} geo - 一个文本对象。
  12981. * @returns {Array} 一个表示一个点的坐标组。
  12982. */
  12983. 'text': function text(geo) {
  12984. return [geo.points[0].x, geo.points[0].y];
  12985. },
  12986. /**
  12987. * @function SuperMap.Format.GeoJSON.extract.multipoint
  12988. * @description 从一个多点对象中返一个坐标组数组。
  12989. * @param {SuperMap.Geometry.MultiPoint} multipoint - 多点对象。
  12990. * @returns {Array} 一个表示多点的坐标组数组。
  12991. */
  12992. 'multipoint': function multipoint(_multipoint) {
  12993. var array = [];
  12994. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  12995. array.push(this.extract.point.apply(this, [_multipoint.components[i]]));
  12996. }
  12997. return array;
  12998. },
  12999. /**
  13000. * @function SuperMap.Format.GeoJSON.extract.linestring
  13001. * @description 从一个线对象中返回一个坐标组数组。
  13002. * @param {SuperMap.Geometry.Linestring} linestring - 线对象。
  13003. * @returns {Array} 一个表示线对象的坐标组数组。
  13004. */
  13005. 'linestring': function linestring(_linestring) {
  13006. var array = [];
  13007. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  13008. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  13009. }
  13010. return array;
  13011. },
  13012. /**
  13013. * @function SuperMap.Format.GeoJSON.extract.multilinestring
  13014. * @description 从一个多线对象中返回一个线数组。
  13015. * @param {SuperMap.Geometry.MultiLinestring} multilinestring - 多线对象。
  13016. *
  13017. * @returns {Array} 一个表示多线的线数组。
  13018. */
  13019. 'multilinestring': function multilinestring(_multilinestring) {
  13020. var array = [];
  13021. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  13022. array.push(this.extract.linestring.apply(this, [_multilinestring.components[i]]));
  13023. }
  13024. return array;
  13025. },
  13026. /**
  13027. * @function SuperMap.Format.GeoJSON.extract.polygon
  13028. * @description 从一个面对象中返回一组线环。
  13029. * @param {SuperMap.Geometry.Polygon} polygon - 面对象。
  13030. * @returns {Array} 一组表示面的线环。
  13031. */
  13032. 'polygon': function polygon(_polygon) {
  13033. var array = [];
  13034. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  13035. array.push(this.extract.linestring.apply(this, [_polygon.components[i]]));
  13036. }
  13037. return array;
  13038. },
  13039. /**
  13040. * @function SuperMap.Format.GeoJSON.extract.multipolygon
  13041. * @description 从一个多面对象中返回一组面。
  13042. * @param {SuperMap.Geometry.MultiPolygon} multipolygon - 多面对象。
  13043. * @returns {Array} 一组表示多面的面。
  13044. */
  13045. 'multipolygon': function multipolygon(_multipolygon) {
  13046. var array = [];
  13047. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  13048. array.push(this.extract.polygon.apply(this, [_multipolygon.components[i]]));
  13049. }
  13050. return array;
  13051. },
  13052. /**
  13053. * @function SuperMap.Format.GeoJSON.extract.collection
  13054. * @description 从一个几何要素集合中一组几何要素数组。
  13055. * @param {SuperMap.Geometry.Collection} collection - 几何要素集合。
  13056. * @returns {Array} 一组表示几何要素集合的几何要素数组。
  13057. */
  13058. 'collection': function collection(_collection) {
  13059. var len = _collection.components.length;
  13060. var array = new Array(len);
  13061. for (var i = 0; i < len; ++i) {
  13062. array[i] = this.extract.geometry.apply(this, [_collection.components[i]]);
  13063. }
  13064. return array;
  13065. }
  13066. };
  13067. return _this;
  13068. }
  13069. /**
  13070. * @function SuperMap.Format.GeoJSON.prototype.read
  13071. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为 SuperMap Feature 对象。
  13072. * @param {GeoJSONObject} json - GeoJSON 对象。
  13073. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  13074. * @param {Function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  13075. * @returns {Object} 返回值依赖于 type 参数的值。
  13076. * -如果 type 等于 "FeatureCollection",返回值将会是 {@link SuperMap.Feature.Vector} 数组。
  13077. * -如果 type 为 "Geometry",输入的 JSON 对象必须表示一个唯一的几何体,然后返回值就会是 {@link SuperMap.Feature.Geometry}。
  13078. * -如果 type 为 "Feature",输入的 JSON 对象也必须表示的一个要素,这样返回值才会是 {@link SuperMap.Feature.Vector}。
  13079. */
  13080. GeoJSON_createClass(GeoJSON, [{
  13081. key: "read",
  13082. value: function read(json, type, filter) {
  13083. type = type ? type : "FeatureCollection";
  13084. var results = null;
  13085. var obj = null;
  13086. if (typeof json == "string") {
  13087. obj = GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "read", this).call(this, json, filter);
  13088. } else {
  13089. obj = json;
  13090. }
  13091. if (!obj) {//SuperMap.Console.error("Bad JSON: " + json);
  13092. } else if (typeof obj.type != "string") {//SuperMap.Console.error("Bad GeoJSON - no type: " + json);
  13093. } else if (this.isValidType(obj, type)) {
  13094. switch (type) {
  13095. case "Geometry":
  13096. try {
  13097. results = this.parseGeometry(obj);
  13098. } catch (err) {//SuperMap.Console.error(err);
  13099. }
  13100. break;
  13101. case "Feature":
  13102. try {
  13103. results = this.parseFeature(obj);
  13104. results.type = "Feature";
  13105. } catch (err) {//SuperMap.Console.error(err);
  13106. }
  13107. break;
  13108. case "FeatureCollection":
  13109. // for type FeatureCollection, we allow input to be any type
  13110. results = [];
  13111. switch (obj.type) {
  13112. case "Feature":
  13113. try {
  13114. results.push(this.parseFeature(obj));
  13115. } catch (err) {
  13116. results = null; //SuperMap.Console.error(err);
  13117. }
  13118. break;
  13119. case "FeatureCollection":
  13120. for (var i = 0, len = obj.features.length; i < len; ++i) {
  13121. try {
  13122. results.push(this.parseFeature(obj.features[i]));
  13123. } catch (err) {
  13124. results = null; // SuperMap.Console.error(err);
  13125. }
  13126. }
  13127. break;
  13128. default:
  13129. try {
  13130. var geom = this.parseGeometry(obj);
  13131. results.push(new Vector(geom));
  13132. } catch (err) {
  13133. results = null; //SuperMap.Console.error(err);
  13134. }
  13135. }
  13136. break;
  13137. default:
  13138. break;
  13139. }
  13140. }
  13141. return results;
  13142. }
  13143. /**
  13144. * @function SuperMap.Format.GeoJSON.prototype.write
  13145. * @description iServer Geometry JSON 对象 转 GeoJSON对象字符串。
  13146. * @param {Object} obj - iServer Geometry JSON 对象。
  13147. * @param {boolean} [pretty=false] - 是否使用换行和缩进来控制输出。
  13148. * @returns {GeoJSONObject} 一个 GeoJSON 字符串,它表示了输入的几何对象,要素对象,或者要素对象数组。
  13149. */
  13150. }, {
  13151. key: "write",
  13152. value: function write(obj, pretty) {
  13153. return GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "write", this).call(this, this.toGeoJSON(obj), pretty);
  13154. }
  13155. /**
  13156. * @function SuperMap.Format.GeoJSON.prototype.fromGeoJSON
  13157. * @version 9.1.1
  13158. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为iServer Feature JSON。
  13159. * @param {GeoJSONObject} json - GeoJSON 对象。
  13160. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  13161. * @param {Function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  13162. * @returns {Object} iServer Feature JSON。
  13163. */
  13164. }, {
  13165. key: "fromGeoJSON",
  13166. value: function fromGeoJSON(json, type, filter) {
  13167. var _this2 = this;
  13168. var feature = this.read(json, type, filter);
  13169. if (!Util.isArray(feature)) {
  13170. return this._toiSevrerFeature(feature);
  13171. }
  13172. return feature.map(function (element) {
  13173. return _this2._toiSevrerFeature(element);
  13174. });
  13175. }
  13176. /**
  13177. * @function SuperMap.Format.GeoJSON.prototype.toGeoJSON
  13178. * @version 9.1.1
  13179. * @description 将 iServer Feature JSON 对象转换为 GeoJSON 对象。
  13180. * @param {Object} obj - iServer Feature JSON。
  13181. * @returns {GeoJSONObject} GeoJSON 对象。
  13182. */
  13183. }, {
  13184. key: "toGeoJSON",
  13185. value: function toGeoJSON(obj) {
  13186. var geojson = {
  13187. "type": null
  13188. };
  13189. if (Util.isArray(obj)) {
  13190. geojson.type = "FeatureCollection";
  13191. var numFeatures = obj.length;
  13192. geojson.features = new Array(numFeatures);
  13193. for (var i = 0; i < numFeatures; ++i) {
  13194. var element = obj[i];
  13195. if (isGeometry(element)) {
  13196. var feature = {};
  13197. feature.geometry = element;
  13198. geojson.features[i] = this.extract.feature.apply(this, [feature]);
  13199. } else {
  13200. geojson.features[i] = this.extract.feature.apply(this, [element]);
  13201. }
  13202. }
  13203. } else if (isGeometry(obj)) {
  13204. var _feature2 = {};
  13205. _feature2.geometry = obj;
  13206. geojson = this.extract.feature.apply(this, [_feature2]);
  13207. } else {
  13208. geojson = this.extract.feature.apply(this, [obj]);
  13209. }
  13210. function isGeometry(input) {
  13211. return input.hasOwnProperty("parts") && input.hasOwnProperty("points") || input.hasOwnProperty("geoParts");
  13212. }
  13213. return geojson;
  13214. }
  13215. /**
  13216. * @function SuperMap.Format.GeoJSON.prototype.isValidType
  13217. * @description 检查一个 GeoJSON 对象是否和给定的类型相符的合法的对象。
  13218. * @returns {boolean} GeoJSON 是否是给定类型的合法对象。
  13219. * @private
  13220. */
  13221. }, {
  13222. key: "isValidType",
  13223. value: function isValidType(obj, type) {
  13224. var valid = false;
  13225. switch (type) {
  13226. case "Geometry":
  13227. if (Util.indexOf(["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection"], obj.type) == -1) {// unsupported geometry type
  13228. //SuperMap.Console.error("Unsupported geometry type: " +
  13229. // obj.type);
  13230. } else {
  13231. valid = true;
  13232. }
  13233. break;
  13234. case "FeatureCollection":
  13235. // allow for any type to be converted to a feature collection
  13236. valid = true;
  13237. break;
  13238. default:
  13239. // for Feature types must match
  13240. if (obj.type == type) {
  13241. valid = true;
  13242. } else {//SuperMap.Console.error("Cannot convert types from " +
  13243. //obj.type + " to " + type);
  13244. }
  13245. }
  13246. return valid;
  13247. }
  13248. /**
  13249. * @function SuperMap.Format.GeoJSON.prototype.parseFeature
  13250. * @description 将一个 GeoJSON 中的 feature 转化成 {@link SuperMap.Feature.Vector}> 对象。
  13251. * @private
  13252. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  13253. * @returns {SuperMap.Feature.Vector} 一个要素。
  13254. */
  13255. }, {
  13256. key: "parseFeature",
  13257. value: function parseFeature(obj) {
  13258. var feature, geometry, attributes, bbox;
  13259. attributes = obj.properties ? obj.properties : {};
  13260. bbox = obj.geometry && obj.geometry.bbox || obj.bbox;
  13261. try {
  13262. geometry = this.parseGeometry(obj.geometry);
  13263. } catch (err) {
  13264. // deal with bad geometries
  13265. throw err;
  13266. }
  13267. feature = new Vector(geometry, attributes);
  13268. if (bbox) {
  13269. feature.bounds = Bounds.fromArray(bbox);
  13270. }
  13271. if (obj.id) {
  13272. feature.fid = obj.id;
  13273. }
  13274. return feature;
  13275. }
  13276. /**
  13277. * @function SuperMap.Format.GeoJSON.prototype.parseGeometry
  13278. * @description 将一个 GeoJSON 中的几何要素转化成 {@link SuperMap.Geometry} 对象。
  13279. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  13280. * @returns {SuperMap.Geometry} 一个几何要素。
  13281. * @private
  13282. */
  13283. }, {
  13284. key: "parseGeometry",
  13285. value: function parseGeometry(obj) {
  13286. if (obj == null) {
  13287. return null;
  13288. }
  13289. var geometry;
  13290. if (obj.type == "GeometryCollection") {
  13291. if (!Util.isArray(obj.geometries)) {
  13292. throw "GeometryCollection must have geometries array: " + obj;
  13293. }
  13294. var numGeom = obj.geometries.length;
  13295. var components = new Array(numGeom);
  13296. for (var i = 0; i < numGeom; ++i) {
  13297. components[i] = this.parseGeometry.apply(this, [obj.geometries[i]]);
  13298. }
  13299. geometry = new Collection(components);
  13300. } else {
  13301. if (!Util.isArray(obj.coordinates)) {
  13302. throw "Geometry must have coordinates array: " + obj;
  13303. }
  13304. if (!this.parseCoords[obj.type.toLowerCase()]) {
  13305. throw "Unsupported geometry type: " + obj.type;
  13306. }
  13307. try {
  13308. geometry = this.parseCoords[obj.type.toLowerCase()].apply(this, [obj.coordinates]);
  13309. } catch (err) {
  13310. // deal with bad coordinates
  13311. throw err;
  13312. }
  13313. }
  13314. return geometry;
  13315. }
  13316. /**
  13317. * @function SuperMap.Format.GeoJSON.prototype.createCRSObject
  13318. * @description 从一个要素对象中创建一个坐标参考系对象。
  13319. * @param {SuperMap.Feature.Vector} object - 要素对象。
  13320. * @private
  13321. * @returns {GeoJSONObject} 一个可作为 GeoJSON 对象的 CRS 属性使用的对象。
  13322. */
  13323. }, {
  13324. key: "createCRSObject",
  13325. value: function createCRSObject(object) {
  13326. var proj = object.layer.projection.toString();
  13327. var crs = {};
  13328. if (proj.match(/epsg:/i)) {
  13329. var code = parseInt(proj.substring(proj.indexOf(":") + 1));
  13330. if (code == 4326) {
  13331. crs = {
  13332. "type": "name",
  13333. "properties": {
  13334. "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
  13335. }
  13336. };
  13337. } else {
  13338. crs = {
  13339. "type": "name",
  13340. "properties": {
  13341. "name": "EPSG:" + code
  13342. }
  13343. };
  13344. }
  13345. }
  13346. return crs;
  13347. }
  13348. }, {
  13349. key: "_toiSevrerFeature",
  13350. value: function _toiSevrerFeature(feature) {
  13351. var attributes = feature.attributes;
  13352. var attrNames = [];
  13353. var attrValues = [];
  13354. for (var attr in attributes) {
  13355. attrNames.push(attr);
  13356. attrValues.push(attributes[attr]);
  13357. }
  13358. var newFeature = {
  13359. fieldNames: attrNames,
  13360. fieldValues: attrValues,
  13361. geometry: ServerGeometry.fromGeometry(feature.geometry)
  13362. };
  13363. newFeature.geometry.id = feature.fid;
  13364. return newFeature;
  13365. }
  13366. }, {
  13367. key: "createAttributes",
  13368. value: function createAttributes(feature) {
  13369. if (!feature) {
  13370. return null;
  13371. }
  13372. var attr = {};
  13373. processFieldsAttributes(feature, attr);
  13374. var exceptKeys = ["fieldNames", "fieldValues", "geometry", "stringID", "ID"];
  13375. for (var key in feature) {
  13376. if (exceptKeys.indexOf(key) > -1) {
  13377. continue;
  13378. }
  13379. attr[key] = feature[key];
  13380. }
  13381. function processFieldsAttributes(feature, attributes) {
  13382. if (!(feature.hasOwnProperty("fieldNames") && feature.hasOwnProperty("fieldValues"))) {
  13383. return;
  13384. }
  13385. var names = feature.fieldNames,
  13386. values = feature.fieldValues;
  13387. for (var i in names) {
  13388. attributes[names[i]] = values[i];
  13389. }
  13390. }
  13391. return attr;
  13392. }
  13393. }]);
  13394. return GeoJSON;
  13395. }(JSONFormat);
  13396. SuperMap.Format.GeoJSON = GeoJSON;
  13397. ;// CONCATENATED MODULE: ./src/common/format/WKT.js
  13398. function WKT_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { WKT_typeof = function _typeof(obj) { return typeof obj; }; } else { WKT_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return WKT_typeof(obj); }
  13399. function WKT_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13400. 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); } }
  13401. function WKT_createClass(Constructor, protoProps, staticProps) { if (protoProps) WKT_defineProperties(Constructor.prototype, protoProps); if (staticProps) WKT_defineProperties(Constructor, staticProps); return Constructor; }
  13402. function WKT_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) WKT_setPrototypeOf(subClass, superClass); }
  13403. function WKT_setPrototypeOf(o, p) { WKT_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WKT_setPrototypeOf(o, p); }
  13404. 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); }; }
  13405. function WKT_possibleConstructorReturn(self, call) { if (call && (WKT_typeof(call) === "object" || typeof call === "function")) { return call; } return WKT_assertThisInitialized(self); }
  13406. function WKT_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  13407. function WKT_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  13408. function WKT_getPrototypeOf(o) { WKT_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WKT_getPrototypeOf(o); }
  13409. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13410. * This program are made available under the terms of the Apache License, Version 2.0
  13411. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13412. /**
  13413. * @class SuperMap.Format.WKT
  13414. * @classdesc 用于读写常见文本的类。通过 {@link SuperMap.Format.WKT} 构造器来创建一个新的实例。
  13415. * @category BaseTypes Format
  13416. * @extends {SuperMap.Format}
  13417. * @param {Object} options - 可选的选项对象,其属性将被设置到实例。option 具体配置项继承自 {@link SuperMap.Format}。
  13418. */
  13419. var WKT = /*#__PURE__*/function (_Format) {
  13420. WKT_inherits(WKT, _Format);
  13421. var _super = WKT_createSuper(WKT);
  13422. function WKT(options) {
  13423. var _this;
  13424. WKT_classCallCheck(this, WKT);
  13425. _this = _super.call(this, options);
  13426. _this.regExes = {
  13427. 'typeStr': /^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,
  13428. 'spaces': /\s+/,
  13429. 'parenComma': /\)\s*,\s*\(/,
  13430. 'doubleParenComma': /\)\s*\)\s*,\s*\(\s*\(/,
  13431. // can't use {2} here
  13432. 'trimParens': /^\s*\(?(.*?)\)?\s*$/
  13433. };
  13434. _this.CLASS_NAME = "SuperMap.Format.WKT";
  13435. /**
  13436. * @private
  13437. * @description Object with properties corresponding to the geometry types.
  13438. * Property values are functions that do the actual data extraction.
  13439. */
  13440. _this.extract = {
  13441. /**
  13442. * @description Return a space delimited string of point coordinates.
  13443. * @param {SuperMap.Geometry.Point} point
  13444. * @returns {string} A string of coordinates representing the point
  13445. */
  13446. 'point': function point(_point) {
  13447. return _point.x + ' ' + _point.y;
  13448. },
  13449. /**
  13450. * @description Return a comma delimited string of point coordinates from a multipoint.
  13451. * @param {SuperMap.Geometry.MultiPoint} multipoint
  13452. * @returns {string} A string of point coordinate strings representing
  13453. * the multipoint
  13454. */
  13455. 'multipoint': function multipoint(_multipoint) {
  13456. var array = [];
  13457. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  13458. array.push('(' + this.extract.point.apply(this, [_multipoint.components[i]]) + ')');
  13459. }
  13460. return array.join(',');
  13461. },
  13462. /**
  13463. * @description Return a comma delimited string of point coordinates from a line.
  13464. * @param {SuperMap.Geometry.LineString} linestring
  13465. * @returns {string} A string of point coordinate strings representing
  13466. * the linestring
  13467. */
  13468. 'linestring': function linestring(_linestring) {
  13469. var array = [];
  13470. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  13471. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  13472. }
  13473. return array.join(',');
  13474. },
  13475. /**
  13476. * @description Return a comma delimited string of linestring strings from a multilinestring.
  13477. * @param {SuperMap.Geometry.MultiLineString} multilinestring
  13478. * @returns {string} A string of of linestring strings representing
  13479. * the multilinestring
  13480. */
  13481. 'multilinestring': function multilinestring(_multilinestring) {
  13482. var array = [];
  13483. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  13484. array.push('(' + this.extract.linestring.apply(this, [_multilinestring.components[i]]) + ')');
  13485. }
  13486. return array.join(',');
  13487. },
  13488. /**
  13489. * @description Return a comma delimited string of linear ring arrays from a polygon.
  13490. * @param {SuperMap.Geometry.Polygon} polygon
  13491. * @returns {string} An array of linear ring arrays representing the polygon
  13492. */
  13493. 'polygon': function polygon(_polygon) {
  13494. var array = [];
  13495. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  13496. array.push('(' + this.extract.linestring.apply(this, [_polygon.components[i]]) + ')');
  13497. }
  13498. return array.join(',');
  13499. },
  13500. /**
  13501. * @description Return an array of polygon arrays from a multipolygon.
  13502. * @param {SuperMap.Geometry.MultiPolygon} multipolygon
  13503. * @returns {string} An array of polygon arrays representing
  13504. * the multipolygon
  13505. */
  13506. 'multipolygon': function multipolygon(_multipolygon) {
  13507. var array = [];
  13508. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  13509. array.push('(' + this.extract.polygon.apply(this, [_multipolygon.components[i]]) + ')');
  13510. }
  13511. return array.join(',');
  13512. },
  13513. /**
  13514. * @description Return the WKT portion between 'GEOMETRYCOLLECTION(' and ')' for an <SuperMap.Geometry.Collection>
  13515. * @param {SuperMap.Geometry.Collection} collection
  13516. * @returns {string} internal WKT representation of the collection
  13517. */
  13518. 'collection': function collection(_collection) {
  13519. var array = [];
  13520. for (var i = 0, len = _collection.components.length; i < len; ++i) {
  13521. array.push(this.extractGeometry.apply(this, [_collection.components[i]]));
  13522. }
  13523. return array.join(',');
  13524. }
  13525. };
  13526. /**
  13527. * @private
  13528. * @description Object with properties corresponding to the geometry types.
  13529. * Property values are functions that do the actual parsing.
  13530. */
  13531. _this.parse = {
  13532. /**
  13533. * @private
  13534. * @description Return point feature given a point WKT fragment.
  13535. * @param {string} str A WKT fragment representing the point
  13536. * @returns {SuperMap.Feature.Vector} A point feature
  13537. *
  13538. */
  13539. 'point': function point(str) {
  13540. var coords = StringExt.trim(str).split(this.regExes.spaces);
  13541. return new Vector(new Point(coords[0], coords[1]));
  13542. },
  13543. /**
  13544. * @description Return a multipoint feature given a multipoint WKT fragment.
  13545. * @param {string} A WKT fragment representing the multipoint
  13546. * @returns {SuperMap.Feature.Vector} A multipoint feature
  13547. * @private
  13548. */
  13549. 'multipoint': function multipoint(str) {
  13550. var point;
  13551. var points = StringExt.trim(str).split(',');
  13552. var components = [];
  13553. for (var i = 0, len = points.length; i < len; ++i) {
  13554. point = points[i].replace(this.regExes.trimParens, '$1');
  13555. components.push(this.parse.point.apply(this, [point]).geometry);
  13556. }
  13557. return new Vector(new MultiPoint(components));
  13558. },
  13559. /**
  13560. * @description Return a linestring feature given a linestring WKT fragment.
  13561. * @param {string} A WKT fragment representing the linestring
  13562. * @returns {SuperMap.Feature.Vector} A linestring feature
  13563. * @private
  13564. */
  13565. 'linestring': function linestring(str) {
  13566. var points = StringExt.trim(str).split(',');
  13567. var components = [];
  13568. for (var i = 0, len = points.length; i < len; ++i) {
  13569. components.push(this.parse.point.apply(this, [points[i]]).geometry);
  13570. }
  13571. return new Vector(new LineString(components));
  13572. },
  13573. /**
  13574. * @description Return a multilinestring feature given a multilinestring WKT fragment.
  13575. * @param {string} A WKT fragment representing the multilinestring
  13576. * @returns {SuperMap.Feature.Vector} A multilinestring feature
  13577. * @private
  13578. */
  13579. 'multilinestring': function multilinestring(str) {
  13580. var line;
  13581. var lines = StringExt.trim(str).split(this.regExes.parenComma);
  13582. var components = [];
  13583. for (var i = 0, len = lines.length; i < len; ++i) {
  13584. line = lines[i].replace(this.regExes.trimParens, '$1');
  13585. components.push(this.parse.linestring.apply(this, [line]).geometry);
  13586. }
  13587. return new Vector(new MultiLineString(components));
  13588. },
  13589. /**
  13590. * @description Return a polygon feature given a polygon WKT fragment.
  13591. * @param {string} A WKT fragment representing the polygon
  13592. * @returns {SuperMap.Feature.Vector} A polygon feature
  13593. * @private
  13594. */
  13595. 'polygon': function polygon(str) {
  13596. var ring, linestring, linearring;
  13597. var rings = StringExt.trim(str).split(this.regExes.parenComma);
  13598. var components = [];
  13599. for (var i = 0, len = rings.length; i < len; ++i) {
  13600. ring = rings[i].replace(this.regExes.trimParens, '$1');
  13601. linestring = this.parse.linestring.apply(this, [ring]).geometry;
  13602. linearring = new LinearRing(linestring.components);
  13603. components.push(linearring);
  13604. }
  13605. return new Vector(new Polygon(components));
  13606. },
  13607. /**
  13608. * @private
  13609. * @description Return a multipolygon feature given a multipolygon WKT fragment.
  13610. * @param {string} A WKT fragment representing the multipolygon
  13611. * @returns {SuperMap.Feature.Vector} A multipolygon feature
  13612. *
  13613. */
  13614. 'multipolygon': function multipolygon(str) {
  13615. var polygon;
  13616. var polygons = StringExt.trim(str).split(this.regExes.doubleParenComma);
  13617. var components = [];
  13618. for (var i = 0, len = polygons.length; i < len; ++i) {
  13619. polygon = polygons[i].replace(this.regExes.trimParens, '$1');
  13620. components.push(this.parse.polygon.apply(this, [polygon]).geometry);
  13621. }
  13622. return new Vector(new MultiPolygon(components));
  13623. },
  13624. /**
  13625. * @description Return an array of features given a geometrycollection WKT fragment.
  13626. * @param {string} A WKT fragment representing the geometrycollection
  13627. * @returns {Array} An array of SuperMap.Feature.Vector
  13628. * @private
  13629. */
  13630. 'geometrycollection': function geometrycollection(str) {
  13631. // separate components of the collection with |
  13632. str = str.replace(/,\s*([A-Za-z])/g, '|$1');
  13633. var wktArray = StringExt.trim(str).split('|');
  13634. var components = [];
  13635. for (var i = 0, len = wktArray.length; i < len; ++i) {
  13636. components.push(this.read(wktArray[i]));
  13637. }
  13638. return components;
  13639. }
  13640. };
  13641. return _this;
  13642. }
  13643. /**
  13644. * @function SuperMap.Format.WKT.prototype.read
  13645. * @description Deserialize a WKT string and return a vector feature or an
  13646. * array of vector features. Supports WKT for POINT, MULTIPOINT,
  13647. * LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, and
  13648. * GEOMETRYCOLLECTION.
  13649. * @param {string} wkt - A WKT string
  13650. * @returns {SuperMap.Feature.Vector|Array} A feature or array of features for
  13651. * GEOMETRYCOLLECTION WKT.
  13652. */
  13653. WKT_createClass(WKT, [{
  13654. key: "read",
  13655. value: function read(wkt) {
  13656. var features, type, str;
  13657. wkt = wkt.replace(/[\n\r]/g, " ");
  13658. var matches = this.regExes.typeStr.exec(wkt);
  13659. if (matches) {
  13660. type = matches[1].toLowerCase();
  13661. str = matches[2];
  13662. if (this.parse[type]) {
  13663. features = this.parse[type].apply(this, [str]);
  13664. }
  13665. }
  13666. return features;
  13667. }
  13668. /**
  13669. * @function SuperMap.Format.WKT.prototype.write
  13670. * @description Serialize a feature or array of features into a WKT string.
  13671. * @param {(SuperMap.Feature.Vector|Array)} features - A feature or array of features
  13672. * @returns {string} The WKT string representation of the input geometries
  13673. */
  13674. }, {
  13675. key: "write",
  13676. value: function write(features) {
  13677. var collection, geometry, isCollection;
  13678. if (features.constructor === Array) {
  13679. collection = features;
  13680. isCollection = true;
  13681. } else {
  13682. collection = [features];
  13683. isCollection = false;
  13684. }
  13685. var pieces = [];
  13686. if (isCollection) {
  13687. pieces.push('GEOMETRYCOLLECTION(');
  13688. }
  13689. for (var i = 0, len = collection.length; i < len; ++i) {
  13690. if (isCollection && i > 0) {
  13691. pieces.push(',');
  13692. }
  13693. geometry = collection[i].geometry;
  13694. pieces.push(this.extractGeometry(geometry));
  13695. }
  13696. if (isCollection) {
  13697. pieces.push(')');
  13698. }
  13699. return pieces.join('');
  13700. }
  13701. /**
  13702. * @function SuperMap.Format.WKT.prototype.extractGeometry
  13703. * @description Entry point to construct the WKT for a single Geometry object.
  13704. * @param {SuperMap.Geometry} geometry
  13705. * @returns {string} A WKT string of representing the geometry
  13706. */
  13707. }, {
  13708. key: "extractGeometry",
  13709. value: function extractGeometry(geometry) {
  13710. var type = geometry.CLASS_NAME.split('.')[2].toLowerCase();
  13711. if (!this.extract[type]) {
  13712. return null;
  13713. }
  13714. var wktType = type === 'collection' ? 'GEOMETRYCOLLECTION' : type.toUpperCase();
  13715. var data = wktType + '(' + this.extract[type].apply(this, [geometry]) + ')';
  13716. return data;
  13717. }
  13718. }]);
  13719. return WKT;
  13720. }(Format);
  13721. SuperMap.Format.WKT = WKT;
  13722. ;// CONCATENATED MODULE: ./src/common/format/index.js
  13723. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13724. * This program are made available under the terms of the Apache License, Version 2.0
  13725. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13726. ;// CONCATENATED MODULE: ./src/common/control/TimeControlBase.js
  13727. function TimeControlBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13728. 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); } }
  13729. function TimeControlBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeControlBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeControlBase_defineProperties(Constructor, staticProps); return Constructor; }
  13730. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13731. * This program are made available under the terms of the Apache License, Version 2.0
  13732. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13733. /**
  13734. * @class SuperMap.TimeControlBase
  13735. * @classdesc 时间控制基类类。
  13736. * @category Control
  13737. * @param {Object} options - 该类开放的可选属性。
  13738. * @param {number} [options.speed=1] - 速度。不能小于 0,(每帧渲染的数据之间的间隔为1),设置越大速度越快。
  13739. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms),服务器刷新的时间间隔。
  13740. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  13741. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时以当前时间进行设置,建议设置。
  13742. * @param {boolean} [options.repeat=true] - 是否重复循环。
  13743. * @param {boolean} [options.reverse=false] - 是否反向。
  13744. */
  13745. var TimeControlBase = /*#__PURE__*/function () {
  13746. function TimeControlBase(options) {
  13747. TimeControlBase_classCallCheck(this, TimeControlBase);
  13748. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  13749. var me = this;
  13750. options = options || {};
  13751. /**
  13752. * @member {number} [SuperMap.TimeControlBase.prototype.speed=1]
  13753. * @description 步长,必须为非负数,默认为1(表示前后两次渲染的数据之间的间隔为1)
  13754. */
  13755. this.speed = options.speed && options.speed >= 0 ? options.speed : 1;
  13756. /**
  13757. * @member {number} [SuperMap.TimeControlBase.prototype.frequency=1000]
  13758. * @description 刷新频率(单位ms),服务器刷新的时间间隔。
  13759. */
  13760. this.frequency = options.speed && options.frequency >= 0 ? options.frequency : 1000;
  13761. /**
  13762. * @member {number} [SuperMap.TimeControlBase.prototype.startTime=0]
  13763. * @description 记录的起始时间,必须为数字,
  13764. * 如果不设置,初始化时为0,建议设置
  13765. */
  13766. this.startTime = options.startTime && options.startTime != null ? options.startTime : 0;
  13767. /**
  13768. * @member {number} SuperMap.TimeControlBase.prototype.endTime
  13769. * @description 记录的结束时间,必须为数字,
  13770. * 如果不设置,初始化时以当前时间进行设置,建议设置
  13771. */
  13772. this.endTime = options.endTime && options.endTime != null && options.endTime >= me.startTime ? options.endTime : +new Date();
  13773. /**
  13774. * @member {boolean} [SuperMap.TimeControlBase.prototype.repeat=true]
  13775. * @description 是否重复循环。
  13776. */
  13777. this.repeat = options.repeat !== undefined ? options.repeat : true;
  13778. /**
  13779. * @member {boolean} [SuperMap.TimeControlBase.prototype.reverse=false]
  13780. * @description 是否反向。
  13781. */
  13782. this.reverse = options.reverse !== undefined ? options.reverse : false;
  13783. /**
  13784. * @member {number} SuperMap.TimeControlBase.prototype.currentTime
  13785. * @description 记录近期的时间,也就是当前帧运行到的时间。
  13786. */
  13787. this.currentTime = null;
  13788. /**
  13789. * @member {number} SuperMap.TimeControlBase.prototype.oldTime
  13790. * @description 记录上一帧的时间,也就是之前运行到的时间。
  13791. */
  13792. this.oldTime = null;
  13793. /**
  13794. * @member {boolean} [SuperMap.TimeControlBase.prototype.running=false]
  13795. * @description 记录当前是否处于运行中。
  13796. */
  13797. this.running = false;
  13798. /**
  13799. * @private
  13800. * @member {Array.<string>} SuperMap.TimeControlBase.prototype.EVENT_TYPES
  13801. * @description 此类支持的事件类型。
  13802. *
  13803. */
  13804. this.EVENT_TYPES = ["start", "pause", "stop"];
  13805. /**
  13806. * @private
  13807. * @member {SuperMap.Events} SuperMap.TimeControlBase.prototype.events
  13808. * @description 事件
  13809. */
  13810. me.events = new Events(this, null, this.EVENT_TYPES);
  13811. me.speed = Number(me.speed);
  13812. me.frequency = Number(me.frequency);
  13813. me.startTime = Number(me.startTime);
  13814. me.endTime = Number(me.endTime);
  13815. me.startTime = Date.parse(new Date(me.startTime));
  13816. me.endTime = Date.parse(new Date(me.endTime)); //初始化当前时间
  13817. me.currentTime = me.startTime;
  13818. this.CLASS_NAME = "SuperMap.TimeControlBase";
  13819. }
  13820. /**
  13821. * @function SuperMap.TimeControlBase.prototype.updateOptions
  13822. * @param {Object} options - 设置参数得可选参数。设置步长,刷新频率、开始结束时间、是否循环、是否反向。
  13823. */
  13824. TimeControlBase_createClass(TimeControlBase, [{
  13825. key: "updateOptions",
  13826. value: function updateOptions(options) {
  13827. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  13828. var me = this;
  13829. options = options || {};
  13830. if (options.speed && options.speed >= 0) {
  13831. me.speed = options.speed;
  13832. me.speed = Number(me.speed);
  13833. }
  13834. if (options.speed && options.frequency >= 0) {
  13835. me.frequency = options.frequency;
  13836. me.frequency = Number(me.frequency);
  13837. }
  13838. if (options.startTime && options.startTime != null) {
  13839. me.startTime = options.startTime;
  13840. me.startTime = Date.parse(new Date(me.startTime));
  13841. }
  13842. if (options.endTime && options.endTime != null && options.endTime >= me.startTime) {
  13843. me.endTime = options.endTime;
  13844. me.endTime = Date.parse(new Date(me.endTime));
  13845. }
  13846. if (options.repeat != null) {
  13847. me.repeat = options.repeat;
  13848. }
  13849. if (options.reverse != null) {
  13850. me.reverse = options.reverse;
  13851. }
  13852. }
  13853. /**
  13854. * @function SuperMap.TimeControlBase.prototype.start
  13855. * @description 开始。
  13856. */
  13857. }, {
  13858. key: "start",
  13859. value: function start() {
  13860. var me = this;
  13861. if (!me.running) {
  13862. me.running = true;
  13863. me.tick();
  13864. me.events.triggerEvent('start', me.currentTime);
  13865. }
  13866. }
  13867. /**
  13868. * @function SuperMap.TimeControlBase.prototype.pause
  13869. * @description 暂停。
  13870. */
  13871. }, {
  13872. key: "pause",
  13873. value: function pause() {
  13874. var me = this;
  13875. me.running = false;
  13876. me.events.triggerEvent('pause', me.currentTime);
  13877. }
  13878. /**
  13879. * @function SuperMap.TimeControlBase.prototype.stop
  13880. * @description 停止,停止后返回起始状态。
  13881. */
  13882. }, {
  13883. key: "stop",
  13884. value: function stop() {
  13885. var me = this; //停止时 时间设置为开始时间
  13886. me.currentTime = me.startTime; //如果正在运行,修改为初始时间即可绘制一帧
  13887. if (me.running) {
  13888. me.running = false;
  13889. }
  13890. me.events.triggerEvent('stop', me.currentTime);
  13891. }
  13892. /**
  13893. * @function SuperMap.TimeControlBase.prototype.toggle
  13894. * @description 开关切换,切换的是开始和暂停。
  13895. */
  13896. }, {
  13897. key: "toggle",
  13898. value: function toggle() {
  13899. var me = this;
  13900. if (me.running) {
  13901. me.pause();
  13902. } else {
  13903. me.start();
  13904. }
  13905. }
  13906. /**
  13907. * @function SuperMap.TimeControlBase.prototype.setSpeed
  13908. * @description 设置步长。
  13909. * @param {number} [speed=1] - 步长,必须为非负数。
  13910. * @returns {boolean} true 代表设置成功,false 设置失败(speed 小于 0 时失败)。
  13911. */
  13912. }, {
  13913. key: "setSpeed",
  13914. value: function setSpeed(speed) {
  13915. var me = this;
  13916. if (speed >= 0) {
  13917. me.speed = speed;
  13918. return true;
  13919. }
  13920. return false;
  13921. }
  13922. /**
  13923. * @function SuperMap.TimeControlBase.prototype.getSpeed
  13924. * @description 获取步长。
  13925. * @returns {number} 返回当前的步长
  13926. */
  13927. }, {
  13928. key: "getSpeed",
  13929. value: function getSpeed() {
  13930. return this.speed;
  13931. }
  13932. /**
  13933. * @function SuperMap.TimeControlBase.prototype.setFrequency
  13934. * @description 设置刷新频率。
  13935. * @param {number} [frequency=1000] - 刷新频率,单位为 ms。
  13936. * @returns {boolean} true 代表设置成功,false 设置失败(frequency 小于 0 时失败)。
  13937. */
  13938. }, {
  13939. key: "setFrequency",
  13940. value: function setFrequency(frequency) {
  13941. var me = this;
  13942. if (frequency >= 0) {
  13943. me.frequency = frequency;
  13944. return true;
  13945. }
  13946. return false;
  13947. }
  13948. /**
  13949. * @function SuperMap.TimeControlBase.prototype.getFrequency
  13950. * @description 获取刷新频率。
  13951. * @returns {number} 返回当前的刷新频率。
  13952. */
  13953. }, {
  13954. key: "getFrequency",
  13955. value: function getFrequency() {
  13956. return this.frequency;
  13957. }
  13958. /**
  13959. * @function SuperMap.TimeControlBase.prototype.setStartTime
  13960. * @description 设置起始时间,设置完成后如果当前时间小于起始时间,则从起始时间开始。
  13961. * @param {number} startTime - 需要设置的起始时间。
  13962. * @returns {boolean} true 代表设置成功,false 设置失败(startTime 大于结束时间时失败)。
  13963. */
  13964. }, {
  13965. key: "setStartTime",
  13966. value: function setStartTime(startTime) {
  13967. var me = this;
  13968. startTime = Date.parse(new Date(startTime)); //起始时间不得大于结束时间
  13969. if (startTime > me.endTime) {
  13970. return false;
  13971. }
  13972. me.startTime = startTime; //如果当前时间小于了起始时间,则从当前起始时间开始
  13973. if (me.currentTime < me.startTime) {
  13974. me.currentTime = me.startTime;
  13975. me.tick();
  13976. }
  13977. return true;
  13978. }
  13979. /**
  13980. * @function SuperMap.TimeControlBase.prototype.getStartTime
  13981. * @description 获取起始时间。
  13982. * @returns {number} 返回当前的起始时间。
  13983. */
  13984. }, {
  13985. key: "getStartTime",
  13986. value: function getStartTime() {
  13987. return this.startTime;
  13988. }
  13989. /**
  13990. * @function SuperMap.TimeControlBase.prototype.setEndTime
  13991. * @description 设置结束时间,设置完成后如果当前时间大于结束,则从起始时间开始。
  13992. * @param {number} endTime - 需要设置的结束时间。
  13993. * @returns {boolean} true 代表设置成功,false 设置失败(endTime 小于开始时间时失败)。
  13994. */
  13995. }, {
  13996. key: "setEndTime",
  13997. value: function setEndTime(endTime) {
  13998. var me = this;
  13999. me.endTime = Date.parse(new Date(me.endTime)); //结束时间不得小于开始时间
  14000. if (endTime < me.startTime) {
  14001. return false;
  14002. }
  14003. me.endTime = endTime; //如果当前时间大于了结束时间,则从起始时间开始
  14004. if (me.currentTime >= me.endTime) {
  14005. me.currentTime = me.startTime;
  14006. me.tick();
  14007. }
  14008. return true;
  14009. }
  14010. /**
  14011. * @function SuperMap.TimeControlBase.prototype.getEndTime
  14012. * @description 获取结束时间。
  14013. * @returns {number} 返回当前的结束时间。
  14014. */
  14015. }, {
  14016. key: "getEndTime",
  14017. value: function getEndTime() {
  14018. return this.endTime;
  14019. }
  14020. /**
  14021. * @function SuperMap.TimeControlBase.prototype.setCurrentTime
  14022. * @description 设置当前时间。
  14023. * @param {number} currentTime - 需要设置的当前时间。
  14024. * @returns {boolean} true 代表设置成功,false 设置失败。
  14025. */
  14026. }, {
  14027. key: "setCurrentTime",
  14028. value: function setCurrentTime(currentTime) {
  14029. var me = this;
  14030. me.currentTime = Date.parse(new Date(me.currentTime)); //结束时间不得小于开始时间
  14031. if (currentTime >= me.startTime && currentTime <= me.endTime) {
  14032. me.currentTime = currentTime;
  14033. me.startTime = me.currentTime;
  14034. me.tick();
  14035. return true;
  14036. }
  14037. return false;
  14038. }
  14039. /**
  14040. * @function SuperMap.TimeControlBase.prototype.getCurrentTime
  14041. * @description 获取当前时间。
  14042. * @returns {number} 返回当前时间。
  14043. */
  14044. }, {
  14045. key: "getCurrentTime",
  14046. value: function getCurrentTime() {
  14047. return this.currentTime;
  14048. }
  14049. /**
  14050. * @function SuperMap.TimeControlBase.prototype.setRepeat
  14051. * @description 设置是否重复循环。
  14052. * @param {boolean} [repeat=true] - 是否重复循环。
  14053. */
  14054. }, {
  14055. key: "setRepeat",
  14056. value: function setRepeat(repeat) {
  14057. this.repeat = repeat;
  14058. }
  14059. /**
  14060. * @function SuperMap.TimeControlBase.prototype.getRepeat
  14061. * @description 获取是否重复循环,默认是 true。
  14062. * @returns {boolean} 返回是否重复循环。
  14063. */
  14064. }, {
  14065. key: "getRepeat",
  14066. value: function getRepeat() {
  14067. return this.repeat;
  14068. }
  14069. /**
  14070. * @function SuperMap.TimeControlBase.prototype.setReverse
  14071. * @description 设置是否反向。
  14072. * @param {boolean} [reverse=false] - 是否反向。
  14073. */
  14074. }, {
  14075. key: "setReverse",
  14076. value: function setReverse(reverse) {
  14077. this.reverse = reverse;
  14078. }
  14079. /**
  14080. * @function SuperMap.TimeControlBase.prototype.getReverse
  14081. * @description 获取是否反向,默认是false。
  14082. * @returns {boolean} 返回是否反向。
  14083. */
  14084. }, {
  14085. key: "getReverse",
  14086. value: function getReverse() {
  14087. return this.reverse;
  14088. }
  14089. /**
  14090. * @function SuperMap.TimeControlBase.prototype.getRunning
  14091. * @description 获取运行状态。
  14092. * @returns {boolean} true 代表正在运行,false 发表没有运行。
  14093. */
  14094. }, {
  14095. key: "getRunning",
  14096. value: function getRunning() {
  14097. return this.running;
  14098. }
  14099. /**
  14100. * @function SuperMap.TimeControlBase.prototype.destroy
  14101. * @description 销毁 Animator 对象,释放资源。
  14102. */
  14103. }, {
  14104. key: "destroy",
  14105. value: function destroy() {
  14106. var me = this;
  14107. me.speed = null;
  14108. me.frequency = null;
  14109. me.startTime = null;
  14110. me.endTime = null;
  14111. me.currentTime = null;
  14112. me.repeat = null;
  14113. me.running = false;
  14114. me.reverse = null;
  14115. }
  14116. }, {
  14117. key: "tick",
  14118. value: function tick() {//TODO 每次刷新执行的操作。子类实现
  14119. }
  14120. }]);
  14121. return TimeControlBase;
  14122. }();
  14123. SuperMap.TimeControlBase = TimeControlBase;
  14124. ;// CONCATENATED MODULE: ./src/common/control/TimeFlowControl.js
  14125. function TimeFlowControl_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TimeFlowControl_typeof = function _typeof(obj) { return typeof obj; }; } else { TimeFlowControl_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TimeFlowControl_typeof(obj); }
  14126. function TimeFlowControl_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14127. 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); } }
  14128. function TimeFlowControl_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeFlowControl_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeFlowControl_defineProperties(Constructor, staticProps); return Constructor; }
  14129. function TimeFlowControl_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TimeFlowControl_get = Reflect.get; } else { TimeFlowControl_get = function _get(target, property, receiver) { var base = TimeFlowControl_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return TimeFlowControl_get(target, property, receiver || target); }
  14130. function TimeFlowControl_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TimeFlowControl_getPrototypeOf(object); if (object === null) break; } return object; }
  14131. function TimeFlowControl_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) TimeFlowControl_setPrototypeOf(subClass, superClass); }
  14132. function TimeFlowControl_setPrototypeOf(o, p) { TimeFlowControl_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TimeFlowControl_setPrototypeOf(o, p); }
  14133. 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); }; }
  14134. function TimeFlowControl_possibleConstructorReturn(self, call) { if (call && (TimeFlowControl_typeof(call) === "object" || typeof call === "function")) { return call; } return TimeFlowControl_assertThisInitialized(self); }
  14135. function TimeFlowControl_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  14136. function TimeFlowControl_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  14137. function TimeFlowControl_getPrototypeOf(o) { TimeFlowControl_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TimeFlowControl_getPrototypeOf(o); }
  14138. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14139. * This program are made available under the terms of the Apache License, Version 2.0
  14140. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14141. /**
  14142. * @class SuperMap.TimeFlowControl
  14143. * @classdesc 时间管理类。
  14144. * @category Control
  14145. * @description 此类只负责时间上的控制,具体执行的操作需要用户在初始化时的回调函数内部进行实现。
  14146. * 如设置起始时间为 1000,结束时间是 2000,步长设置为 1,
  14147. * 那么表示按照每次1年(可以通过 setSpeed 进行修改)的变化从公元 1000 年开始到公元 2000 年为止,默认每 1 秒会 1 次(通过 setFrequency 修改)
  14148. * @extends {SuperMap.TimeControlBase}
  14149. * @param {function} callback - 每次刷新回调函数。具体的效果需要用户在此回调函数里面实现。
  14150. * @param {Object} options - 该类开放的可选属性。
  14151. * @param {number} [options.speed=1] - 步长(单位 ms)。不能小于 0,(每次刷新的数据之间的间隔为 1ms)。
  14152. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms)。
  14153. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  14154. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时使用 new Date() 以当前时间进行设置,建议设置。
  14155. * @param {boolean} [options.repeat=true] - 是否重复循环。
  14156. * @param {boolean} [options.reverse=false] - 是否反向。
  14157. */
  14158. var TimeFlowControl = /*#__PURE__*/function (_TimeControlBase) {
  14159. TimeFlowControl_inherits(TimeFlowControl, _TimeControlBase);
  14160. var _super = TimeFlowControl_createSuper(TimeFlowControl);
  14161. function TimeFlowControl(callback, options) {
  14162. var _this;
  14163. TimeFlowControl_classCallCheck(this, TimeFlowControl);
  14164. _this = _super.call(this, options);
  14165. var me = TimeFlowControl_assertThisInitialized(_this);
  14166. /**
  14167. * @member SuperMap.TimeFlowControl.prototype.callback -{function}
  14168. * @description 每次刷新执行的回调函数。
  14169. */
  14170. me.callback = callback; //先让IE下支持bind方法
  14171. if (!Function.prototype.bind) {
  14172. Function.prototype.bind = function (oThis) {
  14173. if (typeof this !== "function") {
  14174. throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  14175. }
  14176. var aArgs = Array.prototype.slice.call(arguments, 1),
  14177. fToBind = this,
  14178. fNOP = function fNOP() {//empty Function
  14179. },
  14180. fBound = function fBound() {
  14181. return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
  14182. };
  14183. fNOP.prototype = this.prototype;
  14184. fBound.prototype = new fNOP();
  14185. return fBound;
  14186. };
  14187. } //保证 this.tick 的上下文还是 TimeControl 这个对象
  14188. me.update = me.update.bind(me);
  14189. me.oldTime = me.currentTime;
  14190. me.CLASS_NAME = "SuperMap.TimeFlowControl";
  14191. return _this;
  14192. }
  14193. /**
  14194. * @function SuperMap.TimeFlowControl.prototype.updateOptions
  14195. * @override
  14196. */
  14197. TimeFlowControl_createClass(TimeFlowControl, [{
  14198. key: "updateOptions",
  14199. value: function updateOptions(options) {
  14200. options = options || {};
  14201. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "updateOptions", this).call(this, options);
  14202. }
  14203. /**
  14204. * @function SuperMap.TimeFlowControl.prototype.start
  14205. * @override
  14206. */
  14207. }, {
  14208. key: "start",
  14209. value: function start() {
  14210. var me = this;
  14211. if (me.running) {
  14212. return;
  14213. }
  14214. me.running = true;
  14215. if (me.reverse) {
  14216. if (me.currentTime === me.startTime) {
  14217. me.oldTime = me.endTime;
  14218. me.currentTime = me.oldTime;
  14219. }
  14220. } else {
  14221. if (me.oldTime === me.endTime) {
  14222. me.currentTime = me.startTime;
  14223. me.oldTime = me.currentTime;
  14224. }
  14225. }
  14226. me.tick();
  14227. }
  14228. /**
  14229. * @function SuperMap.TimeFlowControl.prototype.stop
  14230. * @override
  14231. */
  14232. }, {
  14233. key: "stop",
  14234. value: function stop() {
  14235. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "stop", this).call(this);
  14236. var me = this;
  14237. me.oldTime = me.currentTime;
  14238. if (me.running) {
  14239. me.running = false;
  14240. } //清除定时tick
  14241. me.intervalId && window.clearTimeout(me.intervalId);
  14242. }
  14243. /**
  14244. * @function SuperMap.TimeFlowControl.prototype.destroy
  14245. * @override
  14246. */
  14247. }, {
  14248. key: "destroy",
  14249. value: function destroy() {
  14250. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "destroy", this).call(this);
  14251. var me = this;
  14252. me.oldTime = null;
  14253. me.callback = null;
  14254. }
  14255. /**
  14256. * @function SuperMap.TimeFlowControl.prototype.tick
  14257. * @description 定时刷新。
  14258. */
  14259. }, {
  14260. key: "tick",
  14261. value: function tick() {
  14262. var me = this;
  14263. me.intervalId && window.clearInterval(me.intervalId);
  14264. me.intervalId = null;
  14265. me.update();
  14266. me.intervalId = window.setInterval(me.update, me.frequency);
  14267. }
  14268. /**
  14269. * @function SuperMap.TimeFlowControl.prototype.update
  14270. * @override
  14271. */
  14272. }, {
  14273. key: "update",
  14274. value: function update() {
  14275. var me = this; //判定是否还需要继续
  14276. if (!me.running) {
  14277. return;
  14278. } //调用回调函数
  14279. me.callback && me.callback(me.currentTime); //destroy之后callback就为空,所以需要判定一下
  14280. if (!me.reverse) {
  14281. //如果相等,则代表上一帧已经运行到了最后,下一帧运行初始化的状态
  14282. if (me.currentTime === me.endTime) {
  14283. //不循环时
  14284. if (!me.repeat) {
  14285. me.running = false;
  14286. me.stop();
  14287. return null;
  14288. }
  14289. me.stop();
  14290. me.currentTime = me.startTime;
  14291. me.oldTime = me.currentTime;
  14292. me.start();
  14293. } else {
  14294. //否则时间递增
  14295. me.oldTime = me.currentTime;
  14296. me.currentTime += me.speed;
  14297. }
  14298. if (me.currentTime >= me.endTime) {
  14299. me.currentTime = me.endTime;
  14300. }
  14301. } else {
  14302. //如果相等,则代表上一帧已经运行到了最前,下一帧运行结束的状态
  14303. if (me.currentTime === me.startTime) {
  14304. //不循环时
  14305. if (!me.repeat) {
  14306. me.running = false;
  14307. return null;
  14308. }
  14309. me.oldTime = me.endTime;
  14310. me.currentTime = me.oldTime;
  14311. } else {
  14312. //否则时间递减
  14313. me.currentTime = me.oldTime;
  14314. me.oldTime -= me.speed;
  14315. }
  14316. if (me.oldTime <= me.startTime) {
  14317. me.oldTime = me.startTime;
  14318. }
  14319. }
  14320. }
  14321. }]);
  14322. return TimeFlowControl;
  14323. }(TimeControlBase);
  14324. SuperMap.TimeFlowControl = TimeFlowControl;
  14325. ;// CONCATENATED MODULE: ./src/common/control/index.js
  14326. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14327. * This program are made available under the terms of the Apache License, Version 2.0
  14328. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14329. // EXTERNAL MODULE: ./node_modules/promise-polyfill/dist/polyfill.js
  14330. var polyfill = __webpack_require__(957);
  14331. // EXTERNAL MODULE: ./node_modules/fetch-ie8/fetch.js
  14332. var fetch = __webpack_require__(937);
  14333. // EXTERNAL MODULE: ./node_modules/fetch-jsonp/build/fetch-jsonp.js
  14334. var fetch_jsonp = __webpack_require__(238);
  14335. var fetch_jsonp_default = /*#__PURE__*/__webpack_require__.n(fetch_jsonp);
  14336. ;// CONCATENATED MODULE: ./src/common/util/FetchRequest.js
  14337. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14338. * This program are made available under the terms of the Apache License, Version 2.0
  14339. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14340. var FetchRequest_fetch = window.fetch;
  14341. var setFetch = function setFetch(newFetch) {
  14342. FetchRequest_fetch = newFetch;
  14343. };
  14344. /**
  14345. * @function SuperMap.setCORS
  14346. * @description 设置是否允许跨域请求,全局配置,优先级低于 service 下的 crossOring 参数。
  14347. * @param {boolean} cors - 是否允许跨域请求。
  14348. */
  14349. var setCORS = SuperMap.setCORS = function (cors) {
  14350. SuperMap.CORS = cors;
  14351. };
  14352. /**
  14353. * @function SuperMap.isCORS
  14354. * @description 是是否允许跨域请求。
  14355. * @returns {boolean} 是否允许跨域请求。
  14356. */
  14357. var isCORS = SuperMap.isCORS = function () {
  14358. if (SuperMap.CORS != undefined) {
  14359. return SuperMap.CORS;
  14360. }
  14361. return window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest();
  14362. };
  14363. /**
  14364. * @function SuperMap.setRequestTimeout
  14365. * @description 设置请求超时时间。
  14366. * @param {number} [timeout=45] - 请求超时时间,单位秒。
  14367. */
  14368. var setRequestTimeout = SuperMap.setRequestTimeout = function (timeout) {
  14369. return SuperMap.RequestTimeout = timeout;
  14370. };
  14371. /**
  14372. * @function SuperMap.getRequestTimeout
  14373. * @description 获取请求超时时间。
  14374. * @returns {number} 请求超时时间。
  14375. */
  14376. var getRequestTimeout = SuperMap.getRequestTimeout = function () {
  14377. return SuperMap.RequestTimeout || 45000;
  14378. };
  14379. var FetchRequest = SuperMap.FetchRequest = {
  14380. commit: function commit(method, url, params, options) {
  14381. method = method ? method.toUpperCase() : method;
  14382. switch (method) {
  14383. case 'GET':
  14384. return this.get(url, params, options);
  14385. case 'POST':
  14386. return this.post(url, params, options);
  14387. case 'PUT':
  14388. return this.put(url, params, options);
  14389. case 'DELETE':
  14390. return this["delete"](url, params, options);
  14391. default:
  14392. return this.get(url, params, options);
  14393. }
  14394. },
  14395. supportDirectRequest: function supportDirectRequest(url, options) {
  14396. if (Util.isInTheSameDomain(url)) {
  14397. return true;
  14398. }
  14399. if (options.crossOrigin != undefined) {
  14400. return options.crossOrigin;
  14401. } else {
  14402. return isCORS() || options.proxy;
  14403. }
  14404. },
  14405. get: function get(url, params, options) {
  14406. options = options || {};
  14407. var type = 'GET';
  14408. url = Util.urlAppend(url, this._getParameterString(params || {}));
  14409. url = this._processUrl(url, options);
  14410. if (!this.supportDirectRequest(url, options)) {
  14411. url = url.replace('.json', '.jsonp');
  14412. var config = {
  14413. url: url,
  14414. data: params
  14415. };
  14416. return SuperMap.Util.RequestJSONPPromise.GET(config);
  14417. }
  14418. if (!this.urlIsLong(url)) {
  14419. return this._fetch(url, params, options, type);
  14420. } else {
  14421. return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
  14422. }
  14423. },
  14424. "delete": function _delete(url, params, options) {
  14425. options = options || {};
  14426. var type = 'DELETE';
  14427. url = Util.urlAppend(url, this._getParameterString(params || {}));
  14428. url = this._processUrl(url, options);
  14429. if (!this.supportDirectRequest(url, options)) {
  14430. url = url.replace('.json', '.jsonp');
  14431. var config = {
  14432. url: url += "&_method=DELETE",
  14433. data: params
  14434. };
  14435. return SuperMap.Util.RequestJSONPPromise.DELETE(config);
  14436. }
  14437. if (this.urlIsLong(url)) {
  14438. return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
  14439. }
  14440. return this._fetch(url, params, options, type);
  14441. },
  14442. post: function post(url, params, options) {
  14443. options = options || {};
  14444. if (!this.supportDirectRequest(url, options)) {
  14445. url = url.replace('.json', '.jsonp');
  14446. var config = {
  14447. url: url += "&_method=POST",
  14448. data: params
  14449. };
  14450. return SuperMap.Util.RequestJSONPPromise.POST(config);
  14451. }
  14452. return this._fetch(this._processUrl(url, options), params, options, 'POST');
  14453. },
  14454. put: function put(url, params, options) {
  14455. options = options || {};
  14456. url = this._processUrl(url, options);
  14457. if (!this.supportDirectRequest(url, options)) {
  14458. url = url.replace('.json', '.jsonp');
  14459. var config = {
  14460. url: url += "&_method=PUT",
  14461. data: params
  14462. };
  14463. return SuperMap.Util.RequestJSONPPromise.PUT(config);
  14464. }
  14465. return this._fetch(url, params, options, 'PUT');
  14466. },
  14467. urlIsLong: function urlIsLong(url) {
  14468. //当前url的字节长度。
  14469. var totalLength = 0,
  14470. charCode = null;
  14471. for (var i = 0, len = url.length; i < len; i++) {
  14472. //转化为Unicode编码
  14473. charCode = url.charCodeAt(i);
  14474. if (charCode < 0x007f) {
  14475. totalLength++;
  14476. } else if (0x0080 <= charCode && charCode <= 0x07ff) {
  14477. totalLength += 2;
  14478. } else if (0x0800 <= charCode && charCode <= 0xffff) {
  14479. totalLength += 3;
  14480. }
  14481. }
  14482. return totalLength < 2000 ? false : true;
  14483. },
  14484. _postSimulatie: function _postSimulatie(type, url, params, options) {
  14485. var separator = url.indexOf('?') > -1 ? '&' : '?';
  14486. url += separator + '_method=' + type;
  14487. if (typeof params !== 'string') {
  14488. params = JSON.stringify(params);
  14489. }
  14490. return this.post(url, params, options);
  14491. },
  14492. _processUrl: function _processUrl(url, options) {
  14493. if (this._isMVTRequest(url)) {
  14494. return url;
  14495. }
  14496. if (url.indexOf('.json') === -1 && !options.withoutFormatSuffix) {
  14497. if (url.indexOf('?') < 0) {
  14498. url += '.json';
  14499. } else {
  14500. var urlArrays = url.split('?');
  14501. if (urlArrays.length === 2) {
  14502. url = urlArrays[0] + '.json?' + urlArrays[1];
  14503. }
  14504. }
  14505. }
  14506. if (options && options.proxy) {
  14507. if (typeof options.proxy === 'function') {
  14508. url = options.proxy(url);
  14509. } else {
  14510. url = decodeURIComponent(url);
  14511. url = options.proxy + encodeURIComponent(url);
  14512. }
  14513. }
  14514. return url;
  14515. },
  14516. _fetch: function _fetch(url, params, options, type) {
  14517. options = options || {};
  14518. options.headers = options.headers || {};
  14519. if (!options.headers['Content-Type']) {
  14520. options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
  14521. }
  14522. if (options.timeout) {
  14523. return this._timeout(options.timeout, FetchRequest_fetch(url, {
  14524. method: type,
  14525. headers: options.headers,
  14526. body: type === 'PUT' || type === 'POST' ? params : undefined,
  14527. credentials: this._getWithCredentials(options),
  14528. mode: 'cors',
  14529. timeout: getRequestTimeout()
  14530. }).then(function (response) {
  14531. return response;
  14532. }));
  14533. }
  14534. return FetchRequest_fetch(url, {
  14535. method: type,
  14536. body: type === 'PUT' || type === 'POST' ? params : undefined,
  14537. headers: options.headers,
  14538. credentials: this._getWithCredentials(options),
  14539. mode: 'cors',
  14540. timeout: getRequestTimeout()
  14541. }).then(function (response) {
  14542. return response;
  14543. });
  14544. },
  14545. _getWithCredentials: function _getWithCredentials(options) {
  14546. if (options.withCredentials === true) {
  14547. return 'include';
  14548. }
  14549. if (options.withCredentials === false) {
  14550. return 'omit';
  14551. }
  14552. return 'same-origin';
  14553. },
  14554. _fetchJsonp: function _fetchJsonp(url, options) {
  14555. options = options || {};
  14556. return fetch_jsonp_default()(url, {
  14557. method: 'GET',
  14558. timeout: options.timeout
  14559. }).then(function (response) {
  14560. return response;
  14561. });
  14562. },
  14563. _timeout: function _timeout(seconds, promise) {
  14564. return new Promise(function (resolve, reject) {
  14565. setTimeout(function () {
  14566. reject(new Error('timeout'));
  14567. }, seconds);
  14568. promise.then(resolve, reject);
  14569. });
  14570. },
  14571. _getParameterString: function _getParameterString(params) {
  14572. var paramsArray = [];
  14573. for (var key in params) {
  14574. var value = params[key];
  14575. if (value != null && typeof value !== 'function') {
  14576. var encodedValue;
  14577. if (Array.isArray(value) || value.toString() === '[object Object]') {
  14578. encodedValue = encodeURIComponent(JSON.stringify(value));
  14579. } else {
  14580. encodedValue = encodeURIComponent(value);
  14581. }
  14582. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  14583. }
  14584. }
  14585. return paramsArray.join('&');
  14586. },
  14587. _isMVTRequest: function _isMVTRequest(url) {
  14588. return url.indexOf('.mvt') > -1 || url.indexOf('.pbf') > -1;
  14589. }
  14590. };
  14591. SuperMap.Util.RequestJSONPPromise = {
  14592. limitLength: 1500,
  14593. queryKeys: [],
  14594. queryValues: [],
  14595. supermap_callbacks: {},
  14596. addQueryStrings: function addQueryStrings(values) {
  14597. var me = this;
  14598. for (var key in values) {
  14599. me.queryKeys.push(key);
  14600. if (typeof values[key] !== 'string') {
  14601. values[key] = SuperMap.Util.toJSON(values[key]);
  14602. }
  14603. var tempValue = encodeURIComponent(values[key]);
  14604. me.queryValues.push(tempValue);
  14605. }
  14606. },
  14607. issue: function issue(config) {
  14608. var me = this,
  14609. uid = me.getUid(),
  14610. url = config.url,
  14611. splitQuestUrl = [];
  14612. var p = new Promise(function (resolve) {
  14613. me.supermap_callbacks[uid] = function (response) {
  14614. delete me.supermap_callbacks[uid];
  14615. resolve(response);
  14616. };
  14617. }); // me.addQueryStrings({
  14618. // callback: "SuperMap.Util.RequestJSONPPromise.supermap_callbacks[" + uid + "]"
  14619. // });
  14620. var sectionURL = url,
  14621. keysCount = 0; //此次sectionURL中有多少个key
  14622. var length = me.queryKeys ? me.queryKeys.length : 0;
  14623. for (var i = 0; i < length; i++) {
  14624. if (sectionURL.length + me.queryKeys[i].length + 2 >= me.limitLength) {
  14625. //+2 for ("&"or"?")and"="
  14626. if (keysCount == 0) {
  14627. return false;
  14628. }
  14629. splitQuestUrl.push(sectionURL);
  14630. sectionURL = url;
  14631. keysCount = 0;
  14632. i--;
  14633. } else {
  14634. if (sectionURL.length + me.queryKeys[i].length + 2 + me.queryValues[i].length > me.limitLength) {
  14635. var leftValue = me.queryValues[i];
  14636. while (leftValue.length > 0) {
  14637. var leftLength = me.limitLength - sectionURL.length - me.queryKeys[i].length - 2; //+2 for ("&"or"?")and"="
  14638. if (sectionURL.indexOf('?') > -1) {
  14639. sectionURL += '&';
  14640. } else {
  14641. sectionURL += '?';
  14642. }
  14643. var tempLeftValue = leftValue.substring(0, leftLength); //避免 截断sectionURL时,将类似于%22这样的符号截成两半,从而导致服务端组装sectionURL时发生错误
  14644. if (tempLeftValue.substring(leftLength - 1, leftLength) === '%') {
  14645. leftLength -= 1;
  14646. tempLeftValue = leftValue.substring(0, leftLength);
  14647. } else if (tempLeftValue.substring(leftLength - 2, leftLength - 1) === '%') {
  14648. leftLength -= 2;
  14649. tempLeftValue = leftValue.substring(0, leftLength);
  14650. }
  14651. sectionURL += me.queryKeys[i] + '=' + tempLeftValue;
  14652. leftValue = leftValue.substring(leftLength);
  14653. if (tempLeftValue.length > 0) {
  14654. splitQuestUrl.push(sectionURL);
  14655. sectionURL = url;
  14656. keysCount = 0;
  14657. }
  14658. }
  14659. } else {
  14660. keysCount++;
  14661. if (sectionURL.indexOf('?') > -1) {
  14662. sectionURL += '&';
  14663. } else {
  14664. sectionURL += '?';
  14665. }
  14666. sectionURL += me.queryKeys[i] + '=' + me.queryValues[i];
  14667. }
  14668. }
  14669. }
  14670. splitQuestUrl.push(sectionURL);
  14671. me.send(splitQuestUrl, 'SuperMap.Util.RequestJSONPPromise.supermap_callbacks[' + uid + ']', config && config.proxy);
  14672. return p;
  14673. },
  14674. getUid: function getUid() {
  14675. var uid = new Date().getTime(),
  14676. random = Math.floor(Math.random() * 1e17);
  14677. return uid * 1000 + random;
  14678. },
  14679. send: function send(splitQuestUrl, callback, proxy) {
  14680. var len = splitQuestUrl.length;
  14681. if (len > 0) {
  14682. var jsonpUserID = new Date().getTime();
  14683. for (var i = 0; i < len; i++) {
  14684. var url = splitQuestUrl[i];
  14685. if (url.indexOf('?') > -1) {
  14686. url += '&';
  14687. } else {
  14688. url += '?';
  14689. }
  14690. url += 'sectionCount=' + len;
  14691. url += '&sectionIndex=' + i;
  14692. url += '&jsonpUserID=' + jsonpUserID;
  14693. if (proxy) {
  14694. url = decodeURIComponent(url);
  14695. url = proxy + encodeURIComponent(url);
  14696. }
  14697. fetch_jsonp_default()(url, {
  14698. jsonpCallbackFunction: callback,
  14699. timeout: 30000
  14700. });
  14701. }
  14702. }
  14703. },
  14704. GET: function GET(config) {
  14705. var me = this;
  14706. me.queryKeys.length = 0;
  14707. me.queryValues.length = 0;
  14708. me.addQueryStrings(config.params);
  14709. return me.issue(config);
  14710. },
  14711. POST: function POST(config) {
  14712. var me = this;
  14713. me.queryKeys.length = 0;
  14714. me.queryValues.length = 0;
  14715. me.addQueryStrings({
  14716. requestEntity: config.data
  14717. });
  14718. return me.issue(config);
  14719. },
  14720. PUT: function PUT(config) {
  14721. var me = this;
  14722. me.queryKeys.length = 0;
  14723. me.queryValues.length = 0;
  14724. me.addQueryStrings({
  14725. requestEntity: config.data
  14726. });
  14727. return me.issue(config);
  14728. },
  14729. DELETE: function DELETE(config) {
  14730. var me = this;
  14731. me.queryKeys.length = 0;
  14732. me.queryValues.length = 0;
  14733. me.addQueryStrings({
  14734. requestEntity: config.data
  14735. });
  14736. return me.issue(config);
  14737. }
  14738. };
  14739. ;// CONCATENATED MODULE: ./src/common/security/SecurityManager.js
  14740. function SecurityManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14741. 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); } }
  14742. function SecurityManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) SecurityManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) SecurityManager_defineProperties(Constructor, staticProps); return Constructor; }
  14743. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14744. * This program are made available under the terms of the Apache License, Version 2.0
  14745. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14746. /**
  14747. * @name SecurityManager
  14748. * @memberOf SuperMap
  14749. * @namespace
  14750. * @category Security
  14751. * @description 安全管理中心,提供 iServer,iPortal,Online 统一权限认证管理。
  14752. * > 使用说明:
  14753. * > 创建任何一个服务之前调用 {@link SuperMap.SecurityManager.registerToken}或
  14754. * > {@link SuperMap.SecurityManager.registerKey}注册凭据。
  14755. * > 发送请求时根据 url 或者服务 id 获取相应的 key 或者 token 并自动添加到服务地址中。
  14756. */
  14757. var SecurityManager = /*#__PURE__*/function () {
  14758. function SecurityManager() {
  14759. SecurityManager_classCallCheck(this, SecurityManager);
  14760. }
  14761. SecurityManager_createClass(SecurityManager, null, [{
  14762. key: "generateToken",
  14763. /**
  14764. * @description 从服务器获取一个token,在此之前要注册服务器信息。
  14765. * @function SuperMap.SecurityManager.generateToken
  14766. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  14767. * @param {SuperMap.TokenServiceParameter} tokenParam - token 申请参数。
  14768. * @returns {Promise} 返回包含 token 信息的 Promise 对象。
  14769. */
  14770. value: function generateToken(url, tokenParam) {
  14771. var serverInfo = this.servers[url];
  14772. if (!serverInfo) {
  14773. return;
  14774. }
  14775. return FetchRequest.post(serverInfo.tokenServiceUrl, JSON.stringify(tokenParam.toJSON())).then(function (response) {
  14776. return response.text();
  14777. });
  14778. }
  14779. /**
  14780. * @description 注册安全服务器相关信息。
  14781. * @function SuperMap.SecurityManager.registerServers
  14782. * @param {SuperMap.ServerInfo} serverInfos - 服务器信息。
  14783. */
  14784. }, {
  14785. key: "registerServers",
  14786. value: function registerServers(serverInfos) {
  14787. this.servers = this.servers || {};
  14788. if (!Util.isArray(serverInfos)) {
  14789. serverInfos = [serverInfos];
  14790. }
  14791. for (var i = 0; i < serverInfos.length; i++) {
  14792. var serverInfo = serverInfos[i];
  14793. this.servers[serverInfo.server] = serverInfo;
  14794. }
  14795. }
  14796. /**
  14797. * @description 服务请求都会自动带上这个 token。
  14798. * @function SuperMap.SecurityManager.registerToken
  14799. * @param {string} url -服务器域名+端口:如http://localhost:8090。
  14800. * @param {string} token - token
  14801. */
  14802. }, {
  14803. key: "registerToken",
  14804. value: function registerToken(url, token) {
  14805. this.tokens = this.tokens || {};
  14806. if (!url || !token) {
  14807. return;
  14808. }
  14809. var domain = this._getTokenStorageKey(url);
  14810. this.tokens[domain] = token;
  14811. }
  14812. /**
  14813. * @description 注册 key,ids 为数组(存在一个 key 对应多个服务)。
  14814. * @function SuperMap.SecurityManager.registerKey
  14815. * @param {Array} ids - 可以是服务 id 数组或者 url 地址数组或者 webAPI 类型数组。
  14816. * @param {string} key - key
  14817. */
  14818. }, {
  14819. key: "registerKey",
  14820. value: function registerKey(ids, key) {
  14821. this.keys = this.keys || {};
  14822. if (!ids || ids.length < 1 || !key) {
  14823. return;
  14824. }
  14825. ids = Util.isArray(ids) ? ids : [ids];
  14826. for (var i = 0; i < ids.length; i++) {
  14827. var id = this._getUrlRestString(ids[0]) || ids[0];
  14828. this.keys[id] = key;
  14829. }
  14830. }
  14831. /**
  14832. * @description 获取服务器信息。
  14833. * @function SuperMap.SecurityManager.getServerInfo
  14834. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  14835. * @returns {SuperMap.ServerInfo} 服务器信息。
  14836. */
  14837. }, {
  14838. key: "getServerInfo",
  14839. value: function getServerInfo(url) {
  14840. this.servers = this.servers || {};
  14841. return this.servers[url];
  14842. }
  14843. /**
  14844. * @description 根据 Url 获取token。
  14845. * @function SuperMap.SecurityManager.getToken
  14846. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  14847. * @returns {string} token
  14848. */
  14849. }, {
  14850. key: "getToken",
  14851. value: function getToken(url) {
  14852. if (!url) {
  14853. return;
  14854. }
  14855. this.tokens = this.tokens || {};
  14856. var domain = this._getTokenStorageKey(url);
  14857. return this.tokens[domain];
  14858. }
  14859. /**
  14860. * @description 根据 Url 获取 key。
  14861. * @function SuperMap.SecurityManager.getKey
  14862. * @param {string} id - id
  14863. * @returns {string} key
  14864. */
  14865. }, {
  14866. key: "getKey",
  14867. value: function getKey(id) {
  14868. this.keys = this.keys || {};
  14869. var key = this._getUrlRestString(id) || id;
  14870. return this.keys[key];
  14871. }
  14872. /**
  14873. * @description iServer 登录验证。
  14874. * @function SuperMap.SecurityManager.loginiServer
  14875. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  14876. * @param {string} username - 用户名。
  14877. * @param {string} password - 密码。
  14878. * @param {boolean} [rememberme=false] - 是否记住。
  14879. * @returns {Promise} 返回包含 iServer 登录请求结果的 Promise 对象。
  14880. */
  14881. }, {
  14882. key: "loginiServer",
  14883. value: function loginiServer(url, username, password, rememberme) {
  14884. url = Util.urlPathAppend(url, 'services/security/login');
  14885. var loginInfo = {
  14886. username: username && username.toString(),
  14887. password: password && password.toString(),
  14888. rememberme: rememberme
  14889. };
  14890. loginInfo = JSON.stringify(loginInfo);
  14891. var requestOptions = {
  14892. headers: {
  14893. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  14894. }
  14895. };
  14896. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  14897. return response.json();
  14898. });
  14899. }
  14900. /**
  14901. * @description iServer登出。
  14902. * @function SuperMap.SecurityManager.logoutiServer
  14903. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  14904. * @returns {Promise} 是否登出成功。
  14905. */
  14906. }, {
  14907. key: "logoutiServer",
  14908. value: function logoutiServer(url) {
  14909. url = Util.urlPathAppend(url, 'services/security/logout');
  14910. var requestOptions = {
  14911. headers: {
  14912. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  14913. },
  14914. withoutFormatSuffix: true
  14915. };
  14916. return FetchRequest.get(url, "", requestOptions).then(function () {
  14917. return true;
  14918. })["catch"](function () {
  14919. return false;
  14920. });
  14921. }
  14922. /**
  14923. * @description Online 登录验证。
  14924. * @function SuperMap.SecurityManager.loginOnline
  14925. * @param {string} callbackLocation - 跳转位置。
  14926. * @param {boolean} [newTab=true] - 是否新窗口打开。
  14927. */
  14928. }, {
  14929. key: "loginOnline",
  14930. value: function loginOnline(callbackLocation, newTab) {
  14931. var loginUrl = SecurityManager.SSO + "/login?service=" + callbackLocation;
  14932. this._open(loginUrl, newTab);
  14933. }
  14934. /**
  14935. * @description iPortal登录验证。
  14936. * @function SuperMap.SecurityManager.loginiPortal
  14937. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  14938. * @param {string} username - 用户名。
  14939. * @param {string} password - 密码。
  14940. * @returns {Promise} 返回包含 iPortal 登录请求结果的 Promise 对象。
  14941. */
  14942. }, {
  14943. key: "loginiPortal",
  14944. value: function loginiPortal(url, username, password) {
  14945. url = Util.urlPathAppend(url, 'web/login');
  14946. var loginInfo = {
  14947. username: username && username.toString(),
  14948. password: password && password.toString()
  14949. };
  14950. loginInfo = JSON.stringify(loginInfo);
  14951. var requestOptions = {
  14952. headers: {
  14953. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  14954. },
  14955. withCredentials: true
  14956. };
  14957. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  14958. return response.json();
  14959. });
  14960. }
  14961. /**
  14962. * @description iPortal 登出。
  14963. * @function SuperMap.SecurityManager.logoutiPortal
  14964. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  14965. * @returns {Promise} 如果登出成功,返回 true;否则返回 false。
  14966. */
  14967. }, {
  14968. key: "logoutiPortal",
  14969. value: function logoutiPortal(url) {
  14970. url = Util.urlPathAppend(url, 'services/security/logout');
  14971. var requestOptions = {
  14972. headers: {
  14973. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  14974. },
  14975. withCredentials: true,
  14976. withoutFormatSuffix: true
  14977. };
  14978. return FetchRequest.get(url, "", requestOptions).then(function () {
  14979. return true;
  14980. })["catch"](function () {
  14981. return false;
  14982. });
  14983. }
  14984. /**
  14985. * @description iManager 登录验证。
  14986. * @function SuperMap.SecurityManager.loginManager
  14987. * @param {string} url - iManager 地址。地址参数为 iManager 首页地址,如: http://localhost:8390/imanager。
  14988. * @param {Object} [loginInfoParams] - iManager 登录参数。
  14989. * @param {string} loginInfoParams.userName - 用户名。
  14990. * @param {string} loginInfoParams.password - 密码。
  14991. * @param {Object} options
  14992. * @param {boolean} [options.isNewTab=true] - 不同域时是否在新窗口打开登录页面。
  14993. * @returns {Promise} 返回包含 iManager 登录请求结果的 Promise 对象。
  14994. */
  14995. }, {
  14996. key: "loginManager",
  14997. value: function loginManager(url, loginInfoParams, options) {
  14998. if (!Util.isInTheSameDomain(url)) {
  14999. var isNewTab = options ? options.isNewTab : true;
  15000. this._open(url, isNewTab);
  15001. return;
  15002. }
  15003. var requestUrl = Util.urlPathAppend(url, 'icloud/security/tokens');
  15004. var params = loginInfoParams || {};
  15005. var loginInfo = {
  15006. username: params.userName && params.userName.toString(),
  15007. password: params.password && params.password.toString()
  15008. };
  15009. loginInfo = JSON.stringify(loginInfo);
  15010. var requestOptions = {
  15011. headers: {
  15012. 'Accept': '*/*',
  15013. 'Content-Type': 'application/json'
  15014. }
  15015. };
  15016. var me = this;
  15017. return FetchRequest.post(requestUrl, loginInfo, requestOptions).then(function (response) {
  15018. response.text().then(function (result) {
  15019. me.imanagerToken = result;
  15020. return result;
  15021. });
  15022. });
  15023. }
  15024. /**
  15025. * @description 清空全部验证信息。
  15026. * @function SuperMap.SecurityManager.destroyAllCredentials
  15027. */
  15028. }, {
  15029. key: "destroyAllCredentials",
  15030. value: function destroyAllCredentials() {
  15031. this.keys = null;
  15032. this.tokens = null;
  15033. this.servers = null;
  15034. }
  15035. /**
  15036. * @description 清空令牌信息。
  15037. * @function SuperMap.SecurityManager.destroyToken
  15038. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  15039. */
  15040. }, {
  15041. key: "destroyToken",
  15042. value: function destroyToken(url) {
  15043. if (!url) {
  15044. return;
  15045. }
  15046. var domain = this._getTokenStorageKey(url);
  15047. this.tokens = this.tokens || {};
  15048. if (this.tokens[domain]) {
  15049. delete this.tokens[domain];
  15050. }
  15051. }
  15052. /**
  15053. * @description 清空服务授权码。
  15054. * @function SuperMap.SecurityManager.destroyKey
  15055. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  15056. */
  15057. }, {
  15058. key: "destroyKey",
  15059. value: function destroyKey(url) {
  15060. if (!url) {
  15061. return;
  15062. }
  15063. this.keys = this.keys || {};
  15064. var key = this._getUrlRestString(url) || url;
  15065. if (this.keys[key]) {
  15066. delete this.keys[key];
  15067. }
  15068. }
  15069. }, {
  15070. key: "_open",
  15071. value: function _open(url, newTab) {
  15072. newTab = newTab != null ? newTab : true;
  15073. var offsetX = window.screen.availWidth / 2 - this.INNER_WINDOW_WIDTH / 2;
  15074. var offsetY = window.screen.availHeight / 2 - this.INNER_WINDOW_HEIGHT / 2;
  15075. 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";
  15076. if (newTab) {
  15077. window.open(url, 'login');
  15078. } else {
  15079. window.open(url, 'login', options);
  15080. }
  15081. }
  15082. }, {
  15083. key: "_getTokenStorageKey",
  15084. value: function _getTokenStorageKey(url) {
  15085. var patten = /(.*?):\/\/([^\/]+)/i;
  15086. var result = url.match(patten);
  15087. if (!result) {
  15088. return url;
  15089. }
  15090. return result[0];
  15091. }
  15092. }, {
  15093. key: "_getUrlRestString",
  15094. value: function _getUrlRestString(url) {
  15095. if (!url) {
  15096. return url;
  15097. } // var patten = /http:\/\/(.*\/rest)/i;
  15098. var patten = /(http|https):\/\/(.*\/rest)/i;
  15099. var result = url.match(patten);
  15100. if (!result) {
  15101. return url;
  15102. }
  15103. return result[0];
  15104. }
  15105. }]);
  15106. return SecurityManager;
  15107. }();
  15108. SecurityManager.INNER_WINDOW_WIDTH = 600;
  15109. SecurityManager.INNER_WINDOW_HEIGHT = 600;
  15110. SecurityManager.SSO = "https://sso.supermap.com";
  15111. SecurityManager.ONLINE = "https://www.supermapol.com";
  15112. SuperMap.SecurityManager = SecurityManager;
  15113. ;// CONCATENATED MODULE: ./src/common/iManager/iManagerServiceBase.js
  15114. function iManagerServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15115. 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); } }
  15116. function iManagerServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManagerServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManagerServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  15117. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15118. * This program are made available under the terms of the Apache License, Version 2.0
  15119. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15120. /**
  15121. * @class SuperMap.iManagerServiceBase
  15122. * @classdesc iManager 服务基类(有权限限制的类需要实现此类)。
  15123. * @category iManager
  15124. * @param {string} url - iManager 首页地址,如:http://localhost:8390/imanager。
  15125. * @param {Object} options - 服务参数。
  15126. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  15127. * @param {Object} [options.headers] - 请求头。
  15128. */
  15129. var IManagerServiceBase = /*#__PURE__*/function () {
  15130. function IManagerServiceBase(url, options) {
  15131. iManagerServiceBase_classCallCheck(this, IManagerServiceBase);
  15132. if (url) {
  15133. var end = url.substr(url.length - 1, 1);
  15134. this.serviceUrl = end === "/" ? url.substr(0, url.length - 2) : url;
  15135. }
  15136. this.options = options || {};
  15137. this.CLASS_NAME = "SuperMap.iManagerServiceBase";
  15138. }
  15139. /**
  15140. * @function SuperMap.iManagerServiceBase.prototype.request
  15141. * @description 子类统一通过该方法发送请求。
  15142. * @param {string} url - 请求 URL。
  15143. * @param {string} [method='GET'] - 请求类型。
  15144. * @param {Object} [requestOptions] - 请求选项。
  15145. * @param {Object} param - 请求参数。
  15146. * @description 发送请求。
  15147. * @returns {Promise} Promise 对象。
  15148. */
  15149. iManagerServiceBase_createClass(IManagerServiceBase, [{
  15150. key: "request",
  15151. value: function request(method, url, param, requestOptions) {
  15152. requestOptions = requestOptions || {
  15153. headers: {
  15154. 'Accept': '*/*',
  15155. 'Content-Type': 'application/json'
  15156. }
  15157. };
  15158. if (!requestOptions.hasOwnProperty("withCredentials")) {
  15159. requestOptions['withCredentials'] = true;
  15160. }
  15161. requestOptions['crossOrigin'] = this.options.crossOrigin;
  15162. requestOptions['headers'] = this.options.headers;
  15163. var token = SecurityManager.imanagerToken;
  15164. if (token) {
  15165. if (!requestOptions.headers) {
  15166. requestOptions.headers = [];
  15167. }
  15168. requestOptions.headers['X-Auth-Token'] = token;
  15169. }
  15170. if (param) {
  15171. param = JSON.stringify(param);
  15172. }
  15173. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  15174. return response.json();
  15175. });
  15176. }
  15177. }]);
  15178. return IManagerServiceBase;
  15179. }();
  15180. SuperMap.iManagerServiceBase = IManagerServiceBase;
  15181. ;// CONCATENATED MODULE: ./src/common/iManager/iManagerCreateNodeParam.js
  15182. function iManagerCreateNodeParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15183. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15184. * This program are made available under the terms of the Apache License, Version 2.0
  15185. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15186. /**
  15187. * @class SuperMap.iManagerCreateNodeParam
  15188. * @classdesc iManager 创建节点参数。
  15189. * @category iManager
  15190. * @param {Object} [params] - iManager 创建节点参数。
  15191. *
  15192. */
  15193. var IManagerCreateNodeParam = function IManagerCreateNodeParam(params) {
  15194. iManagerCreateNodeParam_classCallCheck(this, IManagerCreateNodeParam);
  15195. params = params || {};
  15196. this.nodeSpec = 'SMALL'; //取值范围: ['SMALL','MEDIUM','LARGE'] 以及自定义的环境规格名称
  15197. this.nodeCount = 1; //要创建vm的个数
  15198. this.nodeName = ''; //vm名称
  15199. this.password = ''; //vm的密码,空表示随机分配
  15200. this.description = ''; //描述信息
  15201. this.physicalMachineName = ''; //vm所属的物理机名称.
  15202. this.ips = []; //vm的ip,空数组表示随机分配
  15203. this.userName = ''; //vm所属用户
  15204. Util.extend(this, params);
  15205. };
  15206. SuperMap.iManagerCreateNodeParam = IManagerCreateNodeParam;
  15207. ;// CONCATENATED MODULE: ./src/common/iManager/iManager.js
  15208. function iManager_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { iManager_typeof = function _typeof(obj) { return typeof obj; }; } else { iManager_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return iManager_typeof(obj); }
  15209. function iManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15210. 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); } }
  15211. function iManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManager_defineProperties(Constructor, staticProps); return Constructor; }
  15212. function iManager_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) iManager_setPrototypeOf(subClass, superClass); }
  15213. function iManager_setPrototypeOf(o, p) { iManager_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iManager_setPrototypeOf(o, p); }
  15214. 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); }; }
  15215. function iManager_possibleConstructorReturn(self, call) { if (call && (iManager_typeof(call) === "object" || typeof call === "function")) { return call; } return iManager_assertThisInitialized(self); }
  15216. function iManager_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  15217. function iManager_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  15218. function iManager_getPrototypeOf(o) { iManager_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iManager_getPrototypeOf(o); }
  15219. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15220. * This program are made available under the terms of the Apache License, Version 2.0
  15221. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15222. /**
  15223. * @class SuperMap.iManager
  15224. * @classdesc iManager 服务类。
  15225. * @category iManager
  15226. * @param {string} serviceUrl - iManager 首页地址。
  15227. *
  15228. */
  15229. var IManager = /*#__PURE__*/function (_IManagerServiceBase) {
  15230. iManager_inherits(IManager, _IManagerServiceBase);
  15231. var _super = iManager_createSuper(IManager);
  15232. function IManager(iManagerUrl) {
  15233. iManager_classCallCheck(this, IManager);
  15234. return _super.call(this, iManagerUrl);
  15235. }
  15236. /**
  15237. * @function SuperMap.iManager.prototype.load
  15238. * @description 获取所有服务接口,验证是否已登录授权。
  15239. * @returns {Promise} Promise 对象。
  15240. */
  15241. iManager_createClass(IManager, [{
  15242. key: "load",
  15243. value: function load() {
  15244. return this.request("GET", this.serviceUrl + '/web/api/service.json');
  15245. }
  15246. /**
  15247. * @function SuperMap.iManager.prototype.createIServer
  15248. * @param {SuperMap.iManagerCreateNodeParam} createParam - 创建参数。
  15249. * @description 创建 iServer。
  15250. * @returns {Promise} Promise 对象。
  15251. */
  15252. }, {
  15253. key: "createIServer",
  15254. value: function createIServer(createParam) {
  15255. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/server.json', new IManagerCreateNodeParam(createParam));
  15256. }
  15257. /**
  15258. * @function SuperMap.iManager.prototype.createIPortal
  15259. * @param {SuperMap.iManagerCreateNodeParam} createParam - 创建参数。
  15260. * @description 创建 iPortal。
  15261. * @returns {Promise} Promise 对象。
  15262. */
  15263. }, {
  15264. key: "createIPortal",
  15265. value: function createIPortal(createParam) {
  15266. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/portal.json', new IManagerCreateNodeParam(createParam));
  15267. }
  15268. /**
  15269. * @function SuperMap.iManager.prototype.iServerList
  15270. * @description 获取所有创建的 iServer。
  15271. * @returns {Promise} Promise 对象。
  15272. */
  15273. }, {
  15274. key: "iServerList",
  15275. value: function iServerList() {
  15276. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/server.json');
  15277. }
  15278. /**
  15279. * @function SuperMap.iManager.prototype.iPortalList
  15280. * @description 获取所有创建的 iPortal。
  15281. * @returns {Promise} Promise 对象。
  15282. */
  15283. }, {
  15284. key: "iPortalList",
  15285. value: function iPortalList() {
  15286. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/portal.json');
  15287. }
  15288. /**
  15289. * @function SuperMap.iManager.prototype.startNodes
  15290. * @param {Array} ids - 需要启动节点的 ID 数组。e.g:['1']。
  15291. * @description 启动节点。
  15292. * @returns {Promise} Promise 对象。
  15293. */
  15294. }, {
  15295. key: "startNodes",
  15296. value: function startNodes(ids) {
  15297. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/started.json', ids);
  15298. }
  15299. /**
  15300. * @function SuperMap.iManager.prototype.stopNodes
  15301. * @param {Array} ids - 需要停止节点的 ID 数组。e.g:['1']。
  15302. * @description 停止节点。
  15303. * @returns {Promise} Promise 对象。
  15304. */
  15305. }, {
  15306. key: "stopNodes",
  15307. value: function stopNodes(ids) {
  15308. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/stopped.json', ids);
  15309. }
  15310. }]);
  15311. return IManager;
  15312. }(IManagerServiceBase);
  15313. SuperMap.iManager = IManager;
  15314. ;// CONCATENATED MODULE: ./src/common/iManager/index.js
  15315. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15316. * This program are made available under the terms of the Apache License, Version 2.0
  15317. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15318. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalServiceBase.js
  15319. function iPortalServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15320. 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); } }
  15321. function iPortalServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  15322. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15323. * This program are made available under the terms of the Apache License, Version 2.0
  15324. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15325. /**
  15326. * @class SuperMap.iPortalServiceBase
  15327. * @classdesc iPortal 服务基类(有权限限制的类需要实现此类)。
  15328. * @category iPortal/Online
  15329. * @param {string} url - iPortal 服务地址。
  15330. * @param {Object} options - 可选参数。
  15331. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  15332. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  15333. * @param {Object} [options.headers] - 请求头。
  15334. */
  15335. var IPortalServiceBase = /*#__PURE__*/function () {
  15336. function IPortalServiceBase(url, options) {
  15337. iPortalServiceBase_classCallCheck(this, IPortalServiceBase);
  15338. options = options || {};
  15339. this.serviceUrl = url;
  15340. this.serverType = ServerType.iPortal;
  15341. this.CLASS_NAME = "SuperMap.iPortalServiceBase";
  15342. this.withCredentials = options.withCredentials || false;
  15343. this.crossOrigin = options.crossOrigin;
  15344. this.headers = options.headers;
  15345. }
  15346. /**
  15347. * @function SuperMap.iPortalServiceBase.prototype.request
  15348. * @description 子类统一通过该方法发送请求。
  15349. * @param {string} [method='GET'] - 请求类型。
  15350. * @param {string} url - 服务地址。
  15351. * @param {Object} param - 请求参数。
  15352. * @param {Object} [requestOptions] - fetch 请求配置项。
  15353. * @returns {Promise} 返回包含请求结果的 Promise 对象。
  15354. */
  15355. iPortalServiceBase_createClass(IPortalServiceBase, [{
  15356. key: "request",
  15357. value: function request(method, url, param) {
  15358. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
  15359. headers: this.headers,
  15360. crossOrigin: this.crossOrigin,
  15361. withCredentials: this.withCredentials
  15362. };
  15363. url = this.createCredentialUrl(url);
  15364. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  15365. return response.json();
  15366. });
  15367. }
  15368. /**
  15369. * @function SuperMap.iPortalServiceBase.prototype.createCredentialUrl
  15370. * @description 追加授权信息。
  15371. * @param {string} url - 创建证书 URL 地址。
  15372. * @returns {string} 携带 token 或 key 的新地址。
  15373. */
  15374. }, {
  15375. key: "createCredentialUrl",
  15376. value: function createCredentialUrl(url) {
  15377. var newUrl = url,
  15378. credential = this.getCredential();
  15379. if (credential) {
  15380. var endStr = newUrl.substring(newUrl.length - 1, newUrl.length);
  15381. if (newUrl.indexOf("?") > -1 && endStr === "?") {
  15382. newUrl += credential.getUrlParameters();
  15383. } else if (newUrl.indexOf("?") > -1 && endStr !== "?") {
  15384. newUrl += "&" + credential.getUrlParameters();
  15385. } else {
  15386. newUrl += "?" + credential.getUrlParameters();
  15387. }
  15388. }
  15389. return newUrl;
  15390. }
  15391. /**
  15392. * @function SuperMap.iPortalServiceBase.prototype.getCredential
  15393. * @description 获取 token。
  15394. * @returns {string} 返回获取的 token。
  15395. *
  15396. */
  15397. }, {
  15398. key: "getCredential",
  15399. value: function getCredential() {
  15400. var credential,
  15401. value = SecurityManager.getToken(this.serviceUrl);
  15402. credential = value ? new Credential(value, "token") : null;
  15403. if (!credential) {
  15404. value = this.getKey();
  15405. credential = value ? new Credential(value, "key") : null;
  15406. }
  15407. return credential;
  15408. }
  15409. /**
  15410. * @function SuperMap.iPortalServiceBase.prototype.getKey
  15411. * @description 其子类需要重写该方法,修改其中获取 key 的字段,存储 key 可能是服务 ID 字段,可能是 URL。
  15412. */
  15413. }, {
  15414. key: "getKey",
  15415. value: function getKey() {//return SuperMap.SecurityManager.getKey(this.id);
  15416. //或
  15417. //return SuperMap.SecurityManager.getKey(this.serviceUrl);
  15418. }
  15419. }]);
  15420. return IPortalServiceBase;
  15421. }();
  15422. SuperMap.iPortalServiceBase = IPortalServiceBase;
  15423. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryParam.js
  15424. function iPortalQueryParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15425. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15426. * This program are made available under the terms of the Apache License, Version 2.0
  15427. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15428. /**
  15429. * @class SuperMap.iPortalQueryParam
  15430. * @classdesc iPortal 资源查询参数。
  15431. * @version 10.0.1
  15432. * @category iPortal/Online
  15433. * @param {Object} params - iPortal 资源查询具体参数。
  15434. * @param {SuperMap.ResourceType} [params.resourceType] - 资源类型
  15435. * @param {number} [params.pageSize] - 分页中每页大小。
  15436. * @param {number} [params.currentPage] - 分页页码。
  15437. * @param {SuperMap.OrderBy} [params.orderBy] - 排序字段。
  15438. * @param {SuperMap.OrderType} [params.orderType] - 根据升序还是降序过滤。
  15439. * @param {SuperMap.SearchType} [params.searchType] - 根据查询的范围进行过滤。
  15440. * @param {Array} [params.tags] - 标签。
  15441. * @param {Array} [params.dirIds] - 目录 id
  15442. * @param {Array} [params.resourceSubTypes] - 根据资源的子类型进行过滤。
  15443. * @param {SuperMap.AggregationTypes} [params.aggregationTypes] - 聚合查询的类型。
  15444. * @param {string} [params.text] - 搜索的关键词。
  15445. * @param {Array} [params.groupIds] - 根据群组进行过滤。
  15446. * @param {Array} [params.departmentIds] - 根据部门进行过滤。
  15447. */
  15448. var IPortalQueryParam = function IPortalQueryParam(params) {
  15449. iPortalQueryParam_classCallCheck(this, IPortalQueryParam);
  15450. params = params || {};
  15451. this.resourceType = ""; // 空为全部 MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  15452. this.pageSize = 12; // 每页多少条
  15453. this.currentPage = 1; // 第几页
  15454. this.orderBy = "UPDATETIME"; // UPDATETIME HEATLEVEL
  15455. this.orderType = "DESC"; // DESC ASC
  15456. this.searchType = "PUBLIC"; // PUBLIC SHARETOME_RES MYDEPARTMENT_RES MYGROUP_RES MY_RES
  15457. this.tags = []; // 标签
  15458. this.dirIds = []; // 类别
  15459. this.resourceSubTypes = []; // 类型
  15460. this.aggregationTypes = []; // TAG TYPE SUBTYPE
  15461. this.text = ""; // 搜索字段
  15462. this.groupIds = []; // 群组Id过滤
  15463. this.departmentIds = []; // 部门Id过滤
  15464. Util.extend(this, params);
  15465. };
  15466. SuperMap.iPortalQueryParam = IPortalQueryParam;
  15467. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryResult.js
  15468. function iPortalQueryResult_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15469. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15470. * This program are made available under the terms of the Apache License, Version 2.0
  15471. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15472. /**
  15473. * @class SuperMap.iPortalQueryResult
  15474. * @classdesc iPortal 资源结果集封装类。
  15475. * @version 10.0.1
  15476. * @category iPortal/Online
  15477. * @param {Object} queryResult - 资源参数。
  15478. * @param {Array} [queryResult.content] - 页面内容。
  15479. * @param {number} [queryResult.total] - 总记录数。
  15480. * @param {number} [queryResult.currentPage] - 当前第几页。
  15481. * @param {number} [queryResult.pageSize] - 每页大小。
  15482. * @param {Object} [queryResult.aggregations] - 聚合查询的结果。
  15483. */
  15484. var IPortalQueryResult = function IPortalQueryResult(queryResult) {
  15485. iPortalQueryResult_classCallCheck(this, IPortalQueryResult);
  15486. queryResult = queryResult || {};
  15487. this.content = [];
  15488. this.total = 0;
  15489. this.currentPage = 1;
  15490. this.pageSize = 12;
  15491. this.aggregations = null;
  15492. Util.extend(this, queryResult);
  15493. };
  15494. SuperMap.iPortalQueryResult = IPortalQueryResult;
  15495. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalResource.js
  15496. function iPortalResource_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { iPortalResource_typeof = function _typeof(obj) { return typeof obj; }; } else { iPortalResource_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return iPortalResource_typeof(obj); }
  15497. function iPortalResource_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15498. 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); } }
  15499. function iPortalResource_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalResource_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalResource_defineProperties(Constructor, staticProps); return Constructor; }
  15500. function iPortalResource_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) iPortalResource_setPrototypeOf(subClass, superClass); }
  15501. function iPortalResource_setPrototypeOf(o, p) { iPortalResource_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalResource_setPrototypeOf(o, p); }
  15502. 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); }; }
  15503. function iPortalResource_possibleConstructorReturn(self, call) { if (call && (iPortalResource_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortalResource_assertThisInitialized(self); }
  15504. function iPortalResource_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  15505. function iPortalResource_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  15506. function iPortalResource_getPrototypeOf(o) { iPortalResource_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalResource_getPrototypeOf(o); }
  15507. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15508. * This program are made available under the terms of the Apache License, Version 2.0
  15509. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15510. /**
  15511. * @class SuperMap.iPortalResource
  15512. * @classdesc iPortal 资源详情类。
  15513. * @version 10.0.1
  15514. * @category iPortal/Online
  15515. * @param {string} portalUrl - 资源地址。
  15516. * @param {Object} resourceInfo - 资源详情参数。
  15517. * @param {Array} [resourceInfo.authorizeSetting] - 资源的授权信息
  15518. * @param {string} [resourceInfo.bounds] - 资源的坐标范围
  15519. * @param {string} [resourceInfo.bounds4326] - 资源的坐标范围,转换为EPSG 4326坐标系统后的地理范围。
  15520. * @param {string} [resourceInfo.checkStatus] - 资源的审核状态,可以是:空,SUCCESSFUL,UNCHECKED,FAILED
  15521. * @param {Date} [resourceInfo.createTime] - 资源的创建时间
  15522. * @param {string} [resourceInfo.description] - 资源描述
  15523. * @param {number} [resourceInfo.dirId] - 资源所在的门户目录的id
  15524. * @param {number} [resourceInfo.epsgCode] - 门户资源基于的坐标系的EPSG值。
  15525. * @param {number} [resourceInfo.heatLevel] - 记录资源的访问量或下载量。
  15526. * @param {string} [resourceInfo.id] - 资源存储到ElasticSearch中的文档id
  15527. * @param {string} [resourceInfo.name] - 资源名称
  15528. * @param {number} [resourceInfo.personalDirId] - 资源所在的个人目录的id
  15529. * @param {number} [resourceInfo.resourceId] - 资源表(maps,services等)里的id
  15530. * @param {string} [resourceInfo.resourceSubType] - 某类资源的具体子类型。
  15531. * @param {SuperMap.ResourceType} [resourceInfo.resourceType] - 资源类型
  15532. * @param {number} [resourceInfo.serviceRootUrlId] - 批量注册服务时,服务根地址的ID
  15533. * @param {Array} [resourceInfo.tags] - 资源的标签
  15534. * @param {string} [resourceInfo.thumbnail] - 资源的缩略图
  15535. * @param {Date} [resourceInfo.updateTime] - 资源的更新时间
  15536. * @param {string} [resourceInfo.userName] - 搜索的关键词
  15537. * @param {Object} [resourceInfo.sourceJSON] - 提供了门户项目返回的所有信息。
  15538. * @extends {SuperMap.iPortalServiceBase}
  15539. */
  15540. var IPortalResource = /*#__PURE__*/function (_IPortalServiceBase) {
  15541. iPortalResource_inherits(IPortalResource, _IPortalServiceBase);
  15542. var _super = iPortalResource_createSuper(IPortalResource);
  15543. function IPortalResource(portalUrl, resourceInfo) {
  15544. var _this;
  15545. iPortalResource_classCallCheck(this, IPortalResource);
  15546. _this = _super.call(this, portalUrl);
  15547. resourceInfo = resourceInfo || {};
  15548. _this.authorizeSetting = [];
  15549. _this.bounds = "";
  15550. _this.bounds4326 = "";
  15551. _this.checkStatus = "";
  15552. _this.createTime = 0;
  15553. _this.description = null;
  15554. _this.dirId = null;
  15555. _this.epsgCode = 0;
  15556. _this.heatLevel = 0;
  15557. _this.id = 0;
  15558. _this.name = "";
  15559. _this.personalDirId = null;
  15560. _this.resourceId = 0;
  15561. _this.resourceSubType = null;
  15562. _this.resourceType = null;
  15563. _this.serviceRootUrlId = null;
  15564. _this.tags = null;
  15565. _this.thumbnail = null;
  15566. _this.updateTime = 0;
  15567. _this.userName = "";
  15568. _this.sourceJSON = {}; //返回门户资源详细信息
  15569. Util.extend(iPortalResource_assertThisInitialized(_this), resourceInfo); // INSIGHTS_WORKSPACE MAP_DASHBOARD
  15570. _this.resourceUrl = portalUrl + "/web/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  15571. if (_this.withCredentials) {
  15572. _this.resourceUrl = portalUrl + "/web/mycontent/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  15573. } // if (this.id) {
  15574. // this.mapUrl = mapUrl + "/" + this.id;
  15575. // }
  15576. return _this;
  15577. }
  15578. /**
  15579. * @function SuperMap.iPortalResource.prototype.load
  15580. * @description 加载资源信息。
  15581. * @returns {Promise} 返回 Promise 对象。如果成功,Promise 没有返回值,请求返回结果自动填充到该类的属性中;如果失败,Promise 返回值包含错误信息。
  15582. */
  15583. iPortalResource_createClass(IPortalResource, [{
  15584. key: "load",
  15585. value: function load() {
  15586. var me = this;
  15587. return me.request("GET", me.resourceUrl + ".json").then(function (resourceInfo) {
  15588. if (resourceInfo.error) {
  15589. return resourceInfo;
  15590. }
  15591. me.sourceJSON = resourceInfo;
  15592. });
  15593. }
  15594. /**
  15595. * @function SuperMap.iPortalResource.prototype.update
  15596. * @description 更新资源属性信息。
  15597. * @returns {Promise} 返回包含更新操作状态的 Promise 对象。
  15598. */
  15599. }, {
  15600. key: "update",
  15601. value: function update() {
  15602. var resourceName = this.resourceType.replace("_", "").toLowerCase();
  15603. var options = {
  15604. headers: {
  15605. 'Content-Type': 'application/x-www-form-urlencoded'
  15606. }
  15607. };
  15608. if (resourceName === 'data') {
  15609. this.resourceUrl = this.resourceUrl + "/attributes.json";
  15610. }
  15611. var entity = JSON.stringify(this.sourceJSON); //对服务资源进行编辑时,请求体内容只留关键字字段(目前如果是全部字段 更新返回成功 但其实没有真正的更新)
  15612. if (resourceName === 'service') {
  15613. var serviceInfo = {
  15614. authorizeSetting: this.sourceJSON.authorizeSetting,
  15615. metadata: this.sourceJSON.metadata,
  15616. tags: this.sourceJSON.tags,
  15617. thumbnail: this.sourceJSON.thumbnail,
  15618. tokenRefreshUrl: this.sourceJSON.tokenRefreshUrl
  15619. };
  15620. entity = JSON.stringify(serviceInfo);
  15621. }
  15622. return this.request("PUT", this.resourceUrl, entity, options);
  15623. }
  15624. }]);
  15625. return IPortalResource;
  15626. }(IPortalServiceBase);
  15627. SuperMap.iPortalResource = IPortalResource;
  15628. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareParam.js
  15629. function iPortalShareParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15630. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15631. * This program are made available under the terms of the Apache License, Version 2.0
  15632. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15633. /**
  15634. * @class SuperMap.iPortalShareParam
  15635. * @classdesc iPortal 资源共享参数。
  15636. * @version 10.0.1
  15637. * @category iPortal/Online
  15638. * @param {Object} params - iPortal 资源共享具体参数。
  15639. * @param {SuperMap.ResourceType} [params.resourceType] - 资源类型。
  15640. * @param {Array} [params.ids] - 资源的id数组。
  15641. * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
  15642. */
  15643. var IPortalShareParam = function IPortalShareParam(params) {
  15644. iPortalShareParam_classCallCheck(this, IPortalShareParam);
  15645. params = params || {};
  15646. this.ids = [];
  15647. this.entities = [];
  15648. this.resourceType = ""; // MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  15649. Util.extend(this, params);
  15650. };
  15651. SuperMap.iPortalShareParam = IPortalShareParam;
  15652. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortal.js
  15653. function iPortal_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { iPortal_typeof = function _typeof(obj) { return typeof obj; }; } else { iPortal_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return iPortal_typeof(obj); }
  15654. function iPortal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15655. 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); } }
  15656. function iPortal_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortal_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortal_defineProperties(Constructor, staticProps); return Constructor; }
  15657. function iPortal_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) iPortal_setPrototypeOf(subClass, superClass); }
  15658. function iPortal_setPrototypeOf(o, p) { iPortal_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortal_setPrototypeOf(o, p); }
  15659. 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); }; }
  15660. function iPortal_possibleConstructorReturn(self, call) { if (call && (iPortal_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortal_assertThisInitialized(self); }
  15661. function iPortal_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  15662. function iPortal_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  15663. function iPortal_getPrototypeOf(o) { iPortal_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortal_getPrototypeOf(o); }
  15664. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15665. * This program are made available under the terms of the Apache License, Version 2.0
  15666. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15667. /**
  15668. * @class SuperMap.iPortal
  15669. * @classdesc 对接 SuperMap iPortal 基础服务。
  15670. * @category iPortal/Online
  15671. * @extends {SuperMap.iPortalServiceBase}
  15672. * @param {string} iportalUrl - 地址。
  15673. * @param {Object} options - 参数。
  15674. * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
  15675. */
  15676. var IPortal = /*#__PURE__*/function (_IPortalServiceBase) {
  15677. iPortal_inherits(IPortal, _IPortalServiceBase);
  15678. var _super = iPortal_createSuper(IPortal);
  15679. function IPortal(iportalUrl, options) {
  15680. var _this;
  15681. iPortal_classCallCheck(this, IPortal);
  15682. _this = _super.call(this, iportalUrl, options);
  15683. _this.iportalUrl = iportalUrl;
  15684. options = options || {};
  15685. _this.withCredentials = options.withCredentials || false;
  15686. return _this;
  15687. }
  15688. /**
  15689. * @function SuperMap.iPortal.prototype.load
  15690. * @description 加载页面。
  15691. * @returns {Promise} 返回包含 iportal web 资源信息的 Promise 对象。
  15692. */
  15693. iPortal_createClass(IPortal, [{
  15694. key: "load",
  15695. value: function load() {
  15696. return FetchRequest.get(this.iportalUrl + "/web");
  15697. }
  15698. /**
  15699. * @function SuperMap.iPortal.prototype.queryResources
  15700. * @description 查询资源。
  15701. * @version 10.0.1
  15702. * @param {SuperMap.iPortalQueryParam} queryParams - 查询参数。
  15703. * @returns {Promise} 返回包含所有资源结果的 Promise 对象。
  15704. */
  15705. }, {
  15706. key: "queryResources",
  15707. value: function queryResources(queryParams) {
  15708. if (!(queryParams instanceof IPortalQueryParam)) {
  15709. return new Promise(function (resolve) {
  15710. resolve("queryParams is not instanceof iPortalQueryParam !");
  15711. });
  15712. }
  15713. var me = this;
  15714. var resourceUrl = this.iportalUrl + "/gateway/catalog/resource/search.json";
  15715. queryParams.t = new Date().getTime();
  15716. return this.request("GET", resourceUrl, queryParams).then(function (result) {
  15717. var content = [];
  15718. result.content.forEach(function (item) {
  15719. content.push(new IPortalResource(me.iportalUrl, item));
  15720. });
  15721. var queryResult = new IPortalQueryResult();
  15722. queryResult.content = content;
  15723. queryResult.total = result.total;
  15724. queryResult.currentPage = result.currentPage;
  15725. queryResult.pageSize = result.pageSize;
  15726. queryResult.aggregations = result.aggregations;
  15727. return queryResult;
  15728. });
  15729. }
  15730. /**
  15731. * @function SuperMap.iPortal.prototype.updateResourcesShareSetting
  15732. * @description 更新共享设置。
  15733. * @version 10.0.1
  15734. * @param {SuperMap.iPortalShareParam} shareParams - 共享的参数。
  15735. * @returns {Promise} 返回包含共享资源结果的 Promise 对象。
  15736. */
  15737. }, {
  15738. key: "updateResourcesShareSetting",
  15739. value: function updateResourcesShareSetting(shareParams) {
  15740. if (!(shareParams instanceof IPortalShareParam)) {
  15741. return new Promise(function (resolve) {
  15742. resolve("shareParams is not instanceof iPortalShareParam !");
  15743. });
  15744. }
  15745. var resourceUrlName = shareParams.resourceType.replace("_", "").toLowerCase() + "s";
  15746. if (resourceUrlName === "datas") {
  15747. resourceUrlName = "mycontent/" + resourceUrlName;
  15748. }
  15749. var cloneShareParams = {
  15750. ids: shareParams.ids,
  15751. entities: shareParams.entities
  15752. };
  15753. var shareUrl = this.iportalUrl + "/web/" + resourceUrlName + "/sharesetting.json";
  15754. return this.request("PUT", shareUrl, JSON.stringify(cloneShareParams)).then(function (result) {
  15755. return result;
  15756. });
  15757. }
  15758. }]);
  15759. return IPortal;
  15760. }(IPortalServiceBase);
  15761. SuperMap.iPortal = IPortal;
  15762. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareEntity.js
  15763. function iPortalShareEntity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15764. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15765. * This program are made available under the terms of the Apache License, Version 2.0
  15766. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15767. /**
  15768. * @class SuperMap.iPortalShareEntity
  15769. * @classdesc iPortal 资源共享实体参数。
  15770. * @version 10.0.1
  15771. * @category iPortal/Online
  15772. * @param {Object} shareEntity - iPortal 资源共享实体具体参数。
  15773. * @param {SuperMap.PermissionType} [shareEntity.permissionType] - 权限类型。
  15774. * @param {SuperMap.EntityType} [shareEntity.entityType] - 实体类型
  15775. * @param {string} [shareEntity.entityName] - 实体 Name。对应的 USER(用户)、 ROLE(角色)、GROUP(用户组)、IPORTALGROUP(群组)的名称。
  15776. * @param {number} [shareEntity.entityId] - 实体的 id。用于群组的授权。
  15777. */
  15778. var IPortalShareEntity = function IPortalShareEntity(shareEntity) {
  15779. iPortalShareEntity_classCallCheck(this, IPortalShareEntity);
  15780. shareEntity = shareEntity || {};
  15781. this.permissionType = ""; // SEARCH READ READWRITE DOWNLOAD
  15782. this.entityType = ""; // USER DEPARTMENT IPORTALGROUP
  15783. this.entityName = "GUEST"; // GUEST or 具体用户 name
  15784. this.entityId = null;
  15785. Util.extend(this, shareEntity);
  15786. };
  15787. SuperMap.iPortalShareEntity = IPortalShareEntity;
  15788. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddResourceParam.js
  15789. function iPortalAddResourceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15790. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15791. * This program are made available under the terms of the Apache License, Version 2.0
  15792. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15793. /**
  15794. * @class SuperMap.iPortalAddResourceParam
  15795. * @classdesc iPortal 添加资源参数。
  15796. * @version 10.0.1
  15797. * @category iPortal/Online
  15798. * @param {Object} params - iPortal 添加资源具体参数。
  15799. * @param {String} [params.rootUrl] - 服务地址。
  15800. * @param {Array} [params.tags] - 标签。
  15801. * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
  15802. */
  15803. var IPortalAddResourceParam = function IPortalAddResourceParam(params) {
  15804. iPortalAddResourceParam_classCallCheck(this, IPortalAddResourceParam);
  15805. params = params || {};
  15806. this.rootUrl = "";
  15807. this.tags = [];
  15808. this.entities = [];
  15809. Util.extend(this, params);
  15810. };
  15811. SuperMap.iPortalAddResourceParam = IPortalAddResourceParam;
  15812. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalRegisterServiceParam.js
  15813. function iPortalRegisterServiceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15814. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15815. * This program are made available under the terms of the Apache License, Version 2.0
  15816. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15817. /**
  15818. * @class SuperMap.iPortalRegisterServiceParam
  15819. * @classdesc iPortal 注册服务参数。
  15820. * @version 10.0.1
  15821. * @category iPortal/Online
  15822. * @param {Object} params - iPortal 注册服务具体参数。
  15823. * @param {String} [params.type] - 服务类型。
  15824. * @param {Array} [params.tags] - 服务标签。
  15825. * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
  15826. * @param {Object} [params.metadata] - 服务元信息。
  15827. * @param {Array} [params.addedMapNames] - 地图服务列表。
  15828. * @param {Array} [params.addedSceneNames] - 场景服务列表。
  15829. */
  15830. var IPortalRegisterServiceParam = function IPortalRegisterServiceParam(params) {
  15831. iPortalRegisterServiceParam_classCallCheck(this, IPortalRegisterServiceParam);
  15832. params = params || {};
  15833. this.type = ""; // SUPERMAP_REST ARCGIS_REST WMS WFS WCS WPS WMTS OTHERS
  15834. this.tags = [];
  15835. this.entities = [];
  15836. this.metadata = {};
  15837. this.addedMapNames = [];
  15838. this.addedSceneNames = [];
  15839. Util.extend(this, params);
  15840. };
  15841. SuperMap.iPortalRegisterServiceParam = IPortalRegisterServiceParam;
  15842. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddDataParam.js
  15843. function iPortalAddDataParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15844. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15845. * This program are made available under the terms of the Apache License, Version 2.0
  15846. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15847. /**
  15848. * @class SuperMap.iPortalAddDataParam
  15849. * @classdesc iPortal 上传/注册数据所需的参数。
  15850. * @version 10.0.1
  15851. * @category iPortal/Online
  15852. * @param {Object} params - iPortal 上传/注册数据所需的具体参数。
  15853. * @param {string} params.fileName - 文件名称
  15854. * @param {SuperMap.DataItemType} params.type - 数据类型。
  15855. * @param {Array} [params.tags] - 数据的标签
  15856. * @param {SuperMap.iPortalDataMetaInfoParam} [params.dataMetaInfo] - 数据元信息
  15857. */
  15858. var IPortalAddDataParam = function IPortalAddDataParam(params) {
  15859. iPortalAddDataParam_classCallCheck(this, IPortalAddDataParam);
  15860. params = params || {};
  15861. this.fileName = "";
  15862. this.type = "";
  15863. this.tags = [];
  15864. this.dataMetaInfo = {};
  15865. Util.extend(this, params);
  15866. };
  15867. SuperMap.iPortalAddDataParam = IPortalAddDataParam;
  15868. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataMetaInfoParam.js
  15869. function iPortalDataMetaInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15870. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15871. * This program are made available under the terms of the Apache License, Version 2.0
  15872. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15873. /**
  15874. * @class SuperMap.iPortalDataMetaInfoParam
  15875. * @classdesc iPortal 上传数据/注册数据元信息所需的参数。
  15876. * @version 10.0.1
  15877. * @category iPortal/Online
  15878. * @param {Object} params - iPortal 获取数据项id excel csv类型的数据所需数据元信息具体参数。
  15879. * @param {string} params.xField - X 坐标字段
  15880. * @param {string} params.yField - Y 坐标字段
  15881. * @param {number} params.xIndex - x所在列(关系型存储下CSV或EXCEL数据时必填)
  15882. * @param {number} params.yIndex - y所在列(关系型存储下CSV或EXCEL数据时必填)
  15883. * @param {array} [params.fieldTypes] - 设置字段类型(关系型存储下CSV或EXCEL数据时可选填)。默认类型为:WTEXT。该参数按照CSV文件字段顺序从左到右依次设置,其中默认字段类型可省略不设置。例如,CSV文件中有10个字段,如果只需设定第1,2,4个字段,可设置为[a,b,,c]。
  15884. * @param {string} params.separator - 分隔符(关系型存储下CSV数据时必填)
  15885. * @param {boolean} params.firstRowIsHead - 是否带表头(关系型存储下CSV数据时必填)
  15886. * @param {boolean} params.url - HDFS注册目录地址
  15887. * @param {SuperMap.iPortalDataStoreInfoParam} params.dataStoreInfo - 注册数据时的数据存储信息
  15888. */
  15889. var IPortalDataMetaInfoParam = function IPortalDataMetaInfoParam(params) {
  15890. iPortalDataMetaInfoParam_classCallCheck(this, IPortalDataMetaInfoParam);
  15891. params = params || {};
  15892. this.xField = "";
  15893. this.yField = "";
  15894. this.fileEncoding = "UTF-8";
  15895. this.xIndex = 1;
  15896. this.yIndex = 1;
  15897. this.fieldTypes = [];
  15898. this.separator = "";
  15899. this.firstRowIsHead = true;
  15900. this.url = "";
  15901. this.dataStoreInfo = {};
  15902. Util.extend(this, params);
  15903. };
  15904. SuperMap.iPortalDataMetaInfoParam = IPortalDataMetaInfoParam;
  15905. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataStoreInfoParam.js
  15906. function iPortalDataStoreInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15907. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15908. * This program are made available under the terms of the Apache License, Version 2.0
  15909. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15910. /**
  15911. * @class SuperMap.iPortalDataStoreInfoParam
  15912. * @classdesc iPortal 注册一个HBASE HDFS数据存储类。
  15913. * @version 10.0.1
  15914. * @category iPortal/Online
  15915. * @param {Object} params - iPortal 注册一个HBASE HDFS数据存储类具体参数。
  15916. * @param {string} params.type - 大数据文件共享类型和空间数据库类型,包括大数据文件共享HDFS 目录(HDFS)和空间数据库HBASE
  15917. * @param {string} params.url - HDFS数据存储目录地址
  15918. * @param {SuperMap.iPortalDataConnectionInfoParam} [params.connectionInfo] - HBASE空间数据库服务的连接信息
  15919. */
  15920. var IPortalDataStoreInfoParam = function IPortalDataStoreInfoParam(params) {
  15921. iPortalDataStoreInfoParam_classCallCheck(this, IPortalDataStoreInfoParam);
  15922. params = params || {};
  15923. this.type = "";
  15924. this.url = "";
  15925. this.connectionInfo = {};
  15926. Util.extend(this, params);
  15927. };
  15928. SuperMap.iPortalDataStoreInfoParam = IPortalDataStoreInfoParam;
  15929. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataConnectionInfoParam.js
  15930. function iPortalDataConnectionInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15931. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15932. * This program are made available under the terms of the Apache License, Version 2.0
  15933. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15934. /**
  15935. * @class SuperMap.iPortalDataConnectionInfoParam
  15936. * @classdesc iPortal HBASE数据源连接信息类。
  15937. * @version 10.0.1
  15938. * @category iPortal/Online
  15939. * @param {Object} params - iPortal HBASE数据源连接信息类具体参数。
  15940. * @param {string} params.dataBase - 数据源连接的数据库名。
  15941. * @param {string} params.server - 服务地址。
  15942. */
  15943. var IPortalDataConnectionInfoParam = function IPortalDataConnectionInfoParam(params) {
  15944. iPortalDataConnectionInfoParam_classCallCheck(this, IPortalDataConnectionInfoParam);
  15945. params = params || {};
  15946. this.dataBase = "";
  15947. this.server = "";
  15948. Util.extend(this, params);
  15949. };
  15950. SuperMap.iPortalDataConnectionInfoParam = IPortalDataConnectionInfoParam;
  15951. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalUser.js
  15952. function iPortalUser_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { iPortalUser_typeof = function _typeof(obj) { return typeof obj; }; } else { iPortalUser_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return iPortalUser_typeof(obj); }
  15953. function iPortalUser_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15954. 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); } }
  15955. function iPortalUser_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalUser_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalUser_defineProperties(Constructor, staticProps); return Constructor; }
  15956. function iPortalUser_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) iPortalUser_setPrototypeOf(subClass, superClass); }
  15957. function iPortalUser_setPrototypeOf(o, p) { iPortalUser_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalUser_setPrototypeOf(o, p); }
  15958. 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); }; }
  15959. function iPortalUser_possibleConstructorReturn(self, call) { if (call && (iPortalUser_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortalUser_assertThisInitialized(self); }
  15960. function iPortalUser_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  15961. function iPortalUser_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  15962. function iPortalUser_getPrototypeOf(o) { iPortalUser_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalUser_getPrototypeOf(o); }
  15963. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15964. * This program are made available under the terms of the Apache License, Version 2.0
  15965. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15966. /**
  15967. * @class SuperMap.iPortalUser
  15968. * @classdesc iPortal 门户中用户信息的封装类。用于管理用户资源,包括可删除,添加资源。
  15969. * @version 10.0.1
  15970. * @category iPortal/Online
  15971. * @param {string} iportalUrl - iportal根地址。
  15972. * @extends {SuperMap.iPortalServiceBase}
  15973. *
  15974. */
  15975. var IPortalUser = /*#__PURE__*/function (_IPortalServiceBase) {
  15976. iPortalUser_inherits(IPortalUser, _IPortalServiceBase);
  15977. var _super = iPortalUser_createSuper(IPortalUser);
  15978. function IPortalUser(iportalUrl) {
  15979. var _this;
  15980. iPortalUser_classCallCheck(this, IPortalUser);
  15981. _this = _super.call(this, iportalUrl);
  15982. _this.iportalUrl = iportalUrl;
  15983. return _this;
  15984. }
  15985. /**
  15986. * @function SuperMap.iPortalUser.prototype.deleteResources
  15987. * @description 删除资源。
  15988. * @param {Object} params - 删除资源所需的参数对象:{ids,resourceType}。
  15989. * @returns {Promise} 返回包含删除操作状态的 Promise 对象。
  15990. */
  15991. iPortalUser_createClass(IPortalUser, [{
  15992. key: "deleteResources",
  15993. value: function deleteResources(params) {
  15994. var resourceName = params.resourceType.replace("_", "").toLowerCase();
  15995. var deleteResourceUrl = this.iportalUrl + "/web/" + resourceName + "s.json?ids=" + encodeURI(JSON.stringify(params.ids));
  15996. if (resourceName === 'data') {
  15997. deleteResourceUrl = this.iportalUrl + "/web/mycontent/datas/delete.json";
  15998. return this.request("POST", deleteResourceUrl, JSON.stringify(params.ids));
  15999. }
  16000. return this.request("DELETE", deleteResourceUrl);
  16001. }
  16002. /**
  16003. * @function SuperMap.iPortalUser.prototype.addMap
  16004. * @description 添加地图。
  16005. * @version 10.1.0
  16006. * @param {SuperMap.iPortalAddResourceParam} addMapParams - 添加地图的参数。
  16007. * @returns {Promise} 返回包含添加地图结果的 Promise 对象。
  16008. */
  16009. }, {
  16010. key: "addMap",
  16011. value: function addMap(addMapParams) {
  16012. if (!(addMapParams instanceof IPortalAddResourceParam)) {
  16013. return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");
  16014. }
  16015. var cloneAddMapParams = {
  16016. rootUrl: addMapParams.rootUrl,
  16017. tags: addMapParams.tags,
  16018. authorizeSetting: addMapParams.entities
  16019. };
  16020. var addMapUrl = this.iportalUrl + "/web/maps/batchaddmaps.json";
  16021. return this.request("POST", addMapUrl, JSON.stringify(cloneAddMapParams)).then(function (result) {
  16022. return result;
  16023. });
  16024. }
  16025. /**
  16026. * @function SuperMap.iPortalUser.prototype.addScene
  16027. * @description 添加场景。
  16028. * @version 10.1.0
  16029. * @param {SuperMap.iPortalAddResourceParam} addSceneParams - 添加场景的参数。
  16030. * @returns {Promise} 返回包含添加场景结果的 Promise 对象。
  16031. */
  16032. }, {
  16033. key: "addScene",
  16034. value: function addScene(addSceneParams) {
  16035. if (!(addSceneParams instanceof IPortalAddResourceParam)) {
  16036. return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");
  16037. }
  16038. var cloneAddSceneParams = {
  16039. rootUrl: addSceneParams.rootUrl,
  16040. tags: addSceneParams.tags,
  16041. authorizeSetting: addSceneParams.entities
  16042. };
  16043. var addSceneUrl = this.iportalUrl + "/web/scenes/batchaddscenes.json";
  16044. return this.request("POST", addSceneUrl, JSON.stringify(cloneAddSceneParams)).then(function (result) {
  16045. return result;
  16046. });
  16047. }
  16048. /**
  16049. * @function SuperMap.iPortalUser.prototype.registerService
  16050. * @description 注册服务。
  16051. * @version 10.1.0
  16052. * @param {SuperMap.iPortalRegisterServiceParam} registerParams - 注册服务的参数。
  16053. * @returns {Promise} 返回包含注册服务结果的 Promise 对象。
  16054. */
  16055. }, {
  16056. key: "registerService",
  16057. value: function registerService(registerParams) {
  16058. if (!(registerParams instanceof IPortalRegisterServiceParam)) {
  16059. return this.getErrMsgPromise("registerParams is not instanceof IPortalRegisterServiceParam !");
  16060. }
  16061. var cloneRegisterParams = {
  16062. type: registerParams.type,
  16063. tags: registerParams.tags,
  16064. authorizeSetting: registerParams.entities,
  16065. metadata: registerParams.metadata,
  16066. addedMapNames: registerParams.addedMapNames,
  16067. addedSceneNames: registerParams.addedSceneNames
  16068. };
  16069. var registerUrl = this.iportalUrl + "/web/services.json";
  16070. return this.request("POST", registerUrl, JSON.stringify(cloneRegisterParams)).then(function (result) {
  16071. return result;
  16072. });
  16073. }
  16074. /**
  16075. * @function SuperMap.iPortalUser.prototype.getErrMsgPromise
  16076. * @description 获取包含错误信息的Promise对象。
  16077. * @version 10.1.0
  16078. * @param {String} errMsg - 传入的错误信息。
  16079. * @returns {Promise} 返回包含错误信息的 Promise 对象。
  16080. */
  16081. }, {
  16082. key: "getErrMsgPromise",
  16083. value: function getErrMsgPromise(errMsg) {
  16084. return new Promise(function (resolve) {
  16085. resolve(errMsg);
  16086. });
  16087. }
  16088. /**
  16089. * @function SuperMap.iPortalUser.prototype.uploadDataRequest
  16090. * @description 上传数据。
  16091. * @version 10.1.0
  16092. * @param {number} id - 上传数据的资源id。
  16093. * @param {Object} formData - 请求体为文本数据流。
  16094. * @returns {Promise} 返回包含上传数据操作的 Promise 对象。
  16095. */
  16096. }, {
  16097. key: "uploadDataRequest",
  16098. value: function uploadDataRequest(id, formData) {
  16099. var uploadDataUrl = this.iportalUrl + "/web/mycontent/datas/" + id + "/upload.json";
  16100. return this.request("POST", uploadDataUrl, formData);
  16101. }
  16102. /**
  16103. * @function SuperMap.iPortalUser.prototype.addData
  16104. * @description 上传/注册数据。
  16105. * @version 10.1.0
  16106. * @param {SuperMap.iPortalAddDataParam} params - 上传/注册数据所需的参数。
  16107. * @param {Object} [formData] - 请求体为文本数据流(上传数据时传入)。
  16108. * @returns {Promise} 返回上传/注册数据的 Promise 对象。
  16109. */
  16110. }, {
  16111. key: "addData",
  16112. value: function addData(params, formData) {
  16113. var _this2 = this;
  16114. if (!(params instanceof IPortalAddDataParam)) {
  16115. return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");
  16116. }
  16117. var datasUrl = this.iportalUrl + "/web/mycontent/datas.json";
  16118. var entity = {
  16119. fileName: params.fileName,
  16120. tags: params.tags,
  16121. type: params.type
  16122. };
  16123. var type = params.type.toLowerCase();
  16124. var dataMetaInfo;
  16125. if (type === "excel" || type === "csv") {
  16126. if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
  16127. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  16128. }
  16129. dataMetaInfo = {
  16130. xField: params.dataMetaInfo.xField,
  16131. yField: params.dataMetaInfo.yField
  16132. };
  16133. if (type === 'csv') {
  16134. dataMetaInfo.fileEncoding = params.dataMetaInfo.fileEncoding;
  16135. }
  16136. entity.coordType = "WGS84";
  16137. entity.dataMetaInfo = dataMetaInfo;
  16138. } else if (type === "hdfs" || type === "hbase") {
  16139. if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
  16140. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  16141. }
  16142. if (!(params.dataMetaInfo.dataStoreInfo instanceof IPortalDataStoreInfoParam)) {
  16143. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");
  16144. }
  16145. var dataStoreInfo = {
  16146. type: params.dataMetaInfo.dataStoreInfo.type
  16147. };
  16148. switch (type) {
  16149. case "hdfs":
  16150. dataStoreInfo.url = params.dataMetaInfo.dataStoreInfo.url;
  16151. dataMetaInfo = {
  16152. url: params.dataMetaInfo.url,
  16153. dataStoreInfo: dataStoreInfo
  16154. };
  16155. break;
  16156. case "hbase":
  16157. if (!(params.dataMetaInfo.dataStoreInfo.connectionInfo instanceof IPortalDataConnectionInfoParam)) {
  16158. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");
  16159. }
  16160. dataStoreInfo.connectionInfo = {
  16161. dataBase: params.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,
  16162. server: params.dataMetaInfo.dataStoreInfo.connectionInfo.server,
  16163. engineType: 'HBASE'
  16164. };
  16165. dataStoreInfo.datastoreType = "SPATIAL"; //该字段SPATIAL表示HBASE注册
  16166. dataMetaInfo = {
  16167. dataStoreInfo: dataStoreInfo
  16168. };
  16169. break;
  16170. }
  16171. entity.dataMetaInfo = dataMetaInfo;
  16172. }
  16173. return this.request("POST", datasUrl, JSON.stringify(entity)).then(function (res) {
  16174. if (type === "hdfs" || type === "hbase") {
  16175. return res;
  16176. } else {
  16177. if (res.childID) {
  16178. return _this2.uploadDataRequest(res.childID, formData);
  16179. } else {
  16180. return res.customResult;
  16181. }
  16182. }
  16183. });
  16184. }
  16185. /**
  16186. * @function SuperMap.iPortalUser.prototype.publishOrUnpublish
  16187. * @description 发布/取消发布。
  16188. * @version 10.1.0
  16189. * @param {object} options - 发布/取消发布数据服务所需的参数。
  16190. * @param {object} options.dataId - 数据项id。
  16191. * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  16192. * @param {object} [options.dataServiceId] - 发布的服务 id。
  16193. * @param {boolean} forPublish - 是否取消发布。
  16194. * @returns {Promise} 返回发布/取消发布数据服务的 Promise 对象。
  16195. */
  16196. }, {
  16197. key: "publishOrUnpublish",
  16198. value: function publishOrUnpublish(option, forPublish) {
  16199. if (!option.dataId || !option.serviceType) {
  16200. return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");
  16201. }
  16202. var dataId = option.dataId;
  16203. var dataServiceId = option.dataServiceId;
  16204. var serviceType = option.serviceType;
  16205. var publishUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?serviceType=" + serviceType;
  16206. if (dataServiceId) {
  16207. publishUrl += "&dataServiceId=" + dataServiceId;
  16208. }
  16209. return this.request("PUT", publishUrl, JSON.stringify(forPublish)).then(function (res) {
  16210. // 发起服务状态查询
  16211. if (forPublish) {
  16212. // 发布服务的结果异步处理
  16213. // var publishStateUrl = this.iportalUrl + "web/mycontent/datas/" + dataId + "/publishstatus.rjson";
  16214. if (!dataServiceId) {
  16215. // 发布服务时会回传serviceIDs,发布服务之前serviceIDs为空
  16216. dataServiceId = res.customResult;
  16217. }
  16218. return dataServiceId;
  16219. } else {
  16220. // 取消发布的结果同步处理
  16221. return res;
  16222. }
  16223. });
  16224. }
  16225. /**
  16226. * @function SuperMap.iPortalUser.prototype.getDataPublishedStatus
  16227. * @description 查询服务状态,发起服务状态查询。
  16228. * @version 10.1.0
  16229. * @param {number} dataId - 查询服务状态的数据项id。
  16230. * @param {string} dataServiceId - 发布的服务id。
  16231. * @returns {Promise} 返回查询服务状态的 Promise 对象。
  16232. */
  16233. }, {
  16234. key: "getDataPublishedStatus",
  16235. value: function getDataPublishedStatus(dataId, dataServiceId) {
  16236. var publishStateUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?dataServiceId=" + dataServiceId + "&forPublish=true";
  16237. return this.request("GET", publishStateUrl);
  16238. }
  16239. /**
  16240. * @function SuperMap.iPortalUser.prototype.unPublishedDataService
  16241. * @description 取消发布。
  16242. * @version 10.1.0
  16243. * @param {object} options - 取消发布服务具体参数。
  16244. * @param {object} options.dataId - 数据项id。
  16245. * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  16246. * @param {object} [options.dataServiceId] - 发布的服务 id。
  16247. * @returns {Promise} 返回取消发布数据服务的 Promise 对象。
  16248. */
  16249. }, {
  16250. key: "unPublishDataService",
  16251. value: function unPublishDataService(option) {
  16252. return this.publishOrUnpublish(option, false);
  16253. }
  16254. /**
  16255. * @function SuperMap.iPortalUser.prototype.publishedDataService
  16256. * @description 发布数据服务。
  16257. * @version 10.1.0
  16258. * @param {object} options - 发布数据服务具体参数。
  16259. * @param {object} options.dataId - 数据项id。
  16260. * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  16261. * @param {object} [options.dataServiceId] - 发布的服务 id。
  16262. * @returns {Promise} 返回发布数据服务的 Promise 对象。
  16263. */
  16264. }, {
  16265. key: "publishDataService",
  16266. value: function publishDataService(option) {
  16267. return this.publishOrUnpublish(option, true);
  16268. }
  16269. }]);
  16270. return IPortalUser;
  16271. }(IPortalServiceBase);
  16272. SuperMap.iPortalUser = IPortalUser;
  16273. ;// CONCATENATED MODULE: ./src/common/iPortal/index.js
  16274. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16275. * This program are made available under the terms of the Apache License, Version 2.0
  16276. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16277. ;// CONCATENATED MODULE: ./src/common/iServer/CommonServiceBase.js
  16278. function CommonServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16279. 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); } }
  16280. function CommonServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  16281. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16282. * This program are made available under the terms of the Apache License, Version 2.0
  16283. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16284. /**
  16285. * @class SuperMap.CommonServiceBase
  16286. * @category iServer
  16287. * @classdesc 对接 iServer 各种服务的 Service 的基类。
  16288. * @param {string} url - 服务地址。
  16289. * @param {Object} options - 参数。
  16290. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  16291. * @param {string} [options.proxy] - 服务代理地址。
  16292. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  16293. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  16294. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16295. * @param {Object} [options.headers] - 请求头。
  16296. */
  16297. var CommonServiceBase = /*#__PURE__*/function () {
  16298. function CommonServiceBase(url, options) {
  16299. CommonServiceBase_classCallCheck(this, CommonServiceBase);
  16300. var me = this;
  16301. this.EVENT_TYPES = ["processCompleted", "processFailed"];
  16302. this.events = null;
  16303. this.eventListeners = null;
  16304. this.url = null;
  16305. this.urls = null;
  16306. this.proxy = null;
  16307. this.serverType = null;
  16308. this.index = null;
  16309. this.length = null;
  16310. this.options = null;
  16311. this.totalTimes = null;
  16312. this.POLLING_TIMES = 3;
  16313. this._processSuccess = null;
  16314. this._processFailed = null;
  16315. this.isInTheSameDomain = null;
  16316. this.withCredentials = false;
  16317. if (Util.isArray(url)) {
  16318. me.urls = url;
  16319. me.length = url.length;
  16320. me.totalTimes = me.length;
  16321. if (me.length === 1) {
  16322. me.url = url[0];
  16323. } else {
  16324. me.index = parseInt(Math.random() * me.length);
  16325. me.url = url[me.index];
  16326. }
  16327. } else {
  16328. me.totalTimes = 1;
  16329. me.url = url;
  16330. }
  16331. if (Util.isArray(url) && !me.isServiceSupportPolling()) {
  16332. me.url = url[0];
  16333. me.totalTimes = 1;
  16334. }
  16335. me.serverType = me.serverType || ServerType.ISERVER;
  16336. options = options || {};
  16337. this.crossOrigin = options.crossOrigin;
  16338. this.headers = options.headers;
  16339. Util.extend(this, options);
  16340. me.isInTheSameDomain = Util.isInTheSameDomain(me.url);
  16341. me.events = new Events(me, null, me.EVENT_TYPES, true);
  16342. if (me.eventListeners instanceof Object) {
  16343. me.events.on(me.eventListeners);
  16344. }
  16345. this.CLASS_NAME = "SuperMap.CommonServiceBase";
  16346. }
  16347. /**
  16348. * @function SuperMap.CommonServiceBase.prototype.destroy
  16349. * @description 释放资源,将引用的资源属性置空。
  16350. */
  16351. CommonServiceBase_createClass(CommonServiceBase, [{
  16352. key: "destroy",
  16353. value: function destroy() {
  16354. var me = this;
  16355. if (Util.isArray(me.urls)) {
  16356. me.urls = null;
  16357. me.index = null;
  16358. me.length = null;
  16359. me.totalTimes = null;
  16360. }
  16361. me.url = null;
  16362. me.options = null;
  16363. me._processSuccess = null;
  16364. me._processFailed = null;
  16365. me.isInTheSameDomain = null;
  16366. me.EVENT_TYPES = null;
  16367. if (me.events) {
  16368. me.events.destroy();
  16369. me.events = null;
  16370. }
  16371. if (me.eventListeners) {
  16372. me.eventListeners = null;
  16373. }
  16374. }
  16375. /**
  16376. * @function SuperMap.CommonServiceBase.prototype.request
  16377. * @description: 该方法用于向服务发送请求。
  16378. * @param {Object} options - 参数。
  16379. * @param {string} [options.method='GET'] - 请求方式,包括 "GET","POST","PUT","DELETE"。
  16380. * @param {string} [options.url] - 发送请求的地址。
  16381. * @param {Object} [options.params] - 作为查询字符串添加到 URL 中的一组键值对,此参数只适用于 GET 方式发送的请求。
  16382. * @param {string} [options.data] - 发送到服务器的数据。
  16383. * @param {function} options.success - 请求成功后的回调函数。
  16384. * @param {function} options.failure - 请求失败后的回调函数。
  16385. * @param {Object} [options.scope] - 如果回调函数是对象的一个公共方法,设定该对象的范围。
  16386. * @param {boolean} [options.isInTheSameDomain] - 请求是否在当前域中。
  16387. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  16388. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16389. * @param {Object} [options.headers] - 请求头。
  16390. */
  16391. }, {
  16392. key: "request",
  16393. value: function request(options) {
  16394. var me = this;
  16395. options.url = options.url || me.url;
  16396. options.proxy = options.proxy || me.proxy;
  16397. options.withCredentials = options.withCredentials != undefined ? options.withCredentials : me.withCredentials;
  16398. options.crossOrigin = options.crossOrigin != undefined ? options.crossOrigin : me.crossOrigin;
  16399. options.headers = options.headers || me.headers;
  16400. options.isInTheSameDomain = me.isInTheSameDomain; //为url添加安全认证信息片段
  16401. var credential = this.getCredential(options.url);
  16402. if (credential) {
  16403. options.url = Util.urlAppend(options.url, credential.getUrlParameters());
  16404. }
  16405. me.calculatePollingTimes();
  16406. me._processSuccess = options.success;
  16407. me._processFailed = options.failure;
  16408. options.scope = me;
  16409. options.success = me.getUrlCompleted;
  16410. options.failure = me.getUrlFailed;
  16411. me.options = options;
  16412. me._commit(me.options);
  16413. }
  16414. /**
  16415. * @function SuperMap.CommonServiceBase.prototype.getCredential
  16416. * @description 获取凭据信息
  16417. * @param {string} url - 服务地址。
  16418. * @returns {SuperMap.Credential} 凭据信息对象。
  16419. */
  16420. }, {
  16421. key: "getCredential",
  16422. value: function getCredential(url) {
  16423. var keyUrl = url,
  16424. credential,
  16425. value;
  16426. switch (this.serverType) {
  16427. case ServerType.IPORTAL:
  16428. value = SecurityManager.getToken(keyUrl);
  16429. credential = value ? new Credential(value, "token") : null;
  16430. if (!credential) {
  16431. value = SecurityManager.getKey(keyUrl);
  16432. credential = value ? new Credential(value, "key") : null;
  16433. }
  16434. break;
  16435. case ServerType.ONLINE:
  16436. value = SecurityManager.getKey(keyUrl);
  16437. credential = value ? new Credential(value, "key") : null;
  16438. break;
  16439. default:
  16440. //iServer or others
  16441. value = SecurityManager.getToken(keyUrl);
  16442. credential = value ? new Credential(value, "token") : null;
  16443. break;
  16444. }
  16445. return credential;
  16446. }
  16447. /**
  16448. * @function SuperMap.CommonServiceBase.prototype.getUrlCompleted
  16449. * @description 请求成功后执行此方法。
  16450. * @param {Object} result - 服务器返回的结果对象。
  16451. */
  16452. }, {
  16453. key: "getUrlCompleted",
  16454. value: function getUrlCompleted(result) {
  16455. var me = this;
  16456. me._processSuccess(result);
  16457. }
  16458. /**
  16459. * @function SuperMap.CommonServiceBase.prototype.getUrlFailed
  16460. * @description 请求失败后执行此方法。
  16461. * @param {Object} result - 服务器返回的结果对象。
  16462. */
  16463. }, {
  16464. key: "getUrlFailed",
  16465. value: function getUrlFailed(result) {
  16466. var me = this;
  16467. if (me.totalTimes > 0) {
  16468. me.totalTimes--;
  16469. me.ajaxPolling();
  16470. } else {
  16471. me._processFailed(result);
  16472. }
  16473. }
  16474. /**
  16475. *
  16476. * @function SuperMap.CommonServiceBase.prototype.ajaxPolling
  16477. * @description 请求失败后,如果剩余请求失败次数不为 0,重新获取 URL 发送请求
  16478. */
  16479. }, {
  16480. key: "ajaxPolling",
  16481. value: function ajaxPolling() {
  16482. var me = this,
  16483. url = me.options.url,
  16484. re = /^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;
  16485. me.index = parseInt(Math.random() * me.length);
  16486. me.url = me.urls[me.index];
  16487. url = url.replace(re, re.exec(me.url)[0]);
  16488. me.options.url = url;
  16489. me.options.isInTheSameDomain = Util.isInTheSameDomain(url);
  16490. me._commit(me.options);
  16491. }
  16492. /**
  16493. * @function SuperMap.CommonServiceBase.prototype.calculatePollingTimes
  16494. * @description 计算剩余请求失败执行次数。
  16495. */
  16496. }, {
  16497. key: "calculatePollingTimes",
  16498. value: function calculatePollingTimes() {
  16499. var me = this;
  16500. if (me.times) {
  16501. if (me.totalTimes > me.POLLING_TIMES) {
  16502. if (me.times > me.POLLING_TIMES) {
  16503. me.totalTimes = me.POLLING_TIMES;
  16504. } else {
  16505. me.totalTimes = me.times;
  16506. }
  16507. } else {
  16508. if (me.times < me.totalTimes) {
  16509. me.totalTimes = me.times;
  16510. }
  16511. }
  16512. } else {
  16513. if (me.totalTimes > me.POLLING_TIMES) {
  16514. me.totalTimes = me.POLLING_TIMES;
  16515. }
  16516. }
  16517. me.totalTimes--;
  16518. }
  16519. /**
  16520. * @function SuperMap.CommonServiceBase.prototype.isServiceSupportPolling
  16521. * @description 判断服务是否支持轮询。
  16522. */
  16523. }, {
  16524. key: "isServiceSupportPolling",
  16525. value: function isServiceSupportPolling() {
  16526. var me = this;
  16527. return !(me.CLASS_NAME === "SuperMap.REST.ThemeService" || me.CLASS_NAME === "SuperMap.REST.EditFeaturesService");
  16528. }
  16529. /**
  16530. * @function SuperMap.CommonServiceBase.prototype.serviceProcessCompleted
  16531. * @description 状态完成,执行此方法。
  16532. * @param {Object} result - 服务器返回的结果对象。
  16533. */
  16534. }, {
  16535. key: "serviceProcessCompleted",
  16536. value: function serviceProcessCompleted(result) {
  16537. result = Util.transformResult(result);
  16538. this.events.triggerEvent("processCompleted", {
  16539. result: result
  16540. });
  16541. }
  16542. /**
  16543. * @function SuperMap.CommonServiceBase.prototype.serviceProcessFailed
  16544. * @description 状态失败,执行此方法。
  16545. * @param {Object} result - 服务器返回的结果对象。
  16546. */
  16547. }, {
  16548. key: "serviceProcessFailed",
  16549. value: function serviceProcessFailed(result) {
  16550. result = Util.transformResult(result);
  16551. var error = result.error || result;
  16552. this.events.triggerEvent("processFailed", {
  16553. error: error
  16554. });
  16555. }
  16556. }, {
  16557. key: "_commit",
  16558. value: function _commit(options) {
  16559. if (options.method === "POST" || options.method === "PUT") {
  16560. if (options.params) {
  16561. options.url = Util.urlAppend(options.url, Util.getParameterString(options.params || {}));
  16562. }
  16563. options.params = options.data;
  16564. }
  16565. FetchRequest.commit(options.method, options.url, options.params, {
  16566. headers: options.headers,
  16567. withCredentials: options.withCredentials,
  16568. crossOrigin: options.crossOrigin,
  16569. timeout: options.async ? 0 : null,
  16570. proxy: options.proxy
  16571. }).then(function (response) {
  16572. if (response.text) {
  16573. return response.text();
  16574. }
  16575. if (response.json) {
  16576. return response.json();
  16577. }
  16578. return response;
  16579. }).then(function (text) {
  16580. var result = text;
  16581. if (typeof text === "string") {
  16582. result = new JSONFormat().read(text);
  16583. }
  16584. if (!result || result.error || result.code >= 300 && result.code !== 304) {
  16585. if (result && result.error) {
  16586. result = {
  16587. error: result.error
  16588. };
  16589. } else {
  16590. result = {
  16591. error: result
  16592. };
  16593. }
  16594. }
  16595. if (result.error) {
  16596. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  16597. failure(result);
  16598. } else {
  16599. result.succeed = result.succeed == undefined ? true : result.succeed;
  16600. var success = options.scope ? FunctionExt.bind(options.success, options.scope) : options.success;
  16601. success(result);
  16602. }
  16603. })["catch"](function (e) {
  16604. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  16605. failure(e);
  16606. });
  16607. }
  16608. }]);
  16609. return CommonServiceBase;
  16610. }();
  16611. SuperMap.CommonServiceBase = CommonServiceBase;
  16612. /**
  16613. * 服务器请求回调函数
  16614. * @callback RequestCallback
  16615. * @example
  16616. * var requestCallback = function (serviceResult){
  16617. * console.log(serviceResult.result);
  16618. * }
  16619. * new QueryService(url).queryByBounds(param, requestCallback);
  16620. * @param {Object} serviceResult
  16621. * @param {Object} serviceResult.result 服务器返回结果。
  16622. * @param {Object} serviceResult.object 发布应用程序事件的对象。
  16623. * @param {Object} serviceResult.type 事件类型。
  16624. * @param {Object} serviceResult.element 接受浏览器事件的 DOM 节点。
  16625. */
  16626. ;// CONCATENATED MODULE: ./src/common/iServer/GeoCodingParameter.js
  16627. function GeoCodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16628. 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); } }
  16629. function GeoCodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoCodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoCodingParameter_defineProperties(Constructor, staticProps); return Constructor; }
  16630. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16631. * This program are made available under the terms of the Apache License, Version 2.0
  16632. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16633. /**
  16634. * @class SuperMap.GeoCodingParameter
  16635. * @category iServer AddressMatch
  16636. * @classdesc 地理正向匹配参数类。
  16637. * @param {Object} options - 参数。
  16638. * @param {string} options.address - 地点关键词。
  16639. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  16640. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  16641. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  16642. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  16643. * @param {number} [options.maxReturn] - 最大返回结果数。
  16644. */
  16645. var GeoCodingParameter = /*#__PURE__*/function () {
  16646. function GeoCodingParameter(options) {
  16647. GeoCodingParameter_classCallCheck(this, GeoCodingParameter);
  16648. if (options.filters && typeof options.filters === 'string') {
  16649. options.filters = options.filters.split(',');
  16650. }
  16651. /**
  16652. * @member {string} SuperMap.GeoCodingParameter.prototype.address
  16653. * @description 地点关键词。
  16654. */
  16655. this.address = null;
  16656. /**
  16657. * @member {number} [SuperMap.GeoCodingParameter.prototype.fromIndex]
  16658. * @description 设置返回对象的起始索引值。
  16659. */
  16660. this.fromIndex = null;
  16661. /**
  16662. * @member {number} [SuperMap.GeoCodingParameter.prototype.toIndex]
  16663. * @description 设置返回对象的结束索引值。
  16664. */
  16665. this.toIndex = null;
  16666. /**
  16667. * @member {Array.<string>} [SuperMap.GeoCodingParameter.prototype.filters]
  16668. * @description 过滤字段,限定查询区域。
  16669. */
  16670. this.filters = null;
  16671. /**
  16672. * @member {string} [SuperMap.GeoCodingParameter.prototype.prjCoordSys]
  16673. * @description 查询结果的坐标系。
  16674. */
  16675. this.prjCoordSys = null;
  16676. /**
  16677. * @member {number} [SuperMap.GeoCodingParameter.prototype.maxReturn]
  16678. * @description 最大返回结果数。
  16679. */
  16680. this.maxReturn = null;
  16681. Util.extend(this, options);
  16682. }
  16683. /**
  16684. * @function SuperMap.GeoCodingParameter.prototype.destroy
  16685. * @description 释放资源,将引用资源的属性置空。
  16686. */
  16687. GeoCodingParameter_createClass(GeoCodingParameter, [{
  16688. key: "destroy",
  16689. value: function destroy() {
  16690. this.address = null;
  16691. this.fromIndex = null;
  16692. this.toIndex = null;
  16693. this.filters = null;
  16694. this.prjCoordSys = null;
  16695. this.maxReturn = null;
  16696. }
  16697. }]);
  16698. return GeoCodingParameter;
  16699. }();
  16700. SuperMap.GeoCodingParameter = GeoCodingParameter;
  16701. ;// CONCATENATED MODULE: ./src/common/iServer/GeoDecodingParameter.js
  16702. function GeoDecodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16703. 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); } }
  16704. function GeoDecodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoDecodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoDecodingParameter_defineProperties(Constructor, staticProps); return Constructor; }
  16705. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16706. * This program are made available under the terms of the Apache License, Version 2.0
  16707. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16708. /**
  16709. * @class SuperMap.GeoDecodingParameter
  16710. * @category iServer AddressMatch
  16711. * @classdesc 地理反向匹配参数类。
  16712. * @param {Object} options - 参数。
  16713. * @param {number} options.x - 查询位置的横坐标。
  16714. * @param {number} options.y - 查询位置的纵坐标。
  16715. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  16716. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  16717. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  16718. * @param {number} [options.maxReturn] - 最大返回结果数。
  16719. * @param {number} [options.geoDecodingRadius] - 查询半径。
  16720. */
  16721. var GeoDecodingParameter = /*#__PURE__*/function () {
  16722. function GeoDecodingParameter(options) {
  16723. GeoDecodingParameter_classCallCheck(this, GeoDecodingParameter);
  16724. if (options.filters) {
  16725. options.filters = options.filters.split(',');
  16726. }
  16727. /**
  16728. * @member {number} SuperMap.GeoDecodingParameter.prototype.x
  16729. * @description 查询位置的横坐标。
  16730. */
  16731. this.x = null;
  16732. /**
  16733. * @member {number} SuperMap.GeoDecodingParameter.prototype.y
  16734. * @description 查询位置的纵坐标。
  16735. */
  16736. this.y = null;
  16737. /**
  16738. * @member {number} [SuperMap.GeoDecodingParameter.prototype.fromIndex]
  16739. * @description 设置返回对象的起始索引值。
  16740. */
  16741. this.fromIndex = null;
  16742. /**
  16743. * @member {number} [SuperMap.GeoDecodingParameter.prototype.toIndex]
  16744. * @description 设置返回对象的结束索引值。
  16745. */
  16746. this.toIndex = null;
  16747. /**
  16748. * @member {Array.<string>} [SuperMap.GeoDecodingParameter.prototype.filters]
  16749. * @description 过滤字段,限定查询区域。
  16750. */
  16751. this.filters = null;
  16752. /**
  16753. * @member {string} [SuperMap.GeoDecodingParameter.prototype.prjCoordSys]
  16754. * @description 查询结果的坐标系。
  16755. */
  16756. this.prjCoordSys = null;
  16757. /**
  16758. * @member {number} [SuperMap.GeoDecodingParameter.prototype.maxReturn]
  16759. * @description 最大返回结果数。
  16760. */
  16761. this.maxReturn = null;
  16762. /**
  16763. * @member {number} SuperMap.GeoDecodingParameter.prototype.geoDecodingRadius
  16764. * @description 查询半径。
  16765. */
  16766. this.geoDecodingRadius = null;
  16767. Util.extend(this, options);
  16768. }
  16769. /**
  16770. * @function SuperMap.GeoDecodingParameter.prototype.destroy
  16771. * @description 释放资源,将引用资源的属性置空。
  16772. */
  16773. GeoDecodingParameter_createClass(GeoDecodingParameter, [{
  16774. key: "destroy",
  16775. value: function destroy() {
  16776. this.x = null;
  16777. this.y = null;
  16778. this.fromIndex = null;
  16779. this.toIndex = null;
  16780. this.filters = null;
  16781. this.prjCoordSys = null;
  16782. this.maxReturn = null;
  16783. this.geoDecodingRadius = null;
  16784. }
  16785. }]);
  16786. return GeoDecodingParameter;
  16787. }();
  16788. SuperMap.GeoDecodingParameter = GeoDecodingParameter;
  16789. ;// CONCATENATED MODULE: ./src/common/iServer/AddressMatchService.js
  16790. function AddressMatchService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { AddressMatchService_typeof = function _typeof(obj) { return typeof obj; }; } else { AddressMatchService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return AddressMatchService_typeof(obj); }
  16791. function AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16792. 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); } }
  16793. function AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AddressMatchService_defineProperties(Constructor, staticProps); return Constructor; }
  16794. function AddressMatchService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { AddressMatchService_get = Reflect.get; } else { AddressMatchService_get = function _get(target, property, receiver) { var base = AddressMatchService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return AddressMatchService_get(target, property, receiver || target); }
  16795. function AddressMatchService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AddressMatchService_getPrototypeOf(object); if (object === null) break; } return object; }
  16796. function AddressMatchService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) AddressMatchService_setPrototypeOf(subClass, superClass); }
  16797. function AddressMatchService_setPrototypeOf(o, p) { AddressMatchService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AddressMatchService_setPrototypeOf(o, p); }
  16798. 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); }; }
  16799. function AddressMatchService_possibleConstructorReturn(self, call) { if (call && (AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } return AddressMatchService_assertThisInitialized(self); }
  16800. function AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16801. function AddressMatchService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  16802. function AddressMatchService_getPrototypeOf(o) { AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AddressMatchService_getPrototypeOf(o); }
  16803. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16804. * This program are made available under the terms of the Apache License, Version 2.0
  16805. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16806. /**
  16807. * @class SuperMap.AddressMatchService
  16808. * @category iServer AddressMatch
  16809. * @classdesc 地址匹配服务,包括正向匹配和反向匹配。
  16810. * @param {string} url - 地址匹配服务地址。
  16811. * @param {Object} options - 参数。
  16812. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16813. * @param {Object} [options.headers] - 请求头。
  16814. */
  16815. var AddressMatchService_AddressMatchService = /*#__PURE__*/function (_CommonServiceBase) {
  16816. AddressMatchService_inherits(AddressMatchService, _CommonServiceBase);
  16817. var _super = AddressMatchService_createSuper(AddressMatchService);
  16818. function AddressMatchService(url, options) {
  16819. var _this;
  16820. AddressMatchService_classCallCheck(this, AddressMatchService);
  16821. _this = _super.call(this, url, options);
  16822. _this.options = options || {};
  16823. _this.CLASS_NAME = 'SuperMap.AddressMatchService';
  16824. return _this;
  16825. }
  16826. /**
  16827. * @function SuperMap.AddressMatchService.prototype.destroy
  16828. * @override
  16829. */
  16830. AddressMatchService_createClass(AddressMatchService, [{
  16831. key: "destroy",
  16832. value: function destroy() {
  16833. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "destroy", this).call(this);
  16834. }
  16835. /**
  16836. * @function SuperMap.AddressMatchService.prototype.code
  16837. * @param {string} url - 正向地址匹配服务地址。
  16838. * @param {SuperMap.GeoCodingParameter} params - 正向地址匹配服务参数。
  16839. */
  16840. }, {
  16841. key: "code",
  16842. value: function code(url, params) {
  16843. if (!(params instanceof GeoCodingParameter)) {
  16844. return;
  16845. }
  16846. this.processAsync(url, params);
  16847. }
  16848. /**
  16849. * @function SuperMap.AddressMatchService.prototype.decode
  16850. * @param {string} url - 反向地址匹配服务地址。
  16851. * @param {SuperMap.GeoDecodingParameter} params - 反向地址匹配服务参数。
  16852. */
  16853. }, {
  16854. key: "decode",
  16855. value: function decode(url, params) {
  16856. if (!(params instanceof GeoDecodingParameter)) {
  16857. return;
  16858. }
  16859. this.processAsync(url, params);
  16860. }
  16861. /**
  16862. * @function SuperMap.AddressMatchService.prototype.processAsync
  16863. * @description 负责将客户端的动态分段服务参数传递到服务端。
  16864. * @param {string} url - 服务地址。
  16865. * @param {Object} params - 参数。
  16866. */
  16867. }, {
  16868. key: "processAsync",
  16869. value: function processAsync(url, params) {
  16870. this.request({
  16871. method: 'GET',
  16872. url: url,
  16873. params: params,
  16874. scope: this,
  16875. success: this.serviceProcessCompleted,
  16876. failure: this.serviceProcessFailed
  16877. });
  16878. }
  16879. /**
  16880. * @function SuperMap.AddressMatchService.prototype.serviceProcessCompleted
  16881. * @param {Object} result - 服务器返回的结果对象。
  16882. * @description 服务流程是否完成
  16883. */
  16884. }, {
  16885. key: "serviceProcessCompleted",
  16886. value: function serviceProcessCompleted(result) {
  16887. if (result.succeed) {
  16888. delete result.succeed;
  16889. }
  16890. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessCompleted", this).call(this, result);
  16891. }
  16892. /**
  16893. * @function SuperMap.AddressMatchService.prototype.serviceProcessCompleted
  16894. * @param {Object} result - 服务器返回的结果对象。
  16895. * @description 服务流程是否失败
  16896. */
  16897. }, {
  16898. key: "serviceProcessFailed",
  16899. value: function serviceProcessFailed(result) {
  16900. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessFailed", this).call(this, result);
  16901. }
  16902. }]);
  16903. return AddressMatchService;
  16904. }(CommonServiceBase);
  16905. SuperMap.AddressMatchService = AddressMatchService_AddressMatchService;
  16906. ;// CONCATENATED MODULE: ./src/common/iServer/AggQueryBuilderParameter.js
  16907. function AggQueryBuilderParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16908. function AggQueryBuilderParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  16909. function AggQueryBuilderParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) AggQueryBuilderParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) AggQueryBuilderParameter_defineProperties(Constructor, staticProps); return Constructor; }
  16910. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16911. * This program are made available under the terms of the Apache License, Version 2.0
  16912. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16913. /**
  16914. * @class SuperMap.AggQueryBuilderParameter
  16915. * @classdesc 聚合查询 QueryBuilder 参数基类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  16916. * @category iServer Data FeatureResults
  16917. * @param {Object} option - 初始化参数。
  16918. * @param {string} option.name - 查询结果名称。
  16919. * @param {SuperMap.AggregationQueryBuilderType} option.queryType - 查询类型。
  16920. */
  16921. var AggQueryBuilderParameter = /*#__PURE__*/function () {
  16922. function AggQueryBuilderParameter(option) {
  16923. AggQueryBuilderParameter_classCallCheck(this, AggQueryBuilderParameter);
  16924. /**
  16925. * @member {string} SuperMap.AggQueryBuilderParameter.prototype.name
  16926. * @description 查询结果名称。
  16927. */
  16928. this.name = null;
  16929. /**
  16930. * @member {SuperMap.AggregationQueryBuilderType} SuperMap.AggQueryBuilderParameter.prototype.queryType
  16931. * @description 查询类型。
  16932. */
  16933. this.queryType = null;
  16934. this.CLASS_NAME = "SuperMap.AggQueryBuilderParameter";
  16935. Util.extend(this, option);
  16936. }
  16937. AggQueryBuilderParameter_createClass(AggQueryBuilderParameter, [{
  16938. key: "destroy",
  16939. value: function destroy() {
  16940. var me = this;
  16941. me.name = null;
  16942. me.queryType = null;
  16943. }
  16944. }]);
  16945. return AggQueryBuilderParameter;
  16946. }();
  16947. SuperMap.AggQueryBuilderParameter = AggQueryBuilderParameter;
  16948. ;// CONCATENATED MODULE: ./src/common/iServer/AggregationParameter.js
  16949. function AggregationParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16950. 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); } }
  16951. function AggregationParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) AggregationParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) AggregationParameter_defineProperties(Constructor, staticProps); return Constructor; }
  16952. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16953. * This program are made available under the terms of the Apache License, Version 2.0
  16954. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16955. /**
  16956. * @class SuperMap.AggregationParameter
  16957. * @classdesc 聚合查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  16958. * @category iServer Data FeatureResults
  16959. * @param {Object} options - 初始化参数。
  16960. * @param {string} options.aggName - 聚合名称。
  16961. * @param {SuperMap.AggregationType} options.aggType - 聚合类型设置。
  16962. * @param {string} options.aggFieldName - 聚合字段。
  16963. * @param {SuperMap.AggregationParameter} options.subAgg - 子聚合类。
  16964. *
  16965. */
  16966. var AggregationParameter = /*#__PURE__*/function () {
  16967. function AggregationParameter(options) {
  16968. AggregationParameter_classCallCheck(this, AggregationParameter);
  16969. /**
  16970. * @member {string} SuperMap.AggregationParameter.prototype.aggName
  16971. * @description 聚合名称。
  16972. */
  16973. this.aggName = null;
  16974. /**
  16975. * @member {SuperMap.AggregationType} SuperMap.AggregationParameter.prototype.aggType
  16976. * @description 聚合类型设置类。
  16977. */
  16978. this.aggType = null;
  16979. /**
  16980. * @member {string} SuperMap.AggregationParameter.prototype.aggFieldName
  16981. * @description 聚合字段。
  16982. */
  16983. this.aggFieldName = null;
  16984. /**
  16985. * @member {SuperMap.AggregationParameter} SuperMap.AggregationParameter.prototype.subAgg
  16986. * @description 子聚合。
  16987. */
  16988. this.subAgg = null;
  16989. this.CLASS_NAME = "SuperMap.AggregationParameter";
  16990. Util.extend(this, options);
  16991. }
  16992. AggregationParameter_createClass(AggregationParameter, [{
  16993. key: "destroy",
  16994. value: function destroy() {
  16995. var me = this;
  16996. me.aggName = null;
  16997. me.aggFieldName = null;
  16998. me.aggType = null;
  16999. if (me.subAgg) {
  17000. me.subAgg = null;
  17001. }
  17002. }
  17003. }]);
  17004. return AggregationParameter;
  17005. }();
  17006. SuperMap.AggregationParameter = AggregationParameter;
  17007. ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationParameters.js
  17008. function AreaSolarRadiationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17009. 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); } }
  17010. function AreaSolarRadiationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationParameters_defineProperties(Constructor, staticProps); return Constructor; }
  17011. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17012. * This program are made available under the terms of the Apache License, Version 2.0
  17013. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17014. /**
  17015. * @class SuperMap.AreaSolarRadiationParameters
  17016. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  17017. * @classdesc 地区太阳辐射参数类。
  17018. * @param {Object} options - 参数。
  17019. * @param {string} options.dataset - 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"的形式来表示,例如:JingjinTerrain@Jingjin。
  17020. * @param {string} options.targetDatasourceName - 指定的存储结果数据集的数据源名称, 例如:"Jingjin"。
  17021. * @param {string} options.totalGridName - 指定地区太阳辐射总辐射量数据集的名称。
  17022. * @param {string} options.diffuseDatasetGridName - 指定地区太阳辐射散射辐射量数据集的名称。
  17023. * @param {string} options.durationDatasetGridName - 指定地区太阳辐射太阳直射持续时间数据集的名称。
  17024. * @param {string} options.directDatasetGridName - 指定地区太阳辐射直射辐射量数据集的名称。
  17025. * @param {number} options.latitude - 待计算区域的纬度值。
  17026. * @param {string} [options.timeMode = 'MULTIDAYS'] - 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  17027. * @param {number} options.dayStart - 起始日期(年内的第几天)。
  17028. * @param {number} options.dayEnd - 结束日期(年内的第几天)。
  17029. * @param {number} [options.hourStart] - 起始时间(一天中的第几个小时)。
  17030. * @param {number} [options.hourEnd] - 结束时间(一天中的第几个小时)。
  17031. * @param {number} [options.transmittance] - 太阳辐射穿过大气的透射率。
  17032. * @param {number} [options.hourInterval=0.5] - 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确,如果修改此参数,必须使用整数)。
  17033. * @param {number} [options.dayInterval=5] - 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确,必须使用整数)。
  17034. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  17035. */
  17036. var AreaSolarRadiationParameters = /*#__PURE__*/function () {
  17037. function AreaSolarRadiationParameters(options) {
  17038. AreaSolarRadiationParameters_classCallCheck(this, AreaSolarRadiationParameters);
  17039. /**
  17040. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.dataset
  17041. * @description 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示,例如:JingjinTerrain@Jingjin。注:地区太阳辐射数据必须为栅格数据集。
  17042. */
  17043. this.dataset = null;
  17044. /**
  17045. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.targetDatasourceName
  17046. * @description 指定的存储结果数据集的数据源名称,例如:"Jingjin"。
  17047. */
  17048. this.targetDatasourceName = null;
  17049. /**
  17050. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.totalGridName
  17051. * @description 指定地区太阳辐射总辐射量数据集的名称。
  17052. */
  17053. this.totalGridName = null;
  17054. /**
  17055. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.diffuseDatasetGridName
  17056. * @description 指定地区太阳辐射散射辐射量数据集的名称。
  17057. */
  17058. this.diffuseDatasetGridName = null;
  17059. /**
  17060. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.durationDatasetGridName
  17061. * @description 指定地区太阳辐射太阳直射持续时间数据集的名称。
  17062. */
  17063. this.durationDatasetGridName = null;
  17064. /**
  17065. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.durationDatasetGridName
  17066. * @description 指定地区太阳辐射直射辐射量数据集的名称。
  17067. */
  17068. this.directDatasetGridName = null;
  17069. /**
  17070. * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.latitude
  17071. * @description 待计算区域的纬度值。
  17072. */
  17073. this.latitude = null;
  17074. /**
  17075. * @member {string} [SuperMap.AreaSolarRadiationParameters.prototype.timeMode='MULTIDAYS']
  17076. * @description 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  17077. */
  17078. this.timeMode = "MULTIDAYS";
  17079. /**
  17080. * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.dayStart
  17081. * @description 起始日期(年内的第几天)。
  17082. */
  17083. this.dayStart = null;
  17084. /**
  17085. * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.dayEnd
  17086. * @description 结束日期(年内的第几天)。
  17087. */
  17088. this.dayEnd = null;
  17089. /**
  17090. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourStart]
  17091. * @description 起始时间(一天中的第几个小时)。
  17092. */
  17093. this.hourStart = null;
  17094. /**
  17095. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourEnd]
  17096. * @description 结束时间(一天中的第几个小时)。
  17097. */
  17098. this.hourEnd = null;
  17099. /**
  17100. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.transmittance]
  17101. * @description 太阳辐射穿过大气的透射率。
  17102. */
  17103. this.transmittance = null;
  17104. /**
  17105. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourInterval=0.5]
  17106. * @description 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确, 如果修改此参数,必须使用整数)
  17107. */
  17108. this.hourInterval = null;
  17109. /**
  17110. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.dayInterval=5]
  17111. * @description 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确, 必须使用整数)
  17112. */
  17113. this.dayInterval = null;
  17114. /**
  17115. * @member {boolean} [SuperMap.AreaSolarRadiationParameters.prototype.deleteExistResultDataset=false]
  17116. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  17117. */
  17118. this.deleteExistResultDataset = false;
  17119. Util.extend(this, options);
  17120. this.CLASS_NAME = "SuperMap.AreaSolarRadiationParameters";
  17121. }
  17122. /**
  17123. * @function SuperMap.AreaSolarRadiationParameters.prototype.destroy
  17124. * @description 释放资源,将引用资源的属性置空。
  17125. */
  17126. AreaSolarRadiationParameters_createClass(AreaSolarRadiationParameters, [{
  17127. key: "destroy",
  17128. value: function destroy() {
  17129. var me = this;
  17130. me.dataset = null;
  17131. me.zFactor = 1.0;
  17132. me.averageCurvatureName = null;
  17133. me.profileCurvatureName = null;
  17134. me.planCurvatureName = null;
  17135. me.deleteExistResultDataset = true;
  17136. }
  17137. /**
  17138. * @function SuperMap.AreaSolarRadiationParameters.toObject
  17139. * @param {SuperMap.AreaSolarRadiationParameters} param - 地区太阳辐射参数类。
  17140. * @param {SuperMap.AreaSolarRadiationParameters} tempObj - 地区太阳辐射参数对象。
  17141. * @returns {Object} JSON对象。
  17142. * @description 将SuperMap.AreaSolarRadiationParameters对象转换成JSON对象。
  17143. */
  17144. }], [{
  17145. key: "toObject",
  17146. value: function toObject(param, tempObj) {
  17147. var parameter = {};
  17148. for (var name in param) {
  17149. if (name !== "dataset") {
  17150. var name1 = name === "latitude" || name === "timeMode" || name === "dayStart";
  17151. var name2 = name === "dayEnd" || name === "hourStart" || name === "hourEnd";
  17152. var name3 = name === "transmittance" || name === "hourInterval" || name === "dayInterval";
  17153. if (name1 || name2 || name3) {
  17154. parameter[name] = param[name];
  17155. } else {
  17156. tempObj[name] = param[name];
  17157. }
  17158. }
  17159. }
  17160. tempObj["parameter"] = parameter;
  17161. }
  17162. }]);
  17163. return AreaSolarRadiationParameters;
  17164. }();
  17165. SuperMap.AreaSolarRadiationParameters = AreaSolarRadiationParameters;
  17166. ;// CONCATENATED MODULE: ./src/common/iServer/SpatialAnalystBase.js
  17167. function SpatialAnalystBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SpatialAnalystBase_typeof = function _typeof(obj) { return typeof obj; }; } else { SpatialAnalystBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SpatialAnalystBase_typeof(obj); }
  17168. function SpatialAnalystBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17169. 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); } }
  17170. function SpatialAnalystBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystBase_defineProperties(Constructor, staticProps); return Constructor; }
  17171. function SpatialAnalystBase_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SpatialAnalystBase_get = Reflect.get; } else { SpatialAnalystBase_get = function _get(target, property, receiver) { var base = SpatialAnalystBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SpatialAnalystBase_get(target, property, receiver || target); }
  17172. function SpatialAnalystBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SpatialAnalystBase_getPrototypeOf(object); if (object === null) break; } return object; }
  17173. function SpatialAnalystBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SpatialAnalystBase_setPrototypeOf(subClass, superClass); }
  17174. function SpatialAnalystBase_setPrototypeOf(o, p) { SpatialAnalystBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystBase_setPrototypeOf(o, p); }
  17175. 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); }; }
  17176. function SpatialAnalystBase_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystBase_typeof(call) === "object" || typeof call === "function")) { return call; } return SpatialAnalystBase_assertThisInitialized(self); }
  17177. function SpatialAnalystBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17178. function SpatialAnalystBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  17179. function SpatialAnalystBase_getPrototypeOf(o) { SpatialAnalystBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystBase_getPrototypeOf(o); }
  17180. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17181. * This program are made available under the terms of the Apache License, Version 2.0
  17182. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17183. /**
  17184. * @class SuperMap.SpatialAnalystBase
  17185. * @category iServer SpatialAnalyst
  17186. * @classdesc 空间分析服务基类。
  17187. * @param {string} url - 地址。
  17188. * @param {Object} options - 参数。
  17189. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  17190. * @param {Object} [options.headers] - 请求头。
  17191. * @extends {SuperMap.CommonServiceBase}
  17192. */
  17193. var SpatialAnalystBase = /*#__PURE__*/function (_CommonServiceBase) {
  17194. SpatialAnalystBase_inherits(SpatialAnalystBase, _CommonServiceBase);
  17195. var _super = SpatialAnalystBase_createSuper(SpatialAnalystBase);
  17196. function SpatialAnalystBase(url, options) {
  17197. var _this;
  17198. SpatialAnalystBase_classCallCheck(this, SpatialAnalystBase);
  17199. _this = _super.call(this, url, options);
  17200. /**
  17201. * @member {SuperMap.DataFormat} [SuperMap.SpatialAnalystBase.prototype.format=SuperMap.DataFormat.GEOJSON]
  17202. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"。
  17203. */
  17204. _this.format = DataFormat.GEOJSON;
  17205. _this.CLASS_NAME = "SuperMap.SpatialAnalystBase";
  17206. return _this;
  17207. }
  17208. /**
  17209. * @function SuperMap.SpatialAnalystBase.prototype.destroy
  17210. * @override
  17211. */
  17212. SpatialAnalystBase_createClass(SpatialAnalystBase, [{
  17213. key: "destroy",
  17214. value: function destroy() {
  17215. SpatialAnalystBase_get(SpatialAnalystBase_getPrototypeOf(SpatialAnalystBase.prototype), "destroy", this).call(this);
  17216. this.format = null;
  17217. }
  17218. /**
  17219. * @function SuperMap.SpatialAnalystBase.prototype.serviceProcessCompleted
  17220. * @description 分析完成,执行此方法。
  17221. * @param {Object} result - 服务器返回的结果对象。
  17222. */
  17223. }, {
  17224. key: "serviceProcessCompleted",
  17225. value: function serviceProcessCompleted(result) {
  17226. var me = this,
  17227. analystResult;
  17228. result = Util.transformResult(result);
  17229. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  17230. //批量分析时会返回多个结果
  17231. if (Util.isArray(result)) {
  17232. for (var i = 0; i < result.length; i++) {
  17233. result[i] = me.toGeoJSONResult(result[i]);
  17234. }
  17235. analystResult = result;
  17236. } else {
  17237. analystResult = me.toGeoJSONResult(result);
  17238. }
  17239. }
  17240. if (!analystResult) {
  17241. analystResult = result;
  17242. }
  17243. me.events.triggerEvent("processCompleted", {
  17244. result: analystResult
  17245. });
  17246. }
  17247. /**
  17248. * @function SuperMap.SpatialAnalystBase.prototype.toGeoJSONResult
  17249. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  17250. * @param {Object} result - 服务器返回的结果对象。
  17251. *
  17252. */
  17253. }, {
  17254. key: "toGeoJSONResult",
  17255. value: function toGeoJSONResult(result) {
  17256. if (!result) {
  17257. return null;
  17258. } //批量叠加分析时结果这样处理
  17259. if (result.result && result.result.resultGeometry) {
  17260. result = result.result;
  17261. }
  17262. var geoJSONFormat = new GeoJSON();
  17263. if (result.recordsets) {
  17264. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  17265. if (recordsets[i].features) {
  17266. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  17267. }
  17268. }
  17269. } else if (result.recordset && result.recordset.features) {
  17270. result.recordset.features = geoJSONFormat.toGeoJSON(result.recordset.features);
  17271. }
  17272. if (result.resultGeometry) {
  17273. result.resultGeometry = geoJSONFormat.toGeoJSON(result.resultGeometry);
  17274. }
  17275. if (result.regions) {
  17276. result.regions = geoJSONFormat.toGeoJSON(result.regions);
  17277. }
  17278. return result;
  17279. }
  17280. }]);
  17281. return SpatialAnalystBase;
  17282. }(CommonServiceBase);
  17283. SuperMap.SpatialAnalystBase = SpatialAnalystBase;
  17284. ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationService.js
  17285. function AreaSolarRadiationService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { AreaSolarRadiationService_typeof = function _typeof(obj) { return typeof obj; }; } else { AreaSolarRadiationService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return AreaSolarRadiationService_typeof(obj); }
  17286. function AreaSolarRadiationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17287. 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); } }
  17288. function AreaSolarRadiationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationService_defineProperties(Constructor, staticProps); return Constructor; }
  17289. function AreaSolarRadiationService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { AreaSolarRadiationService_get = Reflect.get; } else { AreaSolarRadiationService_get = function _get(target, property, receiver) { var base = AreaSolarRadiationService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return AreaSolarRadiationService_get(target, property, receiver || target); }
  17290. function AreaSolarRadiationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AreaSolarRadiationService_getPrototypeOf(object); if (object === null) break; } return object; }
  17291. function AreaSolarRadiationService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) AreaSolarRadiationService_setPrototypeOf(subClass, superClass); }
  17292. function AreaSolarRadiationService_setPrototypeOf(o, p) { AreaSolarRadiationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AreaSolarRadiationService_setPrototypeOf(o, p); }
  17293. 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); }; }
  17294. function AreaSolarRadiationService_possibleConstructorReturn(self, call) { if (call && (AreaSolarRadiationService_typeof(call) === "object" || typeof call === "function")) { return call; } return AreaSolarRadiationService_assertThisInitialized(self); }
  17295. function AreaSolarRadiationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17296. function AreaSolarRadiationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  17297. function AreaSolarRadiationService_getPrototypeOf(o) { AreaSolarRadiationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AreaSolarRadiationService_getPrototypeOf(o); }
  17298. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17299. * This program are made available under the terms of the Apache License, Version 2.0
  17300. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17301. /**
  17302. * @class SuperMap.AreaSolarRadiationService
  17303. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  17304. * @classdesc 地区太阳辐射服务类。
  17305. * @param {string} url - 服务的访问地址。如:</br>http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst。</br>
  17306. * @param {Object} options - 参数。</br>
  17307. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  17308. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  17309. * @param {Object} [options.headers] - 请求头。
  17310. * @extends {SuperMap.SpatialAnalystBase}
  17311. * @example 例如:
  17312. * (start code)
  17313. * var myAreaSolarRadiationService = new SuperMap.AreaSolarRadiationService(url);
  17314. * myAreaSolarRadiationService.on({
  17315. * "processCompleted": processCompleted,
  17316. * "processFailed": processFailed
  17317. * }
  17318. * );
  17319. * (end)
  17320. *
  17321. */
  17322. var AreaSolarRadiationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  17323. AreaSolarRadiationService_inherits(AreaSolarRadiationService, _SpatialAnalystBase);
  17324. var _super = AreaSolarRadiationService_createSuper(AreaSolarRadiationService);
  17325. function AreaSolarRadiationService(url, options) {
  17326. var _this;
  17327. AreaSolarRadiationService_classCallCheck(this, AreaSolarRadiationService);
  17328. _this = _super.call(this, url, options);
  17329. _this.CLASS_NAME = "SuperMap.AreaSolarRadiationService";
  17330. return _this;
  17331. }
  17332. /**
  17333. * @function SuperMap.AreaSolarRadiationService.prototype.destroy
  17334. * @override
  17335. */
  17336. AreaSolarRadiationService_createClass(AreaSolarRadiationService, [{
  17337. key: "destroy",
  17338. value: function destroy() {
  17339. AreaSolarRadiationService_get(AreaSolarRadiationService_getPrototypeOf(AreaSolarRadiationService.prototype), "destroy", this).call(this);
  17340. }
  17341. /**
  17342. * @function SuperMap.AreaSolarRadiationService.prototype.processAsync
  17343. * @description 负责将客户端的查询参数传递到服务端。
  17344. * @param {SuperMap.AreaSolarRadiationParameters} parameter - 地区太阳辐射参数。
  17345. */
  17346. }, {
  17347. key: "processAsync",
  17348. value: function processAsync(parameter) {
  17349. if (!(parameter instanceof AreaSolarRadiationParameters)) {
  17350. return;
  17351. }
  17352. var me = this;
  17353. var parameterObject = {};
  17354. if (parameter instanceof AreaSolarRadiationParameters) {
  17355. me.url = Util.urlPathAppend(me.url, "datasets/".concat(parameter.dataset, "/solarradiation"));
  17356. }
  17357. me.url = Util.urlAppend(me.url, 'returnContent=true');
  17358. AreaSolarRadiationParameters.toObject(parameter, parameterObject);
  17359. var jsonParameters = Util.toJSON(parameterObject);
  17360. me.request({
  17361. method: 'POST',
  17362. data: jsonParameters,
  17363. scope: me,
  17364. success: me.serviceProcessCompleted,
  17365. failure: me.serviceProcessFailed
  17366. });
  17367. }
  17368. }]);
  17369. return AreaSolarRadiationService;
  17370. }(SpatialAnalystBase);
  17371. SuperMap.AreaSolarRadiationService = AreaSolarRadiationService;
  17372. ;// CONCATENATED MODULE: ./src/common/iServer/BufferDistance.js
  17373. function BufferDistance_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17374. 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); } }
  17375. function BufferDistance_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferDistance_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferDistance_defineProperties(Constructor, staticProps); return Constructor; }
  17376. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17377. * This program are made available under the terms of the Apache License, Version 2.0
  17378. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17379. /**
  17380. * @class SuperMap.BufferDistance
  17381. * @category iServer SpatialAnalyst BufferAnalyst
  17382. * @classdesc 缓冲区分析的缓冲距离类。通过该类可以设置缓冲区分析的缓冲距离,距离可以是数值也可以是数值型的字段表达式。
  17383. * @param {Object} options - 参数。
  17384. * @param {string} [options.exp] - 以数值型的字段表达式作为缓冲区分析的距离值。
  17385. * @param {number} [options.value=100] - 以数值作为缓冲区分析的距离值。单位:米。
  17386. */
  17387. var BufferDistance = /*#__PURE__*/function () {
  17388. function BufferDistance(options) {
  17389. BufferDistance_classCallCheck(this, BufferDistance);
  17390. /**
  17391. * @member {string} [SuperMap.BufferDistance.prototype.exp]
  17392. * @description 以数值型的字段表达式作为缓冲区分析的距离值。
  17393. */
  17394. this.exp = null;
  17395. /**
  17396. * @member {number} [SuperMap.BufferDistance.prototype.value=100]
  17397. * @description 以数值作为缓冲区分析的距离值。单位:米。
  17398. */
  17399. this.value = 100;
  17400. Util.extend(this, options);
  17401. this.CLASS_NAME = "SuperMap.BufferDistance";
  17402. }
  17403. /**
  17404. * @function SuperMap.BufferDistance.prototype.destroy
  17405. * @description 释放资源,将引用资源的属性置空。
  17406. */
  17407. BufferDistance_createClass(BufferDistance, [{
  17408. key: "destroy",
  17409. value: function destroy() {
  17410. this.exp = null;
  17411. this.value = null;
  17412. }
  17413. }]);
  17414. return BufferDistance;
  17415. }();
  17416. SuperMap.BufferDistance = BufferDistance;
  17417. ;// CONCATENATED MODULE: ./src/common/iServer/BufferSetting.js
  17418. function BufferSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17419. 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); } }
  17420. function BufferSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferSetting_defineProperties(Constructor, staticProps); return Constructor; }
  17421. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17422. * This program are made available under the terms of the Apache License, Version 2.0
  17423. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17424. /**
  17425. * @class SuperMap.BufferSetting
  17426. * @category iServer SpatialAnalyst BufferAnalyst
  17427. * @classdesc 缓冲区分析通用设置类。
  17428. * @param {Object} options - 参数。
  17429. * @param {SuperMap.BufferEndType} [options.endType=SuperMap.BufferEndType.FLAT] - 缓冲区端点枚举值。
  17430. * @param {SuperMap.BufferDistance} [options.leftDistance=100] - 左侧缓冲距离。
  17431. * @param {SuperMap.BufferDistance} [options.rightDistance=100] - 右侧缓冲距离。
  17432. * @param {number} [options.semicircleLineSegment=4] - 圆头缓冲圆弧处线段的个数。
  17433. * @param {SuperMap.BufferRadiusUnit} [options.radiusUnit=SuperMap.BufferRadiusUnit.METER] - 缓冲半径单位。
  17434. */
  17435. var BufferSetting = /*#__PURE__*/function () {
  17436. function BufferSetting(options) {
  17437. BufferSetting_classCallCheck(this, BufferSetting);
  17438. /**
  17439. * @member {SuperMap.BufferEndType} [SuperMap.BufferSetting.prototype.endType = SuperMap.BufferEndType.FLAT]
  17440. * @description 缓冲区端点枚举值。分为平头和圆头两种。
  17441. */
  17442. this.endType = BufferEndType.FLAT;
  17443. /**
  17444. * @member {SuperMap.BufferDistance} [SuperMap.BufferSetting.prototype.leftDistance=100]
  17445. * @description 左侧缓冲距离。
  17446. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  17447. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
  17448. */
  17449. this.leftDistance = new BufferDistance();
  17450. /**
  17451. * @member {SuperMap.BufferDistance} [SuperMap.BufferSetting.prototype.rightDistance=100]
  17452. * @description 右侧缓冲距离。
  17453. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  17454. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
  17455. */
  17456. this.rightDistance = new BufferDistance();
  17457. /**
  17458. * @member {number} [SuperMap.BufferSetting.prototype.semicircleLineSegment=4]
  17459. * @description 圆头缓冲圆弧处线段的个数。即用多少个线段来模拟一个半圆。
  17460. */
  17461. this.semicircleLineSegment = 4;
  17462. /**
  17463. * @member {SuperMap.BufferRadiusUnit} [SuperMap.BufferSetting.prototype.radiusUnit = SuperMap.BufferRadiusUnit.METER]
  17464. * @description 缓冲半径单位,可以是{@link SuperMap.BufferRadiusUnit.METER}、{@link SuperMap.BufferRadiusUnit.MILIMETER}、
  17465. * {@link SuperMap.BufferRadiusUnit.CENTIMETER}、{@link SuperMap.BufferRadiusUnit.DECIMETER}、{@link SuperMap.BufferRadiusUnit.KILOMETER}、
  17466. * {@link SuperMap.BufferRadiusUnit.FOOT}、{@link SuperMap.BufferRadiusUnit.INCH}、{@link SuperMap.BufferRadiusUnit.MILE}、{@link SuperMap.BufferRadiusUnit.YARD}。
  17467. * 仅对BufferAnalyst有效。
  17468. */
  17469. this.radiusUnit = BufferRadiusUnit.METER;
  17470. if (options) {
  17471. Util.extend(this, options);
  17472. }
  17473. this.CLASS_NAME = "SuperMap.BufferSetting";
  17474. }
  17475. /**
  17476. * @function SuperMap.BufferSetting.prototype.destroy
  17477. * @description 释放资源,将引用资源的属性置空。
  17478. */
  17479. BufferSetting_createClass(BufferSetting, [{
  17480. key: "destroy",
  17481. value: function destroy() {
  17482. var me = this;
  17483. me.endType = null;
  17484. if (me.leftDistance) {
  17485. me.leftDistance.destroy();
  17486. me.leftDistance = null;
  17487. }
  17488. if (me.rightDistance) {
  17489. me.rightDistance.destroy();
  17490. me.rightDistance = null;
  17491. }
  17492. me.semicircleLineSegment = null;
  17493. me.radiusUnit = null;
  17494. }
  17495. }]);
  17496. return BufferSetting;
  17497. }();
  17498. SuperMap.BufferSetting = BufferSetting;
  17499. ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystParameters.js
  17500. function BufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17501. 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); } }
  17502. function BufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  17503. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17504. * This program are made available under the terms of the Apache License, Version 2.0
  17505. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17506. /**
  17507. * @class SuperMap.BufferAnalystParameters
  17508. * @category iServer SpatialAnalyst BufferAnalyst
  17509. * @classdesc 缓冲区分析参数基类。
  17510. * @param {Object} options - 参数。
  17511. * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  17512. */
  17513. var BufferAnalystParameters = /*#__PURE__*/function () {
  17514. function BufferAnalystParameters(options) {
  17515. BufferAnalystParameters_classCallCheck(this, BufferAnalystParameters);
  17516. var me = this;
  17517. /**
  17518. * @member {SuperMap.BufferSetting} [SuperMap.BufferAnalystParameters.prototype.bufferSetting]
  17519. * @description 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  17520. */
  17521. me.bufferSetting = new BufferSetting();
  17522. Util.extend(this, options);
  17523. this.CLASS_NAME = "SuperMap.BufferAnalystParameters";
  17524. }
  17525. /**
  17526. * @function SuperMap.BufferAnalystParameters.prototype.destroy
  17527. * @description 释放资源,将引用资源的属性置空。
  17528. */
  17529. BufferAnalystParameters_createClass(BufferAnalystParameters, [{
  17530. key: "destroy",
  17531. value: function destroy() {
  17532. var me = this;
  17533. if (me.bufferSetting) {
  17534. me.bufferSetting.destroy();
  17535. me.bufferSetting = null;
  17536. }
  17537. }
  17538. }]);
  17539. return BufferAnalystParameters;
  17540. }();
  17541. SuperMap.BufferAnalystParameters = BufferAnalystParameters;
  17542. ;// CONCATENATED MODULE: ./src/common/iServer/DataReturnOption.js
  17543. function DataReturnOption_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17544. 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); } }
  17545. function DataReturnOption_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataReturnOption_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataReturnOption_defineProperties(Constructor, staticProps); return Constructor; }
  17546. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17547. * This program are made available under the terms of the Apache License, Version 2.0
  17548. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17549. /**
  17550. * @class SuperMap.DataReturnOption
  17551. * @category iServer SpatialAnalyst
  17552. * @classdesc 数据返回设置类。
  17553. * @param {Object} options - 参数。
  17554. * @param {number} [options.expectCount=1000] - 设置返回的最大记录数,小于或者等于 0 时表示返回所有记录数。
  17555. * @param {string} [options.dataset] - 设置结果数据集标识,当 dataReturnMode 为 {@link SuperMap.DataReturnMode.DATASET_ONLY}或{@link SuperMap.DataReturnMode.DATASET_AND_RECORDSET}时有效,
  17556. * 作为返回数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  17557. * @param {SuperMap.DataReturnMode} [options.dataReturnMode=SuperMap.DataReturnMode.RECORDSET_ONLY] - 数据返回模式。
  17558. * @param {boolean} [options.deleteExistResultDataset=true] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  17559. */
  17560. var DataReturnOption = /*#__PURE__*/function () {
  17561. function DataReturnOption(options) {
  17562. DataReturnOption_classCallCheck(this, DataReturnOption);
  17563. /**
  17564. * @member {number} [SuperMap.DataReturnOption.prototype.expectCount=1000]
  17565. * @description 设置返回的最大记录数,小于或者等于0时表示返回所有记录数。
  17566. */
  17567. this.expectCount = 1000;
  17568. /**
  17569. * @member {string} [SuperMap.DataReturnOption.prototype.dataset]
  17570. * @description 设置结果数据集标识,当dataReturnMode为 {@link SuperMap.DataReturnMode.DATASET_ONLY}
  17571. * 或{@link SuperMap.DataReturnMode.DATASET_AND_RECORDSET}时有效,
  17572. * 作为返回数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  17573. */
  17574. this.dataset = null;
  17575. /**
  17576. * @member {SuperMap.DataReturnMode} [SuperMap.DataReturnOption.prototype.dataReturnMode=SuperMap.DataReturnMode.RECORDSET_ONLY]
  17577. * @description 数据返回模式。
  17578. */
  17579. this.dataReturnMode = DataReturnMode.RECORDSET_ONLY;
  17580. /**
  17581. * @member {boolean} [SuperMap.DataReturnOption.prototype.deleteExistResultDataset=true]
  17582. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  17583. */
  17584. this.deleteExistResultDataset = true;
  17585. Util.extend(this, options);
  17586. this.CLASS_NAME = "SuperMap.DataReturnOption";
  17587. }
  17588. /**
  17589. * @function SuperMap.DataReturnOption.prototype.destroy
  17590. * @description 释放资源,将引用资源的属性置空。
  17591. */
  17592. DataReturnOption_createClass(DataReturnOption, [{
  17593. key: "destroy",
  17594. value: function destroy() {
  17595. var me = this;
  17596. me.expectCount = null;
  17597. me.dataset = null;
  17598. me.dataReturnMode = null;
  17599. me.deleteExistResultDataset = null;
  17600. }
  17601. }]);
  17602. return DataReturnOption;
  17603. }();
  17604. SuperMap.DataReturnOption = DataReturnOption;
  17605. ;// CONCATENATED MODULE: ./src/common/iServer/JoinItem.js
  17606. function JoinItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17607. 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); } }
  17608. function JoinItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) JoinItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) JoinItem_defineProperties(Constructor, staticProps); return Constructor; }
  17609. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17610. * This program are made available under the terms of the Apache License, Version 2.0
  17611. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17612. /**
  17613. * @class SuperMap.JoinItem
  17614. * @category iServer
  17615. * @classdesc 连接信息类。
  17616. * 该类用于矢量数据集与外部表的连接。外部表可以为另一个矢量数据集(其中纯属性数据集中没有空间几何信息)所对应的 DBMS 表,也可以是用户自建的业务表。
  17617. * 需要注意的是,矢量数据集与外部表必须属于同一数据源。表之间的联系的建立有两种方式,一种是连接(join),一种是关联(link)。
  17618. * 连接,实际上是依据相同的字段将一个外部表追加到指定的表;而关联是基于一个相同的字段定义了两个表格之间的联系,但不是实际的追加。
  17619. * 用于连接两个表的字段的名称不一定相同,但类型必须一致。当两个表格之间建立了连接,通过对主表进行操作,可以对外部表进行查询,制作专题图以及分析等。
  17620. * 当两个表格之间是一对一或多对一的关系时,可以使用 join 连接。当为多对一的关系时,允许指定多个字段之间的关联。
  17621. *(注意:SuperMap.JoinItem 目前支持左连接和内连接,不支持全连接和右连接,UDB 引擎不支持内连接。并且用于建立连接的两个表必须在同一个数据源下。)
  17622. * @param {Object} options - 参数。
  17623. * @param {string} options.foreignTableName - 外部表的名称。
  17624. * @param {string} options.joinFilter - 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  17625. * @param {SuperMap.JoinType} options.joinType - 两个表之间连接类型。
  17626. * @example 下面以 SQL 查询说明 joinItem 的使用方法:
  17627. *(start code)
  17628. * function queryBySQL() {
  17629. * // 设置与外部表的连接信息
  17630. * var joinItem = new SuperMap.JoinItem({
  17631. * foreignTableName: "foreignTable",
  17632. * joinFilter: "foreignTable.CONTINENT = Countries.CONTINENT",
  17633. * joinType: "LEFTJOIN"
  17634. * })
  17635. * var queryParam, queryBySQLParams, queryBySQLService;
  17636. * // 设置查询参数,在查询参数中添加joinItem关联条件信息
  17637. * queryParam = new SuperMap.FilterParameter({
  17638. * name: "Countries@World",
  17639. * joinItems: [joinItem]
  17640. * }),
  17641. * queryBySQLParams = new SuperMap.QueryBySQLParameters({
  17642. * queryParams: [queryParam]
  17643. * }),
  17644. * queryBySQLService = new SuperMap.QueryBySQLService(url, {
  17645. * eventListeners: { "processCompleted": processCompleted, "processFailed": processFailed}
  17646. * });
  17647. * queryBySQLService.processAsync(queryBySQLParams);
  17648. * }
  17649. * function processCompleted(queryEventArgs) {//todo}
  17650. * function processFailed(e) {//todo}
  17651. * (end)
  17652. */
  17653. var JoinItem = /*#__PURE__*/function () {
  17654. function JoinItem(options) {
  17655. JoinItem_classCallCheck(this, JoinItem);
  17656. /**
  17657. * @member {string} SuperMap.JoinItem.prototype.foreignTableName
  17658. * @description 外部表的名称。
  17659. * 如果外部表的名称是以 “表名@数据源名” 命名方式,则该属性只需赋值表名。
  17660. * 例如:外部表 Name@changchun,Name 为表名,changchun 为数据源名称,则该属性的赋值应为:Name。
  17661. */
  17662. this.foreignTableName = null;
  17663. /**
  17664. * @member {string} SuperMap.JoinItem.prototype.joinFilter
  17665. * @description 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  17666. * 例如,将房屋面数据集(Building)的 district 字段与房屋拥有者的纯属性数据集(Owner)的 region 字段相连接,
  17667. * 两个数据集对应的表名称分别为 Table_Building 和 Table_Owner,
  17668. * 则连接表达式为 Table_Building.district = Table_Owner.region。
  17669. * 当有多个字段相连接时,用 AND 将多个表达式相连。
  17670. */
  17671. this.joinFilter = null;
  17672. /**
  17673. * @member {SuperMap.JoinType} SuperMap.JoinItem.prototype.joinType
  17674. * @description 两个表之间连接类型。
  17675. * 连接类型决定了对两个表进行连接查询后返回的记录的情况。
  17676. */
  17677. this.joinType = null;
  17678. if (options) {
  17679. Util.extend(this, options);
  17680. }
  17681. this.CLASS_NAME = "SuperMap.JoinItem";
  17682. }
  17683. /**
  17684. * @function SuperMap.JoinItem.prototype.destroy
  17685. * @description 释放资源,将引用资源的属性置空。
  17686. */
  17687. JoinItem_createClass(JoinItem, [{
  17688. key: "destroy",
  17689. value: function destroy() {
  17690. var me = this;
  17691. me.foreignTableName = null;
  17692. me.joinFilter = null;
  17693. me.joinType = null;
  17694. }
  17695. /**
  17696. * @function SuperMap.JoinItem.prototype.toServerJSONObject
  17697. * @description 转换成对应的 JSON 格式对象。
  17698. */
  17699. }, {
  17700. key: "toServerJSONObject",
  17701. value: function toServerJSONObject() {
  17702. var dataObj = {};
  17703. dataObj = Util.copyAttributes(dataObj, this); //joinFilter基本是个纯属性对象,这里不再做转换
  17704. return dataObj;
  17705. }
  17706. }]);
  17707. return JoinItem;
  17708. }();
  17709. SuperMap.JoinItem = JoinItem;
  17710. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceConnectionInfo.js
  17711. function DatasourceConnectionInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17712. 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); } }
  17713. function DatasourceConnectionInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasourceConnectionInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasourceConnectionInfo_defineProperties(Constructor, staticProps); return Constructor; }
  17714. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17715. * This program are made available under the terms of the Apache License, Version 2.0
  17716. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17717. // eslint-disable-line no-unused-vars
  17718. /**
  17719. * @class SuperMap.DatasourceConnectionInfo
  17720. * @category iServer Data
  17721. * @classdesc 数据源连接信息类。该类包括了进行数据源连接的所有信息,如所要连接的服务器名称、数据库名称、用户名以及密码等。
  17722. * 当保存为工作空间时, 工作空间中的数据源的连接信息都将存储到工作空间文件中。对于不同类型的数据源,其连接信息有所区别。
  17723. * 所以在使 用该类所包含的成员时,请注意该成员所适用的数据源类型。对于从数据源对象中返回的数据连接信息对象,只有 connect 方法可以被修改,
  17724. * 其他内容是不可以被修改的。对于用户创建的数据源连接信息对象,其内容都可以修改。
  17725. * @category iServer Data
  17726. * @param {Object} options - 参数。
  17727. * @param {string} options.alias - 数据源别名。
  17728. * @param {string} options.dataBase - 数据源连接的数据库名。
  17729. * @param {boolean} [options.connect] - 数据源是否自动连接数据。
  17730. * @param {string} [options.driver] - 使用 ODBC(Open Database Connectivity,开放数据库互连)的数据库的驱动程序名。
  17731. * @param {SuperMap.EngineType} [options.engineType] - 数据源连接的引擎类型。
  17732. * @param {boolean} [options.exclusive] - 是否以独占方式打开数据源。
  17733. * @param {boolean} [options.OpenLinkTable] - 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  17734. * @param {string} [options.password] - 登录数据源连接的数据库或文件的密码。
  17735. * @param {boolean} [options.readOnly] - 是否以只读方式打开数据源。
  17736. * @param {string} [options.server] - 数据库服务器名或 SDB 文件名。
  17737. * @param {string} [options.user] - 登录数据库的用户名。
  17738. */
  17739. var DatasourceConnectionInfo = /*#__PURE__*/function () {
  17740. function DatasourceConnectionInfo(options) {
  17741. DatasourceConnectionInfo_classCallCheck(this, DatasourceConnectionInfo);
  17742. /**
  17743. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.alias
  17744. * @description 数据源别名。
  17745. */
  17746. this.alias = null;
  17747. /**
  17748. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.connect]
  17749. * @description 数据源是否自动连接数据。
  17750. */
  17751. this.connect = null;
  17752. /**
  17753. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.dataBase
  17754. * @description 数据源连接的数据库名。
  17755. */
  17756. this.dataBase = null;
  17757. /**
  17758. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.driver]
  17759. * @description 使用 ODBC(Open Database Connectivity,开放数据库互连) 的数据库的驱动程序名。
  17760. * 其中,对于 SQL Server 数据库与 iServer 发布的 WMTS 服务,此为必设参数。
  17761. * 对于 SQL Server 数据库,它使用 ODBC 连接,所设置的驱动程序名为 "SQL Server" 或 "SQL Native Client";
  17762. * 对于 iServer 发布的 WMTS 服务,设置的驱动名称为 "WMTS"。
  17763. */
  17764. this.driver = null;
  17765. /**
  17766. * @member {SuperMap.EngineType} [SuperMap.DatasourceConnectionInfo.prototype.engineType]
  17767. * @description 数据源连接的引擎类型。
  17768. */
  17769. this.engineType = null;
  17770. /**
  17771. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.exclusive]
  17772. * @description 是否以独占方式打开数据源。
  17773. */
  17774. this.exclusive = null;
  17775. /**
  17776. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.OpenLinkTable]
  17777. * @description 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  17778. */
  17779. this.OpenLinkTable = null;
  17780. /**
  17781. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.password]
  17782. * @description 登录数据源连接的数据库或文件的密码。
  17783. */
  17784. this.password = null;
  17785. /**
  17786. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.readOnly]
  17787. * @description 是否以只读方式打开数据源。
  17788. */
  17789. this.readOnly = null;
  17790. /**
  17791. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.server]
  17792. * @description 数据库服务器名、文件名或服务地址。
  17793. * 1.对于 SDB 和 UDB 文件,为其文件的绝对路径。注意:当绝对路径的长度超过 UTF-8 编码格式的 260 字节长度,该数据源无法打开。
  17794. * 2.对于 Oracle 数据库,其服务器名为其 TNS 服务名称。
  17795. * 3.对于 SQL Server 数据库,其服务器名为其系统的 DSN(Database Source Name) 名称。
  17796. * 4.对于 PostgreSQL 数据库,其服务器名为 “IP:端口号”,默认的端口号是 5432。
  17797. * 5.对于 DB2 数据库,已经进行了编目,所以不需要进行服务器的设置。
  17798. * 6.对于 Kingbase 数据库,其服务器名为其 IP 地址。
  17799. * 7.对于 GoogleMaps 数据源,其服务器地址,默认设置为 “{@link http://maps.google.com}”,且不可更改。
  17800. * 8.对于 SuperMapCould 数据源,为其服务地址。
  17801. * 9.对于 MAPWORLD 数据源,为其服务地址,默认设置为 “{@link http://www.tianditu.cn}”,且不可更改。
  17802. * 10.对于 OGC 和 REST 数据源,为其服务地址。
  17803. */
  17804. this.server = null;
  17805. /**
  17806. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.user
  17807. * @description 登录数据库的用户名。
  17808. */
  17809. this.user = null;
  17810. if (options) {
  17811. Util.extend(this, options);
  17812. }
  17813. this.CLASS_NAME = "SuperMap.DatasourceConnectionInfo";
  17814. }
  17815. /**
  17816. * @function SuperMap.DatasourceConnectionInfo.prototype.destroy
  17817. * @description 释放资源,将引用资源的属性置空。
  17818. */
  17819. DatasourceConnectionInfo_createClass(DatasourceConnectionInfo, [{
  17820. key: "destroy",
  17821. value: function destroy() {
  17822. var me = this;
  17823. me.alias = null;
  17824. me.connect = null;
  17825. me.dataBase = null;
  17826. me.driver = null;
  17827. me.engineType = null;
  17828. me.exclusive = null;
  17829. me.OpenLinkTable = null;
  17830. me.password = null;
  17831. me.readOnly = null;
  17832. me.server = null;
  17833. me.user = null;
  17834. }
  17835. }]);
  17836. return DatasourceConnectionInfo;
  17837. }();
  17838. SuperMap.DatasourceConnectionInfo = DatasourceConnectionInfo;
  17839. ;// CONCATENATED MODULE: ./src/common/iServer/LinkItem.js
  17840. function LinkItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17841. 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); } }
  17842. function LinkItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinkItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinkItem_defineProperties(Constructor, staticProps); return Constructor; }
  17843. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17844. * This program are made available under the terms of the Apache License, Version 2.0
  17845. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17846. /**
  17847. * @class SuperMap.LinkItem
  17848. * @constructs SuperMap.LinkItem
  17849. * @category iServer
  17850. * @classdesc 关联信息类。
  17851. * @description 该类用于矢量数据集与外部表的关联。 外部表是另一个数据集(其中纯属性数据集中没有空间几何信息)中的 DBMS 表,
  17852. * 矢量数据集与外部表可以属于不同的数据源,但数据源类型目前只支持 SQL Server 和 Oracle 类型。使用 LinkItem 时,
  17853. * 空间数据和属性数据必须满足关联条件,即主空间数据集与外部属性表之间存在关联字段。{@link SuperMap.LinkItem}
  17854. * 只支持左连接,UDB、PostgreSQL 和 DB2 数据源不支持 {@link SuperMap.LinkItem};另外,用于建立关联关系的两个表可以不在同一个数据源下。注意:<br>
  17855. * 1. 使用 {@link SuperMap.LinkItem} 的约束条件为:空间数据和属性数据必须有关联条件,即主空间数据集与外部属性表之间存在关联字段;<br>
  17856. * 2. 使用外关联表制作专题图时,所关联的字段必须设置表名,例如,如果所关联的字段为 BaseMap_R 数据集的 SmID,就要写成 BaseMap_R.SMID。
  17857. * @param {Object} options - 参数。
  17858. * @param {SuperMap.DatasourceConnectionInfo} options.datasourceConnectionInfo - 关联的外部数据源信息。
  17859. * @param {Array.<string>} options.foreignKeys - 主空间数据集的外键。
  17860. * @param {string} options.foreignTable - 关联的外部属性表的名称。
  17861. * @param {Array.<string>} options.linkFields - 欲保留的外部属性表的字段。
  17862. * @param {string} options.linkFilter - 与外部属性表的连接条件。
  17863. * @param {string} options.name - 此关联信息对象的名称。
  17864. * @param {Array.<string>} options.primaryKeys - 需要关联的外部属性表的主键。
  17865. * @example 下面以 SQL 查询说明 linkitem 的使用方法:
  17866. * function queryBySQL() {
  17867. * // 设置关联的外部数据库信息,alias表示数据库别名
  17868. * var dc = new SuperMap.DatasourceConnectionInfo({
  17869. * dataBase: "RelQuery",
  17870. * server: "{ip}:{port}",
  17871. * user: "sa",
  17872. * password: "map",
  17873. * driver: "SQL Server",
  17874. * connect: true,
  17875. * OpenLinkTable: false,
  17876. * alias: "RelQuery",
  17877. * engineType: EngineType.SQLPLUS,
  17878. * readOnly: false,
  17879. * exclusive: false
  17880. * });
  17881. * // 设置关联信息
  17882. * var linkItem = new SuperMap.LinkItem({
  17883. * datasourceConnectionInfo: dc,
  17884. * foreignKeys: ["name"],
  17885. * foreignTable: "Pop_2011",
  17886. * linkFields: ["SmID as Pid","pop"],
  17887. * name: "link",
  17888. * primatryKeys: ["name"],
  17889. * });
  17890. * // 设置查询参数,在查询参数中添加linkItem关联条件信息
  17891. * var queryParam, queryBySQLParams, queryBySQLService;
  17892. * queryParam = new SuperMap.FilterParameter({
  17893. * name: "Province@RelQuery",
  17894. * fields: ["SmID","name"],
  17895. * attributeFilter: "SmID<7",
  17896. * linkItems: [linkItem]
  17897. * }),
  17898. * queryBySQLParams = new SuperMap.QueryBySQLParameters({
  17899. * queryParams: [queryParam]
  17900. * }),
  17901. * queryBySQLService = new SuperMap.QueryBySQLService(url, {
  17902. * eventListeners: {
  17903. * "processCompleted": processCompleted,
  17904. * "processFailed": processFailed
  17905. * }
  17906. * });
  17907. * queryBySQLService.processAsync(queryBySQLParams);
  17908. * }
  17909. * function processCompleted(queryEventArgs) {//todo}
  17910. * function processFailed(e) {//todo}
  17911. *
  17912. */
  17913. var LinkItem = /*#__PURE__*/function () {
  17914. function LinkItem(options) {
  17915. LinkItem_classCallCheck(this, LinkItem);
  17916. /**
  17917. * @member {SuperMap.DatasourceConnectionInfo} SuperMap.LinkItem.prototype.datasourceConnectionInfo
  17918. * @description 关联的外部数据源信息。
  17919. */
  17920. this.datasourceConnectionInfo = null;
  17921. /**
  17922. * @member {Array.<string>} SuperMap.LinkItem.prototype.foreignKeys
  17923. * @description 主空间数据集的外键。
  17924. */
  17925. this.foreignKeys = null;
  17926. /**
  17927. * @member {string} SuperMap.LinkItem.prototype.foreignTable
  17928. * @description 关联的外部属性表的名称,目前仅支持 Supermap 管理的表,即另一个矢量数据集所对应的 DBMS 表。
  17929. */
  17930. this.foreignTable = null;
  17931. /**
  17932. * @member {Array.<string>} SuperMap.LinkItem.prototype.linkFields
  17933. * @description 欲保留的外部属性表的字段。如果不设置字段或者设置的字段在外部属性表中不存在的话则不返
  17934. * 回任何外部属性表的属性信息。如果欲保留的外部表字段与主表字段存在同名,则还需要指定一个不存在字段名作为外部表的字段别名。
  17935. */
  17936. this.linkFields = null;
  17937. /**
  17938. * @member {string} SuperMap.LinkItem.prototype.linkFilter
  17939. * @description 与外部属性表的连接条件。
  17940. */
  17941. this.linkFilter = null;
  17942. /**
  17943. * @member {string} SuperMap.LinkItem.prototype.name
  17944. * @description 此关联信息对象的名称。
  17945. */
  17946. this.name = null;
  17947. /**
  17948. * @member {Array.<string>} SuperMap.LinkItem.prototype.primaryKeys
  17949. * @description 需要关联的外部属性表的主键。
  17950. */
  17951. this.primaryKeys = null;
  17952. if (options) {
  17953. Util.extend(this, options);
  17954. }
  17955. this.CLASS_NAME = "SuperMap.LinkItem";
  17956. }
  17957. /**
  17958. * @function SuperMap.LinkItem.prototype.destroy
  17959. * @description 释放资源,将引用资源的属性置空。
  17960. */
  17961. LinkItem_createClass(LinkItem, [{
  17962. key: "destroy",
  17963. value: function destroy() {
  17964. var me = this;
  17965. if (me.datasourceConnectionInfo instanceof DatasourceConnectionInfo) {
  17966. me.datasourceConnectionInfo.destroy();
  17967. me.datasourceConnectionInfo = null;
  17968. }
  17969. me.foreignKeys = null;
  17970. me.foreignTable = null;
  17971. me.linkFields = null;
  17972. me.linkFilter = null;
  17973. me.name = null;
  17974. me.primaryKeys = null;
  17975. }
  17976. }]);
  17977. return LinkItem;
  17978. }();
  17979. SuperMap.LinkItem = LinkItem;
  17980. ;// CONCATENATED MODULE: ./src/common/iServer/FilterParameter.js
  17981. function FilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17982. 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); } }
  17983. function FilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilterParameter_defineProperties(Constructor, staticProps); return Constructor; }
  17984. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17985. * This program are made available under the terms of the Apache License, Version 2.0
  17986. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17987. /**
  17988. * @class SuperMap.FilterParameter
  17989. * @category iServer
  17990. * @classdesc 查询过滤条件参数类。该类用于设置查询数据集的查询过滤参数。
  17991. * @param {Object} options - 参数。
  17992. * @param {string} options.attributeFilter - 属性过滤条件。
  17993. * @param {string} options.name - 查询数据集名称或者图层名称。
  17994. * @param {Array.<SuperMap.JoinItem>} [options.joinItems] - 与外部表的连接信息 SuperMap.JoinItem 数组。
  17995. * @param {Array.<SuperMap.LinkItem>} [options.linkItems] - 与外部表的关联信息 SuperMap.LinkItem 数组。
  17996. * @param {Array.<string>} [options.ids] - 查询 id 数组,即属性表中的 SmID 值。
  17997. * @param {string} [options.orderBy] - 查询排序的字段,orderBy 的字段须为数值型的。
  17998. * @param {string} [options.groupBy] - 查询分组条件的字段。
  17999. * @param {Array.<string>} [options.fields] - 查询字段数组。
  18000. */
  18001. var FilterParameter = /*#__PURE__*/function () {
  18002. function FilterParameter(options) {
  18003. FilterParameter_classCallCheck(this, FilterParameter);
  18004. /**
  18005. * @member {string} SuperMap.FilterParameter.prototype.attributeFilter
  18006. * @description 属性过滤条件。
  18007. * 相当于 SQL 语句中的 WHERE 子句,其格式为:WHERE <条件表达式>,
  18008. * attributeFilter 就是其中的“条件表达式”。
  18009. * 该字段的用法为 attributeFilter = "过滤条件"。
  18010. * 例如,要查询字段 fieldValue 小于100的记录,设置 attributeFilter = "fieldValue < 100";
  18011. * 要查询字段 name 的值为“酒店”的记录,设置 attributeFilter = "name like '%酒店%'",等等。
  18012. */
  18013. this.attributeFilter = null;
  18014. /**
  18015. * @member {string} SuperMap.FilterParameter.prototype.name
  18016. * @description 查询数据集名称或者图层名称,根据实际的查询对象而定。
  18017. * 一般情况下该字段为数据集名称,但在进行与地图相关功能的操作时,
  18018. * 需要设置为图层名称(图层名称格式:数据集名称@数据源别名)。
  18019. * 因为一个地图的图层可能是来自于不同数据源的数据集,
  18020. * 而不同的数据源中可能存在同名的数据集,
  18021. * 使用数据集名称不能唯一的确定数据集,
  18022. * 所以在进行与地图相关功能的操作时,该值需要设置为图层名称。
  18023. */
  18024. this.name = null;
  18025. /**
  18026. * @member {Array.<SuperMap.JoinItem>} [SuperMap.FilterParameter.prototype.joinItems]
  18027. * @description 与外部表的连接信息 SuperMap.JoinItem 数组。
  18028. */
  18029. this.joinItems = null;
  18030. /**
  18031. * @member {Array.<SuperMap.LinkItem>} [SuperMap.FilterParameter.prototype.linkItems]
  18032. * @description 与外部表的关联信息 LinkItem 数组。
  18033. */
  18034. this.linkItems = null;
  18035. /**
  18036. * @member {Array.<string>} [SuperMap.FilterParameter.prototype.ids]
  18037. * @description 查询 id 数组,即属性表中的 SmID 值。
  18038. */
  18039. this.ids = null;
  18040. /**
  18041. * @member {string} [SuperMap.FilterParameter.prototype.orderBy]
  18042. * @description 查询排序的字段,orderBy的字段须为数值型的。
  18043. * 相当于 SQL 语句中的 ORDER BY 子句,其格式为:ORDER BY <列名>,
  18044. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  18045. * 对单个字段排序时,该字段的用法为 orderBy = "字段名";
  18046. * 对多个字段排序时,字段之间以英文逗号进行分割,用法为 orderBy = "字段名1, 字段名2"。
  18047. * 例如,现有一个国家数据集,它有两个字段分别为“SmArea”和“pop_1994”,
  18048. * 分别表示国家的面积和1994年的各国人口数量。
  18049. * 如果要按照各国人口数量对记录进行排序,则 orderBy = "pop_1994";
  18050. * 如果要以面积和人口进行排序,则 orderBy = "SmArea, pop_1994"。
  18051. */
  18052. this.orderBy = null;
  18053. /**
  18054. * @member {string} [SuperMap.FilterParameter.prototype.groupBy]
  18055. * @description 查询分组条件的字段。
  18056. * 相当于 SQL 语句中的 GROUP BY 子句,其格式为:GROUP BY <列名>,
  18057. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  18058. * 对单个字段分组时,该字段的用法为 groupBy = "字段名";
  18059. * 对多个字段分组时,字段之间以英文逗号进行分割,用法为 groupBy = "字段名1, 字段名2"。
  18060. * 例如,现有一个全球城市数据集,该数据集有两个字段分别为“Continent”和“Country”,
  18061. * 分别表示某个城市所属的洲和国家。
  18062. * 如果要按照国家对全球的城市进行分组, 可以设置 groupBy = "Country";
  18063. * 如果以洲和国家对城市进行分组,设置 groupBy = "Continent, Country"。
  18064. */
  18065. this.groupBy = null;
  18066. /**
  18067. * @member {Array.<string>} [SuperMap.FilterParameter.prototype.fields]
  18068. * @description 查询字段数组,如果不设置则使用系统返回的所有字段。
  18069. */
  18070. this.fields = null;
  18071. if (options) {
  18072. Util.extend(this, options);
  18073. }
  18074. this.CLASS_NAME = "SuperMap.FilterParameter";
  18075. }
  18076. /**
  18077. * @function SuperMap.FilterParameter.prototype.destroy
  18078. * @description 释放资源,将引用资源的属性置空。
  18079. */
  18080. FilterParameter_createClass(FilterParameter, [{
  18081. key: "destroy",
  18082. value: function destroy() {
  18083. var me = this;
  18084. me.attributeFilter = null;
  18085. me.name = null;
  18086. if (me.joinItems) {
  18087. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  18088. joinItems[i].destroy();
  18089. }
  18090. me.joinItems = null;
  18091. }
  18092. if (me.linkItems) {
  18093. for (var _i = 0, linkItems = me.linkItems, _len = linkItems.length; _i < _len; _i++) {
  18094. linkItems[_i].destroy();
  18095. }
  18096. me.linkItems = null;
  18097. }
  18098. me.ids = null;
  18099. me.orderBy = null;
  18100. me.groupBy = null;
  18101. me.fields = null;
  18102. }
  18103. }]);
  18104. return FilterParameter;
  18105. }();
  18106. SuperMap.FilterParameter = FilterParameter;
  18107. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetBufferAnalystParameters.js
  18108. function DatasetBufferAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DatasetBufferAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { DatasetBufferAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DatasetBufferAnalystParameters_typeof(obj); }
  18109. function DatasetBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18110. 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); } }
  18111. function DatasetBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetBufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18112. function DatasetBufferAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetBufferAnalystParameters_get = Reflect.get; } else { DatasetBufferAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetBufferAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return DatasetBufferAnalystParameters_get(target, property, receiver || target); }
  18113. function DatasetBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  18114. function DatasetBufferAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DatasetBufferAnalystParameters_setPrototypeOf(subClass, superClass); }
  18115. function DatasetBufferAnalystParameters_setPrototypeOf(o, p) { DatasetBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetBufferAnalystParameters_setPrototypeOf(o, p); }
  18116. 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); }; }
  18117. function DatasetBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetBufferAnalystParameters_assertThisInitialized(self); }
  18118. function DatasetBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18119. function DatasetBufferAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  18120. function DatasetBufferAnalystParameters_getPrototypeOf(o) { DatasetBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetBufferAnalystParameters_getPrototypeOf(o); }
  18121. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18122. * This program are made available under the terms of the Apache License, Version 2.0
  18123. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18124. /**
  18125. * @class SuperMap.DatasetBufferAnalystParameters
  18126. * @category iServer SpatialAnalyst BufferAnalyst
  18127. * @classdesc 数据集缓冲区分析参数类。
  18128. * @param {Object} options - 参数。
  18129. * @param {string} options.dataset - 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  18130. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  18131. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  18132. * @param {boolean} [options.isAttributeRetained=true] - 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  18133. * @param {boolean} [options.isUnion=false] - 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  18134. * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  18135. *
  18136. * @extends {SuperMap.BufferAnalystParameters}
  18137. */
  18138. var DatasetBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  18139. DatasetBufferAnalystParameters_inherits(DatasetBufferAnalystParameters, _BufferAnalystParamet);
  18140. var _super = DatasetBufferAnalystParameters_createSuper(DatasetBufferAnalystParameters);
  18141. function DatasetBufferAnalystParameters(options) {
  18142. var _this;
  18143. DatasetBufferAnalystParameters_classCallCheck(this, DatasetBufferAnalystParameters);
  18144. _this = _super.call(this, options);
  18145. /**
  18146. * @member {string} SuperMap.DatasetBufferAnalystParameters.prototype.dataset
  18147. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  18148. */
  18149. _this.dataset = null;
  18150. /**
  18151. * @member {SuperMap.FilterParameter} [SuperMap.DatasetBufferAnalystParameters.prototype.filterQueryParameter]
  18152. * @description 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  18153. */
  18154. _this.filterQueryParameter = new FilterParameter();
  18155. /**
  18156. * @member {SuperMap.DataReturnOption} [SuperMap.DatasetBufferAnalystParameters.prototype.resultSetting]
  18157. * @description 结果返回设置类。
  18158. */
  18159. _this.resultSetting = new DataReturnOption();
  18160. /**
  18161. * @member {boolean} [SuperMap.DatasetBufferAnalystParameters.prototype.isAttributeRetained=true]
  18162. * @description 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  18163. */
  18164. _this.isAttributeRetained = true;
  18165. /**
  18166. * @member {boolean} [SuperMap.DatasetBufferAnalystParameters.prototype.isUnion=false]
  18167. * @description 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  18168. */
  18169. _this.isUnion = false;
  18170. Util.extend(DatasetBufferAnalystParameters_assertThisInitialized(_this), options);
  18171. _this.CLASS_NAME = "SuperMap.DatasetBufferAnalystParameters";
  18172. return _this;
  18173. }
  18174. /**
  18175. * @function SuperMap.DatasetBufferAnalystParameters.prototype.destroy
  18176. * @override
  18177. */
  18178. DatasetBufferAnalystParameters_createClass(DatasetBufferAnalystParameters, [{
  18179. key: "destroy",
  18180. value: function destroy() {
  18181. DatasetBufferAnalystParameters_get(DatasetBufferAnalystParameters_getPrototypeOf(DatasetBufferAnalystParameters.prototype), "destroy", this).call(this);
  18182. var me = this;
  18183. me.dataset = null;
  18184. if (me.filterQueryParameter) {
  18185. me.filterQueryParameter.destroy();
  18186. me.filterQueryParameter = null;
  18187. }
  18188. if (me.resultSetting) {
  18189. me.resultSetting.destroy();
  18190. me.resultSetting = null;
  18191. }
  18192. me.isAttributeRetained = null;
  18193. me.isUnion = null;
  18194. }
  18195. /**
  18196. * @function SuperMap.DatasetBufferAnalystParameters.toObject
  18197. * @param {SuperMap.DatasetBufferAnalystParameters} datasetBufferAnalystParameters - 数据集缓冲区分析参数类。
  18198. * @param {SuperMap.DatasetBufferAnalystParameters} tempObj - 数据集缓冲区分析参数对象。
  18199. * @description 将数据集缓冲区分析参数对象转换为 JSON 对象。
  18200. * @returns {Object} JSON 对象。
  18201. */
  18202. }], [{
  18203. key: "toObject",
  18204. value: function toObject(datasetBufferAnalystParameters, tempObj) {
  18205. for (var name in datasetBufferAnalystParameters) {
  18206. if (name === "bufferSetting") {
  18207. datasetBufferAnalystParameters.bufferSetting.radiusUnit = datasetBufferAnalystParameters.bufferSetting.radiusUnit.toUpperCase();
  18208. tempObj.bufferAnalystParameter = datasetBufferAnalystParameters.bufferSetting;
  18209. } else if (name === "resultSetting") {
  18210. tempObj.dataReturnOption = datasetBufferAnalystParameters.resultSetting;
  18211. } else if (name === "dataset") {
  18212. continue;
  18213. } else {
  18214. tempObj[name] = datasetBufferAnalystParameters[name];
  18215. }
  18216. }
  18217. }
  18218. }]);
  18219. return DatasetBufferAnalystParameters;
  18220. }(BufferAnalystParameters);
  18221. SuperMap.DatasetBufferAnalystParameters = DatasetBufferAnalystParameters;
  18222. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBufferAnalystParameters.js
  18223. function GeometryBufferAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeometryBufferAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GeometryBufferAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeometryBufferAnalystParameters_typeof(obj); }
  18224. function GeometryBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18225. 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); } }
  18226. function GeometryBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18227. function GeometryBufferAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryBufferAnalystParameters_get = Reflect.get; } else { GeometryBufferAnalystParameters_get = function _get(target, property, receiver) { var base = GeometryBufferAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeometryBufferAnalystParameters_get(target, property, receiver || target); }
  18228. function GeometryBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  18229. function GeometryBufferAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeometryBufferAnalystParameters_setPrototypeOf(subClass, superClass); }
  18230. function GeometryBufferAnalystParameters_setPrototypeOf(o, p) { GeometryBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBufferAnalystParameters_setPrototypeOf(o, p); }
  18231. 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); }; }
  18232. function GeometryBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryBufferAnalystParameters_assertThisInitialized(self); }
  18233. function GeometryBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18234. function GeometryBufferAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  18235. function GeometryBufferAnalystParameters_getPrototypeOf(o) { GeometryBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBufferAnalystParameters_getPrototypeOf(o); }
  18236. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18237. * This program are made available under the terms of the Apache License, Version 2.0
  18238. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18239. /**
  18240. * @class SuperMap.GeometryBufferAnalystParameters
  18241. * @category iServer SpatialAnalyst BufferAnalyst
  18242. * @classdesc 几何对象缓冲区分析参数类
  18243. * 对指定的某个几何对象做缓冲区分析。通过该类可以指定要做缓冲区分析的几何对象、缓冲区参数等。
  18244. * @param {Object} options - 参数。
  18245. * @param {Object} options.sourceGeometry - 要做缓冲区分析的几何对象。
  18246. * @param {number} options.sourceGeometrySRID - 缓冲区几何对象投影坐标参数, 如 4326,3857。
  18247. * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  18248. * @extends {SuperMap.BufferAnalystParameters}
  18249. */
  18250. var GeometryBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  18251. GeometryBufferAnalystParameters_inherits(GeometryBufferAnalystParameters, _BufferAnalystParamet);
  18252. var _super = GeometryBufferAnalystParameters_createSuper(GeometryBufferAnalystParameters);
  18253. function GeometryBufferAnalystParameters(options) {
  18254. var _this;
  18255. GeometryBufferAnalystParameters_classCallCheck(this, GeometryBufferAnalystParameters);
  18256. _this = _super.call(this, options);
  18257. /**
  18258. * @member {Object} SuperMap.GeometryBufferAnalystParameters.prototype.sourceGeometry
  18259. * @description 要做缓冲区分析的几何对象。<br>
  18260. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  18261. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  18262. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  18263. */
  18264. _this.sourceGeometry = null;
  18265. /**
  18266. * @member {number} SuperMap.GeometryBufferAnalystParameters.prototype.sourceGeometrySRID
  18267. * @description 缓冲区几何对象投影坐标参数, 如 4326,3857。
  18268. */
  18269. _this.sourceGeometrySRID = null;
  18270. if (options) {
  18271. Util.extend(GeometryBufferAnalystParameters_assertThisInitialized(_this), options);
  18272. }
  18273. _this.CLASS_NAME = " SuperMap.GeometryBufferAnalystParameters";
  18274. return _this;
  18275. }
  18276. /**
  18277. * @function SuperMap.GeometryBufferAnalystParameters.prototype.destroy
  18278. * @override
  18279. */
  18280. GeometryBufferAnalystParameters_createClass(GeometryBufferAnalystParameters, [{
  18281. key: "destroy",
  18282. value: function destroy() {
  18283. GeometryBufferAnalystParameters_get(GeometryBufferAnalystParameters_getPrototypeOf(GeometryBufferAnalystParameters.prototype), "destroy", this).call(this);
  18284. var me = this;
  18285. if (me.sourceGeometry) {
  18286. me.sourceGeometry.destroy();
  18287. me.sourceGeometry = null;
  18288. }
  18289. }
  18290. /**
  18291. * @function SuperMap.GeometryBufferAnalystParameters.toObject
  18292. * @param {SuperMap.GeometryBufferAnalystParameters} geometryBufferAnalystParameters - 几何对象缓冲区分析参数类。
  18293. * @param {SuperMap.GeometryBufferAnalystParameters} tempObj - 几何对象缓冲区分析参数对象。
  18294. * @description 将几何对象缓冲区分析参数对象转换为 JSON 对象。
  18295. * @returns {Object} JSON 对象。
  18296. */
  18297. }], [{
  18298. key: "toObject",
  18299. value: function toObject(geometryBufferAnalystParameters, tempObj) {
  18300. for (var name in geometryBufferAnalystParameters) {
  18301. if (name === "bufferSetting") {
  18302. var tempBufferSetting = {};
  18303. for (var key in geometryBufferAnalystParameters.bufferSetting) {
  18304. tempBufferSetting[key] = geometryBufferAnalystParameters.bufferSetting[key];
  18305. }
  18306. tempObj.analystParameter = tempBufferSetting;
  18307. } else if (name === "sourceGeometry") {
  18308. tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryBufferAnalystParameters.sourceGeometry);
  18309. } else {
  18310. tempObj[name] = geometryBufferAnalystParameters[name];
  18311. }
  18312. }
  18313. }
  18314. }]);
  18315. return GeometryBufferAnalystParameters;
  18316. }(BufferAnalystParameters);
  18317. SuperMap.GeometryBufferAnalystParameters = GeometryBufferAnalystParameters;
  18318. ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystService.js
  18319. function BufferAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { BufferAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { BufferAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return BufferAnalystService_typeof(obj); }
  18320. function BufferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18321. 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); } }
  18322. function BufferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  18323. function BufferAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { BufferAnalystService_get = Reflect.get; } else { BufferAnalystService_get = function _get(target, property, receiver) { var base = BufferAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return BufferAnalystService_get(target, property, receiver || target); }
  18324. function BufferAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BufferAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  18325. function BufferAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) BufferAnalystService_setPrototypeOf(subClass, superClass); }
  18326. function BufferAnalystService_setPrototypeOf(o, p) { BufferAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BufferAnalystService_setPrototypeOf(o, p); }
  18327. 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); }; }
  18328. function BufferAnalystService_possibleConstructorReturn(self, call) { if (call && (BufferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return BufferAnalystService_assertThisInitialized(self); }
  18329. function BufferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18330. function BufferAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  18331. function BufferAnalystService_getPrototypeOf(o) { BufferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BufferAnalystService_getPrototypeOf(o); }
  18332. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18333. * This program are made available under the terms of the Apache License, Version 2.0
  18334. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18335. /**
  18336. * @class SuperMap.BufferAnalystService
  18337. * @category iServer SpatialAnalyst BufferAnalyst
  18338. * @classdesc 缓冲区分析服务类。
  18339. * 该类负责将客户设置的缓冲区分析参数传递给服务端,并接收服务端返回的缓冲区分析结果数据。
  18340. * 缓冲区分析结果通过该类支持的事件的监听函数参数获取。
  18341. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  18342. * @param {Object} options - 参数。</br>
  18343. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  18344. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  18345. * @param {Object} [options.headers] - 请求头。
  18346. * @extends {SuperMap.SpatialAnalystBase}
  18347. * @example 例如:
  18348. * (start code)
  18349. * var myBufferAnalystService = new SuperMap.BufferAnalystService(url, {
  18350. * eventListeners: {
  18351. * "processCompleted": bufferCompleted,
  18352. * "processFailed": bufferFailed
  18353. * }
  18354. * });
  18355. * (end)
  18356. *
  18357. *
  18358. */
  18359. var BufferAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  18360. BufferAnalystService_inherits(BufferAnalystService, _SpatialAnalystBase);
  18361. var _super = BufferAnalystService_createSuper(BufferAnalystService);
  18362. function BufferAnalystService(url, options) {
  18363. var _this;
  18364. BufferAnalystService_classCallCheck(this, BufferAnalystService);
  18365. _this = _super.call(this, url, options);
  18366. /**
  18367. * @member {string} SuperMap.BufferAnalystService.prototype.mode
  18368. * @description 缓冲区分析类型
  18369. */
  18370. _this.mode = null;
  18371. if (options) {
  18372. Util.extend(BufferAnalystService_assertThisInitialized(_this), options);
  18373. }
  18374. _this.CLASS_NAME = "SuperMap.BufferAnalystService";
  18375. return _this;
  18376. }
  18377. /**
  18378. * @function SuperMap.BufferAnalystService.prototype.destroy
  18379. * @override
  18380. */
  18381. BufferAnalystService_createClass(BufferAnalystService, [{
  18382. key: "destroy",
  18383. value: function destroy() {
  18384. BufferAnalystService_get(BufferAnalystService_getPrototypeOf(BufferAnalystService.prototype), "destroy", this).call(this);
  18385. this.mode = null;
  18386. }
  18387. /**
  18388. * @method SuperMap.BufferAnalystService.prototype.processAsync
  18389. * @description 负责将客户端的查询参数传递到服务端。
  18390. * @param {SuperMap.BufferAnalystParameters} parameter - 缓冲区分析参数
  18391. */
  18392. }, {
  18393. key: "processAsync",
  18394. value: function processAsync(parameter) {
  18395. var parameterObject = {};
  18396. var me = this;
  18397. if (parameter instanceof DatasetBufferAnalystParameters) {
  18398. me.mode = 'datasets';
  18399. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/buffer');
  18400. DatasetBufferAnalystParameters.toObject(parameter, parameterObject);
  18401. } else if (parameter instanceof GeometryBufferAnalystParameters) {
  18402. me.mode = 'geometry';
  18403. me.url = Util.urlPathAppend(me.url, 'geometry/buffer');
  18404. GeometryBufferAnalystParameters.toObject(parameter, parameterObject);
  18405. }
  18406. var jsonParameters = Util.toJSON(parameterObject);
  18407. me.url = Util.urlAppend(me.url, 'returnContent=true');
  18408. me.request({
  18409. method: "POST",
  18410. data: jsonParameters,
  18411. scope: me,
  18412. success: me.serviceProcessCompleted,
  18413. failure: me.serviceProcessFailed
  18414. });
  18415. }
  18416. }]);
  18417. return BufferAnalystService;
  18418. }(SpatialAnalystBase);
  18419. SuperMap.BufferAnalystService = BufferAnalystService;
  18420. ;// CONCATENATED MODULE: ./src/common/iServer/OutputSetting.js
  18421. function OutputSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18422. 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); } }
  18423. function OutputSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) OutputSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) OutputSetting_defineProperties(Constructor, staticProps); return Constructor; }
  18424. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18425. * This program are made available under the terms of the Apache License, Version 2.0
  18426. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18427. /**
  18428. * @class SuperMap.OutputSetting
  18429. * @category iServer ProcessingService
  18430. * @classdesc 分布式分析输出类型设置类。
  18431. * @param {Object} options - 参数。
  18432. * @param {SuperMap.DatasourceConnectionInfo} options.datasourceInfo - 数据源连接信息。
  18433. * @param {string} [options.datasetName='analystResult'] - 结果数据集名称。
  18434. * @param {SuperMap.OutputType} [options.type=SuperMap.OutputType.UDB] - 输出类型。
  18435. * @param {string} [options.outputPath] - 分析结果输出路径。
  18436. */
  18437. var OutputSetting = /*#__PURE__*/function () {
  18438. function OutputSetting(options) {
  18439. OutputSetting_classCallCheck(this, OutputSetting);
  18440. /**
  18441. * @member {SuperMap.OutputType} SuperMap.OutputSetting.prototype.type
  18442. * @description 分布式分析的输出类型。
  18443. */
  18444. this.type = OutputType.UDB;
  18445. /**
  18446. * @member {string} [SuperMap.OutputSetting.prototype.datasetName='analystResult']
  18447. * @description 分布式分析的输出结果数据集名称。
  18448. */
  18449. this.datasetName = "analystResult";
  18450. /**
  18451. * @member {SuperMap.DatasourceConnectionInfo} SuperMap.OutputSetting.prototype.datasourceInfo
  18452. * @description 分布式分析的输出结果数据源连接信息。
  18453. */
  18454. this.datasourceInfo = null;
  18455. /**
  18456. * @member {string} [SuperMap.OutputSetting.prototype.outputPath]
  18457. * @description 分布式分析的分析结果输出路径。
  18458. */
  18459. this.outputPath = "";
  18460. Util.extend(this, options);
  18461. this.CLASS_NAME = "SuperMap.OutputSetting";
  18462. }
  18463. /**
  18464. * @function SuperMap.OutputSetting.prototype.destroy
  18465. * @description 释放资源,将引用资源的属性置空。
  18466. */
  18467. OutputSetting_createClass(OutputSetting, [{
  18468. key: "destroy",
  18469. value: function destroy() {
  18470. var me = this;
  18471. me.type = null;
  18472. me.datasetName = null;
  18473. me.outputPath = null;
  18474. if (me.datasourceInfo instanceof DatasourceConnectionInfo) {
  18475. me.datasourceInfo.destroy();
  18476. me.datasourceInfo = null;
  18477. }
  18478. }
  18479. }]);
  18480. return OutputSetting;
  18481. }();
  18482. SuperMap.OutputSetting = OutputSetting;
  18483. ;// CONCATENATED MODULE: ./src/common/iServer/MappingParameters.js
  18484. function MappingParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18485. 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); } }
  18486. function MappingParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MappingParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MappingParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18487. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18488. * This program are made available under the terms of the Apache License, Version 2.0
  18489. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18490. /**
  18491. * @class SuperMap.MappingParameters
  18492. * @category iServer ProcessingService
  18493. * @classdesc 分析后结果可视化的参数类。
  18494. * @param {Object} options - 参数。
  18495. * @param {Array.<SuperMap.ThemeGridRangeItem>} [options.items] - 栅格分段专题图子项数组。
  18496. * @param {number} [options.numericPrecision=1] - 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  18497. * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 专题图分段模式。
  18498. * @param {number} [options.rangeCount] - 专题图分段个数。
  18499. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 专题图颜色渐变模式。
  18500. */
  18501. var MappingParameters = /*#__PURE__*/function () {
  18502. function MappingParameters(options) {
  18503. MappingParameters_classCallCheck(this, MappingParameters);
  18504. /**
  18505. * @member {Array.<SuperMap.ThemeGridRangeItem>} [SuperMap.MappingParameters.prototype.items]
  18506. * @description 栅格分段专题图子项数组。
  18507. */
  18508. this.items = null;
  18509. /**
  18510. * @member {number} [SuperMap.MappingParameters.prototype.numericPrecision=1]
  18511. * @description 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  18512. */
  18513. this.numericPrecision = 1;
  18514. /**
  18515. * @member {SuperMap.RangeMode} [SuperMap.MappingParameters.prototype.RangeMode=SuperMap.RangeMode.EQUALINTERVAL]
  18516. * @description 专题图分段模式。
  18517. */
  18518. this.rangeMode = RangeMode.EQUALINTERVAL;
  18519. /**
  18520. * @member {number} [SuperMap.MappingParameters.prototype.rangeCount]
  18521. * @description 专题图分段个数。
  18522. */
  18523. this.rangeCount = "";
  18524. /**
  18525. * @member {SuperMap.ColorGradientType} [SuperMap.MappingParameters.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  18526. * @description 专题图颜色渐变模式。
  18527. */
  18528. this.colorGradientType = ColorGradientType.YELLOW_RED;
  18529. Util.extend(this, options);
  18530. this.CLASS_NAME = "SuperMap.MappingParameters";
  18531. }
  18532. /**
  18533. * @function SuperMap.MappingParameters.prototype.destroy
  18534. * @description 释放资源,将引用资源的属性置空。
  18535. */
  18536. MappingParameters_createClass(MappingParameters, [{
  18537. key: "destroy",
  18538. value: function destroy() {
  18539. var me = this;
  18540. if (me.items) {
  18541. if (me.items.length > 0) {
  18542. for (var item in me.items) {
  18543. me.items[item].destroy();
  18544. me.items[item] = null;
  18545. }
  18546. }
  18547. me.items = null;
  18548. }
  18549. me.numericPrecision = null;
  18550. me.rangeMode = null;
  18551. me.rangeCount = null;
  18552. me.colorGradientType = null;
  18553. }
  18554. }]);
  18555. return MappingParameters;
  18556. }();
  18557. SuperMap.MappingParameters = MappingParameters;
  18558. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsParameter.js
  18559. function BuffersAnalystJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18560. 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); } }
  18561. function BuffersAnalystJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  18562. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18563. * This program are made available under the terms of the Apache License, Version 2.0
  18564. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18565. /**
  18566. * @class SuperMap.BuffersAnalystJobsParameter
  18567. * @category iServer ProcessingService BufferAnalyst
  18568. * @classdesc 缓冲区分析任务参数类。
  18569. * @param {Object} options - 参数。
  18570. * @param {string} options.datasetName - 数据集名。
  18571. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 分析范围(默认为全图范围)。
  18572. * @param {string} [options.distance='15'] - 缓冲距离,或缓冲区半径。
  18573. * @param {string} [options.distanceField='pickup_latitude'] - 缓冲区分析距离字段。
  18574. * @param {SuperMap.AnalystSizeUnit} [options.distanceUnit=SuperMap.AnalystSizeUnit.METER] - 缓冲距离单位单位。
  18575. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  18576. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  18577. */
  18578. var BuffersAnalystJobsParameter = /*#__PURE__*/function () {
  18579. function BuffersAnalystJobsParameter(options) {
  18580. BuffersAnalystJobsParameter_classCallCheck(this, BuffersAnalystJobsParameter);
  18581. /**
  18582. * @member {string} SuperMap.BuffersAnalystJobsParameter.prototype.datasetName
  18583. * @description 数据集名。
  18584. */
  18585. this.datasetName = '';
  18586. /**
  18587. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.BuffersAnalystJobsParameter.prototype.bounds
  18588. * @description 分析范围。
  18589. */
  18590. this.bounds = '';
  18591. /**
  18592. * @member {string} [SuperMap.BuffersAnalystJobsParameter.prototype.distance='15']
  18593. * @description 缓冲距离,或称为缓冲区半径。当缓冲距离字段位空时,此参数有效。
  18594. */
  18595. this.distance = '';
  18596. /**
  18597. * @member {string} [SuperMap.BuffersAnalystJobsParameter.prototype.distanceField='pickup_latitude']
  18598. * @description 缓冲距离字段。
  18599. */
  18600. this.distanceField = '';
  18601. /**
  18602. * @member {SuperMap.AnalystSizeUnit} [SuperMap.BuffersAnalystJobsParameter.prototype.distanceUnit=SuperMap.AnalystSizeUnit.METER]
  18603. * @description 缓冲距离单位。
  18604. */
  18605. this.distanceUnit = AnalystSizeUnit.METER;
  18606. /**
  18607. * @member {string} SuperMap.BuffersAnalystJobsParameter.prototype.dissolveField
  18608. * @description 融合字段,根据字段值对缓冲区结果面对象进行融合。
  18609. */
  18610. this.dissolveField = '';
  18611. /**
  18612. * @member {SuperMap.OutputSetting} [SuperMap.BuffersAnalystJobsParameter.prototype.output]
  18613. * @description 输出参数设置类。
  18614. */
  18615. this.output = null;
  18616. /**
  18617. * @member {SuperMap.MappingParameters} [SuperMap.BuffersAnalystJobsParameter.prototype.mappingParameters]
  18618. * @description 分析后结果可视化的参数类。
  18619. */
  18620. this.mappingParameters = null;
  18621. if (!options) {
  18622. return this;
  18623. }
  18624. Util.extend(this, options);
  18625. this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsParameter';
  18626. }
  18627. /**
  18628. * @function SuperMap.BuffersAnalystJobsParameter.prototype.destroy
  18629. * @description 释放资源,将引用资源的属性置空。
  18630. */
  18631. BuffersAnalystJobsParameter_createClass(BuffersAnalystJobsParameter, [{
  18632. key: "destroy",
  18633. value: function destroy() {
  18634. this.datasetName = null;
  18635. this.bounds = null;
  18636. this.distance = null;
  18637. this.distanceField = null;
  18638. this.distanceUnit = null;
  18639. this.dissolveField = null;
  18640. if (this.output instanceof OutputSetting) {
  18641. this.output.destroy();
  18642. this.output = null;
  18643. }
  18644. if (this.mappingParameters instanceof MappingParameters) {
  18645. this.mappingParameters.destroy();
  18646. this.mappingParameters = null;
  18647. }
  18648. }
  18649. /**
  18650. * @function SuperMap.BuffersAnalystJobsParameter.toObject
  18651. * @param {SuperMap.BuffersAnalystJobsParameter} BuffersAnalystJobsParameter - 缓冲区分析任务参数。
  18652. * @param {Object} tempObj - 目标对象。
  18653. * @description 生成缓冲区分析任务对象。
  18654. */
  18655. }], [{
  18656. key: "toObject",
  18657. value: function toObject(BuffersAnalystJobsParameter, tempObj) {
  18658. for (var name in BuffersAnalystJobsParameter) {
  18659. if (name === 'datasetName') {
  18660. tempObj['input'] = tempObj['input'] || {};
  18661. tempObj['input'][name] = BuffersAnalystJobsParameter[name];
  18662. continue;
  18663. }
  18664. if (name === 'output') {
  18665. tempObj['output'] = tempObj['output'] || {};
  18666. tempObj['output'] = BuffersAnalystJobsParameter[name];
  18667. continue;
  18668. }
  18669. tempObj['analyst'] = tempObj['analyst'] || {};
  18670. if (name === 'bounds' && BuffersAnalystJobsParameter[name]) {
  18671. tempObj['analyst'][name] = BuffersAnalystJobsParameter[name].toBBOX();
  18672. } else {
  18673. tempObj['analyst'][name] = BuffersAnalystJobsParameter[name];
  18674. }
  18675. if (name === 'mappingParameters') {
  18676. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  18677. tempObj['analyst']['mappingParameters'] = BuffersAnalystJobsParameter[name];
  18678. }
  18679. }
  18680. }
  18681. }]);
  18682. return BuffersAnalystJobsParameter;
  18683. }();
  18684. SuperMap.BuffersAnalystJobsParameter = BuffersAnalystJobsParameter;
  18685. ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingServiceBase.js
  18686. function ProcessingServiceBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ProcessingServiceBase_typeof = function _typeof(obj) { return typeof obj; }; } else { ProcessingServiceBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ProcessingServiceBase_typeof(obj); }
  18687. function ProcessingServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18688. 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); } }
  18689. function ProcessingServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  18690. function ProcessingServiceBase_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ProcessingServiceBase_get = Reflect.get; } else { ProcessingServiceBase_get = function _get(target, property, receiver) { var base = ProcessingServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ProcessingServiceBase_get(target, property, receiver || target); }
  18691. function ProcessingServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ProcessingServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  18692. function ProcessingServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ProcessingServiceBase_setPrototypeOf(subClass, superClass); }
  18693. function ProcessingServiceBase_setPrototypeOf(o, p) { ProcessingServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingServiceBase_setPrototypeOf(o, p); }
  18694. 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); }; }
  18695. function ProcessingServiceBase_possibleConstructorReturn(self, call) { if (call && (ProcessingServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return ProcessingServiceBase_assertThisInitialized(self); }
  18696. function ProcessingServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18697. function ProcessingServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  18698. function ProcessingServiceBase_getPrototypeOf(o) { ProcessingServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingServiceBase_getPrototypeOf(o); }
  18699. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18700. * This program are made available under the terms of the Apache License, Version 2.0
  18701. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18702. /**
  18703. * @class SuperMap.ProcessingServiceBase
  18704. * @category iServer ProcessingService
  18705. * @classdesc 分布式分析服务基类
  18706. * @extends {SuperMap.CommonServiceBase}
  18707. * @param {string} url - 分布式分析服务地址。
  18708. * @param {Object} options - 参数。
  18709. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  18710. * @param {number} options.index - 服务访问地址在数组中的位置。
  18711. * @param {number} options.length - 服务访问地址数组长度。
  18712. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  18713. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  18714. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  18715. * @param {Object} [options.headers] - 请求头。
  18716. */
  18717. var ProcessingServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  18718. ProcessingServiceBase_inherits(ProcessingServiceBase, _CommonServiceBase);
  18719. var _super = ProcessingServiceBase_createSuper(ProcessingServiceBase);
  18720. function ProcessingServiceBase(url, options) {
  18721. var _this;
  18722. ProcessingServiceBase_classCallCheck(this, ProcessingServiceBase);
  18723. options = options || {};
  18724. /*
  18725. * Constant: EVENT_TYPES
  18726. * {Array.<string>}
  18727. * 此类支持的事件类型
  18728. * - *processCompleted* 创建成功后触发的事件。
  18729. * - *processFailed* 创建失败后触发的事件 。
  18730. * - *processRunning* 创建过程的整个阶段都会触发的事件,用于获取创建过程的状态 。
  18731. */
  18732. options.EVENT_TYPES = ["processCompleted", "processFailed", "processRunning"];
  18733. _this = _super.call(this, url, options);
  18734. _this.CLASS_NAME = "SuperMap.ProcessingServiceBase";
  18735. return _this;
  18736. }
  18737. /**
  18738. * @function SuperMap.ProcessingServiceBase.prototype.destroy
  18739. * @override
  18740. */
  18741. ProcessingServiceBase_createClass(ProcessingServiceBase, [{
  18742. key: "destroy",
  18743. value: function destroy() {
  18744. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "destroy", this).call(this);
  18745. }
  18746. /**
  18747. * @function SuperMap.ProcessingServiceBase.prototype.getJobs
  18748. * @description 获取分布式分析任务。
  18749. * @param {string} url - 资源地址。
  18750. */
  18751. }, {
  18752. key: "getJobs",
  18753. value: function getJobs(url) {
  18754. var me = this;
  18755. FetchRequest.get(me._processUrl(url), null, {
  18756. proxy: me.proxy
  18757. }).then(function (response) {
  18758. return response.json();
  18759. }).then(function (result) {
  18760. me.events.triggerEvent("processCompleted", {
  18761. result: result
  18762. });
  18763. })["catch"](function (e) {
  18764. me.eventListeners.processFailed({
  18765. error: e
  18766. });
  18767. });
  18768. }
  18769. /**
  18770. * @function SuperMap.ProcessingServiceBase.prototype.addJob
  18771. * @description 添加分布式分析任务。
  18772. * @param {string} url - 资源根地址。
  18773. * @param {Object} params - 创建一个空间分析的请求参数。
  18774. * @param {string} paramType - 请求参数类型。
  18775. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  18776. */
  18777. }, {
  18778. key: "addJob",
  18779. value: function addJob(url, params, paramType, seconds) {
  18780. var me = this,
  18781. parameterObject = null;
  18782. if (params && params instanceof paramType) {
  18783. parameterObject = new Object();
  18784. paramType.toObject(params, parameterObject);
  18785. }
  18786. var headers = Object.assign({
  18787. 'Content-Type': 'application/x-www-form-urlencoded'
  18788. }, me.headers || {});
  18789. var options = {
  18790. proxy: me.proxy,
  18791. headers: headers,
  18792. withCredentials: me.withCredentials,
  18793. crossOrigin: me.crossOrigin,
  18794. isInTheSameDomain: me.isInTheSameDomain
  18795. };
  18796. FetchRequest.post(me._processUrl(url), JSON.stringify(parameterObject), options).then(function (response) {
  18797. return response.json();
  18798. }).then(function (result) {
  18799. if (result.succeed) {
  18800. me.serviceProcessCompleted(result, seconds);
  18801. } else {
  18802. me.serviceProcessFailed(result);
  18803. }
  18804. })["catch"](function (e) {
  18805. me.serviceProcessFailed({
  18806. error: e
  18807. });
  18808. });
  18809. }
  18810. }, {
  18811. key: "serviceProcessCompleted",
  18812. value: function serviceProcessCompleted(result, seconds) {
  18813. result = Util.transformResult(result);
  18814. seconds = seconds || 1000;
  18815. var me = this;
  18816. if (result) {
  18817. var id = setInterval(function () {
  18818. FetchRequest.get(me._processUrl(result.newResourceLocation), {
  18819. _t: new Date().getTime()
  18820. }).then(function (response) {
  18821. return response.json();
  18822. }).then(function (job) {
  18823. me.events.triggerEvent("processRunning", {
  18824. id: job.id,
  18825. state: job.state
  18826. });
  18827. if (job.state.runState === 'LOST' || job.state.runState === 'KILLED' || job.state.runState === 'FAILED') {
  18828. clearInterval(id);
  18829. me.events.triggerEvent("processFailed", {
  18830. error: job.state.errorMsg,
  18831. state: job.state.runState
  18832. });
  18833. }
  18834. if (job.state.runState === 'FINISHED' && job.setting.serviceInfo) {
  18835. clearInterval(id);
  18836. me.events.triggerEvent("processCompleted", {
  18837. result: job
  18838. });
  18839. }
  18840. })["catch"](function (e) {
  18841. clearInterval(id);
  18842. me.events.triggerEvent("processFailed", {
  18843. error: e
  18844. });
  18845. });
  18846. }, seconds);
  18847. }
  18848. }
  18849. }, {
  18850. key: "serviceProcessFailed",
  18851. value: function serviceProcessFailed(result) {
  18852. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "serviceProcessFailed", this).call(this, result);
  18853. }
  18854. }, {
  18855. key: "_processUrl",
  18856. value: function _processUrl(url) {
  18857. if (SecurityManager.getToken(url)) {
  18858. url = Util.urlAppend(url, 'token=' + SecurityManager.getToken(url));
  18859. }
  18860. return url;
  18861. }
  18862. }]);
  18863. return ProcessingServiceBase;
  18864. }(CommonServiceBase);
  18865. SuperMap.ProcessingServiceBase = ProcessingServiceBase;
  18866. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsService.js
  18867. function BuffersAnalystJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { BuffersAnalystJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { BuffersAnalystJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return BuffersAnalystJobsService_typeof(obj); }
  18868. function BuffersAnalystJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18869. 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); } }
  18870. function BuffersAnalystJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  18871. function BuffersAnalystJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { BuffersAnalystJobsService_get = Reflect.get; } else { BuffersAnalystJobsService_get = function _get(target, property, receiver) { var base = BuffersAnalystJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return BuffersAnalystJobsService_get(target, property, receiver || target); }
  18872. function BuffersAnalystJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BuffersAnalystJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  18873. function BuffersAnalystJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) BuffersAnalystJobsService_setPrototypeOf(subClass, superClass); }
  18874. function BuffersAnalystJobsService_setPrototypeOf(o, p) { BuffersAnalystJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BuffersAnalystJobsService_setPrototypeOf(o, p); }
  18875. 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); }; }
  18876. function BuffersAnalystJobsService_possibleConstructorReturn(self, call) { if (call && (BuffersAnalystJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return BuffersAnalystJobsService_assertThisInitialized(self); }
  18877. function BuffersAnalystJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18878. function BuffersAnalystJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  18879. function BuffersAnalystJobsService_getPrototypeOf(o) { BuffersAnalystJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BuffersAnalystJobsService_getPrototypeOf(o); }
  18880. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18881. * This program are made available under the terms of the Apache License, Version 2.0
  18882. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18883. /**
  18884. * @class SuperMap.BuffersAnalystJobsService
  18885. * @category iServer ProcessingService BufferAnalyst
  18886. * @classdesc 缓冲区分析服务类
  18887. * @extends {SuperMap.ProcessingServiceBase}
  18888. * @param {string} url - 服务地址。
  18889. * @param {Object} options - 参数。
  18890. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  18891. * @param {Object} [options.headers] - 请求头。
  18892. */
  18893. var BuffersAnalystJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  18894. BuffersAnalystJobsService_inherits(BuffersAnalystJobsService, _ProcessingServiceBas);
  18895. var _super = BuffersAnalystJobsService_createSuper(BuffersAnalystJobsService);
  18896. function BuffersAnalystJobsService(url, options) {
  18897. var _this;
  18898. BuffersAnalystJobsService_classCallCheck(this, BuffersAnalystJobsService);
  18899. _this = _super.call(this, url, options);
  18900. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/buffers');
  18901. _this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsService';
  18902. return _this;
  18903. }
  18904. /**
  18905. *@override
  18906. */
  18907. BuffersAnalystJobsService_createClass(BuffersAnalystJobsService, [{
  18908. key: "destroy",
  18909. value: function destroy() {
  18910. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "destroy", this).call(this);
  18911. }
  18912. /**
  18913. * @function SuperMap.BuffersAnalystJobsService.prototype.getBufferJobs
  18914. * @description 获取缓冲区分析所有任务
  18915. */
  18916. }, {
  18917. key: "getBuffersJobs",
  18918. value: function getBuffersJobs() {
  18919. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, this.url);
  18920. }
  18921. /**
  18922. * @function SuperMap.BuffersAnalystJobsService.prototype.getBufferJob
  18923. * @description 获取指定id的缓冲区分析服务
  18924. * @param {string} id - 指定要获取数据的id。
  18925. */
  18926. }, {
  18927. key: "getBuffersJob",
  18928. value: function getBuffersJob(id) {
  18929. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  18930. }
  18931. /**
  18932. * @function SuperMap.BuffersAnalystJobsService.prototype.addBufferJob
  18933. * @description 新建缓冲区分析服务
  18934. * @param {SuperMap.BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  18935. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  18936. */
  18937. }, {
  18938. key: "addBuffersJob",
  18939. value: function addBuffersJob(params, seconds) {
  18940. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "addJob", this).call(this, this.url, params, BuffersAnalystJobsParameter, seconds);
  18941. }
  18942. }]);
  18943. return BuffersAnalystJobsService;
  18944. }(ProcessingServiceBase);
  18945. SuperMap.BuffersAnalystJobsService = BuffersAnalystJobsService;
  18946. ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystParameters.js
  18947. function BurstPipelineAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18948. 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); } }
  18949. function BurstPipelineAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18950. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18951. * This program are made available under the terms of the Apache License, Version 2.0
  18952. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18953. /**
  18954. * @class SuperMap.BurstPipelineAnalystParameters
  18955. * @category iServer NetworkAnalyst BurstAnalyse
  18956. * @classdesc 爆管分析参数类。
  18957. * @param {Object} options - 参数。
  18958. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  18959. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  18960. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  18961. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  18962. */
  18963. var BurstPipelineAnalystParameters = /*#__PURE__*/function () {
  18964. function BurstPipelineAnalystParameters(options) {
  18965. BurstPipelineAnalystParameters_classCallCheck(this, BurstPipelineAnalystParameters);
  18966. var me = this;
  18967. /**
  18968. * @member {Array.<number>} SuperMap.BurstPipelineAnalystParameters.prototype.sourceNodeIDs
  18969. * @description 指定的设施点 ID 数组。
  18970. */
  18971. this.sourceNodeIDs = null;
  18972. /**
  18973. * @member {number} [SuperMap.BurstPipelineAnalystParameters.prototype.edgeID]
  18974. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  18975. */
  18976. this.edgeID = null;
  18977. /**
  18978. * @member {number} [SuperMap.BurstPipelineAnalystParameters.prototype.nodeID]
  18979. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  18980. */
  18981. this.nodeID = null;
  18982. /**
  18983. * @member {boolean} [SuperMap.BurstPipelineAnalystParameters.prototype.isUncertainDirectionValid=false]
  18984. * @description 指定不确定流向是否有效。
  18985. * 指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行。
  18986. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  18987. */
  18988. this.isUncertainDirectionValid = false;
  18989. Util.extend(me, options);
  18990. this.CLASS_NAME = "SuperMap.BurstPipelineAnalystParameters";
  18991. }
  18992. /**
  18993. * @function SuperMap.BurstPipelineAnalystParameters.prototype.destroy
  18994. * @description 释放资源,将引用资源的属性置空。
  18995. */
  18996. BurstPipelineAnalystParameters_createClass(BurstPipelineAnalystParameters, [{
  18997. key: "destroy",
  18998. value: function destroy() {
  18999. var me = this;
  19000. me.sourceNodeIDs = null;
  19001. me.edgeID = null;
  19002. me.nodeID = null;
  19003. me.isUncertainDirectionValid = null;
  19004. }
  19005. }]);
  19006. return BurstPipelineAnalystParameters;
  19007. }();
  19008. SuperMap.BurstPipelineAnalystParameters = BurstPipelineAnalystParameters;
  19009. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalystServiceBase.js
  19010. function NetworkAnalystServiceBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { NetworkAnalystServiceBase_typeof = function _typeof(obj) { return typeof obj; }; } else { NetworkAnalystServiceBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return NetworkAnalystServiceBase_typeof(obj); }
  19011. function NetworkAnalystServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19012. 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); } }
  19013. function NetworkAnalystServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  19014. function NetworkAnalystServiceBase_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { NetworkAnalystServiceBase_get = Reflect.get; } else { NetworkAnalystServiceBase_get = function _get(target, property, receiver) { var base = NetworkAnalystServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return NetworkAnalystServiceBase_get(target, property, receiver || target); }
  19015. function NetworkAnalystServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NetworkAnalystServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  19016. function NetworkAnalystServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) NetworkAnalystServiceBase_setPrototypeOf(subClass, superClass); }
  19017. function NetworkAnalystServiceBase_setPrototypeOf(o, p) { NetworkAnalystServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystServiceBase_setPrototypeOf(o, p); }
  19018. 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); }; }
  19019. function NetworkAnalystServiceBase_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return NetworkAnalystServiceBase_assertThisInitialized(self); }
  19020. function NetworkAnalystServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19021. function NetworkAnalystServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19022. function NetworkAnalystServiceBase_getPrototypeOf(o) { NetworkAnalystServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystServiceBase_getPrototypeOf(o); }
  19023. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19024. * This program are made available under the terms of the Apache License, Version 2.0
  19025. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19026. /**
  19027. * @class SuperMap.NetworkAnalystServiceBase
  19028. * @category iServer NetworkAnalyst
  19029. * @classdesc 网络分析服务基类。
  19030. * @description 网络分析服务基类。
  19031. * @extends {SuperMap.CommonServiceBase}
  19032. * @param {string} url - 网络分析服务地址。
  19033. * @param {Object} options - 参数。
  19034. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19035. * @param {Object} [options.headers] - 请求头。
  19036. */
  19037. var NetworkAnalystServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  19038. NetworkAnalystServiceBase_inherits(NetworkAnalystServiceBase, _CommonServiceBase);
  19039. var _super = NetworkAnalystServiceBase_createSuper(NetworkAnalystServiceBase);
  19040. function NetworkAnalystServiceBase(url, options) {
  19041. var _this;
  19042. NetworkAnalystServiceBase_classCallCheck(this, NetworkAnalystServiceBase);
  19043. _this = _super.call(this, url, options);
  19044. /**
  19045. * @member {SuperMap.DataFormat} [SuperMap.NetworkAnalystServiceBase.prototype.format=SuperMap.DataFormat.GEOJSON]
  19046. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"
  19047. */
  19048. _this.format = DataFormat.GEOJSON;
  19049. _this.CLASS_NAME = "SuperMap.NetworkAnalystServiceBase";
  19050. return _this;
  19051. }
  19052. /**
  19053. * @function SuperMap.NetworkAnalystServiceBase.prototype.destroy
  19054. * @description 释放资源,将引用的资源属性置空。
  19055. */
  19056. NetworkAnalystServiceBase_createClass(NetworkAnalystServiceBase, [{
  19057. key: "destroy",
  19058. value: function destroy() {
  19059. NetworkAnalystServiceBase_get(NetworkAnalystServiceBase_getPrototypeOf(NetworkAnalystServiceBase.prototype), "destroy", this).call(this);
  19060. this.format = null;
  19061. }
  19062. /**
  19063. * @function SuperMap.NetworkAnalystServiceBase.prototype.serviceProcessCompleted
  19064. * @description 分析完成,执行此方法。
  19065. * @param {Object} result - 服务器返回的结果对象。
  19066. */
  19067. }, {
  19068. key: "serviceProcessCompleted",
  19069. value: function serviceProcessCompleted(result) {
  19070. var me = this,
  19071. analystResult;
  19072. result = Util.transformResult(result);
  19073. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  19074. analystResult = me.toGeoJSONResult(result);
  19075. }
  19076. if (!analystResult) {
  19077. analystResult = result;
  19078. }
  19079. me.events.triggerEvent("processCompleted", {
  19080. result: analystResult
  19081. });
  19082. }
  19083. /**
  19084. * @function SuperMap.NetworkAnalystServiceBase.prototype.toGeoJSONResult
  19085. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。只处理结果中的路由,由子类实现。
  19086. * @param {Object} result - 服务器返回的结果对象。
  19087. * @returns {GeoJSONObject} GeoJSON 对象。
  19088. */
  19089. }, {
  19090. key: "toGeoJSONResult",
  19091. value: function toGeoJSONResult(result) {
  19092. // eslint-disable-line no-unused-vars
  19093. return null;
  19094. }
  19095. }]);
  19096. return NetworkAnalystServiceBase;
  19097. }(CommonServiceBase);
  19098. SuperMap.NetworkAnalystServiceBase = NetworkAnalystServiceBase;
  19099. ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystService.js
  19100. function BurstPipelineAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { BurstPipelineAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { BurstPipelineAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return BurstPipelineAnalystService_typeof(obj); }
  19101. function BurstPipelineAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19102. 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); } }
  19103. function BurstPipelineAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  19104. function BurstPipelineAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { BurstPipelineAnalystService_get = Reflect.get; } else { BurstPipelineAnalystService_get = function _get(target, property, receiver) { var base = BurstPipelineAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return BurstPipelineAnalystService_get(target, property, receiver || target); }
  19105. function BurstPipelineAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BurstPipelineAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  19106. function BurstPipelineAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) BurstPipelineAnalystService_setPrototypeOf(subClass, superClass); }
  19107. function BurstPipelineAnalystService_setPrototypeOf(o, p) { BurstPipelineAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BurstPipelineAnalystService_setPrototypeOf(o, p); }
  19108. 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); }; }
  19109. function BurstPipelineAnalystService_possibleConstructorReturn(self, call) { if (call && (BurstPipelineAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return BurstPipelineAnalystService_assertThisInitialized(self); }
  19110. function BurstPipelineAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19111. function BurstPipelineAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19112. function BurstPipelineAnalystService_getPrototypeOf(o) { BurstPipelineAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BurstPipelineAnalystService_getPrototypeOf(o); }
  19113. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19114. * This program are made available under the terms of the Apache License, Version 2.0
  19115. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19116. /**
  19117. * @class SuperMap.BurstPipelineAnalystService
  19118. * @category iServer NetworkAnalyst BurstAnalyse
  19119. * @classdesc 爆管分析服务类,即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组、普通结点 ID 数组及其上下游弧段 ID 数组。
  19120. * @extends {SuperMap.NetworkAnalystServiceBase}
  19121. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  19122. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源},
  19123. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  19124. * @param {Object} options - 参数。
  19125. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  19126. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19127. * @param {Object} [options.headers] - 请求头。
  19128. */
  19129. var BurstPipelineAnalystService = /*#__PURE__*/function (_NetworkAnalystServic) {
  19130. BurstPipelineAnalystService_inherits(BurstPipelineAnalystService, _NetworkAnalystServic);
  19131. var _super = BurstPipelineAnalystService_createSuper(BurstPipelineAnalystService);
  19132. function BurstPipelineAnalystService(url, options) {
  19133. var _this;
  19134. BurstPipelineAnalystService_classCallCheck(this, BurstPipelineAnalystService);
  19135. _this = _super.call(this, url, options);
  19136. _this.CLASS_NAME = "SuperMap.BurstPipelineAnalystService";
  19137. return _this;
  19138. }
  19139. /**
  19140. * @function SuperMap.BurstPipelineAnalystService.prototype.destroy
  19141. * @override
  19142. */
  19143. BurstPipelineAnalystService_createClass(BurstPipelineAnalystService, [{
  19144. key: "destroy",
  19145. value: function destroy() {
  19146. BurstPipelineAnalystService_get(BurstPipelineAnalystService_getPrototypeOf(BurstPipelineAnalystService.prototype), "destroy", this).call(this);
  19147. }
  19148. /**
  19149. * @function SuperMap.BurstPipelineAnalystService.prototype.processAsync
  19150. * @description 负责将客户端的查询参数传递到服务端。
  19151. * @params {SuperMap.BurstPipelineAnalystParameters} params - 爆管分析参数类
  19152. */
  19153. }, {
  19154. key: "processAsync",
  19155. value: function processAsync(params) {
  19156. if (!(params instanceof BurstPipelineAnalystParameters)) {
  19157. return null;
  19158. }
  19159. var me = this,
  19160. jsonObject;
  19161. me.url = Util.urlPathAppend(me.url, 'burstAnalyse');
  19162. jsonObject = {
  19163. sourceNodeIDs: params.sourceNodeIDs,
  19164. isUncertainDirectionValid: params.isUncertainDirectionValid
  19165. }; //必传参数不正确,就终止
  19166. if (params.edgeID !== null && params.nodeID !== null) {
  19167. throw new Error('edgeID and nodeID cannot be null at the same time.');
  19168. }
  19169. if (params.edgeID === null && params.nodeID === null) {
  19170. throw new Error('edgeID and nodeID cannot be null at the same time.');
  19171. }
  19172. if (params.edgeID !== null) {
  19173. jsonObject.edgeID = params.edgeID;
  19174. } else {
  19175. jsonObject.nodeID = params.nodeID;
  19176. }
  19177. me.request({
  19178. method: "GET",
  19179. params: jsonObject,
  19180. scope: me,
  19181. success: me.serviceProcessCompleted,
  19182. failure: me.serviceProcessFailed
  19183. });
  19184. }
  19185. }]);
  19186. return BurstPipelineAnalystService;
  19187. }(NetworkAnalystServiceBase);
  19188. SuperMap.BurstPipelineAnalystService = BurstPipelineAnalystService;
  19189. ;// CONCATENATED MODULE: ./src/common/iServer/ChartFeatureInfoSpecsService.js
  19190. function ChartFeatureInfoSpecsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ChartFeatureInfoSpecsService_typeof = function _typeof(obj) { return typeof obj; }; } else { ChartFeatureInfoSpecsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ChartFeatureInfoSpecsService_typeof(obj); }
  19191. function ChartFeatureInfoSpecsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19192. 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); } }
  19193. function ChartFeatureInfoSpecsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartFeatureInfoSpecsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartFeatureInfoSpecsService_defineProperties(Constructor, staticProps); return Constructor; }
  19194. function ChartFeatureInfoSpecsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ChartFeatureInfoSpecsService_get = Reflect.get; } else { ChartFeatureInfoSpecsService_get = function _get(target, property, receiver) { var base = ChartFeatureInfoSpecsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ChartFeatureInfoSpecsService_get(target, property, receiver || target); }
  19195. function ChartFeatureInfoSpecsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ChartFeatureInfoSpecsService_getPrototypeOf(object); if (object === null) break; } return object; }
  19196. function ChartFeatureInfoSpecsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ChartFeatureInfoSpecsService_setPrototypeOf(subClass, superClass); }
  19197. function ChartFeatureInfoSpecsService_setPrototypeOf(o, p) { ChartFeatureInfoSpecsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartFeatureInfoSpecsService_setPrototypeOf(o, p); }
  19198. 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); }; }
  19199. function ChartFeatureInfoSpecsService_possibleConstructorReturn(self, call) { if (call && (ChartFeatureInfoSpecsService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartFeatureInfoSpecsService_assertThisInitialized(self); }
  19200. function ChartFeatureInfoSpecsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19201. function ChartFeatureInfoSpecsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19202. function ChartFeatureInfoSpecsService_getPrototypeOf(o) { ChartFeatureInfoSpecsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartFeatureInfoSpecsService_getPrototypeOf(o); }
  19203. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19204. * This program are made available under the terms of the Apache License, Version 2.0
  19205. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19206. /**
  19207. * @class SuperMap.ChartFeatureInfoSpecsService
  19208. * @category iServer Map Chart
  19209. * @classdesc 海图物标信息服务类,通过该服务类可以查询到服务端支持的所有海图物标信息。
  19210. * 用户可以通过两种方式获取查询结果:
  19211. * 一种是通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件;
  19212. * 另一种是使用 AsyncResponder 类实现异步处理。
  19213. * @extends {SuperMap.CommonServiceBase}
  19214. * @param {string} url - 地图(特指海图)服务地址。
  19215. * 如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  19216. * 发送请求格式类似于:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图/chartFeatureInfoSpecs.json"。
  19217. * @param {Object} options - 参数。
  19218. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  19219. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  19220. * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为"ISERVER","GEOJSON"。
  19221. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19222. * @param {Object} [options.headers] - 请求头。
  19223. */
  19224. var ChartFeatureInfoSpecsService = /*#__PURE__*/function (_CommonServiceBase) {
  19225. ChartFeatureInfoSpecsService_inherits(ChartFeatureInfoSpecsService, _CommonServiceBase);
  19226. var _super = ChartFeatureInfoSpecsService_createSuper(ChartFeatureInfoSpecsService);
  19227. function ChartFeatureInfoSpecsService(url, options) {
  19228. var _this;
  19229. ChartFeatureInfoSpecsService_classCallCheck(this, ChartFeatureInfoSpecsService);
  19230. _this = _super.call(this, url, options);
  19231. _this.CLASS_NAME = "SuperMap.ChartFeatureInfoSpecsService";
  19232. return _this;
  19233. }
  19234. /**
  19235. * @function SuperMap.ChartFeatureInfoSpecsService.prototype.destroy
  19236. * @override
  19237. */
  19238. ChartFeatureInfoSpecsService_createClass(ChartFeatureInfoSpecsService, [{
  19239. key: "destroy",
  19240. value: function destroy() {
  19241. ChartFeatureInfoSpecsService_get(ChartFeatureInfoSpecsService_getPrototypeOf(ChartFeatureInfoSpecsService.prototype), "destroy", this).call(this);
  19242. Util.reset(this);
  19243. }
  19244. /**
  19245. * @function SuperMap.ChartFeatureInfoSpecsService.prototype.processAsync
  19246. * @description 根据地图(特指海图)服务地址与服务端完成异步通讯,获取物标信息。
  19247. * 当查询物标信息成功时,将触发 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE
  19248. * 事件。用可以通过户两种方式获取图层信息:
  19249. * 1. 通过 AsyncResponder 类获取(推荐使用);
  19250. * 2. 通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件获取。
  19251. */
  19252. }, {
  19253. key: "processAsync",
  19254. value: function processAsync() {
  19255. var me = this,
  19256. method = "GET";
  19257. if (!me.isTempLayers) {
  19258. Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
  19259. }
  19260. me.request({
  19261. method: method,
  19262. params: null,
  19263. scope: me,
  19264. success: me.serviceProcessCompleted,
  19265. failure: me.serviceProcessFailed
  19266. });
  19267. }
  19268. }]);
  19269. return ChartFeatureInfoSpecsService;
  19270. }(CommonServiceBase);
  19271. SuperMap.ChartFeatureInfoSpecsService = ChartFeatureInfoSpecsService;
  19272. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryFilterParameter.js
  19273. function ChartQueryFilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19274. 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); } }
  19275. function ChartQueryFilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryFilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryFilterParameter_defineProperties(Constructor, staticProps); return Constructor; }
  19276. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19277. * This program are made available under the terms of the Apache License, Version 2.0
  19278. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19279. /**
  19280. * @class SuperMap.ChartQueryFilterParameter
  19281. * @category iServer Map Chart
  19282. * @classdesc 海图查询过滤参数类,用于设置海图查询的过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  19283. * @param {Object} options - 参数。
  19284. * @param {string} options.attributeFilter - 属性字段过滤条件。
  19285. * @param {number} options.chartFeatureInfoSpecCode - 查询的物标代号。
  19286. * @param {boolean} [options.isQueryPoint] - 是否查询点。
  19287. * @param {boolean} [options.isQueryLine] - 是否查询线。
  19288. * @param {boolean} [options.isQueryRegion] - 是否查询面。
  19289. */
  19290. var ChartQueryFilterParameter = /*#__PURE__*/function () {
  19291. function ChartQueryFilterParameter(options) {
  19292. ChartQueryFilterParameter_classCallCheck(this, ChartQueryFilterParameter);
  19293. /**
  19294. * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryPoint]
  19295. * @description 是否查询点。
  19296. */
  19297. this.isQueryPoint = null;
  19298. /**
  19299. * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryLine]
  19300. * @description 是否查询线。
  19301. */
  19302. this.isQueryLine = null;
  19303. /**
  19304. * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryRegion]
  19305. * @description 是否查询面。
  19306. */
  19307. this.isQueryRegion = null;
  19308. /**
  19309. * @member {string} SuperMap.ChartQueryFilterParameter.prototype.attributeFilter
  19310. * @description 属性字段过滤条件。
  19311. */
  19312. this.attributeFilter = null;
  19313. /**
  19314. * @member {number} SuperMap.ChartQueryFilterParameter.prototype.chartFeatureInfoSpecCode
  19315. * @description 查询的物标代号。
  19316. */
  19317. this.chartFeatureInfoSpecCode = null;
  19318. Util.extend(this, options);
  19319. this.CLASS_NAME = "SuperMap.ChartQueryFilterParameter";
  19320. }
  19321. /**
  19322. * @function SuperMap.ChartQueryFilterParameter.prototype.destroy
  19323. * @description 释放资源,将引用资源的属性置空。
  19324. */
  19325. ChartQueryFilterParameter_createClass(ChartQueryFilterParameter, [{
  19326. key: "destroy",
  19327. value: function destroy() {
  19328. var me = this;
  19329. me.isQueryPoint = null;
  19330. me.isQueryLine = null;
  19331. me.isQueryRegion = null;
  19332. me.attributeFilter = null;
  19333. me.chartFeatureInfoSpecCode = null;
  19334. }
  19335. /**
  19336. * @function SuperMap.ChartQueryFilterParameter.prototype.toJson
  19337. * @description 将属性信息转化成 JSON 格式字符串。
  19338. */
  19339. }, {
  19340. key: "toJson",
  19341. value: function toJson() {
  19342. var json = "";
  19343. json += "\"isQueryPoint\":" + this.isQueryPoint + ",";
  19344. json += "\"isQueryLine\":" + this.isQueryLine + ",";
  19345. json += "\"isQueryRegion\":" + this.isQueryRegion + ",";
  19346. if (this.attributeFilter) {
  19347. json += "\"attributeFilter\": \"" + this.attributeFilter + "\",";
  19348. }
  19349. json += "\"chartFeatureInfoSpecCode\":" + this.chartFeatureInfoSpecCode;
  19350. json = "{" + json + "}";
  19351. return json;
  19352. }
  19353. }]);
  19354. return ChartQueryFilterParameter;
  19355. }();
  19356. SuperMap.ChartQueryFilterParameter = ChartQueryFilterParameter;
  19357. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryParameters.js
  19358. function ChartQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19359. 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); } }
  19360. function ChartQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19361. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19362. * This program are made available under the terms of the Apache License, Version 2.0
  19363. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19364. /**
  19365. * @class SuperMap.ChartQueryParameters
  19366. * @category iServer Map Chart
  19367. * @classdesc 海图查询参数类,该类用于设置海图查询时的相关参数,海图查询分为海图属性查询和海图范围查询两类,通过属性 queryMode 指定查询模式。
  19368. * 必设属性有:queryMode、chartLayerNames、chartQueryFilterParameters。当进行海图范围查询时,必设属性还包括 bounds。
  19369. * @param {Object} options - 参数。
  19370. * @param {string} options.queryMode - 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery")。
  19371. * @param {Array.<string>} options.chartLayerNames - 查询的海图图层的名称。
  19372. * @param {Array.<{SuperMap.ChartQueryFilterParameter}>} options.chartQueryFilterParameters - 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  19373. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 海图查询范围。当进行海图范围查询时,此参数为必选。
  19374. * @param {boolean} [options.returnContent=true] - 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  19375. * @param {number} [options.startRecord=0] - 查询起始记录位置。
  19376. * @param {number} [options.expectCount] - 期望查询结果返回的记录数,该值大于0。
  19377. */
  19378. var ChartQueryParameters = /*#__PURE__*/function () {
  19379. function ChartQueryParameters(options) {
  19380. ChartQueryParameters_classCallCheck(this, ChartQueryParameters);
  19381. /**
  19382. * @member {string} SuperMap.ChartQueryParameters.prototype.queryMode
  19383. * @description 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery") 。
  19384. */
  19385. this.queryMode = null;
  19386. /**
  19387. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.ChartQueryParameters.prototype.bounds
  19388. * @description 海图查询范围。
  19389. */
  19390. this.bounds = null;
  19391. /**
  19392. * @member {Array.<string>} SuperMap.ChartQueryParameters.prototype.chartLayerNames
  19393. * @description 查询的海图图层的名称。
  19394. */
  19395. this.chartLayerNames = null;
  19396. /**
  19397. * @member {Array.<SuperMap.ChartQueryFilterParameter>} SuperMap.ChartQueryParameters.prototype.chartQueryFilterParameters
  19398. * @description 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  19399. */
  19400. this.chartQueryFilterParameters = null;
  19401. /**
  19402. * @member {boolean} [SuperMap.ChartQueryParameters.prototype.returnContent=true]
  19403. * @description 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  19404. */
  19405. this.returnContent = true;
  19406. /**
  19407. * @member {number} [SuperMap.ChartQueryParameters.prototype.startRecord=0]
  19408. * @description 查询起始记录位置。
  19409. */
  19410. this.startRecord = 0;
  19411. /**
  19412. * @member {number} [SuperMap.ChartQueryParameters.prototype.expectCount]
  19413. * @description 期望查询结果返回的记录数,该值大于0。
  19414. */
  19415. this.expectCount = null;
  19416. Util.extend(this, options);
  19417. this.CLASS_NAME = "SuperMap.ChartQueryParameters";
  19418. }
  19419. /**
  19420. * @function SuperMap.ChartQueryParameters.prototype.destroy
  19421. * @description 释放资源,将引用资源的属性置空。
  19422. */
  19423. ChartQueryParameters_createClass(ChartQueryParameters, [{
  19424. key: "destroy",
  19425. value: function destroy() {
  19426. var me = this;
  19427. me.queryMode = null;
  19428. me.bounds = null;
  19429. me.chartLayerNames = null;
  19430. me.chartQueryFilterParameters = null;
  19431. me.returnContent = true;
  19432. me.startRecord = 0;
  19433. me.expectCount = null;
  19434. }
  19435. /**
  19436. * @function SuperMap.ChartQueryParameters.prototype.getVariablesJson
  19437. * @description 将属性信息转换成能够被服务识别的 JSON 格式字符串。
  19438. * @returns {string} JSON 字符串。
  19439. */
  19440. }, {
  19441. key: "getVariablesJson",
  19442. value: function getVariablesJson() {
  19443. var json = "";
  19444. json += "\"queryMode\":\"" + this.queryMode + "\",";
  19445. if (this.chartLayerNames && this.chartLayerNames.length) {
  19446. var chartLayersArray = [];
  19447. var layerLength = this.chartLayerNames.length;
  19448. for (var i = 0; i < layerLength; i++) {
  19449. chartLayersArray.push("\"" + this.chartLayerNames[i] + "\"");
  19450. }
  19451. var layerNames = "[" + chartLayersArray.join(",") + "]";
  19452. json += "\"chartLayerNames\":" + layerNames + ",";
  19453. }
  19454. if (this.queryMode === "ChartBoundsQuery" && this.bounds) {
  19455. json += "\"bounds\":" + "{" + "\"leftBottom\":" + "{" + "\"x\":" + this.bounds.left + "," + "\"y\":" + this.bounds.bottom + "}" + "," + "\"rightTop\":" + "{" + "\"x\":" + this.bounds.right + "," + "\"y\":" + this.bounds.top + "}" + "},";
  19456. }
  19457. if (this.chartQueryFilterParameters && this.chartQueryFilterParameters.length) {
  19458. var chartParamArray = [];
  19459. var chartLength = this.chartQueryFilterParameters.length;
  19460. for (var j = 0; j < chartLength; j++) {
  19461. var chartQueryFilterParameter = this.chartQueryFilterParameters[j];
  19462. if (!(chartQueryFilterParameter instanceof ChartQueryFilterParameter)) {
  19463. continue;
  19464. }
  19465. chartParamArray.push(chartQueryFilterParameter.toJson());
  19466. }
  19467. var chartParamsJson = "[" + chartParamArray.join(",") + "]";
  19468. chartParamsJson = "\"chartQueryParams\":" + chartParamsJson + ",";
  19469. chartParamsJson += "\"startRecord\":" + this.startRecord + ",";
  19470. chartParamsJson += "\"expectCount\":" + this.expectCount;
  19471. chartParamsJson = "{" + chartParamsJson + "}";
  19472. json += "\"chartQueryParameters\":" + chartParamsJson;
  19473. }
  19474. json = "{" + json + "}";
  19475. return json;
  19476. }
  19477. }]);
  19478. return ChartQueryParameters;
  19479. }();
  19480. SuperMap.ChartQueryParameters = ChartQueryParameters;
  19481. ;// CONCATENATED MODULE: ./src/common/iServer/QueryParameters.js
  19482. function QueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19483. 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); } }
  19484. function QueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19485. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19486. * This program are made available under the terms of the Apache License, Version 2.0
  19487. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19488. /**
  19489. * @class SuperMap.QueryParameters
  19490. * @category iServer Map QueryResults
  19491. * @classdesc 查询参数基类。距离查询、SQL 查询、几何地物查询等各自的参数均继承此类。
  19492. * @param {Object} options - 参数。
  19493. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  19494. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  19495. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  19496. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  19497. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  19498. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  19499. * @param {number} [options.startRecord=0] - 查询起始记录号。
  19500. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  19501. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  19502. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  19503. */
  19504. var QueryParameters = /*#__PURE__*/function () {
  19505. function QueryParameters(options) {
  19506. QueryParameters_classCallCheck(this, QueryParameters);
  19507. if (!options) {
  19508. return;
  19509. }
  19510. /**
  19511. * @member {string} [SuperMap.QueryParameters.prototype.customParams]
  19512. * @description 自定义参数,供扩展使用。
  19513. */
  19514. this.customParams = null;
  19515. /**
  19516. * @member {Object} [SuperMap.QueryParameters.prototype.prjCoordSys]
  19517. * @description 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}
  19518. */
  19519. this.prjCoordSys = null;
  19520. /**
  19521. * @member {number} [SuperMap.QueryParameters.prototype.expectCount=100000]
  19522. * @description 期望返回结果记录个数,默认返回100000条查询记录,
  19523. * 如果实际不足100000条则返回实际记录条数。
  19524. */
  19525. this.expectCount = 100000;
  19526. /**
  19527. * @member {SuperMap.GeometryType} [SuperMap.QueryParameters.prototype.networkType=SuperMap.GeometryType.LINE]
  19528. * @description 网络数据集对应的查询类型,分为点和线两种类型。
  19529. */
  19530. this.networkType = GeometryType.LINE;
  19531. /**
  19532. * @member {SuperMap.QueryOption} [SuperMap.QueryParameters.prototype.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY]
  19533. * @description 查询结果类型枚举类。
  19534. * 该类描述查询结果返回类型,包括只返回属性、
  19535. * 只返回几何实体以及返回属性和几何实体。
  19536. */
  19537. this.queryOption = QueryOption.ATTRIBUTEANDGEOMETRY;
  19538. /**
  19539. * @member {Array.<SuperMap.FilterParameter>} SuperMap.QueryParameters.prototype.queryParams
  19540. * @description 查询过滤条件参数数组。
  19541. * 该类用于设置查询数据集的查询过滤参数。
  19542. */
  19543. this.queryParams = null;
  19544. /**
  19545. * @member {number} [SuperMap.QueryParameters.prototype.startRecord=0]
  19546. * @description 查询起始记录号。
  19547. */
  19548. this.startRecord = 0;
  19549. /**
  19550. * @member {number} [SuperMap.QueryParameters.prototype.holdTime=10]
  19551. * @description 资源在服务端保存的时间,单位为分钟。
  19552. */
  19553. this.holdTime = 10;
  19554. /**
  19555. * @member {boolean} [SuperMap.QueryParameters.prototype.returnCustomResult=false]
  19556. * @description 仅供三维使用。
  19557. */
  19558. this.returnCustomResult = false;
  19559. /**
  19560. * @member {boolean} [SuperMap.QueryParameters.prototype.returnFeatureWithFieldCaption=false]
  19561. * @description 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  19562. */
  19563. this.returnFeatureWithFieldCaption = false;
  19564. Util.extend(this, options);
  19565. this.CLASS_NAME = "SuperMap.QueryParameters";
  19566. }
  19567. /**
  19568. * @function SuperMap.QueryParameters.prototype.destroy
  19569. * @description 释放资源,将引用资源的属性置空。
  19570. */
  19571. QueryParameters_createClass(QueryParameters, [{
  19572. key: "destroy",
  19573. value: function destroy() {
  19574. var me = this;
  19575. me.customParams = null;
  19576. me.expectCount = null;
  19577. me.networkType = null;
  19578. me.queryOption = null;
  19579. if (me.queryParams) {
  19580. for (var i = 0, qps = me.queryParams, len = qps.length; i < len; i++) {
  19581. qps[i].destroy();
  19582. }
  19583. me.queryParams = null;
  19584. }
  19585. me.startRecord = null;
  19586. me.holdTime = null;
  19587. me.returnCustomResult = null;
  19588. me.prjCoordSys = null;
  19589. }
  19590. }]);
  19591. return QueryParameters;
  19592. }();
  19593. SuperMap.QueryParameters = QueryParameters;
  19594. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryService.js
  19595. function ChartQueryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ChartQueryService_typeof = function _typeof(obj) { return typeof obj; }; } else { ChartQueryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ChartQueryService_typeof(obj); }
  19596. function ChartQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19597. 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); } }
  19598. function ChartQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryService_defineProperties(Constructor, staticProps); return Constructor; }
  19599. function ChartQueryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ChartQueryService_setPrototypeOf(subClass, superClass); }
  19600. function ChartQueryService_setPrototypeOf(o, p) { ChartQueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartQueryService_setPrototypeOf(o, p); }
  19601. 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); }; }
  19602. function ChartQueryService_possibleConstructorReturn(self, call) { if (call && (ChartQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartQueryService_assertThisInitialized(self); }
  19603. function ChartQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19604. function ChartQueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19605. function ChartQueryService_getPrototypeOf(o) { ChartQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartQueryService_getPrototypeOf(o); }
  19606. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19607. * This program are made available under the terms of the Apache License, Version 2.0
  19608. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19609. /**
  19610. * @class SuperMap.ChartQueryService
  19611. * @category iServer Map Chart
  19612. * @classdesc 海图查询服务类。该类负责将海图查询所需参数(ChartQueryParameters)传递至服务端,并获取服务端的返回结果。
  19613. * 用户可以通过两种方式获取查询结果:
  19614. * 1.通过 AsyncResponder 类获取(推荐使用);
  19615. * 2.通过监听 QueryEvent.PROCESS_COMPLETE 事件获取。
  19616. * @extends {SuperMap.CommonServiceBase}
  19617. * @param {string} url - 地图查询服务访问地址。如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  19618. * @param {Object} options - 参数。
  19619. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  19620. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  19621. * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为"ISERVER","GEOJSON"。
  19622. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19623. * @param {Object} [options.headers] - 请求头。
  19624. * @example
  19625. * 下面示例显示了如何进行海图属性查询:
  19626. * var nameArray = ["GB4X0000_52000"];
  19627. * var chartQueryFilterParameter = new ChartQueryFilterParameter({
  19628. * isQueryPoint:true,
  19629. * isQueryLine:true,
  19630. * isQueryRegion:true,
  19631. * attributeFilter:"SmID<10",
  19632. * chartFeatureInfoSpecCode:1
  19633. * });
  19634. *
  19635. * var chartQueryParameters = new SuperMap.ChartQueryParameters({
  19636. * queryMode:"ChartAttributeQuery",
  19637. * chartLayerNames:nameArray,
  19638. * returnContent:true,
  19639. * chartQueryFilterParameters:[chartQueryFilterParameter]
  19640. * });
  19641. *
  19642. * var chartQueryService = new SuperMap.ChartQueryService(url);
  19643. *
  19644. * chartQueryService.events.on({
  19645. * "processCompleted":processCompleted,
  19646. * "processFailed":processFailed
  19647. * });
  19648. * chartQueryService.processAsync(chartQueryParameters);
  19649. */
  19650. var ChartQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  19651. ChartQueryService_inherits(ChartQueryService, _CommonServiceBase);
  19652. var _super = ChartQueryService_createSuper(ChartQueryService);
  19653. function ChartQueryService(url, options) {
  19654. var _this;
  19655. ChartQueryService_classCallCheck(this, ChartQueryService);
  19656. _this = _super.call(this, url, options);
  19657. options = options || {};
  19658. /**
  19659. * @member {boolean} SuperMap.ChartQueryService.prototype.returnContent
  19660. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  19661. */
  19662. _this.returnContent = null;
  19663. /**
  19664. * @member {SuperMap.DataFormat} SuperMap.ChartQueryService.prototype.format
  19665. * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式
  19666. * 参数格式为"ISERVER","GEOJSON",GEOJSON
  19667. */
  19668. _this.format = DataFormat.GEOJSON;
  19669. Util.extend(ChartQueryService_assertThisInitialized(_this), options);
  19670. var me = ChartQueryService_assertThisInitialized(_this);
  19671. if (options.format) {
  19672. me.format = options.format.toUpperCase();
  19673. }
  19674. if (!me.url) {
  19675. return ChartQueryService_possibleConstructorReturn(_this);
  19676. }
  19677. me.url = Util.urlPathAppend(me.url, 'queryResults');
  19678. _this.CLASS_NAME = "SuperMap.ChartQueryService";
  19679. return _this;
  19680. }
  19681. /**
  19682. * @function SuperMap.ChartQueryService.prototype.destroy
  19683. * @override
  19684. */
  19685. ChartQueryService_createClass(ChartQueryService, [{
  19686. key: "destroy",
  19687. value: function destroy() {
  19688. var me = this;
  19689. CommonServiceBase.prototype.destroy.apply(this, arguments);
  19690. me.returnContent = null;
  19691. me.format = null;
  19692. }
  19693. /**
  19694. * @function SuperMap.ChartQueryService.prototype.processAsync
  19695. * @description 使用服务地址 URL 实例化 ChartQueryService 对象。
  19696. * @param {SuperMap.ChartQueryParameters} params - 查询参数。
  19697. */
  19698. }, {
  19699. key: "processAsync",
  19700. value: function processAsync(params) {
  19701. //todo重点需要添加代码的地方
  19702. if (!(params instanceof ChartQueryParameters)) {
  19703. return;
  19704. }
  19705. var me = this,
  19706. jsonParameters;
  19707. me.returnContent = params.returnContent;
  19708. jsonParameters = params.getVariablesJson();
  19709. if (me.returnContent) {
  19710. me.url = Util.urlAppend(me.url, 'returnContent=true');
  19711. }
  19712. me.request({
  19713. method: "POST",
  19714. data: jsonParameters,
  19715. scope: me,
  19716. success: me.serviceProcessCompleted,
  19717. failure: me.serviceProcessFailed
  19718. });
  19719. }
  19720. /**
  19721. * @function SuperMap.ChartQueryService.prototype.serviceProcessCompleted
  19722. * @description 查询完成,执行此方法。
  19723. * @param {Object} result - 服务器返回的结果对象。
  19724. */
  19725. }, {
  19726. key: "serviceProcessCompleted",
  19727. value: function serviceProcessCompleted(result) {
  19728. var me = this;
  19729. result = Util.transformResult(result);
  19730. if (result && result.recordsets && me.format === DataFormat.GEOJSON) {
  19731. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  19732. if (recordsets[i].features) {
  19733. var geoJSONFormat = new GeoJSON();
  19734. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  19735. }
  19736. }
  19737. }
  19738. me.events.triggerEvent("processCompleted", {
  19739. result: result
  19740. });
  19741. }
  19742. /**
  19743. * @function SuperMap.ChartQueryService.prototype.getQueryParameters
  19744. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  19745. * @param {Object} params - JSON 字符串表示的查询参数。
  19746. * @returns {SuperMap.QueryParameters} 返回查询结果
  19747. */
  19748. }, {
  19749. key: "getQueryParameters",
  19750. value: function getQueryParameters(params) {
  19751. return new QueryParameters({
  19752. queryMode: params.queryMode,
  19753. bounds: params.bounds,
  19754. chartLayerNames: params.chartLayerNames,
  19755. chartQueryFilterParameters: params.chartQueryFilterParameters,
  19756. returnContent: params.returnContent
  19757. });
  19758. }
  19759. }]);
  19760. return ChartQueryService;
  19761. }(CommonServiceBase);
  19762. SuperMap.ChartQueryService = ChartQueryService;
  19763. ;// CONCATENATED MODULE: ./src/common/iServer/ClipParameter.js
  19764. function ClipParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19765. 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); } }
  19766. function ClipParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ClipParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ClipParameter_defineProperties(Constructor, staticProps); return Constructor; }
  19767. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19768. * This program are made available under the terms of the Apache License, Version 2.0
  19769. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19770. /**
  19771. * @class SuperMap.ClipParameter
  19772. * @category iServer SpatialAnalyst InterpolationAnalyst
  19773. * @classdesc 用于裁剪的参数。
  19774. * @description 优先使用用户指定的裁剪区域多边形进行裁剪,也可以通过指定数据源和数据集名,从而使用指定数据集的边界多边形进行裁剪。
  19775. * @param {Object} options - 参数。
  19776. * @param {string} [options.clipDatasetName] - 裁剪的数据集名。
  19777. * @param {string} [options.clipDatasourceName] - 裁剪的数据集所在数据源的名字。
  19778. * @param {(SuperMap.Geometry.Polygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON)} [options.clipRegion] - 用户指定的裁剪区域。
  19779. * @param {boolean} [options.isClipInRegion=true] - 是否对裁剪区内的数据集进行裁剪。
  19780. * @param {boolean} [options.isExactClip=true] - 是否使用精确裁剪。
  19781. */
  19782. var ClipParameter = /*#__PURE__*/function () {
  19783. function ClipParameter(options) {
  19784. ClipParameter_classCallCheck(this, ClipParameter);
  19785. /**
  19786. * @member {string} SuperMap.ClipParameter.prototype.clipDatasetName
  19787. * @description 用于裁剪的数据集名,clipDatasetName 与 clipRegion 必须设置一个。
  19788. */
  19789. this.clipDatasetName = null;
  19790. /**
  19791. * @member {string} SuperMap.ClipParameter.prototype.clipDatasourceName
  19792. * @description 用于裁剪的数据集所在数据源的名字。当 clipRegion 不设置时起作用。
  19793. */
  19794. this.clipDatasourceName = null;
  19795. /**
  19796. * @member {(SuperMap.Geometry.Polygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON)} SuperMap.ClipParameter.prototype.clipRegion
  19797. * @description 用户指定的裁剪区域,优先使用,clipDatasetName 与 clipRegion 必须设置一个。
  19798. */
  19799. this.clipRegion = null;
  19800. /**
  19801. * @member {boolean} [SuperMap.ClipParameter.prototype.isClipInRegion=true]
  19802. * @description 是否对裁剪区内的数据集进行裁剪。若为 true,则对裁剪区域内的结果进行裁剪,若为 false,则对裁剪区域外的结果进行裁剪。
  19803. */
  19804. this.isClipInRegion = true;
  19805. /**
  19806. * @member {boolean} [SuperMap.ClipParameter.prototype.isExactClip=true]
  19807. * @description 是否使用精确裁剪。
  19808. */
  19809. this.isExactClip = null;
  19810. if (options) {
  19811. Util.extend(this, options);
  19812. }
  19813. this.CLASS_NAME = "SuperMap.ClipParameter";
  19814. }
  19815. /**
  19816. * @function SuperMap.ClipParameter.prototype.destroy
  19817. * @description 释放资源,将引用资源的属性置空。
  19818. */
  19819. ClipParameter_createClass(ClipParameter, [{
  19820. key: "destroy",
  19821. value: function destroy() {
  19822. var me = this;
  19823. me.clipDatasetName = null;
  19824. me.clipDatasourceName = null;
  19825. me.clipRegion = null;
  19826. me.isClipInRegion = null;
  19827. me.isExactClip = null;
  19828. }
  19829. /**
  19830. * @function SuperMap.ClipParameter.prototype.toJSON
  19831. * @description 将 ClipParameter 对象转化为 JSON 字符串。
  19832. * @returns {string} 返回转换后的 JSON 字符串。
  19833. */
  19834. }, {
  19835. key: "toJSON",
  19836. value: function toJSON() {
  19837. return Util.toJSON({
  19838. isClipInRegion: this.isClipInRegion,
  19839. clipDatasetName: this.clipDatasetName,
  19840. clipDatasourceName: this.clipDatasourceName,
  19841. isExactClip: this.isExactClip,
  19842. clipRegion: ServerGeometry.fromGeometry(this.clipRegion)
  19843. });
  19844. }
  19845. }]);
  19846. return ClipParameter;
  19847. }();
  19848. SuperMap.ClipParameter = ClipParameter;
  19849. ;// CONCATENATED MODULE: ./src/common/iServer/ColorDictionary.js
  19850. function ColorDictionary_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19851. 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); } }
  19852. function ColorDictionary_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorDictionary_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorDictionary_defineProperties(Constructor, staticProps); return Constructor; }
  19853. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19854. * This program are made available under the terms of the Apache License, Version 2.0
  19855. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19856. /**
  19857. * @class SuperMap.ColorDictionary
  19858. * @category iServer Map Theme
  19859. * @classdesc 颜色对照表类。
  19860. * @description 颜色对照表中的键名为具体的高程值,键值表示该高程值要显示的颜色。对于栅格图层中高程值小于颜色对照表中高程最小值的点使用颜色对照表中高程最小值对应的颜色,对于栅格图层中高程值大于颜色对照表中高程最大值的点使用颜色对照表中高程最大值对应的颜色,对于栅格图层中高程值在颜色对照表中没有对应颜色的点,则查找颜色对照表中与当前高程值相邻的两个高程对应的颜色,然后通过渐变运算要显示的颜色。如果设置了颜色对照表的话,则颜色表设置无效。
  19861. * @param {Object} options - 参数。
  19862. * @param {number} options.elevation - 高程值。
  19863. * @param {SuperMap.ServerColor} options.color - 服务端颜色类。
  19864. */
  19865. var ColorDictionary = /*#__PURE__*/function () {
  19866. function ColorDictionary(options) {
  19867. ColorDictionary_classCallCheck(this, ColorDictionary);
  19868. options = options || {};
  19869. /**
  19870. * @member {number} SuperMap.ColorDictionary.prototype.elevation
  19871. * @description 高程值。
  19872. */
  19873. this.elevation = null;
  19874. /**
  19875. * @member {SuperMap.ServerColor} SuperMap.ColorDictionary.prototype.color
  19876. * @description 服务端颜色类。
  19877. */
  19878. this.color = null;
  19879. Util.extend(this, options);
  19880. var me = this,
  19881. c = me.color;
  19882. if (c) {
  19883. me.color = new ServerColor(c.red, c.green, c.blue);
  19884. }
  19885. this.CLASS_NAME = "SuperMap.ColorDictionary";
  19886. }
  19887. /**
  19888. * @function SuperMap.ColorDictionary.prototype.destroy
  19889. * @description 释放资源,将引用资源的属性置空。
  19890. */
  19891. ColorDictionary_createClass(ColorDictionary, [{
  19892. key: "destroy",
  19893. value: function destroy() {
  19894. Util.reset(this);
  19895. }
  19896. /**
  19897. * @function SuperMap.ColorDictionary.prototype.toServerJSONObject
  19898. * @description 转换成对应的 JSON 格式对象。
  19899. * @returns {Object} JSON 对象。
  19900. */
  19901. }, {
  19902. key: "toServerJSONObject",
  19903. value: function toServerJSONObject() {
  19904. var dataObj = {};
  19905. dataObj = Util.copyAttributes(dataObj, this);
  19906. return dataObj;
  19907. }
  19908. }]);
  19909. return ColorDictionary;
  19910. }();
  19911. SuperMap.ColorDictionary = ColorDictionary;
  19912. ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystResultSetting.js
  19913. function TransportationAnalystResultSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19914. 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); } }
  19915. function TransportationAnalystResultSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystResultSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystResultSetting_defineProperties(Constructor, staticProps); return Constructor; }
  19916. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19917. * This program are made available under the terms of the Apache License, Version 2.0
  19918. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19919. /**
  19920. * @class SuperMap.TransportationAnalystResultSetting
  19921. * @category iServer NetworkAnalyst
  19922. * @classdesc 交通网络分析结果参数类。
  19923. * @description 通过该类设置交通网络分析返回的结果,包括是否返回图片、是否返回弧段空间信息、是否返回结点空间信息等。
  19924. * @param {Object} options - 参数。
  19925. * @param {boolean} [options.returnEdgeFeatures=false] - 是否在分析结果中包含弧段要素集合。
  19926. * @param {boolean} [options.returnEdgeGeometry=false] - 返回的弧段要素集合中是否包含几何对象信息。
  19927. * @param {boolean} [options.returnEdgeIDs=false] - 返回结果中是否包含经过弧段 ID 集合。
  19928. * @param {boolean} [options.returnNodeFeatures=false] - 是否在分析结果中包含结点要素集合。
  19929. * @param {boolean} [options.returnNodeGeometry=false] - 返回的结点要素集合中是否包含几何对象信息。
  19930. * @param {boolean} [options.returnNodeIDs=false] - 返回结果中是否包含经过结点 ID 集合。
  19931. * @param {boolean} [options.returnPathGuides=false] - 返回分析结果中是否包含行驶导引集合。
  19932. * @param {boolean} [options.returnRoutes=false] - 返回分析结果中是否包含路由对象的集合。
  19933. */
  19934. var TransportationAnalystResultSetting = /*#__PURE__*/function () {
  19935. function TransportationAnalystResultSetting(options) {
  19936. TransportationAnalystResultSetting_classCallCheck(this, TransportationAnalystResultSetting);
  19937. if (!options) {
  19938. return;
  19939. }
  19940. /**
  19941. * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeFeatures
  19942. * @description 是否在分析结果中包含弧段要素集合。弧段要素包括弧段的空间信息和属性信息。
  19943. */
  19944. this.returnEdgeFeatures = false;
  19945. /**
  19946. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeGeometry=false]
  19947. * @description 返回的弧段要素集合中是否包含几何对象信息。
  19948. */
  19949. this.returnEdgeGeometry = false;
  19950. /**
  19951. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeIDs=false]
  19952. * @description 返回结果中是否包含经过弧段 ID 集合。
  19953. */
  19954. this.returnEdgeIDs = false;
  19955. /**
  19956. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeFeatures=false]
  19957. * @description 是否在分析结果中包含结点要素集合。
  19958. * 结点要素包括结点的空间信息和属性信息。其中返回的结点要素是否包含空间信息可通过 returnNodeGeometry 字段设置。
  19959. */
  19960. this.returnNodeFeatures = false;
  19961. /**
  19962. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeGeometry=false]
  19963. * @description 返回的结点要素集合中是否包含几何对象信息。
  19964. */
  19965. this.returnNodeGeometry = false;
  19966. /**
  19967. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeIDs=false]
  19968. * @description 返回结果中是否包含经过结点 ID 集合。
  19969. */
  19970. this.returnNodeIDs = false;
  19971. /**
  19972. * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnPathGuides
  19973. * @description 返回分析结果中是否包含行驶导引集合。
  19974. */
  19975. this.returnPathGuides = false;
  19976. /**
  19977. * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnRoutes
  19978. * @description 返回分析结果中是否包含路由对象的集合。
  19979. */
  19980. this.returnRoutes = false;
  19981. Util.extend(this, options);
  19982. this.CLASS_NAME = "SuperMap.TransportationAnalystResultSetting";
  19983. }
  19984. /**
  19985. * @function SuperMap.TransportationAnalystResultSetting.prototype.destroy
  19986. * @description 释放资源,将引用资源的属性置空。
  19987. */
  19988. TransportationAnalystResultSetting_createClass(TransportationAnalystResultSetting, [{
  19989. key: "destroy",
  19990. value: function destroy() {
  19991. var me = this;
  19992. me.returnEdgeFeatures = null;
  19993. me.returnEdgeGeometry = null;
  19994. me.returnEdgeIDs = null;
  19995. me.returnNodeFeatures = null;
  19996. me.returnNodeGeometry = null;
  19997. me.returnNodeIDs = null;
  19998. me.returnPathGuides = null;
  19999. me.returnRoutes = null;
  20000. }
  20001. }]);
  20002. return TransportationAnalystResultSetting;
  20003. }();
  20004. SuperMap.TransportationAnalystResultSetting = TransportationAnalystResultSetting;
  20005. ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystParameter.js
  20006. function TransportationAnalystParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20007. 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); } }
  20008. function TransportationAnalystParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystParameter_defineProperties(Constructor, staticProps); return Constructor; }
  20009. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20010. * This program are made available under the terms of the Apache License, Version 2.0
  20011. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20012. /**
  20013. * @class SuperMap.TransportationAnalystParameter
  20014. * @category iServer NetworkAnalyst
  20015. * @classdesc 交通网络分析通用参数类。
  20016. * @description 该类主要用来提供交通网络分析所需的通用参数。
  20017. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息,还可以对分析结果包含的内容进行一些设置。
  20018. * @param {Object} options - 参数。
  20019. * @param {Array.<number>} options.barrierEdgeIDs - 网络分析中障碍弧段的 ID 数组。
  20020. * @param {Array.<number>} options.barrierNodeIDs - 网络分析中障碍点的 ID 数组。
  20021. * @param {string} options.turnWeightField - 转向权重字段的名称。
  20022. * @param {SuperMap.TransportationAnalystResultSetting} options.resultSetting - 分析结果返回内容。
  20023. * @param {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} [options.barrierPoints] - 网络分析中 Point2D 类型的障碍点数组。
  20024. * @param {string} [options.weightFieldName] - 阻力字段的名称。
  20025. */
  20026. var TransportationAnalystParameter = /*#__PURE__*/function () {
  20027. function TransportationAnalystParameter(options) {
  20028. TransportationAnalystParameter_classCallCheck(this, TransportationAnalystParameter);
  20029. if (!options) {
  20030. return;
  20031. }
  20032. /**
  20033. * @member {Array.<number>} SuperMap.TransportationAnalystParameter.prototype.barrierEdgeIDs
  20034. * @description 网络分析中障碍弧段的 ID 数组。弧段设置为障碍边之后,表示双向都不通。
  20035. */
  20036. this.barrierEdgeIDs = null;
  20037. /**
  20038. * @member {Array.<number>} SuperMap.TransportationAnalystParameter.prototype.barrierNodeIDs
  20039. * @description 网络分析中障碍点的 ID 数组。结点设置为障碍点之后,表示任何方向都不能通过此结点。
  20040. */
  20041. this.barrierNodeIDs = null;
  20042. /**
  20043. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.TransportationAnalystParameter.prototype.barrierPoints
  20044. * @description 网络分析中 Point2D 类型的障碍点数组。障碍点表示任何方向都不能通过此点。</br>
  20045. * 当各网络分析参数类中的 isAnalyzeById 属性设置为 false 时,该属性才生效。
  20046. */
  20047. this.barrierPoints = null;
  20048. /**
  20049. * @member {string} [SuperMap.TransportationAnalystParameter.prototype.weightFieldName]
  20050. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段,例如表示时间、长度等的字段都可以用作阻力字段。
  20051. * 该字段默值为服务器发布的所有耗费字段的第一个字段。
  20052. */
  20053. this.weightFieldName = null;
  20054. /**
  20055. * @member {string} SuperMap.TransportationAnalystParameter.prototype.turnWeightField
  20056. * @description 转向权重字段的名称。
  20057. */
  20058. this.turnWeightField = null;
  20059. /**
  20060. * @member {SuperMap.TransportationAnalystResultSetting} SuperMap.TransportationAnalystParameter.prototype.resultSetting
  20061. * @description 分析结果返回内容。
  20062. */
  20063. this.resultSetting = new TransportationAnalystResultSetting();
  20064. Util.extend(this, options);
  20065. this.CLASS_NAME = "SuperMap.TransportationAnalystParameter";
  20066. }
  20067. /**
  20068. * @function SuperMap.TransportationAnalystParameter.prototype.destroy
  20069. * @description 释放资源,将引用资源的属性置空。
  20070. */
  20071. TransportationAnalystParameter_createClass(TransportationAnalystParameter, [{
  20072. key: "destroy",
  20073. value: function destroy() {
  20074. var me = this;
  20075. me.barrierEdgeIDs = null;
  20076. me.barrierNodeIDs = null;
  20077. me.weightFieldName = null;
  20078. me.turnWeightField = null;
  20079. if (me.resultSetting) {
  20080. me.resultSetting.destroy();
  20081. me.resultSetting = null;
  20082. }
  20083. if (me.barrierPoints && me.barrierPoints.length) {
  20084. for (var i in me.barrierPoints) {
  20085. me.barrierPoints[i].destroy();
  20086. }
  20087. }
  20088. me.barrierPoints = null;
  20089. }
  20090. }]);
  20091. return TransportationAnalystParameter;
  20092. }();
  20093. SuperMap.TransportationAnalystParameter = TransportationAnalystParameter;
  20094. ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixParameters.js
  20095. function ComputeWeightMatrixParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20096. 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); } }
  20097. function ComputeWeightMatrixParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20098. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20099. * This program are made available under the terms of the Apache License, Version 2.0
  20100. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20101. /**
  20102. * @class SuperMap.ComputeWeightMatrixParameters
  20103. * @category iServer NetworkAnalyst WeightMatrix
  20104. * @classdesc 耗费矩阵分析参数类。根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  20105. * @param {Object} options - 参数。
  20106. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  20107. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 要计算耗费矩阵的点数组。
  20108. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  20109. */
  20110. var ComputeWeightMatrixParameters = /*#__PURE__*/function () {
  20111. function ComputeWeightMatrixParameters(options) {
  20112. ComputeWeightMatrixParameters_classCallCheck(this, ComputeWeightMatrixParameters);
  20113. /**
  20114. * @member {boolean} [SuperMap.ComputeWeightMatrixParameters.prototype.isAnalyzeById=false]
  20115. * @description 是否通过节点 ID 指定路径分析的结点,即通过坐标点指定。
  20116. */
  20117. this.isAnalyzeById = false;
  20118. /**
  20119. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.ComputeWeightMatrixParameters.prototype.nodes
  20120. * @description 要计算耗费矩阵的点数组。
  20121. * 当 {@link SuperMap.ComputeWeightMatrixParameters.isAnalyzeById} = false 时,nodes 应为点的坐标数组;
  20122. * 当 {@link SuperMap.ComputeWeightMatrixParameters.isAnalyzeById} = true 时,nodes 应为点的 ID 数组。
  20123. */
  20124. this.nodes = null;
  20125. /**
  20126. * @member {SuperMap.TransportationAnalystParameter} SuperMap.ComputeWeightMatrixParameters.prototype.parameter
  20127. * @description 交通网络分析通用参数。
  20128. */
  20129. this.parameter = new TransportationAnalystParameter();
  20130. Util.extend(this, options);
  20131. this.CLASS_NAME = "SuperMap.ComputeWeightMatrixParameters";
  20132. }
  20133. /**
  20134. * @function SuperMap.ComputeWeightMatrixParameters.prototype.destroy
  20135. * @description 释放资源,将引用资源的属性置空。
  20136. */
  20137. ComputeWeightMatrixParameters_createClass(ComputeWeightMatrixParameters, [{
  20138. key: "destroy",
  20139. value: function destroy() {
  20140. var me = this;
  20141. me.isAnalyzeById = null;
  20142. me.nodes = null;
  20143. if (me.parameter) {
  20144. me.parameter.destroy();
  20145. me.parameter = null;
  20146. }
  20147. }
  20148. }]);
  20149. return ComputeWeightMatrixParameters;
  20150. }();
  20151. SuperMap.ComputeWeightMatrixParameters = ComputeWeightMatrixParameters;
  20152. ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixService.js
  20153. function ComputeWeightMatrixService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ComputeWeightMatrixService_typeof = function _typeof(obj) { return typeof obj; }; } else { ComputeWeightMatrixService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ComputeWeightMatrixService_typeof(obj); }
  20154. function ComputeWeightMatrixService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20155. 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); } }
  20156. function ComputeWeightMatrixService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixService_defineProperties(Constructor, staticProps); return Constructor; }
  20157. function ComputeWeightMatrixService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ComputeWeightMatrixService_get = Reflect.get; } else { ComputeWeightMatrixService_get = function _get(target, property, receiver) { var base = ComputeWeightMatrixService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ComputeWeightMatrixService_get(target, property, receiver || target); }
  20158. function ComputeWeightMatrixService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ComputeWeightMatrixService_getPrototypeOf(object); if (object === null) break; } return object; }
  20159. function ComputeWeightMatrixService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ComputeWeightMatrixService_setPrototypeOf(subClass, superClass); }
  20160. function ComputeWeightMatrixService_setPrototypeOf(o, p) { ComputeWeightMatrixService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ComputeWeightMatrixService_setPrototypeOf(o, p); }
  20161. 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); }; }
  20162. function ComputeWeightMatrixService_possibleConstructorReturn(self, call) { if (call && (ComputeWeightMatrixService_typeof(call) === "object" || typeof call === "function")) { return call; } return ComputeWeightMatrixService_assertThisInitialized(self); }
  20163. function ComputeWeightMatrixService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20164. function ComputeWeightMatrixService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  20165. function ComputeWeightMatrixService_getPrototypeOf(o) { ComputeWeightMatrixService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ComputeWeightMatrixService_getPrototypeOf(o); }
  20166. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20167. * This program are made available under the terms of the Apache License, Version 2.0
  20168. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20169. /**
  20170. * @class SuperMap.ComputeWeightMatrixService
  20171. * @category iServer NetworkAnalyst WeightMatrix
  20172. * @classdesc 耗费矩阵分析服务类。
  20173. * 耗费矩阵是根据交通网络分析参数中的耗费字段来计算一个二维数组,
  20174. * 用来存储指定的任意两点间的资源消耗。
  20175. * 耗费矩阵分析结果通过该类支持的事件的监听函数参数获取
  20176. * @extends {SuperMap.NetworkAnalystServiceBase}
  20177. * @example
  20178. * var mycomputeWeightMatrixService = new SuperMap.ComputeWeightMatrixService(url,{
  20179. * eventListeners: {
  20180. * "processCompleted": computeWeightMatrixCompleted,
  20181. * "processFailed": computeWeightMatrixnError
  20182. * }
  20183. * });
  20184. * @param {string} url - 耗费矩阵分析服务地址。请求服务的URL应为:
  20185. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  20186. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  20187. * @param {Object} options - 参数。
  20188. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20189. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20190. * @param {Object} [options.headers] - 请求头。
  20191. */
  20192. var ComputeWeightMatrixService = /*#__PURE__*/function (_NetworkAnalystServic) {
  20193. ComputeWeightMatrixService_inherits(ComputeWeightMatrixService, _NetworkAnalystServic);
  20194. var _super = ComputeWeightMatrixService_createSuper(ComputeWeightMatrixService);
  20195. function ComputeWeightMatrixService(url, options) {
  20196. var _this;
  20197. ComputeWeightMatrixService_classCallCheck(this, ComputeWeightMatrixService);
  20198. _this = _super.call(this, url, options);
  20199. _this.CLASS_NAME = "SuperMap.ComputeWeightMatrixService";
  20200. return _this;
  20201. }
  20202. /**
  20203. * @function SuperMap.ComputeWeightMatrixService.prototype.destroy
  20204. * @override
  20205. */
  20206. ComputeWeightMatrixService_createClass(ComputeWeightMatrixService, [{
  20207. key: "destroy",
  20208. value: function destroy() {
  20209. ComputeWeightMatrixService_get(ComputeWeightMatrixService_getPrototypeOf(ComputeWeightMatrixService.prototype), "destroy", this).call(this);
  20210. }
  20211. /**
  20212. * @function SuperMap.ComputeWeightMatrixService.prototype.processAsync
  20213. * @description 负责将客户端的查询参数传递到服务端。
  20214. * @param {SuperMap.ComputeWeightMatrixParameters} params - 耗费矩阵分析参数类
  20215. */
  20216. }, {
  20217. key: "processAsync",
  20218. value: function processAsync(params) {
  20219. if (!(params instanceof ComputeWeightMatrixParameters)) {
  20220. return;
  20221. }
  20222. var me = this,
  20223. jsonObject;
  20224. me.url = Util.urlPathAppend(me.url, 'weightmatrix');
  20225. jsonObject = {
  20226. parameter: Util.toJSON(params.parameter),
  20227. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  20228. };
  20229. me.request({
  20230. method: "GET",
  20231. params: jsonObject,
  20232. scope: me,
  20233. success: me.serviceProcessCompleted,
  20234. failure: me.serviceProcessFailed
  20235. });
  20236. }
  20237. /**
  20238. * @function SuperMap.ComputeWeightMatrixService.prototype.getJson
  20239. * @description 将对象转化为JSON字符串。
  20240. * @param {boolean} isAnalyzeById - 是否通过id分析
  20241. * @param {Array.<SuperMap.ComputeWeightMatrixParameters>} params - 分析参数数组
  20242. * @returns {string} 转化后的JSON字符串。
  20243. */
  20244. }, {
  20245. key: "getJson",
  20246. value: function getJson(isAnalyzeById, params) {
  20247. var jsonString = "[",
  20248. len = params ? params.length : 0;
  20249. if (isAnalyzeById === false) {
  20250. for (var i = 0; i < len; i++) {
  20251. if (i > 0) {
  20252. jsonString += ",";
  20253. }
  20254. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  20255. }
  20256. } else if (isAnalyzeById === true) {
  20257. for (var _i = 0; _i < len; _i++) {
  20258. if (_i > 0) {
  20259. jsonString += ",";
  20260. }
  20261. jsonString += params[_i];
  20262. }
  20263. }
  20264. jsonString += ']';
  20265. return jsonString;
  20266. }
  20267. }]);
  20268. return ComputeWeightMatrixService;
  20269. }(NetworkAnalystServiceBase);
  20270. SuperMap.ComputeWeightMatrixService = ComputeWeightMatrixService;
  20271. ;// CONCATENATED MODULE: ./src/common/iServer/DataFlowService.js
  20272. function DataFlowService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DataFlowService_typeof = function _typeof(obj) { return typeof obj; }; } else { DataFlowService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DataFlowService_typeof(obj); }
  20273. function DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20274. 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); } }
  20275. function DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataFlowService_defineProperties(Constructor, staticProps); return Constructor; }
  20276. function DataFlowService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DataFlowService_setPrototypeOf(subClass, superClass); }
  20277. function DataFlowService_setPrototypeOf(o, p) { DataFlowService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DataFlowService_setPrototypeOf(o, p); }
  20278. 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); }; }
  20279. function DataFlowService_possibleConstructorReturn(self, call) { if (call && (DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } return DataFlowService_assertThisInitialized(self); }
  20280. function DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20281. function DataFlowService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  20282. function DataFlowService_getPrototypeOf(o) { DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataFlowService_getPrototypeOf(o); }
  20283. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20284. * This program are made available under the terms of the Apache License, Version 2.0
  20285. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20286. /**
  20287. * @class SuperMap.DataFlowService
  20288. * @category iServer DataFlow
  20289. * @classdesc 数据流服务类
  20290. * @extends {SuperMap.CommonServiceBase}
  20291. * @param {string} url - 数据流服务地址
  20292. * @param {Object} options - 参数。
  20293. * @param {function} options.style - 设置数据加载样式。
  20294. * @param {function} [options.onEachFeature] - 设置每个数据加载popup等。
  20295. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  20296. * @param {Object} [options.excludeField] - -排除字段。
  20297. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20298. * @param {Object} [options.headers] - 请求头。
  20299. */
  20300. var DataFlowService_DataFlowService = /*#__PURE__*/function (_CommonServiceBase) {
  20301. DataFlowService_inherits(DataFlowService, _CommonServiceBase);
  20302. var _super = DataFlowService_createSuper(DataFlowService);
  20303. function DataFlowService(url, options) {
  20304. var _this;
  20305. DataFlowService_classCallCheck(this, DataFlowService);
  20306. options = options || {};
  20307. /*
  20308. * @constant EVENT_TYPES
  20309. * {Array.<string>}
  20310. * 此类支持的事件类型
  20311. */
  20312. options.EVENT_TYPES = ["broadcastSocketConnected", "broadcastSocketError", "broadcastFailed", "broadcastSucceeded", "subscribeSocketConnected", "subscribeSocketError", "messageSucceeded", "setFilterParamSucceeded"];
  20313. _this = _super.call(this, url, options);
  20314. /**
  20315. * @member {GeoJSONObject} SuperMap.DataFlowService.prototype.geometry
  20316. * @description 指定几何范围,该范围内的要素才能被订阅。
  20317. */
  20318. _this.geometry = null;
  20319. /**
  20320. * @member {Object} SuperMap.DataFlowService.prototype.prjCoordSys
  20321. * @description 动态投影参数
  20322. */
  20323. _this.prjCoordSys = null;
  20324. /**
  20325. * @member {Object} SuperMap.DataFlowService.prototype.excludeField
  20326. * @description 排除字段
  20327. */
  20328. _this.excludeField = null;
  20329. Util.extend(DataFlowService_assertThisInitialized(_this), options);
  20330. _this.CLASS_NAME = "SuperMap.DataFlowService";
  20331. return _this;
  20332. }
  20333. /**
  20334. * @function SuperMap.DataFlowService.prototype.initBroadcast
  20335. * @description 初始化广播
  20336. * @returns {SuperMap.DataFlowService}
  20337. */
  20338. DataFlowService_createClass(DataFlowService, [{
  20339. key: "initBroadcast",
  20340. value: function initBroadcast() {
  20341. var me = this;
  20342. this.broadcastWebSocket = this._connect(Util.urlPathAppend(me.url, 'broadcast'));
  20343. this.broadcastWebSocket.onopen = function (e) {
  20344. me.broadcastWebSocket.isOpen = true;
  20345. e.eventType = 'broadcastSocketConnected';
  20346. me.events.triggerEvent('broadcastSocketConnected', e);
  20347. };
  20348. this.broadcastWebSocket.onclose = function (e) {
  20349. me.broadcastWebSocket.isOpen = false;
  20350. e.eventType = 'broadcastSocketConnected';
  20351. me.events.triggerEvent('broadcastSocketConnected', e);
  20352. };
  20353. this.broadcastWebSocket.onerror = function (e) {
  20354. e.eventType = 'broadcastSocketError';
  20355. me.events.triggerEvent('broadcastSocketError', e);
  20356. };
  20357. return this;
  20358. }
  20359. /**
  20360. * @function SuperMap.DataFlowService.prototype.broadcast
  20361. * @description 加载广播数据。
  20362. * @param {GeoJSONObject} geoJSONFeature - JSON 格式的要素数据。
  20363. */
  20364. }, {
  20365. key: "broadcast",
  20366. value: function broadcast(geoJSONFeature) {
  20367. if (!this.broadcastWebSocket || !this.broadcastWebSocket.isOpen) {
  20368. this.events.triggerEvent('broadcastFailed');
  20369. return;
  20370. }
  20371. this.broadcastWebSocket.send(JSON.stringify(geoJSONFeature));
  20372. this.events.triggerEvent('broadcastSucceeded');
  20373. }
  20374. /**
  20375. * @function SuperMap.DataFlowService.prototype.initSubscribe
  20376. * @description 初始化订阅数据
  20377. * @returns {this} this
  20378. */
  20379. }, {
  20380. key: "initSubscribe",
  20381. value: function initSubscribe() {
  20382. var me = this;
  20383. this.subscribeWebSocket = this._connect(Util.urlPathAppend(me.url, 'subscribe'));
  20384. this.subscribeWebSocket.onopen = function (e) {
  20385. me.subscribeWebSocket.send(me._getFilterParams());
  20386. e.eventType = 'subscribeSocketConnected';
  20387. me.events.triggerEvent('subscribeSocketConnected', e);
  20388. };
  20389. this.subscribeWebSocket.onerror = function (e) {
  20390. e.eventType = 'subscribeSocketError';
  20391. me.events.triggerEvent('subscribeSocketError', e);
  20392. };
  20393. this.subscribeWebSocket.onmessage = function (e) {
  20394. me._onMessage(e);
  20395. };
  20396. return this;
  20397. }
  20398. /**
  20399. * @function SuperMap.DataFlowService.prototype.setExcludeField
  20400. * @description 设置排除字段
  20401. * @param {Object} excludeField - 排除字段
  20402. * @returns {this} this
  20403. */
  20404. }, {
  20405. key: "setExcludeField",
  20406. value: function setExcludeField(excludeField) {
  20407. this.excludeField = excludeField;
  20408. this.subscribeWebSocket.send(this._getFilterParams());
  20409. return this;
  20410. }
  20411. /**
  20412. * @function SuperMap.DataFlowService.prototype.setGeometry
  20413. * @description 设置添加的几何要素数据
  20414. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  20415. * @returns {this} this
  20416. */
  20417. }, {
  20418. key: "setGeometry",
  20419. value: function setGeometry(geometry) {
  20420. this.geometry = geometry;
  20421. this.subscribeWebSocket.send(this._getFilterParams());
  20422. return this;
  20423. }
  20424. /**
  20425. * @function SuperMap.DataFlowService.prototype.unSubscribe
  20426. * @description 结束订阅数据
  20427. */
  20428. }, {
  20429. key: "unSubscribe",
  20430. value: function unSubscribe() {
  20431. if (!this.subscribeWebSocket) {
  20432. return;
  20433. }
  20434. this.subscribeWebSocket.close();
  20435. this.subscribeWebSocket = null;
  20436. }
  20437. /**
  20438. * @function SuperMap.DataFlowService.prototype.unBroadcast
  20439. * @description 结束加载广播
  20440. */
  20441. }, {
  20442. key: "unBroadcast",
  20443. value: function unBroadcast() {
  20444. if (!this.broadcastWebSocket) {
  20445. return;
  20446. }
  20447. this.broadcastWebSocket.close();
  20448. this.broadcastWebSocket = null;
  20449. }
  20450. /**
  20451. * @function SuperMap.DataFlowService.prototype.destroy
  20452. * @override
  20453. */
  20454. }, {
  20455. key: "destroy",
  20456. value: function destroy() {
  20457. CommonServiceBase.prototype.destroy.apply(this, arguments);
  20458. var me = this;
  20459. me.geometry = null;
  20460. me.prjCoordSys = null;
  20461. me.excludeField = null;
  20462. this.unBroadcast();
  20463. this.unSubscribe();
  20464. }
  20465. }, {
  20466. key: "_getFilterParams",
  20467. value: function _getFilterParams() {
  20468. var filter = {
  20469. filterParam: {
  20470. prjCoordSys: this.prjCoordSys,
  20471. excludeField: this.excludeField,
  20472. geometry: this.geometry
  20473. }
  20474. };
  20475. return Util.toJSON(filter);
  20476. }
  20477. }, {
  20478. key: "_onMessage",
  20479. value: function _onMessage(e) {
  20480. if (e.data && e.data.indexOf("filterParam") >= 0) {
  20481. var filterParam = JSON.parse(e.data);
  20482. e.filterParam = filterParam;
  20483. e.eventType = 'setFilterParamSucceeded';
  20484. this.events.triggerEvent('setFilterParamSucceeded', e);
  20485. return;
  20486. }
  20487. var feature = JSON.parse(e.data);
  20488. e.featureResult = feature;
  20489. e.eventType = 'messageSucceeded';
  20490. this.events.triggerEvent('messageSucceeded', e);
  20491. }
  20492. }, {
  20493. key: "_connect",
  20494. value: function _connect(url) {
  20495. url = this._appendCredentials(url);
  20496. if ("WebSocket" in window) {
  20497. return new WebSocket(url);
  20498. } else if ("MozWebSocket" in window) {
  20499. var mozWebSocket = window.MozWebSocket;
  20500. return new mozWebSocket(url);
  20501. } else {
  20502. console.log("no WebSocket");
  20503. return null;
  20504. }
  20505. }
  20506. }, {
  20507. key: "_appendCredentials",
  20508. value: function _appendCredentials(url) {
  20509. var token = SecurityManager.getToken(url);
  20510. if (token) {
  20511. url = Util.urlAppend(url, "token=" + token);
  20512. }
  20513. return url;
  20514. }
  20515. }]);
  20516. return DataFlowService;
  20517. }(CommonServiceBase);
  20518. SuperMap.DataFlowService = DataFlowService_DataFlowService;
  20519. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetInfo.js
  20520. function DatasetInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20521. 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); } }
  20522. function DatasetInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetInfo_defineProperties(Constructor, staticProps); return Constructor; }
  20523. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20524. * This program are made available under the terms of the Apache License, Version 2.0
  20525. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20526. /**
  20527. * @class SuperMap.DatasetInfo
  20528. * @category iServer Data
  20529. * @classdesc 数据集信息类。
  20530. * @description 数据集一般为存储在一起的相关数据的集合;根据数据类型的不同,分为矢量数据集、栅格数据集(griddataset)和
  20531. * 影像数据集(image dataset),以及为了处理特定问题而设计的数据集,如拓扑数据集,网络数据集等。
  20532. * 数据集是 GIS 数据组织的最小单位。其中矢量数据集是由同种类型空间要素组成的集合,
  20533. * 所以也可以称为要素集。根据要素的空间特征的不同,矢量数据集又分为点数据集,
  20534. * 线数据集,面数据集等,各矢量数据集是空间特征和性质相同的数据组织起来的集合。
  20535. * 目前版本支持的数据集主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、
  20536. * 网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  20537. * @param {Object} options - 参数。
  20538. * @param {SuperMap.Bounds} [options.bounds] - 数据集范围,该字段只读。
  20539. * @param {string} [options.dataSourceName] - 数据源名称,该字段只读。
  20540. * @param {string} [options.description] - 数据集的描述信息。
  20541. * @param {string} [options.encodeType] - 数据集存储时的压缩编码方式,该字段只读。
  20542. * @param {boolean} [options.isReadOnly] - 数据集是否为只读。
  20543. * @param {string} options.name - 数据集名称,该字段必须且只读。
  20544. * @param {SuperMap.Projection} [options.prjCoordSys] - 数据集的投影信息。
  20545. * @param {string} [options.tableName] - 表名,该字段只读。
  20546. * @param {string} options.type - 数据集类型。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  20547. */
  20548. var DatasetInfo = /*#__PURE__*/function () {
  20549. function DatasetInfo(options) {
  20550. DatasetInfo_classCallCheck(this, DatasetInfo);
  20551. options = options || {};
  20552. /**
  20553. * @member {SuperMap.Bounds} [SuperMap.DatasetInfo.prototype.bounds]
  20554. * @description 数据集范围,该字段只读。
  20555. */
  20556. this.bounds = null;
  20557. /**
  20558. * @member {string} [SuperMap.DatasetInfo.prototype.dataSourceName]
  20559. * @description 数据源名称,该字段只读。
  20560. */
  20561. this.dataSourceName = null;
  20562. /**
  20563. * @member {string} [SuperMap.DatasetInfo.prototype.description]
  20564. * @description 数据集的描述信息。
  20565. */
  20566. this.description = null;
  20567. /**
  20568. * @member {string} [SuperMap.DatasetInfo.prototype.encodeType]
  20569. * @description 数据集存储时的压缩编码方式,该字段只读。
  20570. */
  20571. this.encodeType = null;
  20572. /**
  20573. * @member {boolean} [SuperMap.DatasetInfo.prototype.isReadOnly]
  20574. * @description 数据集是否为只读。
  20575. */
  20576. this.isReadOnly = null;
  20577. /**
  20578. * @member {string} SuperMap.DatasetInfo.prototype.name
  20579. * @description 数据集名称,该字段必须且只读。
  20580. */
  20581. this.name = null;
  20582. /**
  20583. * @member {SuperMap.Projection} [SuperMap.DatasetInfo.prototype.prjCoordSys]
  20584. * @description 数据集的投影信息。
  20585. */
  20586. this.prjCoordSys = null;
  20587. /**
  20588. * @member {string} [SuperMap.DatasetInfo.prototype.tableName]
  20589. * @description 表名,该字段只读。
  20590. */
  20591. this.tableName = null;
  20592. /**
  20593. * @member {string} SuperMap.DatasetInfo.prototype.type
  20594. * @description 数据集类型,该字段必设。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  20595. */
  20596. this.type = null;
  20597. Util.extend(this, options);
  20598. var b = this.bounds;
  20599. if (b) {
  20600. this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  20601. }
  20602. this.CLASS_NAME = "SuperMap.DatasetInfo";
  20603. }
  20604. /**
  20605. * @function SuperMap.DatasetInfo.prototype.destroy
  20606. * @description 释放资源,将引用资源的属性置空。
  20607. */
  20608. DatasetInfo_createClass(DatasetInfo, [{
  20609. key: "destroy",
  20610. value: function destroy() {
  20611. Util.reset(this);
  20612. }
  20613. /**
  20614. * @function SuperMap.DatasetInfo.prototype.toServerJSONObject
  20615. * @description 转换成对应的 JSON 格式对象。
  20616. * @returns {Object} JSON 对象。
  20617. */
  20618. }, {
  20619. key: "toServerJSONObject",
  20620. value: function toServerJSONObject() {
  20621. var dataObj = {};
  20622. dataObj = Util.copyAttributes(dataObj, this);
  20623. if (dataObj.bounds) {
  20624. if (dataObj.bounds.toServerJSONObject) {
  20625. dataObj.bounds = dataObj.bounds.toServerJSONObject();
  20626. }
  20627. }
  20628. return dataObj;
  20629. }
  20630. }]);
  20631. return DatasetInfo;
  20632. }();
  20633. SuperMap.DatasetInfo = DatasetInfo;
  20634. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystParameters.js
  20635. function OverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20636. 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); } }
  20637. function OverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20638. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20639. * This program are made available under the terms of the Apache License, Version 2.0
  20640. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20641. /**
  20642. * @class SuperMap.OverlayAnalystParameters
  20643. * @category iServer SpatialAnalyst OverlayAnalyst
  20644. * @classdesc 叠加分析参数基类。数据集叠加分析参数和几何对象叠加分析参数均继承此基类。
  20645. * @param {Object} options - 参数。
  20646. */
  20647. var OverlayAnalystParameters = /*#__PURE__*/function () {
  20648. function OverlayAnalystParameters(options) {
  20649. OverlayAnalystParameters_classCallCheck(this, OverlayAnalystParameters);
  20650. /**
  20651. * @member {SuperMap.OverlayOperationType} [SuperMap.OverlayAnalystParameters.prototype.operation=SuperMap.OverlayOperationType.UNION]
  20652. * @description 指定叠加分析操作类型。
  20653. */
  20654. this.operation = OverlayOperationType.UNION;
  20655. if (options) {
  20656. Util.extend(this, options);
  20657. }
  20658. this.CLASS_NAME = "SuperMap.OverlayAnalystParameters";
  20659. }
  20660. /**
  20661. * @function SuperMap.OverlayAnalystParameters.prototype.destroy
  20662. * @description 释放资源,将引用资源的属性置空。
  20663. */
  20664. OverlayAnalystParameters_createClass(OverlayAnalystParameters, [{
  20665. key: "destroy",
  20666. value: function destroy() {
  20667. var me = this;
  20668. me.operation = null;
  20669. }
  20670. }]);
  20671. return OverlayAnalystParameters;
  20672. }();
  20673. SuperMap.OverlayAnalystParameters = OverlayAnalystParameters;
  20674. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetOverlayAnalystParameters.js
  20675. function DatasetOverlayAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DatasetOverlayAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { DatasetOverlayAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DatasetOverlayAnalystParameters_typeof(obj); }
  20676. function DatasetOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20677. 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); } }
  20678. function DatasetOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetOverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20679. function DatasetOverlayAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetOverlayAnalystParameters_get = Reflect.get; } else { DatasetOverlayAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetOverlayAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return DatasetOverlayAnalystParameters_get(target, property, receiver || target); }
  20680. function DatasetOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  20681. function DatasetOverlayAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DatasetOverlayAnalystParameters_setPrototypeOf(subClass, superClass); }
  20682. function DatasetOverlayAnalystParameters_setPrototypeOf(o, p) { DatasetOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetOverlayAnalystParameters_setPrototypeOf(o, p); }
  20683. 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); }; }
  20684. function DatasetOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetOverlayAnalystParameters_assertThisInitialized(self); }
  20685. function DatasetOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20686. function DatasetOverlayAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  20687. function DatasetOverlayAnalystParameters_getPrototypeOf(o) { DatasetOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetOverlayAnalystParameters_getPrototypeOf(o); }
  20688. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20689. * This program are made available under the terms of the Apache License, Version 2.0
  20690. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20691. /**
  20692. * @class SuperMap.DatasetOverlayAnalystParameters
  20693. * @category iServer SpatialAnalyst OverlayAnalyst
  20694. * @classdesc 数据集叠加分析参数类。
  20695. * @param {Object} options - 参数。
  20696. * @param {string} options.operateDataset - 叠加分析中操作数据集的名称。
  20697. * @param {string} options.sourceDataset - 叠加分析中源数据集的名称。
  20698. * @param {Array.<string>} [options.operateDatasetFields] - 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  20699. * @param {SuperMap.FilterParameter} [options.operateDatasetFilter] - 设置操作数据集中空间对象过滤条件。
  20700. * @param {Array.<SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon>} [options.operateRegions] - 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  20701. * @param {Array.<string>} [options.sourceDatasetFields] - 叠加分析中源数据集保留在结果数据集中的字段名列表。
  20702. * @param {SuperMap.FilterParameter} [options.sourceDatasetFilter] - 设置源数据集中空间对象过滤条件。
  20703. * @param {number} [options.tolerance=0] - 容限。
  20704. * @param {SuperMap.OverlayOperationType} options.operation - 叠加操作枚举值。
  20705. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  20706. * @extends {SuperMap.GetFeaturesParametersBase}
  20707. */
  20708. var DatasetOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  20709. DatasetOverlayAnalystParameters_inherits(DatasetOverlayAnalystParameters, _OverlayAnalystParame);
  20710. var _super = DatasetOverlayAnalystParameters_createSuper(DatasetOverlayAnalystParameters);
  20711. function DatasetOverlayAnalystParameters(options) {
  20712. var _this;
  20713. DatasetOverlayAnalystParameters_classCallCheck(this, DatasetOverlayAnalystParameters);
  20714. _this = _super.call(this, options);
  20715. /**
  20716. * @member {string} SuperMap.DatasetOverlayAnalystParameters.prototype.operateDataset
  20717. * @description 叠加分析中操作数据集的名称。
  20718. */
  20719. _this.operateDataset = null;
  20720. /**
  20721. * @member {Array.<string>} [SuperMap.DatasetOverlayAnalystParameters.prototype.operateDatasetFields]
  20722. * @description 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  20723. */
  20724. _this.operateDatasetFields = [];
  20725. /**
  20726. * @member {SuperMap.FilterParameter} SuperMap.DatasetOverlayAnalystParameters.prototype.operateDatasetFilter
  20727. * @description 设置操作数据集中空间对象过滤条件。
  20728. */
  20729. _this.operateDatasetFilter = new FilterParameter();
  20730. /**
  20731. * @member {Array.<SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon>} [SuperMap.DatasetOverlayAnalystParameters.prototype.operateRegions]
  20732. * @description 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  20733. */
  20734. _this.operateRegions = [];
  20735. /**
  20736. * @member {string} SuperMap.DatasetOverlayAnalystParameters.prototype.sourceDataset
  20737. * @description 叠加分析中源数据集的名称。
  20738. */
  20739. _this.sourceDataset = null;
  20740. /**
  20741. * @member {Array.<string>} [SuperMap.DatasetOverlayAnalystParameters.prototype.sourceDatasetFields]
  20742. * @description 叠加分析中源数据集保留在结果数据集中的字段名列表。
  20743. */
  20744. _this.sourceDatasetFields = [];
  20745. /**
  20746. * @member {SuperMap.FilterParameter} [SuperMap.DatasetOverlayAnalystParameters.prototype.filterQueryParameter]
  20747. * @description 设置源数据集中空间对象过滤条件。
  20748. */
  20749. _this.sourceDatasetFilter = new FilterParameter();
  20750. /**
  20751. * @member {number} [SuperMap.DatasetOverlayAnalystParameters.prototype.tolerance=0]
  20752. * @description 容限。
  20753. */
  20754. _this.tolerance = 0;
  20755. /**
  20756. * @member {SuperMap.DataReturnOption} [SuperMap.DatasetOverlayAnalystParameters.prototype.resultSetting]
  20757. * @description 结果返回设置类。
  20758. */
  20759. _this.resultSetting = new DataReturnOption();
  20760. Util.extend(DatasetOverlayAnalystParameters_assertThisInitialized(_this), options);
  20761. _this.CLASS_NAME = "SuperMap.DatasetOverlayAnalystParameters";
  20762. return _this;
  20763. }
  20764. /**
  20765. * @function SuperMap.DatasetOverlayAnalystParameters.prototype.destroy
  20766. * @override
  20767. */
  20768. DatasetOverlayAnalystParameters_createClass(DatasetOverlayAnalystParameters, [{
  20769. key: "destroy",
  20770. value: function destroy() {
  20771. DatasetOverlayAnalystParameters_get(DatasetOverlayAnalystParameters_getPrototypeOf(DatasetOverlayAnalystParameters.prototype), "destroy", this).call(this);
  20772. var me = this;
  20773. me.operateDataset = null;
  20774. me.operateDatasetFields = null;
  20775. if (me.operateDatasetFilter) {
  20776. me.operateDatasetFilter.destroy();
  20777. me.operateDatasetFilter = null;
  20778. }
  20779. if (me.operateRegions) {
  20780. for (var i = 0, opRegions = me.operateRegions, len = opRegions.length; i < len; i++) {
  20781. opRegions[i].destroy();
  20782. }
  20783. me.operateRegions = null;
  20784. }
  20785. me.sourceDataset = null;
  20786. me.sourceDatasetFields = null;
  20787. if (me.sourceDatasetFilter) {
  20788. me.sourceDatasetFilter.destroy();
  20789. me.sourceDatasetFilter = null;
  20790. }
  20791. me.tolerance = null;
  20792. if (me.resultSetting) {
  20793. me.resultSetting.destroy();
  20794. me.resultSetting = null;
  20795. }
  20796. }
  20797. /**
  20798. * @function SuperMap.DatasetOverlayAnalystParameters.toObject
  20799. * @param {SuperMap.DatasetOverlayAnalystParameters} datasetOverlayAnalystParameters - 数据集叠加分析参数类。
  20800. * @param {SuperMap.DatasetOverlayAnalystParameters} tempObj - 数据集叠加分析参数对象。
  20801. * @description 将数据集叠加分析参数类转换为 JSON 对象。
  20802. * @returns {Object} JSON 对象。
  20803. */
  20804. }], [{
  20805. key: "toObject",
  20806. value: function toObject(datasetOverlayAnalystParameters, tempObj) {
  20807. for (var name in datasetOverlayAnalystParameters) {
  20808. if (name === "sourceDataset") {
  20809. continue;
  20810. } else if (name === "operateRegions") {
  20811. tempObj.operateRegions = [];
  20812. var ors = datasetOverlayAnalystParameters.operateRegions;
  20813. for (var index in ors) {
  20814. if (ors.hasOwnProperty(index)) {
  20815. //icl542
  20816. tempObj.operateRegions[index] = ServerGeometry.fromGeometry(ors[index]);
  20817. }
  20818. }
  20819. } else if (name === "resultSetting") {
  20820. tempObj.dataReturnOption = datasetOverlayAnalystParameters.resultSetting;
  20821. } else {
  20822. tempObj[name] = datasetOverlayAnalystParameters[name];
  20823. }
  20824. }
  20825. }
  20826. }]);
  20827. return DatasetOverlayAnalystParameters;
  20828. }(OverlayAnalystParameters);
  20829. SuperMap.DatasetOverlayAnalystParameters = DatasetOverlayAnalystParameters;
  20830. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParametersSetting.js
  20831. function SurfaceAnalystParametersSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20832. 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); } }
  20833. function SurfaceAnalystParametersSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParametersSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParametersSetting_defineProperties(Constructor, staticProps); return Constructor; }
  20834. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20835. * This program are made available under the terms of the Apache License, Version 2.0
  20836. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20837. /**
  20838. * @class SuperMap.SurfaceAnalystParametersSetting
  20839. * @category iServer SpatialAnalyst SurfaceAnalyst
  20840. * @classdesc 表面分析参数设置类。
  20841. * 通过该类可以设置表面分析提取等值线、提取等值面的一些参数,包括基准值、等值距、光滑度、光滑方法等。
  20842. * @param {Object} options - 参数。
  20843. * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.clipRegion] - 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  20844. * @param {number} [options.datumValue=0] - 获取或设置表面分析中提取等值线、提取等值面的基准值。
  20845. * @param {Array.<number>} options.expectedZValues - 获取或设置期望分析结果的 Z 值集合。
  20846. * @param {number} [options.interval=0] - 获取或设置等值距。等值距是两条等值线之间的间隔值。
  20847. * @param {number} [options.resampleTolerance=0] - 获取或设置重采样容限。
  20848. * @param {SuperMap.SmoothMethod} [options.smoothMethod=SuperMap.SmoothMethod.BSPLINE] - 获取或设置光滑处理所使用的方法。
  20849. * @param {number} [options.smoothness=0] - 获取或设置表面分析中等值线或等值面的边界线的光滑度。
  20850. */
  20851. var SurfaceAnalystParametersSetting = /*#__PURE__*/function () {
  20852. function SurfaceAnalystParametersSetting(options) {
  20853. SurfaceAnalystParametersSetting_classCallCheck(this, SurfaceAnalystParametersSetting);
  20854. /**
  20855. * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.SurfaceAnalystParametersSetting.prototype.clipRegion]
  20856. * @description 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  20857. */
  20858. this.clipRegion = null;
  20859. /**
  20860. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.datumValue=0]
  20861. * @description 获取或设置表面分析中提取等值线、提取等值面的基准值。
  20862. * 基准值是作为一个生成等值线的初始起算值,并不一定是最小等值线的值。 例如,高程范围为 220 -1550 的 DEM 栅格数据,
  20863. * 如果设基准值为 0, 等值距为 50,则提取等值线时,以基准值 0 为起点,等值距 50 为间隔提取等值线,
  20864. * 因为给定高程的最小值是 220,所以,在给定范围内提取等值线的最小高程是 250。
  20865. * 提取等值线的结果是:最小等值线值为 250,最大等值线值为 1550。
  20866. */
  20867. this.datumValue = 0;
  20868. /**
  20869. * @member {Array.<number>} SuperMap.SurfaceAnalystParametersSetting.prototype.expectedZValues
  20870. * @description 获取或设置期望分析结果的 Z 值集合。
  20871. * Z 值集合存储一系列数值,该数值为待提取等值线的值。即仅高程值在 Z 值集合中的等值线会被提取。
  20872. */
  20873. this.expectedZValues = null;
  20874. /**
  20875. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.interval=0]
  20876. * @description 获取或设置等值距。等值距是两条等值线之间的间隔值。
  20877. */
  20878. this.interval = 0;
  20879. /**
  20880. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.resampleTolerance=0]
  20881. * @description 获取或设置重采样容限。
  20882. * 容限值越大,采样结果数据越简化。当分析结果出现交叉时,可通过调整重采样容限为较小的值来处理。
  20883. */
  20884. this.resampleTolerance = 0;
  20885. /**
  20886. * @member {SuperMap.SmoothMethod} [SuperMap.SurfaceAnalystParametersSetting.prototype.smoothMethod=SuperMap.SmoothMethod.BSPLINE]
  20887. * @description 获取或设置光滑处理所使用的方法。
  20888. */
  20889. this.smoothMethod = SmoothMethod.BSPLINE;
  20890. /**
  20891. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.smoothness=0]
  20892. * @description 获取或设置表面分析中等值线或等值面的边界线的光滑度。
  20893. * 以为 0-5 为例,光滑度为 0 表示不进行光滑操作,值越大表示光滑度越高。
  20894. * 随着光滑度的增加,提取的等值线越光滑.当然光滑度越大,
  20895. * 计算所需的时间和占用的内存也就越大。而且,当等值距较小时,
  20896. * 光滑度太高会出现等值线相交的问题。
  20897. */
  20898. this.smoothness = 0;
  20899. if (options) {
  20900. Util.extend(this, options);
  20901. }
  20902. this.CLASS_NAME = "SuperMap.SurfaceAnalystParametersSetting";
  20903. }
  20904. /**
  20905. * @function SuperMap.SurfaceAnalystParametersSetting.prototype.destroy
  20906. * @description 释放资源,将引用资源的属性置空。
  20907. */
  20908. SurfaceAnalystParametersSetting_createClass(SurfaceAnalystParametersSetting, [{
  20909. key: "destroy",
  20910. value: function destroy() {
  20911. var me = this;
  20912. if (me.clipRegion) {
  20913. me.clipRegion.destroy();
  20914. me.clipRegion = null;
  20915. }
  20916. me.datumValue = null;
  20917. me.expectedZValues = null;
  20918. me.interval = null;
  20919. me.resampleTolerance = null;
  20920. me.smoothMethod = null;
  20921. me.smoothness = null;
  20922. }
  20923. /**
  20924. * @function SuperMap.SurfaceAnalystParametersSetting.prototype.toJSON
  20925. * @description 将对象转化为 JSON 字符串。
  20926. * @returns {string} 对象 JSON 字符串。
  20927. */
  20928. }, {
  20929. key: "toJSON",
  20930. value: function toJSON() {
  20931. var json = "'datumValue':" + Util.toJSON(this.datumValue);
  20932. json += ",'interval':" + Util.toJSON(this.interval);
  20933. json += ",'resampleTolerance':" + Util.toJSON(this.resampleTolerance);
  20934. json += ",'smoothMethod':" + Util.toJSON(this.smoothMethod);
  20935. json += ",'smoothness':" + Util.toJSON(this.smoothness);
  20936. if (this.expectedZValues != null) {
  20937. json += "," + "'expectedZValues':" + Util.toJSON(this.expectedZValues);
  20938. }
  20939. if (this.clipRegion != null) {
  20940. var serverGeometry = this.clipRegion;
  20941. if (this.clipRegion instanceof Geometry && this.clipRegion.components) {
  20942. serverGeometry = ServerGeometry.fromGeometry(this.clipRegion);
  20943. }
  20944. json += ",'clipRegion':" + Util.toJSON(serverGeometry);
  20945. }
  20946. return "{" + json + "}";
  20947. }
  20948. }]);
  20949. return SurfaceAnalystParametersSetting;
  20950. }();
  20951. SuperMap.SurfaceAnalystParametersSetting = SurfaceAnalystParametersSetting;
  20952. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParameters.js
  20953. function SurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20954. 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); } }
  20955. function SurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20956. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20957. * This program are made available under the terms of the Apache License, Version 2.0
  20958. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20959. /**
  20960. * @class SuperMap.SurfaceAnalystParameters
  20961. * @category iServer SpatialAnalyst SurfaceAnalyst
  20962. * @classdesc 表面分析提取操作参数类。
  20963. * @description 通过该类可以为进行表面分析提供参数信息,包括表面分析的方法提取等值线、提取等值面和中间结果的分辨率,
  20964. * {@link SuperMap.DatasetSurfaceAnalystParameters} 和 {@link SuperMap.GeometrySurfaceAnalystParameters} 继承自该类。
  20965. * @param {Object} options - 参数。
  20966. * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
  20967. * @param {number} options.resolution - 指定中间结果(栅格数据集)的分辨率。
  20968. * @param {SuperMap.DataReturnOption} options.resultSetting - 结果返回设置类。
  20969. * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  20970. */
  20971. var SurfaceAnalystParameters = /*#__PURE__*/function () {
  20972. function SurfaceAnalystParameters(options) {
  20973. SurfaceAnalystParameters_classCallCheck(this, SurfaceAnalystParameters);
  20974. /**
  20975. * @member {number} SuperMap.SurfaceAnalystParameters.prototype.resolution
  20976. * @description 获取或设置指定中间结果(栅格数据集)的分辨率。
  20977. */
  20978. this.resolution = 0;
  20979. /**
  20980. * @member {SuperMap.SurfaceAnalystParametersSetting} SuperMap.SurfaceAnalystParameters.prototype.extractParameter
  20981. * @description 获取或设置表面分析参数。
  20982. * 在进行点数据集进行提取等值面分析时,暂时不支持 SurfaceAnalystParametersSetting 类中的 expectedZValues 字段。
  20983. */
  20984. this.extractParameter = new SurfaceAnalystParametersSetting();
  20985. /**
  20986. * @member {SuperMap.DataReturnOption} SuperMap.SurfaceAnalystParameters.prototype.resultSetting
  20987. * @description 结果返回设置类。
  20988. */
  20989. this.resultSetting = new DataReturnOption();
  20990. /**
  20991. * @member {SuperMap.SurfaceAnalystMethod} [SuperMap.SurfaceAnalystParameters.prototype.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE]
  20992. * @description 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  20993. */
  20994. this.surfaceAnalystMethod = SurfaceAnalystMethod.ISOLINE;
  20995. if (options) {
  20996. Util.extend(this, options);
  20997. }
  20998. this.CLASS_NAME = "SuperMap.SurfaceAnalystParameters";
  20999. }
  21000. /**
  21001. * @function SuperMap.SurfaceAnalystParameters.prototype.destroy
  21002. * @description 释放资源,将引用资源的属性置空。
  21003. */
  21004. SurfaceAnalystParameters_createClass(SurfaceAnalystParameters, [{
  21005. key: "destroy",
  21006. value: function destroy() {
  21007. var me = this;
  21008. me.resolution = null;
  21009. if (me.extractParameter) {
  21010. me.extractParameter.destroy();
  21011. me.extractParameter = null;
  21012. }
  21013. if (me.resultSetting) {
  21014. me.resultSetting.destroy();
  21015. me.resultSetting = null;
  21016. }
  21017. me.surfaceAnalystMethod = null;
  21018. }
  21019. }]);
  21020. return SurfaceAnalystParameters;
  21021. }();
  21022. SuperMap.SurfaceAnalystParameters = SurfaceAnalystParameters;
  21023. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetSurfaceAnalystParameters.js
  21024. function DatasetSurfaceAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DatasetSurfaceAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { DatasetSurfaceAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DatasetSurfaceAnalystParameters_typeof(obj); }
  21025. function DatasetSurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21026. 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); } }
  21027. function DatasetSurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21028. function DatasetSurfaceAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetSurfaceAnalystParameters_get = Reflect.get; } else { DatasetSurfaceAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetSurfaceAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return DatasetSurfaceAnalystParameters_get(target, property, receiver || target); }
  21029. function DatasetSurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetSurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  21030. function DatasetSurfaceAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DatasetSurfaceAnalystParameters_setPrototypeOf(subClass, superClass); }
  21031. function DatasetSurfaceAnalystParameters_setPrototypeOf(o, p) { DatasetSurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetSurfaceAnalystParameters_setPrototypeOf(o, p); }
  21032. 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); }; }
  21033. function DatasetSurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetSurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetSurfaceAnalystParameters_assertThisInitialized(self); }
  21034. function DatasetSurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21035. function DatasetSurfaceAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21036. function DatasetSurfaceAnalystParameters_getPrototypeOf(o) { DatasetSurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetSurfaceAnalystParameters_getPrototypeOf(o); }
  21037. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21038. * This program are made available under the terms of the Apache License, Version 2.0
  21039. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21040. /**
  21041. * @class SuperMap.DatasetSurfaceAnalystParameters
  21042. * @category iServer SpatialAnalyst SurfaceAnalyst
  21043. * @classdesc 数据集表面分析参数类。该类对数据集表面分析所用到的参数进行设置。
  21044. * @param {Object} options - 参数。
  21045. * @param {string} options.dataset - 要用来做数据集表面分析的数据源中数据集的名称。
  21046. * @param {string} options.zValueFieldName - 获取或设置用于提取操作的字段名称。
  21047. * @param {integer} options.resolution - 获取或设置指定中间结果(栅格数据集)的分辨率。
  21048. * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 表面分析参数设置类。获取或设置表面分析参数。
  21049. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 获取或设置查询过滤条件参数。
  21050. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  21051. * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  21052. * @extends {SuperMap.SurfaceAnalystParameters}
  21053. */
  21054. var DatasetSurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  21055. DatasetSurfaceAnalystParameters_inherits(DatasetSurfaceAnalystParameters, _SurfaceAnalystParame);
  21056. var _super = DatasetSurfaceAnalystParameters_createSuper(DatasetSurfaceAnalystParameters);
  21057. function DatasetSurfaceAnalystParameters(options) {
  21058. var _this;
  21059. DatasetSurfaceAnalystParameters_classCallCheck(this, DatasetSurfaceAnalystParameters);
  21060. _this = _super.call(this, options);
  21061. /**
  21062. * @member {string} SuperMap.DatasetSurfaceAnalystParameters.prototype.dataset
  21063. * @description 要用来做数据集表面分析的数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Country@World。
  21064. */
  21065. _this.dataset = null;
  21066. /**
  21067. * @member {SuperMap.FilterParameter} SuperMap.DatasetSurfaceAnalystParameters.prototype.filterQueryParameter
  21068. * @description 获取或设置查询过滤条件参数。
  21069. */
  21070. _this.filterQueryParameter = new FilterParameter();
  21071. /**
  21072. * @member {string} SuperMap.DatasetSurfaceAnalystParameters.prototype.zValueFieldName
  21073. * @description 获取或设置用于提取操作的字段名称。提取等值线时,将使用该字段中的值,对点记录集中的点数据进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  21074. */
  21075. _this.zValueFieldName = null;
  21076. if (options) {
  21077. Util.extend(DatasetSurfaceAnalystParameters_assertThisInitialized(_this), options);
  21078. }
  21079. _this.CLASS_NAME = "SuperMap.DatasetSurfaceAnalystParameters";
  21080. return _this;
  21081. }
  21082. /**
  21083. * @function SuperMap.DatasetSurfaceAnalystParameters.prototype.destroy
  21084. * @override
  21085. */
  21086. DatasetSurfaceAnalystParameters_createClass(DatasetSurfaceAnalystParameters, [{
  21087. key: "destroy",
  21088. value: function destroy() {
  21089. DatasetSurfaceAnalystParameters_get(DatasetSurfaceAnalystParameters_getPrototypeOf(DatasetSurfaceAnalystParameters.prototype), "destroy", this).call(this);
  21090. var me = this;
  21091. me.dataset = null;
  21092. if (me.filterQueryParameter) {
  21093. me.filterQueryParameter.destroy();
  21094. me.filterQueryParameter = null;
  21095. }
  21096. me.zValueFieldName = null;
  21097. }
  21098. /**
  21099. * @function SuperMap.DatasetSurfaceAnalystParameters.toObject
  21100. * @param {SuperMap.DatasetSurfaceAnalystParameters} datasetSurfaceAnalystParameters - 数据集表面分析参数类。
  21101. * @param {SuperMap.DatasetSurfaceAnalystParameters} tempObj - 数据集表面分析参数对象。
  21102. * @description 将数据集表面分析参数对象转换为 JSON 对象。
  21103. * @returns JSON 对象。
  21104. */
  21105. }], [{
  21106. key: "toObject",
  21107. value: function toObject(datasetSurfaceAnalystParameters, tempObj) {
  21108. for (var name in datasetSurfaceAnalystParameters) {
  21109. if (name === "filterQueryParameter") {
  21110. tempObj.filterQueryParameter = datasetSurfaceAnalystParameters.filterQueryParameter;
  21111. }
  21112. if (name === "extractParameter") {
  21113. if (datasetSurfaceAnalystParameters.extractParameter.clipRegion instanceof Geometry && datasetSurfaceAnalystParameters.extractParameter.clipRegion.components) {
  21114. datasetSurfaceAnalystParameters.extractParameter.clipRegion = ServerGeometry.fromGeometry(datasetSurfaceAnalystParameters.extractParameter.clipRegion);
  21115. }
  21116. tempObj.extractParameter = datasetSurfaceAnalystParameters.extractParameter;
  21117. } else if (name === "dataset") {
  21118. continue;
  21119. } else if (name === "surfaceAnalystMethod") {
  21120. continue;
  21121. } else {
  21122. tempObj[name] = datasetSurfaceAnalystParameters[name];
  21123. }
  21124. }
  21125. }
  21126. }]);
  21127. return DatasetSurfaceAnalystParameters;
  21128. }(SurfaceAnalystParameters);
  21129. SuperMap.DatasetSurfaceAnalystParameters = DatasetSurfaceAnalystParameters;
  21130. ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystParameters.js
  21131. function ThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21132. 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); } }
  21133. function ThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21134. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21135. * This program are made available under the terms of the Apache License, Version 2.0
  21136. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21137. /**
  21138. * @class SuperMap.ThiessenAnalystParameters
  21139. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  21140. * @classdesc 泰森多边形分析参数基类。
  21141. * @param {Object} options - 参数。
  21142. * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.clipRegion] - 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  21143. * @param {boolean} [options.createResultDataset=false] - 是否返回结果数据集。
  21144. * @param {string} [options.resultDatasetName] - 指定结果数据集名称。
  21145. * @param {string} [options.resultDatasourceName] - 指定结果数据集所在数据源,默认为当前数据源。
  21146. * @param {boolean} [options.returnResultRegion=true] - 是否返回分析得到的多边形面数组。
  21147. */
  21148. var ThiessenAnalystParameters = /*#__PURE__*/function () {
  21149. function ThiessenAnalystParameters(options) {
  21150. ThiessenAnalystParameters_classCallCheck(this, ThiessenAnalystParameters);
  21151. if (!options) {
  21152. return;
  21153. }
  21154. /**
  21155. * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.ThiessenAnalystParameters.prototype.clipRegion]
  21156. * @description 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  21157. */
  21158. this.clipRegion = null;
  21159. /**
  21160. * @member {boolean} [SuperMap.ThiessenAnalystParameters.prototype.createResultDataset=false]
  21161. * @description 是否返回结果数据集。如果为 true,则必须设置属性 resultDatasetName 和 resultDatasourceName。
  21162. */
  21163. this.createResultDataset = false;
  21164. /**
  21165. * @member {string} SuperMap.ThiessenAnalystParameters.prototype.resultDatasetName
  21166. * @description 指定结果数据集名称。
  21167. */
  21168. this.resultDatasetName = null;
  21169. /**
  21170. * @member {string} SuperMap.ThiessenAnalystParameters.prototype.resultDatasourceName
  21171. * @description 指定结果数据集所在数据源。
  21172. */
  21173. this.resultDatasourceName = null;
  21174. /**
  21175. * @member {boolean} SuperMap.ThiessenAnalystParameters.prototype.returnResultRegion
  21176. * @description 是否返回分析得到的多边形面数组。
  21177. */
  21178. this.returnResultRegion = true;
  21179. Util.extend(this, options);
  21180. this.CLASS_NAME = "SuperMap.ThiessenAnalystParameters";
  21181. }
  21182. /**
  21183. * @function SuperMap.ThiessenAnalystParameters.prototype.destroy
  21184. * @description 释放资源,将引用资源的属性置空。
  21185. */
  21186. ThiessenAnalystParameters_createClass(ThiessenAnalystParameters, [{
  21187. key: "destroy",
  21188. value: function destroy() {
  21189. var me = this;
  21190. if (me.clipRegion) {
  21191. me.clipRegion.destroy();
  21192. me.clipRegion = null;
  21193. }
  21194. me.createResultDataset = null;
  21195. me.resultDatasetName = null;
  21196. me.resultDatasourceName = null;
  21197. me.returnResultRegion = null;
  21198. }
  21199. }]);
  21200. return ThiessenAnalystParameters;
  21201. }();
  21202. SuperMap.ThiessenAnalystParameters = ThiessenAnalystParameters;
  21203. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetThiessenAnalystParameters.js
  21204. function DatasetThiessenAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DatasetThiessenAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { DatasetThiessenAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DatasetThiessenAnalystParameters_typeof(obj); }
  21205. function DatasetThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21206. 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); } }
  21207. function DatasetThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21208. function DatasetThiessenAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetThiessenAnalystParameters_get = Reflect.get; } else { DatasetThiessenAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetThiessenAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return DatasetThiessenAnalystParameters_get(target, property, receiver || target); }
  21209. function DatasetThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  21210. function DatasetThiessenAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DatasetThiessenAnalystParameters_setPrototypeOf(subClass, superClass); }
  21211. function DatasetThiessenAnalystParameters_setPrototypeOf(o, p) { DatasetThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetThiessenAnalystParameters_setPrototypeOf(o, p); }
  21212. 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); }; }
  21213. function DatasetThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetThiessenAnalystParameters_assertThisInitialized(self); }
  21214. function DatasetThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21215. function DatasetThiessenAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21216. function DatasetThiessenAnalystParameters_getPrototypeOf(o) { DatasetThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetThiessenAnalystParameters_getPrototypeOf(o); }
  21217. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21218. * This program are made available under the terms of the Apache License, Version 2.0
  21219. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21220. /**
  21221. * @class SuperMap.DatasetThiessenAnalystParameters
  21222. * @category iServer SpatialAnalyst ThiessenAnalyst
  21223. * @classdesc 数据集泰森多边形分析参数类。
  21224. * @param {Object} options - 参数。
  21225. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
  21226. * @extends {SuperMap.ThiessenAnalystParameters}
  21227. */
  21228. var DatasetThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  21229. DatasetThiessenAnalystParameters_inherits(DatasetThiessenAnalystParameters, _ThiessenAnalystParam);
  21230. var _super = DatasetThiessenAnalystParameters_createSuper(DatasetThiessenAnalystParameters);
  21231. function DatasetThiessenAnalystParameters(options) {
  21232. var _this;
  21233. DatasetThiessenAnalystParameters_classCallCheck(this, DatasetThiessenAnalystParameters);
  21234. _this = _super.call(this, options);
  21235. /**
  21236. * @member {SuperMap.FilterParameter} [SuperMap.DatasetThiessenAnalystParameters.prototype.filterQueryParameter]
  21237. * @description 过滤条件,对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
  21238. * @example
  21239. * var filterQueryParameter = new SuperMap.FilterParameter({
  21240. * name: "Countries@World",
  21241. * attributeFilter: "SmID>100"
  21242. * });
  21243. */
  21244. _this.filterQueryParameter = null;
  21245. /**
  21246. * @member {string} SuperMap.DatasetThiessenAnalystParameters.prototype.dataset
  21247. * @description 数据集名称待分析的数据集名称,请使用 "datasetName@datasourceName" 格式来表示。
  21248. */
  21249. _this.dataset = null;
  21250. if (options) {
  21251. Util.extend(DatasetThiessenAnalystParameters_assertThisInitialized(_this), options);
  21252. }
  21253. _this.CLASS_NAME = "SuperMap.DatasetThiessenAnalystParameters";
  21254. return _this;
  21255. }
  21256. /**
  21257. * @function SuperMap.DatasetThiessenAnalystParameters.prototype.destroy
  21258. * @override
  21259. */
  21260. DatasetThiessenAnalystParameters_createClass(DatasetThiessenAnalystParameters, [{
  21261. key: "destroy",
  21262. value: function destroy() {
  21263. DatasetThiessenAnalystParameters_get(DatasetThiessenAnalystParameters_getPrototypeOf(DatasetThiessenAnalystParameters.prototype), "destroy", this).call(this);
  21264. var me = this;
  21265. if (me.filterQueryParameter) {
  21266. me.filterQueryParameter.destroy();
  21267. me.filterQueryParameter = null;
  21268. }
  21269. }
  21270. /**
  21271. * @function SuperMap.DatasetThiessenAnalystParameters.toObject
  21272. * @param {SuperMap.DatasetThiessenAnalystParameters} datasetThiessenAnalystParameters - 泰森多边形分析服务参数类。
  21273. * @param {SuperMap.DatasetThiessenAnalystParameters} tempObj - 泰森多边形分析服务参数对象。
  21274. * @description 将泰森多边形分析服务参数对象转换为 JSON 对象。
  21275. * @returns JSON 对象。
  21276. */
  21277. }], [{
  21278. key: "toObject",
  21279. value: function toObject(datasetThiessenAnalystParameters, tempObj) {
  21280. for (var name in datasetThiessenAnalystParameters) {
  21281. if (name === "clipRegion") {
  21282. tempObj.clipRegion = ServerGeometry.fromGeometry(datasetThiessenAnalystParameters.clipRegion);
  21283. } else {
  21284. tempObj[name] = datasetThiessenAnalystParameters[name];
  21285. }
  21286. }
  21287. }
  21288. }]);
  21289. return DatasetThiessenAnalystParameters;
  21290. }(ThiessenAnalystParameters);
  21291. SuperMap.DatasetThiessenAnalystParameters = DatasetThiessenAnalystParameters;
  21292. ;// CONCATENATED MODULE: ./src/common/iServer/DensityKernelAnalystParameters.js
  21293. function DensityKernelAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21294. 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); } }
  21295. function DensityKernelAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityKernelAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityKernelAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21296. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21297. * This program are made available under the terms of the Apache License, Version 2.0
  21298. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21299. /**
  21300. * @class SuperMap.DensityKernelAnalystParameters
  21301. * @category iServer SpatialAnalyst DensityAnalyst
  21302. * @classdesc 核密度分析参数类。
  21303. * @param {Object} options - 参数。
  21304. * @param {string} options.dataset - 要用来做核密度分析数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:BaseMap_P@Jingjin。
  21305. * @param {string} options.fieldName - 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  21306. * @param {string} options.resultGridName - 指定结果数据集名称。
  21307. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 核密度分析的范围,用于确定结果栅格数据集的范围。如果缺省,则默认为原数据集的范围。
  21308. * @param {number} [options.searchRadius] - 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  21309. * @param {number} [options.resultGridDatasetResolution] - 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  21310. * @param {string} [options.targetDatasource] - 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  21311. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  21312. */
  21313. var DensityKernelAnalystParameters = /*#__PURE__*/function () {
  21314. function DensityKernelAnalystParameters(options) {
  21315. DensityKernelAnalystParameters_classCallCheck(this, DensityKernelAnalystParameters);
  21316. /**
  21317. * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.dataset
  21318. * @description 要用来做核密度分析数据源中数据集的名称。
  21319. * 该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Railway@Changchun。
  21320. * 注:核密度分析支持点数据集和线数据集。
  21321. */
  21322. this.dataset = null;
  21323. /**
  21324. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} [SuperMap.DensityKernelAnalystParameters.prototype.bounds]
  21325. * @description 核密度分析的范围,用于确定结果栅格数据集的范围。
  21326. * 如果缺省,则默认为原数据集的范围。
  21327. */
  21328. this.bounds = null;
  21329. /**
  21330. * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.fieldName
  21331. * @description 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  21332. */
  21333. this.fieldName = null;
  21334. /**
  21335. * @member {number} [SuperMap.DensityKernelAnalystParameters.prototype.resultGridDatasetResolution]
  21336. * @description 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  21337. */
  21338. this.resultGridDatasetResolution = null;
  21339. /**
  21340. * @member {number} [SuperMap.DensityKernelAnalystParameters.prototype.searchRadius]
  21341. * @description 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  21342. */
  21343. this.searchRadius = null;
  21344. /**
  21345. * @member {string} [SuperMap.DensityKernelAnalystParameters.prototype.targetDatasource]
  21346. * @description 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  21347. */
  21348. this.targetDatasource = null;
  21349. /**
  21350. * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.resultGridName
  21351. * @description 指定结果数据集名称。
  21352. */
  21353. this.resultGridName = null;
  21354. /**
  21355. * @member {boolean} [SuperMap.DensityKernelAnalystParameters.prototype.deleteExistResultDataset=false]
  21356. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  21357. */
  21358. this.deleteExistResultDataset = false;
  21359. Util.extend(this, options);
  21360. this.CLASS_NAME = "SuperMap.DensityKernelAnalystParameters";
  21361. }
  21362. /**
  21363. * @function SuperMap.DensityKernelAnalystParameters.prototype.destroy
  21364. * @description 释放资源,将引用资源的属性置空。
  21365. */
  21366. DensityKernelAnalystParameters_createClass(DensityKernelAnalystParameters, [{
  21367. key: "destroy",
  21368. value: function destroy() {
  21369. var me = this;
  21370. me.dataset = null;
  21371. me.bounds = null;
  21372. me.fieldName = null;
  21373. me.resultGridDatasetResolution = null;
  21374. me.searchRadius = null;
  21375. me.targetDatasource = null;
  21376. me.resultGridName = null;
  21377. me.deleteExistResultDataset = null;
  21378. }
  21379. /**
  21380. * @function SuperMap.DensityKernelAnalystParameters.toObject
  21381. * @param {SuperMap.DensityKernelAnalystParameters} densityKernelAnalystParameters -核密度分析参数类。
  21382. * @param {SuperMap.DensityKernelAnalystParameters} tempObj - 核密度分析参数对象。
  21383. * @description 将核密度分析参数对象转换成 JSON 对象。
  21384. * @returns JSON 对象。
  21385. */
  21386. }], [{
  21387. key: "toObject",
  21388. value: function toObject(densityKernelAnalystParameters, tempObj) {
  21389. for (var name in densityKernelAnalystParameters) {
  21390. if (name !== "dataset") {
  21391. tempObj[name] = densityKernelAnalystParameters[name];
  21392. }
  21393. }
  21394. }
  21395. }]);
  21396. return DensityKernelAnalystParameters;
  21397. }();
  21398. SuperMap.DensityKernelAnalystParameters = DensityKernelAnalystParameters;
  21399. ;// CONCATENATED MODULE: ./src/common/iServer/DensityAnalystService.js
  21400. function DensityAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DensityAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { DensityAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DensityAnalystService_typeof(obj); }
  21401. function DensityAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21402. 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); } }
  21403. function DensityAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  21404. function DensityAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { DensityAnalystService_get = Reflect.get; } else { DensityAnalystService_get = function _get(target, property, receiver) { var base = DensityAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return DensityAnalystService_get(target, property, receiver || target); }
  21405. function DensityAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DensityAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  21406. function DensityAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DensityAnalystService_setPrototypeOf(subClass, superClass); }
  21407. function DensityAnalystService_setPrototypeOf(o, p) { DensityAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DensityAnalystService_setPrototypeOf(o, p); }
  21408. 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); }; }
  21409. function DensityAnalystService_possibleConstructorReturn(self, call) { if (call && (DensityAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return DensityAnalystService_assertThisInitialized(self); }
  21410. function DensityAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21411. function DensityAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21412. function DensityAnalystService_getPrototypeOf(o) { DensityAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DensityAnalystService_getPrototypeOf(o); }
  21413. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21414. * This program are made available under the terms of the Apache License, Version 2.0
  21415. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21416. /**
  21417. * @class SuperMap.DensityAnalystService
  21418. * @category iServer SpatialAnalyst DensityAnalyst
  21419. * @classdesc
  21420. * 密度分析服务类,密度分析可计算每个输出栅格像元周围圆形邻域内输入的点或线对象的密度。
  21421. * 密度分析,在某种意义上来说,相当于在表面上将输入的点线对象的测量值散开来,将每个点或线对象的测量量分布在整个研究区域,并计算输出栅格中每个像元的密度值。目前提供1种密度分析:核密度分析(Kernel)。
  21422. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  21423. * @param {Object} options - 参数。</br>
  21424. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  21425. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21426. * @param {Object} [options.headers] - 请求头。
  21427. * @extends {SuperMap.SpatialAnalystBase}
  21428. * @example 例如:
  21429. * var myDensityAnalystService = new SuperMap.DensityAnalystService(url);
  21430. * myDensityAnalystService.on({
  21431. * "processCompleted": processCompleted,
  21432. * "processFailed": processFailed
  21433. * }
  21434. * );
  21435. */
  21436. var DensityAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  21437. DensityAnalystService_inherits(DensityAnalystService, _SpatialAnalystBase);
  21438. var _super = DensityAnalystService_createSuper(DensityAnalystService);
  21439. function DensityAnalystService(url, options) {
  21440. var _this;
  21441. DensityAnalystService_classCallCheck(this, DensityAnalystService);
  21442. _this = _super.call(this, url, options);
  21443. /**
  21444. * @member {string} SuperMap.DensityAnalystService.prototype.mode
  21445. * @description 密度分析类型。
  21446. */
  21447. _this.mode = null;
  21448. if (options) {
  21449. Util.extend(DensityAnalystService_assertThisInitialized(_this), options);
  21450. }
  21451. _this.CLASS_NAME = "SuperMap.DensityAnalystService";
  21452. return _this;
  21453. }
  21454. /**
  21455. * @function SuperMap.DensityAnalystService.prototype.destroy
  21456. * @description 释放资源,将引用资源的属性置空。
  21457. */
  21458. DensityAnalystService_createClass(DensityAnalystService, [{
  21459. key: "destroy",
  21460. value: function destroy() {
  21461. DensityAnalystService_get(DensityAnalystService_getPrototypeOf(DensityAnalystService.prototype), "destroy", this).call(this);
  21462. this.mode = null;
  21463. }
  21464. /**
  21465. * @function SuperMap.DensityAnalystService.prototype.processAsync
  21466. * @description 负责将客户端的查询参数传递到服务端。
  21467. * @param {SuperMap.DensityKernelAnalystParameters} parameter - 核密度分析参数。
  21468. */
  21469. }, {
  21470. key: "processAsync",
  21471. value: function processAsync(parameter) {
  21472. var me = this;
  21473. var parameterObject = new Object();
  21474. if (parameter instanceof DensityKernelAnalystParameters) {
  21475. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/densityanalyst/kernel');
  21476. me.mode = "kernel";
  21477. }
  21478. DensityKernelAnalystParameters.toObject(parameter, parameterObject);
  21479. var jsonParameters = Util.toJSON(parameterObject);
  21480. me.url = Util.urlAppend(me.url, 'returnContent=true');
  21481. me.request({
  21482. method: "POST",
  21483. data: jsonParameters,
  21484. scope: me,
  21485. success: me.serviceProcessCompleted,
  21486. failure: me.serviceProcessFailed
  21487. });
  21488. }
  21489. }]);
  21490. return DensityAnalystService;
  21491. }(SpatialAnalystBase);
  21492. SuperMap.DensityAnalystService = DensityAnalystService;
  21493. ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesParameters.js
  21494. function EditFeaturesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21495. 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); } }
  21496. function EditFeaturesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21497. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21498. * This program are made available under the terms of the Apache License, Version 2.0
  21499. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21500. /**
  21501. * @class SuperMap.EditFeaturesParameters
  21502. * @category iServer Data Feature
  21503. * @classdesc 数据服务中数据集添加、修改、删除参数类。
  21504. * @category iServer Data
  21505. * @param {Object} options - 参数。
  21506. * @param {Array.<SuperMap.Feature.Vector|GeoJSONObject|ol.feature>} options.features - 当前需要创建或者是修改的要素集。
  21507. * @param {boolean} [options.returnContent=false] - 是返回创建要素的 ID 数组还是返回 featureResult 资源的 URI。
  21508. * @param {SuperMap.EditType} [options.editType=SuperMap.EditType.ADD] - POST 动作类型 (ADD、UPDATE、DELETE)。
  21509. * @param {Array.<string|integer>} [options.IDs] - 删除要素时的要素的 ID 数组。
  21510. */
  21511. var EditFeaturesParameters = /*#__PURE__*/function () {
  21512. function EditFeaturesParameters(options) {
  21513. EditFeaturesParameters_classCallCheck(this, EditFeaturesParameters);
  21514. /**
  21515. * @member {string} SuperMap.EditFeaturesParameters.prototype.dataSourceName
  21516. * @description 当前需要创建或者是修改的要素的数据源。
  21517. */
  21518. this.dataSourceName = null;
  21519. /**
  21520. * @member {string} SuperMap.EditFeaturesParameters.prototype.dataSetName
  21521. * @description 当前需要创建或者是修改的要素的数据集。
  21522. */
  21523. this.dataSetName = null;
  21524. /**
  21525. * @member {Array.<SuperMap.Feature.Vector|GeoJSONObject|ol.feature>} SuperMap.EditFeaturesParameters.prototype.features
  21526. * @description 当前需要创建或者是修改的要素集。
  21527. */
  21528. this.features = null;
  21529. /**
  21530. * @member {SuperMap.EditType} [SuperMap.EditFeaturesParameters.prototype.editType=SuperMap.EditType.ADD]
  21531. * @description 要素集更新类型 (add、update、delete)。
  21532. */
  21533. this.editType = EditType.ADD;
  21534. /**
  21535. * @member {Array.<string|number>} [SuperMap.EditFeaturesParameters.prototype.IDs]
  21536. * @description 执行删除时要素集 ID 集合。
  21537. */
  21538. this.IDs = null;
  21539. /**
  21540. * @member {boolean} [SuperMap.EditFeaturesParameters.prototype.returnContent=false]
  21541. * @description 要素添加时,isUseBatch 不传或传为 false 的情况下有效。
  21542. * true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  21543. */
  21544. this.returnContent = false;
  21545. /**
  21546. * @member {boolean} [SuperMap.EditFeaturesParameters.prototype.isUseBatch=false]
  21547. * @description 是否使用批量添加要素功能,要素添加时有效。批量添加能够提高要素编辑效率。true 表示批量添加;false 表示不使用批量添加。
  21548. */
  21549. this.isUseBatch = false;
  21550. Util.extend(this, options);
  21551. this.CLASS_NAME = "SuperMap.EditFeaturesParameters";
  21552. }
  21553. /**
  21554. * @function SuperMap.EditFeaturesParameters.prototype.destroy
  21555. * @description 释放资源,将引用资源的属性置空。
  21556. */
  21557. EditFeaturesParameters_createClass(EditFeaturesParameters, [{
  21558. key: "destroy",
  21559. value: function destroy() {
  21560. var me = this;
  21561. me.dataSourceName = null;
  21562. me.dataSetName = null;
  21563. me.features = null;
  21564. me.editType = null;
  21565. me.IDs = null;
  21566. me.returnContent = null;
  21567. }
  21568. /**
  21569. * @function SuperMap.EditFeaturesParameters.prototype.toJsonParameters
  21570. * @description 将 EditFeaturesParameters 对象参数转换为 JSON 字符串。
  21571. * @param {SuperMap.EditFeaturesParameters} params - 地物编辑参数。
  21572. * @returns {string} JSON 字符串。
  21573. */
  21574. }], [{
  21575. key: "toJsonParameters",
  21576. value: function toJsonParameters(params) {
  21577. var feature,
  21578. len,
  21579. features,
  21580. editType = params.editType;
  21581. if (editType === EditType.DELETE) {
  21582. if (params.IDs === null) {
  21583. return;
  21584. }
  21585. features = {
  21586. ids: params.IDs
  21587. };
  21588. } else {
  21589. features = [];
  21590. if (params.features) {
  21591. len = params.features.length;
  21592. for (var i = 0; i < len; i++) {
  21593. feature = params.features[i];
  21594. feature.geometry = ServerGeometry.fromGeometry(feature.geometry);
  21595. features.push(feature);
  21596. }
  21597. }
  21598. }
  21599. return Util.toJSON(features);
  21600. }
  21601. }]);
  21602. return EditFeaturesParameters;
  21603. }();
  21604. SuperMap.EditFeaturesParameters = EditFeaturesParameters;
  21605. ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesService.js
  21606. function EditFeaturesService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { EditFeaturesService_typeof = function _typeof(obj) { return typeof obj; }; } else { EditFeaturesService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return EditFeaturesService_typeof(obj); }
  21607. function EditFeaturesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21608. 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); } }
  21609. function EditFeaturesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesService_defineProperties(Constructor, staticProps); return Constructor; }
  21610. function EditFeaturesService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { EditFeaturesService_get = Reflect.get; } else { EditFeaturesService_get = function _get(target, property, receiver) { var base = EditFeaturesService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return EditFeaturesService_get(target, property, receiver || target); }
  21611. function EditFeaturesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = EditFeaturesService_getPrototypeOf(object); if (object === null) break; } return object; }
  21612. function EditFeaturesService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) EditFeaturesService_setPrototypeOf(subClass, superClass); }
  21613. function EditFeaturesService_setPrototypeOf(o, p) { EditFeaturesService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return EditFeaturesService_setPrototypeOf(o, p); }
  21614. 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); }; }
  21615. function EditFeaturesService_possibleConstructorReturn(self, call) { if (call && (EditFeaturesService_typeof(call) === "object" || typeof call === "function")) { return call; } return EditFeaturesService_assertThisInitialized(self); }
  21616. function EditFeaturesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21617. function EditFeaturesService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21618. function EditFeaturesService_getPrototypeOf(o) { EditFeaturesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return EditFeaturesService_getPrototypeOf(o); }
  21619. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21620. * This program are made available under the terms of the Apache License, Version 2.0
  21621. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21622. /**
  21623. * @class SuperMap.EditFeaturesService
  21624. * @category iServer Data Feature
  21625. * @classdesc 数据服务中数据集添加、更新、删除服务类。
  21626. * @extends {SuperMap.CommonServiceBase}
  21627. * @param {string} url - 服务端的数据服务资源地址。请求数据服务中数据集编辑服务,URL 应为:</br>
  21628. * http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/datasources/name/{数据源名}/datasets/name/{数据集名} 。</br>
  21629. * 例如:http://localhost:8090/iserver/services/data-jingjin/rest/data/datasources/name/Jingjin/datasets/name/Landuse_R
  21630. * @param {Object} options - 参数。</br>
  21631. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  21632. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  21633. * @param {SuperMap.DataFormat} [format] -查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
  21634. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21635. * @param {Object} [options.headers] - 请求头。
  21636. * @example
  21637. * var myService = new SuperMap.EditFeaturesService(url, {eventListeners: {
  21638. * "processCompleted": editFeatureCompleted,
  21639. * "processFailed": editFeatureError
  21640. * }
  21641. * };
  21642. *
  21643. */
  21644. var EditFeaturesService = /*#__PURE__*/function (_CommonServiceBase) {
  21645. EditFeaturesService_inherits(EditFeaturesService, _CommonServiceBase);
  21646. var _super = EditFeaturesService_createSuper(EditFeaturesService);
  21647. function EditFeaturesService(url, options) {
  21648. var _this;
  21649. EditFeaturesService_classCallCheck(this, EditFeaturesService);
  21650. _this = _super.call(this, url, options);
  21651. /**
  21652. * @member {boolean} [SuperMap.EditFeaturesService.prototype.returnContent=false]
  21653. * @description要素添加时,isUseBatch 不传或传为 false 的情况下有效。true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  21654. */
  21655. _this.returnContent = false;
  21656. /**
  21657. * @member {boolean} [SuperMap.EditFeaturesService.prototype.isUseBatch=false]
  21658. * @description 是否使用批量添加要素功能,要素添加时有效。
  21659. * 批量添加能够提高要素编辑效率。
  21660. * true 表示批量添加;false 表示不使用批量添加。
  21661. */
  21662. _this.isUseBatch = false;
  21663. if (options) {
  21664. Util.extend(EditFeaturesService_assertThisInitialized(_this), options);
  21665. }
  21666. _this.url = Util.urlPathAppend(_this.url, 'features');
  21667. _this.CLASS_NAME = "SuperMap.EditFeaturesService";
  21668. return _this;
  21669. }
  21670. /**
  21671. * @function SuperMap.EditFeaturesService.prototype.destroy
  21672. * @override
  21673. */
  21674. EditFeaturesService_createClass(EditFeaturesService, [{
  21675. key: "destroy",
  21676. value: function destroy() {
  21677. EditFeaturesService_get(EditFeaturesService_getPrototypeOf(EditFeaturesService.prototype), "destroy", this).call(this);
  21678. var me = this;
  21679. me.returnContent = null;
  21680. me.isUseBatch = null;
  21681. me.fromIndex = null;
  21682. me.toIndex = null;
  21683. }
  21684. /**
  21685. * @function SuperMap.EditFeaturesService.prototype.processAsync
  21686. * @description 负责将客户端的更新参数传递到服务端。
  21687. * @param {SuperMap.EditFeaturesParameters} params - 编辑要素参数。
  21688. */
  21689. }, {
  21690. key: "processAsync",
  21691. value: function processAsync(params) {
  21692. if (!(params instanceof EditFeaturesParameters)) {
  21693. return;
  21694. }
  21695. var me = this,
  21696. method = "POST",
  21697. ids = "",
  21698. editType = params.editType,
  21699. jsonParameters = null;
  21700. me.returnContent = params.returnContent;
  21701. me.isUseBatch = params.isUseBatch;
  21702. jsonParameters = EditFeaturesParameters.toJsonParameters(params);
  21703. if (editType === EditType.DELETE) {
  21704. ids = Util.toJSON(params.IDs);
  21705. me.url = Util.urlAppend(me.url, "ids=" + ids);
  21706. method = "DELETE";
  21707. jsonParameters = ids;
  21708. } else if (editType === EditType.UPDATE) {
  21709. method = "PUT";
  21710. } else {
  21711. if (me.isUseBatch) {
  21712. me.url = Util.urlAppend(me.url, "isUseBatch=".concat(me.isUseBatch));
  21713. me.returnContent = false;
  21714. }
  21715. if (me.returnContent) {
  21716. me.url = Util.urlAppend(me.url, 'returnContent=true');
  21717. method = "POST";
  21718. }
  21719. }
  21720. me.request({
  21721. method: method,
  21722. data: jsonParameters,
  21723. scope: me,
  21724. success: me.serviceProcessCompleted,
  21725. failure: me.serviceProcessFailed
  21726. });
  21727. }
  21728. }]);
  21729. return EditFeaturesService;
  21730. }(CommonServiceBase);
  21731. SuperMap.EditFeaturesService = EditFeaturesService;
  21732. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalyst3DParameters.js
  21733. function FacilityAnalyst3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21734. 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); } }
  21735. function FacilityAnalyst3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalyst3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalyst3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21736. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21737. * This program are made available under the terms of the Apache License, Version 2.0
  21738. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21739. /**
  21740. * @class SuperMap.FacilityAnalyst3DParameters
  21741. * @category iServer FacilityAnalyst3D
  21742. * @classdesc 最近设施分析参数基类。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  21743. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,
  21744. * 超过 10 分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起
  21745. * 作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  21746. * @param {Object} options - 参数。
  21747. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  21748. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  21749. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  21750. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  21751. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  21752. */
  21753. var FacilityAnalyst3DParameters = /*#__PURE__*/function () {
  21754. function FacilityAnalyst3DParameters(options) {
  21755. FacilityAnalyst3DParameters_classCallCheck(this, FacilityAnalyst3DParameters);
  21756. /**
  21757. * @member {number} [SuperMap.FacilityAnalyst3DParameters.prototype.edgeID]
  21758. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  21759. */
  21760. this.edgeID = null;
  21761. /**
  21762. * @member {number} [SuperMap.FacilityAnalyst3DParameters.prototype.nodeID]
  21763. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  21764. */
  21765. this.nodeID = null;
  21766. /**
  21767. * @member {string} SuperMap.FacilityAnalyst3DParameters.prototype.weightName
  21768. * @description 指定的权值字段信息对象的名称。
  21769. */
  21770. this.weightName = null;
  21771. /**
  21772. * @member {boolean} [SuperMap.FacilityAnalyst3DParameters.prototype.isUncertainDirectionValid=false]
  21773. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  21774. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找
  21775. */
  21776. this.isUncertainDirectionValid = false;
  21777. Util.extend(this, options);
  21778. this.CLASS_NAME = "SuperMap.FacilityAnalyst3DParameters";
  21779. }
  21780. /**
  21781. * @function SuperMap.FacilityAnalyst3DParameters.prototype.destroy
  21782. * @override
  21783. */
  21784. FacilityAnalyst3DParameters_createClass(FacilityAnalyst3DParameters, [{
  21785. key: "destroy",
  21786. value: function destroy() {
  21787. var me = this;
  21788. me.edgeID = null;
  21789. me.nodeID = null;
  21790. me.weightName = null;
  21791. me.isUncertainDirectionValid = null;
  21792. }
  21793. }]);
  21794. return FacilityAnalyst3DParameters;
  21795. }();
  21796. SuperMap.FacilityAnalyst3DParameters = FacilityAnalyst3DParameters;
  21797. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DParameters.js
  21798. function FacilityAnalystSinks3DParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystSinks3DParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystSinks3DParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystSinks3DParameters_typeof(obj); }
  21799. function FacilityAnalystSinks3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21800. 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); } }
  21801. function FacilityAnalystSinks3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21802. function FacilityAnalystSinks3DParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSinks3DParameters_get = Reflect.get; } else { FacilityAnalystSinks3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystSinks3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FacilityAnalystSinks3DParameters_get(target, property, receiver || target); }
  21803. function FacilityAnalystSinks3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSinks3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  21804. function FacilityAnalystSinks3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystSinks3DParameters_setPrototypeOf(subClass, superClass); }
  21805. function FacilityAnalystSinks3DParameters_setPrototypeOf(o, p) { FacilityAnalystSinks3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DParameters_setPrototypeOf(o, p); }
  21806. 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); }; }
  21807. function FacilityAnalystSinks3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSinks3DParameters_assertThisInitialized(self); }
  21808. function FacilityAnalystSinks3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21809. function FacilityAnalystSinks3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21810. function FacilityAnalystSinks3DParameters_getPrototypeOf(o) { FacilityAnalystSinks3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DParameters_getPrototypeOf(o); }
  21811. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21812. * This program are made available under the terms of the Apache License, Version 2.0
  21813. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21814. /**
  21815. * @class SuperMap.FacilityAnalystSinks3DParameters
  21816. * @category iServer FacilityAnalyst3D Sinks
  21817. * @classdesc 最近设施分析参数类(汇查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  21818. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分钟
  21819. * 能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、
  21820. * 转向表、耗费等属性在最近设施分析时同样可设置。
  21821. * @extends {SuperMap.FacilityAnalyst3DParameters}
  21822. * @param {Object} options - 参数。
  21823. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  21824. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  21825. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  21826. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  21827. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  21828. */
  21829. var FacilityAnalystSinks3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  21830. FacilityAnalystSinks3DParameters_inherits(FacilityAnalystSinks3DParameters, _FacilityAnalyst3DPar);
  21831. var _super = FacilityAnalystSinks3DParameters_createSuper(FacilityAnalystSinks3DParameters);
  21832. function FacilityAnalystSinks3DParameters(options) {
  21833. var _this;
  21834. FacilityAnalystSinks3DParameters_classCallCheck(this, FacilityAnalystSinks3DParameters);
  21835. _this = _super.call(this, options);
  21836. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DParameters";
  21837. return _this;
  21838. }
  21839. /**
  21840. * @function SuperMap.FacilityAnalystSinks3DParameters.prototype.destroy
  21841. * @override
  21842. */
  21843. FacilityAnalystSinks3DParameters_createClass(FacilityAnalystSinks3DParameters, [{
  21844. key: "destroy",
  21845. value: function destroy() {
  21846. FacilityAnalystSinks3DParameters_get(FacilityAnalystSinks3DParameters_getPrototypeOf(FacilityAnalystSinks3DParameters.prototype), "destroy", this).call(this);
  21847. }
  21848. }]);
  21849. return FacilityAnalystSinks3DParameters;
  21850. }(FacilityAnalyst3DParameters);
  21851. SuperMap.FacilityAnalystSinks3DParameters = FacilityAnalystSinks3DParameters;
  21852. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DService.js
  21853. function FacilityAnalystSinks3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystSinks3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystSinks3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystSinks3DService_typeof(obj); }
  21854. function FacilityAnalystSinks3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21855. 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); } }
  21856. function FacilityAnalystSinks3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DService_defineProperties(Constructor, staticProps); return Constructor; }
  21857. function FacilityAnalystSinks3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystSinks3DService_setPrototypeOf(subClass, superClass); }
  21858. function FacilityAnalystSinks3DService_setPrototypeOf(o, p) { FacilityAnalystSinks3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DService_setPrototypeOf(o, p); }
  21859. 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); }; }
  21860. function FacilityAnalystSinks3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSinks3DService_assertThisInitialized(self); }
  21861. function FacilityAnalystSinks3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21862. function FacilityAnalystSinks3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21863. function FacilityAnalystSinks3DService_getPrototypeOf(o) { FacilityAnalystSinks3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DService_getPrototypeOf(o); }
  21864. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21865. * This program are made available under the terms of the Apache License, Version 2.0
  21866. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21867. /**
  21868. * @class SuperMap.FacilityAnalystSinks3DService
  21869. * @category iServer FacilityAnalyst3D Sinks
  21870. * @classdesc 最近设施分析服务类(汇查找资源)<br>
  21871. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  21872. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  21873. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  21874. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  21875. * @extends {SuperMap.CommonServiceBase}
  21876. * @example
  21877. * var myFacilityAnalystSinks3DService = new SuperMap.FacilityAnalystSinks3DService(url, {
  21878. * eventListeners: {
  21879. * "processCompleted": facilityAnalystSinks3DCompleted,
  21880. * "processFailed": facilityAnalystSinks3DError
  21881. * }
  21882. * });
  21883. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:<br>
  21884. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};<br>
  21885. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。<br>
  21886. * @param {Object} options - 参数。<br>
  21887. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  21888. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21889. * @param {Object} [options.headers] - 请求头。
  21890. */
  21891. var FacilityAnalystSinks3DService = /*#__PURE__*/function (_CommonServiceBase) {
  21892. FacilityAnalystSinks3DService_inherits(FacilityAnalystSinks3DService, _CommonServiceBase);
  21893. var _super = FacilityAnalystSinks3DService_createSuper(FacilityAnalystSinks3DService);
  21894. function FacilityAnalystSinks3DService(url, options) {
  21895. var _this;
  21896. FacilityAnalystSinks3DService_classCallCheck(this, FacilityAnalystSinks3DService);
  21897. _this = _super.call(this, url, options);
  21898. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DService";
  21899. return _this;
  21900. }
  21901. /**
  21902. * @function SuperMap.FacilityAnalystSinks3DService.prototype.destroy
  21903. * @override
  21904. */
  21905. FacilityAnalystSinks3DService_createClass(FacilityAnalystSinks3DService, [{
  21906. key: "destroy",
  21907. value: function destroy() {
  21908. CommonServiceBase.prototype.destroy.apply(this, arguments);
  21909. }
  21910. /**
  21911. * @function SuperMap.FacilityAnalystSinks3DService.prototype.processAsync
  21912. * @description 负责将客户端的查询参数传递到服务端。
  21913. * @param {SuperMap.FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)
  21914. */
  21915. }, {
  21916. key: "processAsync",
  21917. value: function processAsync(params) {
  21918. if (!(params instanceof FacilityAnalystSinks3DParameters)) {
  21919. return;
  21920. }
  21921. var me = this,
  21922. jsonObject;
  21923. me.url = Util.urlPathAppend(me.url, 'sinks');
  21924. jsonObject = {
  21925. edgeID: params.edgeID,
  21926. nodeID: params.nodeID,
  21927. weightName: params.weightName,
  21928. isUncertainDirectionValid: params.isUncertainDirectionValid
  21929. };
  21930. me.request({
  21931. method: "GET",
  21932. params: jsonObject,
  21933. scope: me,
  21934. success: me.serviceProcessCompleted,
  21935. failure: me.serviceProcessFailed
  21936. });
  21937. }
  21938. }]);
  21939. return FacilityAnalystSinks3DService;
  21940. }(CommonServiceBase);
  21941. SuperMap.FacilityAnalystSinks3DService = FacilityAnalystSinks3DService;
  21942. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DParameters.js
  21943. function FacilityAnalystSources3DParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystSources3DParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystSources3DParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystSources3DParameters_typeof(obj); }
  21944. function FacilityAnalystSources3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21945. 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); } }
  21946. function FacilityAnalystSources3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21947. function FacilityAnalystSources3DParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSources3DParameters_get = Reflect.get; } else { FacilityAnalystSources3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystSources3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FacilityAnalystSources3DParameters_get(target, property, receiver || target); }
  21948. function FacilityAnalystSources3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  21949. function FacilityAnalystSources3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystSources3DParameters_setPrototypeOf(subClass, superClass); }
  21950. function FacilityAnalystSources3DParameters_setPrototypeOf(o, p) { FacilityAnalystSources3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DParameters_setPrototypeOf(o, p); }
  21951. 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); }; }
  21952. function FacilityAnalystSources3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSources3DParameters_assertThisInitialized(self); }
  21953. function FacilityAnalystSources3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21954. function FacilityAnalystSources3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21955. function FacilityAnalystSources3DParameters_getPrototypeOf(o) { FacilityAnalystSources3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DParameters_getPrototypeOf(o); }
  21956. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21957. * This program are made available under the terms of the Apache License, Version 2.0
  21958. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21959. /**
  21960. * @class SuperMap.FacilityAnalystSources3DParameters
  21961. * @category iServer FacilityAnalyst3D Sources
  21962. * @classdesc 最近设施分析参数类(源查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  21963. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分
  21964. * 钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍
  21965. * 点、转向表、耗费等属性在最近设施分析时同样可设置。
  21966. * @extends {SuperMap.FacilityAnalyst3DParameters}
  21967. * @param {Object} options - 参数。
  21968. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  21969. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  21970. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  21971. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  21972. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  21973. */
  21974. var FacilityAnalystSources3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  21975. FacilityAnalystSources3DParameters_inherits(FacilityAnalystSources3DParameters, _FacilityAnalyst3DPar);
  21976. var _super = FacilityAnalystSources3DParameters_createSuper(FacilityAnalystSources3DParameters);
  21977. function FacilityAnalystSources3DParameters(options) {
  21978. var _this;
  21979. FacilityAnalystSources3DParameters_classCallCheck(this, FacilityAnalystSources3DParameters);
  21980. _this = _super.call(this, options);
  21981. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DParameters";
  21982. return _this;
  21983. }
  21984. /**
  21985. * @function SuperMap.FacilityAnalystSources3DParameters.prototype.destroy
  21986. * @override
  21987. */
  21988. FacilityAnalystSources3DParameters_createClass(FacilityAnalystSources3DParameters, [{
  21989. key: "destroy",
  21990. value: function destroy() {
  21991. FacilityAnalystSources3DParameters_get(FacilityAnalystSources3DParameters_getPrototypeOf(FacilityAnalystSources3DParameters.prototype), "destroy", this).call(this);
  21992. }
  21993. }]);
  21994. return FacilityAnalystSources3DParameters;
  21995. }(FacilityAnalyst3DParameters);
  21996. SuperMap.FacilityAnalystSources3DParameters = FacilityAnalystSources3DParameters;
  21997. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DService.js
  21998. function FacilityAnalystSources3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystSources3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystSources3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystSources3DService_typeof(obj); }
  21999. function FacilityAnalystSources3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22000. 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); } }
  22001. function FacilityAnalystSources3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DService_defineProperties(Constructor, staticProps); return Constructor; }
  22002. function FacilityAnalystSources3DService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSources3DService_get = Reflect.get; } else { FacilityAnalystSources3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystSources3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FacilityAnalystSources3DService_get(target, property, receiver || target); }
  22003. function FacilityAnalystSources3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  22004. function FacilityAnalystSources3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystSources3DService_setPrototypeOf(subClass, superClass); }
  22005. function FacilityAnalystSources3DService_setPrototypeOf(o, p) { FacilityAnalystSources3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DService_setPrototypeOf(o, p); }
  22006. 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); }; }
  22007. function FacilityAnalystSources3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSources3DService_assertThisInitialized(self); }
  22008. function FacilityAnalystSources3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22009. function FacilityAnalystSources3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22010. function FacilityAnalystSources3DService_getPrototypeOf(o) { FacilityAnalystSources3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DService_getPrototypeOf(o); }
  22011. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22012. * This program are made available under the terms of the Apache License, Version 2.0
  22013. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22014. /**
  22015. * @class SuperMap.FacilityAnalystSources3DService
  22016. * @category iServer FacilityAnalyst3D Sources
  22017. * @classdesc 最近设施分析服务类(源查找资源)
  22018. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  22019. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  22020. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  22021. * 最近设施分析结果通过该类支持的事件的监听函数参数获取。
  22022. * @extends {SuperMap.CommonServiceBase}
  22023. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  22024. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  22025. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  22026. * @param {Object} options - 参数。
  22027. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  22028. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22029. * @param {Object} [options.headers] - 请求头。
  22030. */
  22031. var FacilityAnalystSources3DService = /*#__PURE__*/function (_CommonServiceBase) {
  22032. FacilityAnalystSources3DService_inherits(FacilityAnalystSources3DService, _CommonServiceBase);
  22033. var _super = FacilityAnalystSources3DService_createSuper(FacilityAnalystSources3DService);
  22034. function FacilityAnalystSources3DService(url, options) {
  22035. var _this;
  22036. FacilityAnalystSources3DService_classCallCheck(this, FacilityAnalystSources3DService);
  22037. _this = _super.call(this, url, options);
  22038. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DService";
  22039. return _this;
  22040. }
  22041. /**
  22042. * @function SuperMap.FacilityAnalystSources3DService.prototype.destroy
  22043. * @override
  22044. */
  22045. FacilityAnalystSources3DService_createClass(FacilityAnalystSources3DService, [{
  22046. key: "destroy",
  22047. value: function destroy() {
  22048. FacilityAnalystSources3DService_get(FacilityAnalystSources3DService_getPrototypeOf(FacilityAnalystSources3DService.prototype), "destroy", this).call(this);
  22049. }
  22050. /**
  22051. * @function SuperMap.FacilityAnalystSources3DService.prototype.processAsync
  22052. * @description 负责将客户端的查询参数传递到服务端。
  22053. * @param {SuperMap.FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找资源)
  22054. */
  22055. }, {
  22056. key: "processAsync",
  22057. value: function processAsync(params) {
  22058. if (!(params instanceof FacilityAnalystSources3DParameters)) {
  22059. return;
  22060. }
  22061. var me = this,
  22062. jsonObject;
  22063. me.url = Util.urlPathAppend(me.url, 'sources');
  22064. jsonObject = {
  22065. edgeID: params.edgeID,
  22066. nodeID: params.nodeID,
  22067. weightName: params.weightName,
  22068. isUncertainDirectionValid: params.isUncertainDirectionValid
  22069. };
  22070. me.request({
  22071. method: "GET",
  22072. params: jsonObject,
  22073. scope: me,
  22074. success: me.serviceProcessCompleted,
  22075. failure: me.serviceProcessFailed
  22076. });
  22077. }
  22078. }]);
  22079. return FacilityAnalystSources3DService;
  22080. }(CommonServiceBase);
  22081. SuperMap.FacilityAnalystSources3DService = FacilityAnalystSources3DService;
  22082. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamParameters.js
  22083. function FacilityAnalystStreamParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22084. 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); } }
  22085. function FacilityAnalystStreamParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22086. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22087. * This program are made available under the terms of the Apache License, Version 2.0
  22088. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22089. /**
  22090. * @class SuperMap.FacilityAnalystStreamParameters
  22091. * @category iServer NetworkAnalyst UpstreamCriticalFacilities
  22092. * @classdesc 上游/下游关键设施查找资源参数类。
  22093. * @param {Object} options - 参数。
  22094. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  22095. * @param {number} options.queryType - 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  22096. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  22097. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  22098. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  22099. */
  22100. var FacilityAnalystStreamParameters = /*#__PURE__*/function () {
  22101. function FacilityAnalystStreamParameters(options) {
  22102. FacilityAnalystStreamParameters_classCallCheck(this, FacilityAnalystStreamParameters);
  22103. /**
  22104. * @member {Array.<number>} [SuperMap.FacilityAnalystStreamParameters.prototype.sourceNodeIDs]
  22105. * @description 指定的设施点 ID 数组。
  22106. */
  22107. this.sourceNodeIDs = null;
  22108. /**
  22109. * @member {number} [SuperMap.FacilityAnalystStreamParameters.prototype.edgeID]
  22110. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  22111. */
  22112. this.edgeID = null;
  22113. /**
  22114. * @member {number} [SuperMap.FacilityAnalystStreamParameters.prototype.nodeID]
  22115. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  22116. */
  22117. this.nodeID = null;
  22118. /**
  22119. * @member {boolean} [SuperMap.FacilityAnalystStreamParameters.prototype.isUncertainDirectionValid=false]
  22120. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  22121. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  22122. */
  22123. this.isUncertainDirectionValid = false;
  22124. /**
  22125. * @member {number} SuperMap.FacilityAnalystStreamParameters.prototype.queryType
  22126. * @description 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  22127. */
  22128. this.queryType = null;
  22129. Util.extend(this, options);
  22130. this.CLASS_NAME = "SuperMap.FacilityAnalystStreamParameters";
  22131. }
  22132. /**
  22133. * @function SuperMap.FacilityAnalystStreamParameters.prototype.destroy
  22134. * @description 释放资源,将引用资源的属性置空。
  22135. */
  22136. FacilityAnalystStreamParameters_createClass(FacilityAnalystStreamParameters, [{
  22137. key: "destroy",
  22138. value: function destroy() {
  22139. var me = this;
  22140. me.edgeID = null;
  22141. me.nodeID = null;
  22142. me.weightName = null;
  22143. me.isUncertainDirectionValid = null;
  22144. me.type = null;
  22145. }
  22146. }]);
  22147. return FacilityAnalystStreamParameters;
  22148. }();
  22149. SuperMap.FacilityAnalystStreamParameters = FacilityAnalystStreamParameters;
  22150. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamService.js
  22151. function FacilityAnalystStreamService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystStreamService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystStreamService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystStreamService_typeof(obj); }
  22152. function FacilityAnalystStreamService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22153. 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); } }
  22154. function FacilityAnalystStreamService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamService_defineProperties(Constructor, staticProps); return Constructor; }
  22155. function FacilityAnalystStreamService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystStreamService_get = Reflect.get; } else { FacilityAnalystStreamService_get = function _get(target, property, receiver) { var base = FacilityAnalystStreamService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FacilityAnalystStreamService_get(target, property, receiver || target); }
  22156. function FacilityAnalystStreamService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystStreamService_getPrototypeOf(object); if (object === null) break; } return object; }
  22157. function FacilityAnalystStreamService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystStreamService_setPrototypeOf(subClass, superClass); }
  22158. function FacilityAnalystStreamService_setPrototypeOf(o, p) { FacilityAnalystStreamService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystStreamService_setPrototypeOf(o, p); }
  22159. 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); }; }
  22160. function FacilityAnalystStreamService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystStreamService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystStreamService_assertThisInitialized(self); }
  22161. function FacilityAnalystStreamService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22162. function FacilityAnalystStreamService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22163. function FacilityAnalystStreamService_getPrototypeOf(o) { FacilityAnalystStreamService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystStreamService_getPrototypeOf(o); }
  22164. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22165. * This program are made available under the terms of the Apache License, Version 2.0
  22166. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22167. /**
  22168. * @class SuperMap.FacilityAnalystStreamService
  22169. * @category iServer NetworkAnalyst UpstreamCriticalFacilities
  22170. * @classdesc 上游/下游 关键设施查找资源服务类;即查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  22171. * @extends SuperMap.NetworkAnalystServiceBase
  22172. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  22173. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  22174. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet";
  22175. * @param {Object} options - 参数。
  22176. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  22177. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22178. * @param {Object} [options.headers] - 请求头。
  22179. */
  22180. var FacilityAnalystStreamService = /*#__PURE__*/function (_NetworkAnalystServic) {
  22181. FacilityAnalystStreamService_inherits(FacilityAnalystStreamService, _NetworkAnalystServic);
  22182. var _super = FacilityAnalystStreamService_createSuper(FacilityAnalystStreamService);
  22183. function FacilityAnalystStreamService(url, options) {
  22184. var _this;
  22185. FacilityAnalystStreamService_classCallCheck(this, FacilityAnalystStreamService);
  22186. _this = _super.call(this, url, options);
  22187. _this.CLASS_NAME = "SuperMap.FacilityAnalystStreamService";
  22188. return _this;
  22189. }
  22190. /**
  22191. * @function SuperMap.FacilityAnalystStreamService.prototype.destroy
  22192. * @override
  22193. */
  22194. FacilityAnalystStreamService_createClass(FacilityAnalystStreamService, [{
  22195. key: "destroy",
  22196. value: function destroy() {
  22197. FacilityAnalystStreamService_get(FacilityAnalystStreamService_getPrototypeOf(FacilityAnalystStreamService.prototype), "destroy", this).call(this);
  22198. }
  22199. /**
  22200. * @function SuperMap.FacilityAnalystStreamService.prototype.processAsync
  22201. * @description 负责将客户端的查询参数传递到服务端。
  22202. * @param {SuperMap.FacilityAnalystStreamParameters} params - 上游/下游关键设施查找资源参数类。
  22203. */
  22204. }, {
  22205. key: "processAsync",
  22206. value: function processAsync(params) {
  22207. if (!(params instanceof FacilityAnalystStreamParameters)) {
  22208. return;
  22209. }
  22210. var me = this,
  22211. jsonObject; //URL 通过参数类型来判断是 上游 还是下游 查询
  22212. if (params.queryType === 0) {
  22213. me.url = Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  22214. } else if (params.queryType === 1) {
  22215. me.url = Util.urlPathAppend(me.url, 'downstreamcirticalfaclilities');
  22216. } else {
  22217. return;
  22218. }
  22219. jsonObject = {
  22220. sourceNodeIDs: params.sourceNodeIDs,
  22221. isUncertainDirectionValid: params.isUncertainDirectionValid
  22222. };
  22223. if (params.edgeID !== null && params.nodeID !== null) {
  22224. return;
  22225. }
  22226. if (params.edgeID === null && params.nodeID === null) {
  22227. return;
  22228. }
  22229. if (params.edgeID !== null) {
  22230. jsonObject.edgeID = params.edgeID;
  22231. } else {
  22232. jsonObject.nodeID = params.nodeID;
  22233. }
  22234. me.request({
  22235. method: "GET",
  22236. params: jsonObject,
  22237. scope: me,
  22238. success: me.serviceProcessCompleted,
  22239. failure: me.serviceProcessFailed
  22240. });
  22241. }
  22242. }]);
  22243. return FacilityAnalystStreamService;
  22244. }(NetworkAnalystServiceBase);
  22245. SuperMap.FacilityAnalystStreamService = FacilityAnalystStreamService;
  22246. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DParameters.js
  22247. function FacilityAnalystTracedown3DParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystTracedown3DParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystTracedown3DParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystTracedown3DParameters_typeof(obj); }
  22248. function FacilityAnalystTracedown3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22249. 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); } }
  22250. function FacilityAnalystTracedown3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22251. function FacilityAnalystTracedown3DParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTracedown3DParameters_get = Reflect.get; } else { FacilityAnalystTracedown3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystTracedown3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FacilityAnalystTracedown3DParameters_get(target, property, receiver || target); }
  22252. function FacilityAnalystTracedown3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22253. function FacilityAnalystTracedown3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystTracedown3DParameters_setPrototypeOf(subClass, superClass); }
  22254. function FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p) { FacilityAnalystTracedown3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p); }
  22255. 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); }; }
  22256. function FacilityAnalystTracedown3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTracedown3DParameters_assertThisInitialized(self); }
  22257. function FacilityAnalystTracedown3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22258. function FacilityAnalystTracedown3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22259. function FacilityAnalystTracedown3DParameters_getPrototypeOf(o) { FacilityAnalystTracedown3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DParameters_getPrototypeOf(o); }
  22260. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22261. * This program are made available under the terms of the Apache License, Version 2.0
  22262. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22263. /**
  22264. * @class SuperMap.FacilityAnalystTracedown3DParameters
  22265. * @category iServer FacilityAnalyst3D TraceDownResult
  22266. * @classdesc 下游追踪资源参数类。
  22267. * @extends {SuperMap.FacilityAnalyst3DParameters}
  22268. * @param {Object} options - 参数。
  22269. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  22270. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  22271. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  22272. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  22273. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  22274. */
  22275. var FacilityAnalystTracedown3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  22276. FacilityAnalystTracedown3DParameters_inherits(FacilityAnalystTracedown3DParameters, _FacilityAnalyst3DPar);
  22277. var _super = FacilityAnalystTracedown3DParameters_createSuper(FacilityAnalystTracedown3DParameters);
  22278. function FacilityAnalystTracedown3DParameters(options) {
  22279. var _this;
  22280. FacilityAnalystTracedown3DParameters_classCallCheck(this, FacilityAnalystTracedown3DParameters);
  22281. _this = _super.call(this, options);
  22282. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DParameters";
  22283. return _this;
  22284. }
  22285. /**
  22286. * @function SuperMap.FacilityAnalystTracedown3DParameters.prototype.destroy
  22287. * @override
  22288. */
  22289. FacilityAnalystTracedown3DParameters_createClass(FacilityAnalystTracedown3DParameters, [{
  22290. key: "destroy",
  22291. value: function destroy() {
  22292. FacilityAnalystTracedown3DParameters_get(FacilityAnalystTracedown3DParameters_getPrototypeOf(FacilityAnalystTracedown3DParameters.prototype), "destroy", this).call(this);
  22293. }
  22294. }]);
  22295. return FacilityAnalystTracedown3DParameters;
  22296. }(FacilityAnalyst3DParameters);
  22297. SuperMap.FacilityAnalystTracedown3DParameters = FacilityAnalystTracedown3DParameters;
  22298. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DService.js
  22299. function FacilityAnalystTracedown3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystTracedown3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystTracedown3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystTracedown3DService_typeof(obj); }
  22300. function FacilityAnalystTracedown3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22301. 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); } }
  22302. function FacilityAnalystTracedown3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DService_defineProperties(Constructor, staticProps); return Constructor; }
  22303. function FacilityAnalystTracedown3DService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTracedown3DService_get = Reflect.get; } else { FacilityAnalystTracedown3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystTracedown3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FacilityAnalystTracedown3DService_get(target, property, receiver || target); }
  22304. function FacilityAnalystTracedown3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  22305. function FacilityAnalystTracedown3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystTracedown3DService_setPrototypeOf(subClass, superClass); }
  22306. function FacilityAnalystTracedown3DService_setPrototypeOf(o, p) { FacilityAnalystTracedown3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DService_setPrototypeOf(o, p); }
  22307. 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); }; }
  22308. function FacilityAnalystTracedown3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTracedown3DService_assertThisInitialized(self); }
  22309. function FacilityAnalystTracedown3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22310. function FacilityAnalystTracedown3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22311. function FacilityAnalystTracedown3DService_getPrototypeOf(o) { FacilityAnalystTracedown3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DService_getPrototypeOf(o); }
  22312. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22313. * This program are made available under the terms of the Apache License, Version 2.0
  22314. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22315. /**
  22316. * @class SuperMap.FacilityAnalystTracedown3DService
  22317. * @category iServer FacilityAnalyst3D TraceDownResult
  22318. * @classdesc 下游追踪资源服务类
  22319. * @extends {SuperMap.CommonServiceBase}
  22320. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  22321. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  22322. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  22323. * @param {Object} options - 参数。
  22324. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  22325. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22326. * @param {Object} [options.headers] - 请求头。
  22327. */
  22328. var FacilityAnalystTracedown3DService = /*#__PURE__*/function (_CommonServiceBase) {
  22329. FacilityAnalystTracedown3DService_inherits(FacilityAnalystTracedown3DService, _CommonServiceBase);
  22330. var _super = FacilityAnalystTracedown3DService_createSuper(FacilityAnalystTracedown3DService);
  22331. function FacilityAnalystTracedown3DService(url, options) {
  22332. var _this;
  22333. FacilityAnalystTracedown3DService_classCallCheck(this, FacilityAnalystTracedown3DService);
  22334. _this = _super.call(this, url, options);
  22335. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DService";
  22336. return _this;
  22337. }
  22338. /**
  22339. * @function SuperMap.FacilityAnalystTracedown3DService.prototype.destroy
  22340. * @override
  22341. */
  22342. FacilityAnalystTracedown3DService_createClass(FacilityAnalystTracedown3DService, [{
  22343. key: "destroy",
  22344. value: function destroy() {
  22345. FacilityAnalystTracedown3DService_get(FacilityAnalystTracedown3DService_getPrototypeOf(FacilityAnalystTracedown3DService.prototype), "destroy", this).call(this);
  22346. }
  22347. /**
  22348. * @function SuperMap.FacilityAnalystTracedown3DService.prototype.processAsync
  22349. * @description 负责将客户端的查询参数传递到服务端。
  22350. * @param {SuperMap.FacilityAnalystTracedown3DParameters} params - 下游追踪资源参数类。
  22351. */
  22352. }, {
  22353. key: "processAsync",
  22354. value: function processAsync(params) {
  22355. if (!(params instanceof FacilityAnalystTracedown3DParameters)) {
  22356. return;
  22357. }
  22358. var me = this,
  22359. jsonObject;
  22360. me.url = Util.urlPathAppend(me.url, 'tracedownresult');
  22361. jsonObject = {
  22362. edgeID: params.edgeID,
  22363. nodeID: params.nodeID,
  22364. weightName: params.weightName,
  22365. isUncertainDirectionValid: params.isUncertainDirectionValid
  22366. };
  22367. me.request({
  22368. method: "GET",
  22369. params: jsonObject,
  22370. scope: me,
  22371. success: me.serviceProcessCompleted,
  22372. failure: me.serviceProcessFailed
  22373. });
  22374. }
  22375. }]);
  22376. return FacilityAnalystTracedown3DService;
  22377. }(CommonServiceBase);
  22378. SuperMap.FacilityAnalystTracedown3DService = FacilityAnalystTracedown3DService;
  22379. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DParameters.js
  22380. function FacilityAnalystTraceup3DParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystTraceup3DParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystTraceup3DParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystTraceup3DParameters_typeof(obj); }
  22381. function FacilityAnalystTraceup3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22382. 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); } }
  22383. function FacilityAnalystTraceup3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22384. function FacilityAnalystTraceup3DParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTraceup3DParameters_get = Reflect.get; } else { FacilityAnalystTraceup3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystTraceup3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FacilityAnalystTraceup3DParameters_get(target, property, receiver || target); }
  22385. function FacilityAnalystTraceup3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22386. function FacilityAnalystTraceup3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystTraceup3DParameters_setPrototypeOf(subClass, superClass); }
  22387. function FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p) { FacilityAnalystTraceup3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p); }
  22388. 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); }; }
  22389. function FacilityAnalystTraceup3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTraceup3DParameters_assertThisInitialized(self); }
  22390. function FacilityAnalystTraceup3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22391. function FacilityAnalystTraceup3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22392. function FacilityAnalystTraceup3DParameters_getPrototypeOf(o) { FacilityAnalystTraceup3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DParameters_getPrototypeOf(o); }
  22393. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22394. * This program are made available under the terms of the Apache License, Version 2.0
  22395. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22396. /**
  22397. * @class SuperMap.FacilityAnalystTraceup3DParameters
  22398. * @category iServer FacilityAnalyst3D TraceUpResult
  22399. * @classdesc 上游追踪资源参数类。
  22400. * @extends {SuperMap.FacilityAnalyst3DParameters}
  22401. * @param {Object} options - 参数。
  22402. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  22403. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  22404. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  22405. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  22406. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  22407. */
  22408. var FacilityAnalystTraceup3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  22409. FacilityAnalystTraceup3DParameters_inherits(FacilityAnalystTraceup3DParameters, _FacilityAnalyst3DPar);
  22410. var _super = FacilityAnalystTraceup3DParameters_createSuper(FacilityAnalystTraceup3DParameters);
  22411. function FacilityAnalystTraceup3DParameters(options) {
  22412. var _this;
  22413. FacilityAnalystTraceup3DParameters_classCallCheck(this, FacilityAnalystTraceup3DParameters);
  22414. _this = _super.call(this, options);
  22415. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DParameters";
  22416. return _this;
  22417. }
  22418. /**
  22419. * @function SuperMap.FacilityAnalystTraceup3DParameters.prototype.destroy
  22420. * @override
  22421. */
  22422. FacilityAnalystTraceup3DParameters_createClass(FacilityAnalystTraceup3DParameters, [{
  22423. key: "destroy",
  22424. value: function destroy() {
  22425. FacilityAnalystTraceup3DParameters_get(FacilityAnalystTraceup3DParameters_getPrototypeOf(FacilityAnalystTraceup3DParameters.prototype), "destroy", this).call(this);
  22426. }
  22427. }]);
  22428. return FacilityAnalystTraceup3DParameters;
  22429. }(FacilityAnalyst3DParameters);
  22430. SuperMap.FacilityAnalystTraceup3DParameters = FacilityAnalystTraceup3DParameters;
  22431. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DService.js
  22432. function FacilityAnalystTraceup3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystTraceup3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystTraceup3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystTraceup3DService_typeof(obj); }
  22433. function FacilityAnalystTraceup3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22434. 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); } }
  22435. function FacilityAnalystTraceup3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DService_defineProperties(Constructor, staticProps); return Constructor; }
  22436. function FacilityAnalystTraceup3DService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTraceup3DService_get = Reflect.get; } else { FacilityAnalystTraceup3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystTraceup3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FacilityAnalystTraceup3DService_get(target, property, receiver || target); }
  22437. function FacilityAnalystTraceup3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  22438. function FacilityAnalystTraceup3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystTraceup3DService_setPrototypeOf(subClass, superClass); }
  22439. function FacilityAnalystTraceup3DService_setPrototypeOf(o, p) { FacilityAnalystTraceup3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DService_setPrototypeOf(o, p); }
  22440. 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); }; }
  22441. function FacilityAnalystTraceup3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTraceup3DService_assertThisInitialized(self); }
  22442. function FacilityAnalystTraceup3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22443. function FacilityAnalystTraceup3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22444. function FacilityAnalystTraceup3DService_getPrototypeOf(o) { FacilityAnalystTraceup3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DService_getPrototypeOf(o); }
  22445. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22446. * This program are made available under the terms of the Apache License, Version 2.0
  22447. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22448. /**
  22449. * @class SuperMap.FacilityAnalystTraceup3DService
  22450. * @category iServer FacilityAnalyst3D TraceUpResult
  22451. * @classdesc 上游追踪资源服务类
  22452. * @extends {SuperMap.CommonServiceBase}
  22453. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  22454. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  22455. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  22456. * @param {Object} options - 参数。
  22457. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  22458. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22459. * @param {Object} [options.headers] - 请求头。
  22460. */
  22461. var FacilityAnalystTraceup3DService = /*#__PURE__*/function (_CommonServiceBase) {
  22462. FacilityAnalystTraceup3DService_inherits(FacilityAnalystTraceup3DService, _CommonServiceBase);
  22463. var _super = FacilityAnalystTraceup3DService_createSuper(FacilityAnalystTraceup3DService);
  22464. /**
  22465. * @function SuperMap.FacilityAnalystTraceup3DService.constructor
  22466. * @description 上游追踪资源服务类构造函数。
  22467. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  22468. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  22469. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  22470. * @param {Object} options - 参数。
  22471. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  22472. */
  22473. function FacilityAnalystTraceup3DService(url, options) {
  22474. var _this;
  22475. FacilityAnalystTraceup3DService_classCallCheck(this, FacilityAnalystTraceup3DService);
  22476. _this = _super.call(this, url, options);
  22477. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DService";
  22478. return _this;
  22479. }
  22480. /**
  22481. * @function SuperMap.FacilityAnalystTraceup3DService.prototype.destroy
  22482. * @override
  22483. */
  22484. FacilityAnalystTraceup3DService_createClass(FacilityAnalystTraceup3DService, [{
  22485. key: "destroy",
  22486. value: function destroy() {
  22487. FacilityAnalystTraceup3DService_get(FacilityAnalystTraceup3DService_getPrototypeOf(FacilityAnalystTraceup3DService.prototype), "destroy", this).call(this);
  22488. }
  22489. /**
  22490. * @function SuperMap.FacilityAnalystTraceup3DService.prototype.processAsync
  22491. * @description 负责将客户端的查询参数传递到服务端。
  22492. * @param {SuperMap.FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类
  22493. */
  22494. }, {
  22495. key: "processAsync",
  22496. value: function processAsync(params) {
  22497. if (!(params instanceof FacilityAnalystTraceup3DParameters)) {
  22498. return;
  22499. }
  22500. var me = this,
  22501. jsonObject;
  22502. me.url = Util.urlPathAppend(me.url, 'traceupresult');
  22503. jsonObject = {
  22504. edgeID: params.edgeID,
  22505. nodeID: params.nodeID,
  22506. weightName: params.weightName,
  22507. isUncertainDirectionValid: params.isUncertainDirectionValid
  22508. };
  22509. me.request({
  22510. method: "GET",
  22511. params: jsonObject,
  22512. scope: me,
  22513. success: me.serviceProcessCompleted,
  22514. failure: me.serviceProcessFailed
  22515. });
  22516. }
  22517. }]);
  22518. return FacilityAnalystTraceup3DService;
  22519. }(CommonServiceBase);
  22520. SuperMap.FacilityAnalystTraceup3DService = FacilityAnalystTraceup3DService;
  22521. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DParameters.js
  22522. function FacilityAnalystUpstream3DParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystUpstream3DParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystUpstream3DParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystUpstream3DParameters_typeof(obj); }
  22523. function FacilityAnalystUpstream3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22524. 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); } }
  22525. function FacilityAnalystUpstream3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22526. function FacilityAnalystUpstream3DParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystUpstream3DParameters_get = Reflect.get; } else { FacilityAnalystUpstream3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystUpstream3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FacilityAnalystUpstream3DParameters_get(target, property, receiver || target); }
  22527. function FacilityAnalystUpstream3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22528. function FacilityAnalystUpstream3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystUpstream3DParameters_setPrototypeOf(subClass, superClass); }
  22529. function FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p) { FacilityAnalystUpstream3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p); }
  22530. 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); }; }
  22531. function FacilityAnalystUpstream3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystUpstream3DParameters_assertThisInitialized(self); }
  22532. function FacilityAnalystUpstream3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22533. function FacilityAnalystUpstream3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22534. function FacilityAnalystUpstream3DParameters_getPrototypeOf(o) { FacilityAnalystUpstream3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DParameters_getPrototypeOf(o); }
  22535. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22536. * This program are made available under the terms of the Apache License, Version 2.0
  22537. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22538. /**
  22539. * @class SuperMap.FacilityAnalystUpstream3DParameters
  22540. * @category iServer FacilityAnalyst3D UpstreamCriticalFacilities
  22541. * @classdesc 上游关键设施查找资源参数类。
  22542. * @extends {SuperMap.FacilityAnalyst3DParameters}
  22543. * @param {Object} options - 参数。
  22544. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  22545. * @param {number} [options.edgeID] - 指定的弧段ID。edgeID 与 nodeID 必须指定一个。
  22546. * @param {number} [options.nodeID] - 指定的结点ID。edgeID 与 edgeID 必须指定一个。
  22547. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  22548. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  22549. */
  22550. var FacilityAnalystUpstream3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  22551. FacilityAnalystUpstream3DParameters_inherits(FacilityAnalystUpstream3DParameters, _FacilityAnalyst3DPar);
  22552. var _super = FacilityAnalystUpstream3DParameters_createSuper(FacilityAnalystUpstream3DParameters);
  22553. function FacilityAnalystUpstream3DParameters(options) {
  22554. var _this;
  22555. FacilityAnalystUpstream3DParameters_classCallCheck(this, FacilityAnalystUpstream3DParameters);
  22556. _this = _super.call(this, options);
  22557. options = options || {};
  22558. _this.sourceNodeIDs = null;
  22559. Util.extend(FacilityAnalystUpstream3DParameters_assertThisInitialized(_this), options);
  22560. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DParameters";
  22561. return _this;
  22562. }
  22563. /**
  22564. * @function SuperMap.FacilityAnalystUpstream3DParameters.prototype.destroy
  22565. * @override
  22566. */
  22567. FacilityAnalystUpstream3DParameters_createClass(FacilityAnalystUpstream3DParameters, [{
  22568. key: "destroy",
  22569. value: function destroy() {
  22570. FacilityAnalystUpstream3DParameters_get(FacilityAnalystUpstream3DParameters_getPrototypeOf(FacilityAnalystUpstream3DParameters.prototype), "destroy", this).call(this);
  22571. this.sourceNodeIDs = null;
  22572. }
  22573. }]);
  22574. return FacilityAnalystUpstream3DParameters;
  22575. }(FacilityAnalyst3DParameters);
  22576. SuperMap.FacilityAnalystUpstream3DParameters = FacilityAnalystUpstream3DParameters;
  22577. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DService.js
  22578. function FacilityAnalystUpstream3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystUpstream3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystUpstream3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystUpstream3DService_typeof(obj); }
  22579. function FacilityAnalystUpstream3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22580. 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); } }
  22581. function FacilityAnalystUpstream3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DService_defineProperties(Constructor, staticProps); return Constructor; }
  22582. function FacilityAnalystUpstream3DService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystUpstream3DService_get = Reflect.get; } else { FacilityAnalystUpstream3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystUpstream3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FacilityAnalystUpstream3DService_get(target, property, receiver || target); }
  22583. function FacilityAnalystUpstream3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  22584. function FacilityAnalystUpstream3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FacilityAnalystUpstream3DService_setPrototypeOf(subClass, superClass); }
  22585. function FacilityAnalystUpstream3DService_setPrototypeOf(o, p) { FacilityAnalystUpstream3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DService_setPrototypeOf(o, p); }
  22586. 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); }; }
  22587. function FacilityAnalystUpstream3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystUpstream3DService_assertThisInitialized(self); }
  22588. function FacilityAnalystUpstream3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22589. function FacilityAnalystUpstream3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22590. function FacilityAnalystUpstream3DService_getPrototypeOf(o) { FacilityAnalystUpstream3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DService_getPrototypeOf(o); }
  22591. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22592. * This program are made available under the terms of the Apache License, Version 2.0
  22593. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22594. /**
  22595. * @class SuperMap.FacilityAnalystUpstream3DService
  22596. * @category iServer FacilityAnalyst3D UpstreamCriticalFacilities
  22597. * @classdesc 上游关键设施查找资源服务类
  22598. * @extends {SuperMap.CommonServiceBase}
  22599. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  22600. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  22601. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  22602. * @param {Object} options - 参数。
  22603. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  22604. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22605. * @param {Object} [options.headers] - 请求头。
  22606. */
  22607. var FacilityAnalystUpstream3DService = /*#__PURE__*/function (_CommonServiceBase) {
  22608. FacilityAnalystUpstream3DService_inherits(FacilityAnalystUpstream3DService, _CommonServiceBase);
  22609. var _super = FacilityAnalystUpstream3DService_createSuper(FacilityAnalystUpstream3DService);
  22610. function FacilityAnalystUpstream3DService(url, options) {
  22611. var _this;
  22612. FacilityAnalystUpstream3DService_classCallCheck(this, FacilityAnalystUpstream3DService);
  22613. _this = _super.call(this, url, options);
  22614. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DService";
  22615. return _this;
  22616. }
  22617. /**
  22618. * @function SuperMap.FacilityAnalystUpstream3DService.prototype.destroy
  22619. * @override
  22620. */
  22621. FacilityAnalystUpstream3DService_createClass(FacilityAnalystUpstream3DService, [{
  22622. key: "destroy",
  22623. value: function destroy() {
  22624. FacilityAnalystUpstream3DService_get(FacilityAnalystUpstream3DService_getPrototypeOf(FacilityAnalystUpstream3DService.prototype), "destroy", this).call(this);
  22625. }
  22626. /**
  22627. * @function SuperMap.FacilityAnalystUpstream3DService.prototype.processAsync
  22628. * @description 负责将客户端的查询参数传递到服务端。
  22629. * @param {SuperMap.FacilityAnalystUpstream3DParameters} params - 上游关键设施查找资源参数类
  22630. */
  22631. }, {
  22632. key: "processAsync",
  22633. value: function processAsync(params) {
  22634. if (!(params instanceof FacilityAnalystUpstream3DParameters)) {
  22635. return;
  22636. }
  22637. var me = this,
  22638. jsonObject;
  22639. me.url = Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  22640. jsonObject = {
  22641. sourceNodeIDs: params.sourceNodeIDs,
  22642. edgeID: params.edgeID,
  22643. nodeID: params.nodeID,
  22644. isUncertainDirectionValid: params.isUncertainDirectionValid
  22645. };
  22646. me.request({
  22647. method: "GET",
  22648. params: jsonObject,
  22649. scope: me,
  22650. success: me.serviceProcessCompleted,
  22651. failure: me.serviceProcessFailed
  22652. });
  22653. }
  22654. }]);
  22655. return FacilityAnalystUpstream3DService;
  22656. }(CommonServiceBase);
  22657. SuperMap.FacilityAnalystUpstream3DService = FacilityAnalystUpstream3DService;
  22658. ;// CONCATENATED MODULE: ./src/common/iServer/FilterAggParameter.js
  22659. function FilterAggParameter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FilterAggParameter_typeof = function _typeof(obj) { return typeof obj; }; } else { FilterAggParameter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FilterAggParameter_typeof(obj); }
  22660. function FilterAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22661. function FilterAggParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22662. function FilterAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilterAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilterAggParameter_defineProperties(Constructor, staticProps); return Constructor; }
  22663. function FilterAggParameter_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FilterAggParameter_get = Reflect.get; } else { FilterAggParameter_get = function _get(target, property, receiver) { var base = FilterAggParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FilterAggParameter_get(target, property, receiver || target); }
  22664. function FilterAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FilterAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  22665. function FilterAggParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FilterAggParameter_setPrototypeOf(subClass, superClass); }
  22666. function FilterAggParameter_setPrototypeOf(o, p) { FilterAggParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FilterAggParameter_setPrototypeOf(o, p); }
  22667. function FilterAggParameter_createSuper(Derived) { var hasNativeReflectConstruct = FilterAggParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FilterAggParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FilterAggParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FilterAggParameter_possibleConstructorReturn(this, result); }; }
  22668. function FilterAggParameter_possibleConstructorReturn(self, call) { if (call && (FilterAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return FilterAggParameter_assertThisInitialized(self); }
  22669. function FilterAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22670. function FilterAggParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22671. function FilterAggParameter_getPrototypeOf(o) { FilterAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FilterAggParameter_getPrototypeOf(o); }
  22672. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22673. * This program are made available under the terms of the Apache License, Version 2.0
  22674. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22675. /**
  22676. * @class SuperMap.FilterAggParameter
  22677. * @classdesc 过滤条件参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  22678. * @category iServer Data FeatureResults
  22679. * @param {Object} options - 初始化参数。
  22680. * @param {SuperMap.AggQueryBuilderParameter} options.filterParam - 过滤条件参数设置类。
  22681. * @param {SuperMap.AggregationType} [options.aggType=AggregationType.FILTER] - 聚合类型。
  22682. */
  22683. var FilterAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  22684. FilterAggParameter_inherits(FilterAggParameter, _AggregationParameter);
  22685. var _super = FilterAggParameter_createSuper(FilterAggParameter);
  22686. function FilterAggParameter(options) {
  22687. var _this;
  22688. FilterAggParameter_classCallCheck(this, FilterAggParameter);
  22689. _this = _super.call(this, options);
  22690. /**
  22691. * @member {SuperMap.AggQueryBuilderParameter} SuperMap.FilterAggParameter.prototype.filterParam
  22692. * @description 过滤条件参数设置类。
  22693. */
  22694. _this.filterParam = null;
  22695. /**
  22696. * @member {SuperMap.AggregationType} [SuperMap.FilterAggParameter.prototype.aggType=AggregationType.FILTER]
  22697. * @description 聚合类型。
  22698. */
  22699. _this.aggType = AggregationType.FILTER;
  22700. _this.CLASS_NAME = "SuperMap.FilterAggParameter";
  22701. Util.extend(FilterAggParameter_assertThisInitialized(_this), options);
  22702. return _this;
  22703. }
  22704. FilterAggParameter_createClass(FilterAggParameter, [{
  22705. key: "destroy",
  22706. value: function destroy() {
  22707. FilterAggParameter_get(FilterAggParameter_getPrototypeOf(FilterAggParameter.prototype), "destroy", this).call(this);
  22708. var me = this;
  22709. if (me.filterParam) {
  22710. me.filterParam = null;
  22711. }
  22712. }
  22713. }]);
  22714. return FilterAggParameter;
  22715. }(AggregationParameter);
  22716. SuperMap.FilterAggParameter = FilterAggParameter;
  22717. ;// CONCATENATED MODULE: ./src/common/iServer/FieldParameters.js
  22718. function FieldParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22719. 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); } }
  22720. function FieldParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22721. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22722. * This program are made available under the terms of the Apache License, Version 2.0
  22723. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22724. /**
  22725. * @class SuperMap.FieldParameters
  22726. * @category iServer Data Field
  22727. * @classdesc 字段信息查询参数类。
  22728. * @param {Object} options - 参数。
  22729. * @param {string} options.datasource - 数据源名称。
  22730. * @param {string} options.dataset - 数据集名称。
  22731. */
  22732. var FieldParameters = /*#__PURE__*/function () {
  22733. function FieldParameters(options) {
  22734. FieldParameters_classCallCheck(this, FieldParameters);
  22735. /**
  22736. * @member {string} SuperMap.FieldParameters.prototype.datasource
  22737. * @description 要查询的数据集所在的数据源名称。
  22738. */
  22739. this.datasource = null;
  22740. /**
  22741. * @member {string} SuperMap.FieldParameters.prototype.dataset
  22742. * @description 要查询的数据集名称。
  22743. */
  22744. this.dataset = null;
  22745. if (options) {
  22746. Util.extend(this, options);
  22747. }
  22748. this.CLASS_NAME = "SuperMap.FieldParameters";
  22749. }
  22750. /**
  22751. * @function SuperMap.FieldParameters.prototype.destroy
  22752. * @description 释放资源,将引用资源的属性置空。
  22753. */
  22754. FieldParameters_createClass(FieldParameters, [{
  22755. key: "destroy",
  22756. value: function destroy() {
  22757. var me = this;
  22758. me.datasource = null;
  22759. me.dataset = null;
  22760. }
  22761. }]);
  22762. return FieldParameters;
  22763. }();
  22764. SuperMap.FieldParameters = FieldParameters;
  22765. ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticsParameters.js
  22766. function FieldStatisticsParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FieldStatisticsParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FieldStatisticsParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FieldStatisticsParameters_typeof(obj); }
  22767. function FieldStatisticsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22768. 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); } }
  22769. function FieldStatisticsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22770. function FieldStatisticsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FieldStatisticsParameters_setPrototypeOf(subClass, superClass); }
  22771. function FieldStatisticsParameters_setPrototypeOf(o, p) { FieldStatisticsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticsParameters_setPrototypeOf(o, p); }
  22772. 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); }; }
  22773. function FieldStatisticsParameters_possibleConstructorReturn(self, call) { if (call && (FieldStatisticsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldStatisticsParameters_assertThisInitialized(self); }
  22774. function FieldStatisticsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22775. function FieldStatisticsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22776. function FieldStatisticsParameters_getPrototypeOf(o) { FieldStatisticsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticsParameters_getPrototypeOf(o); }
  22777. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22778. * This program are made available under the terms of the Apache License, Version 2.0
  22779. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22780. /**
  22781. * @class SuperMap.FieldStatisticsParameters
  22782. * @category iServer Data Field
  22783. * @classdesc 字段统计信息查询参数类。
  22784. * @param {Object} options - 参数。
  22785. * @param {string} options.datasource - 数据源名称。
  22786. * @param {string} options.dataset - 数据集名称。
  22787. * @param {string} options.fieldName - 字段名。
  22788. * @param {(string.<SuperMap.StatisticMode>|Array.<string.<SuperMap.StatisticMode>>)} statisticMode - 字段统计方法类型。
  22789. * @extends {SuperMap.FieldParameters}
  22790. */
  22791. var FieldStatisticsParameters = /*#__PURE__*/function (_FieldParameters) {
  22792. FieldStatisticsParameters_inherits(FieldStatisticsParameters, _FieldParameters);
  22793. var _super = FieldStatisticsParameters_createSuper(FieldStatisticsParameters);
  22794. function FieldStatisticsParameters(options) {
  22795. var _this;
  22796. FieldStatisticsParameters_classCallCheck(this, FieldStatisticsParameters);
  22797. _this = _super.call(this, options);
  22798. /**
  22799. * @member {string} SuperMap.FieldStatisticsParameters.prototype.fieldName
  22800. * @description 字段名
  22801. */
  22802. _this.fieldName = null;
  22803. /**
  22804. * @member {(string.<SuperMap.StatisticMode>|Array.<string.<SuperMap.StatisticMode>>)} SuperMap.FieldStatisticsParameters.prototype.statisticMode
  22805. * @description 字段统计方法类型
  22806. */
  22807. _this.statisticMode = null;
  22808. if (options) {
  22809. Util.extend(FieldStatisticsParameters_assertThisInitialized(_this), options);
  22810. }
  22811. _this.CLASS_NAME = "SuperMap.FieldStatisticsParameters";
  22812. return _this;
  22813. }
  22814. /**
  22815. * @function SuperMap.FieldStatisticsParameters.prototype.destroy
  22816. * @description 释放资源,将引用资源的属性置空。
  22817. */
  22818. FieldStatisticsParameters_createClass(FieldStatisticsParameters, [{
  22819. key: "destroy",
  22820. value: function destroy() {
  22821. var me = this;
  22822. me.fieldName = null;
  22823. me.statisticMode = null;
  22824. }
  22825. }]);
  22826. return FieldStatisticsParameters;
  22827. }(FieldParameters);
  22828. SuperMap.FieldStatisticsParameters = FieldStatisticsParameters;
  22829. ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticService.js
  22830. function FieldStatisticService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FieldStatisticService_typeof = function _typeof(obj) { return typeof obj; }; } else { FieldStatisticService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FieldStatisticService_typeof(obj); }
  22831. function FieldStatisticService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22832. 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); } }
  22833. function FieldStatisticService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticService_defineProperties(Constructor, staticProps); return Constructor; }
  22834. function FieldStatisticService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FieldStatisticService_get = Reflect.get; } else { FieldStatisticService_get = function _get(target, property, receiver) { var base = FieldStatisticService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FieldStatisticService_get(target, property, receiver || target); }
  22835. function FieldStatisticService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FieldStatisticService_getPrototypeOf(object); if (object === null) break; } return object; }
  22836. function FieldStatisticService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FieldStatisticService_setPrototypeOf(subClass, superClass); }
  22837. function FieldStatisticService_setPrototypeOf(o, p) { FieldStatisticService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticService_setPrototypeOf(o, p); }
  22838. 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); }; }
  22839. function FieldStatisticService_possibleConstructorReturn(self, call) { if (call && (FieldStatisticService_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldStatisticService_assertThisInitialized(self); }
  22840. function FieldStatisticService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22841. function FieldStatisticService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22842. function FieldStatisticService_getPrototypeOf(o) { FieldStatisticService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticService_getPrototypeOf(o); }
  22843. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22844. * This program are made available under the terms of the Apache License, Version 2.0
  22845. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22846. /**
  22847. * @class SuperMap.FieldStatisticService
  22848. * @category iServer Data Field
  22849. * @classdesc 字段查询统计服务类。用来完成对指定数据集指定字段的查询统计分析,即求平均值,最大值等。
  22850. * @extends {SuperMap.CommonServiceBase}
  22851. * @param {string} url - 服务的访问地址。如访问 World Map 服务,只需将 url 设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  22852. * @param {Object} options - 参数。
  22853. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  22854. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  22855. * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  22856. * @param {string} options.datasource - 数据集所在的数据源名称。
  22857. * @param {string} options.dataset - 数据集名称。
  22858. * @param {string} options.field - 查询统计的目标字段名称。
  22859. * @param {SuperMap.StatisticMode} options.statisticMode - 字段查询统计的方法类型。
  22860. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22861. * @param {Object} [options.headers] - 请求头。
  22862. * @example
  22863. * var myService = new SuperMap.FieldStatisticService(url, {eventListeners: {
  22864. * "processCompleted": fieldStatisticCompleted,
  22865. * "processFailed": fieldStatisticError
  22866. * },
  22867. * datasource: "World",
  22868. * dataset: "Countries",
  22869. * field: "SmID",
  22870. * statisticMode: StatisticMode.AVERAGE
  22871. * };
  22872. */
  22873. var FieldStatisticService = /*#__PURE__*/function (_CommonServiceBase) {
  22874. FieldStatisticService_inherits(FieldStatisticService, _CommonServiceBase);
  22875. var _super = FieldStatisticService_createSuper(FieldStatisticService);
  22876. function FieldStatisticService(url, options) {
  22877. var _this;
  22878. FieldStatisticService_classCallCheck(this, FieldStatisticService);
  22879. _this = _super.call(this, url, options);
  22880. /**
  22881. * @member {string} SuperMap.FieldStatisticService.prototype.datasource
  22882. * @description 数据集所在的数据源名称。
  22883. */
  22884. _this.datasource = null;
  22885. /**
  22886. * @member {string} SuperMap.FieldStatisticService.prototype.dataset
  22887. * @description 数据集名称。
  22888. */
  22889. _this.dataset = null;
  22890. /**
  22891. * @member {string} SuperMap.FieldStatisticService.prototype.field
  22892. * @description 查询统计的目标字段名称。
  22893. */
  22894. _this.field = null;
  22895. /**
  22896. * @member {SuperMap.StatisticMode} SuperMap.FieldStatisticService.prototype.statisticMode
  22897. * @description 字段查询统计的方法类型。
  22898. */
  22899. _this.statisticMode = null;
  22900. if (options) {
  22901. Util.extend(FieldStatisticService_assertThisInitialized(_this), options);
  22902. }
  22903. _this.CLASS_NAME = "SuperMap.FieldStatisticService";
  22904. return _this;
  22905. }
  22906. /**
  22907. * @function SuperMap.FieldStatisticService.prototype.destroy
  22908. * @override
  22909. */
  22910. FieldStatisticService_createClass(FieldStatisticService, [{
  22911. key: "destroy",
  22912. value: function destroy() {
  22913. FieldStatisticService_get(FieldStatisticService_getPrototypeOf(FieldStatisticService.prototype), "destroy", this).call(this);
  22914. var me = this;
  22915. me.datasource = null;
  22916. me.dataset = null;
  22917. me.field = null;
  22918. me.statisticMode = null;
  22919. }
  22920. /**
  22921. * @function SuperMap.FieldStatisticService.prototype.processAsync
  22922. * @description 执行服务,进行指定字段的查询统计。
  22923. */
  22924. }, {
  22925. key: "processAsync",
  22926. value: function processAsync() {
  22927. var me = this,
  22928. fieldStatisticURL = "datasources/" + me.datasource + "/datasets/" + me.dataset + "/fields/" + me.field + "/" + me.statisticMode;
  22929. me.url = Util.urlPathAppend(me.url, fieldStatisticURL);
  22930. me.request({
  22931. method: "GET",
  22932. data: null,
  22933. scope: me,
  22934. success: me.serviceProcessCompleted,
  22935. failure: me.serviceProcessFailed
  22936. });
  22937. }
  22938. }]);
  22939. return FieldStatisticService;
  22940. }(CommonServiceBase);
  22941. SuperMap.FieldStatisticService = FieldStatisticService;
  22942. ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesParameters.js
  22943. function FindClosestFacilitiesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22944. 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); } }
  22945. function FindClosestFacilitiesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22946. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22947. * This program are made available under the terms of the Apache License, Version 2.0
  22948. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22949. /**
  22950. * @class SuperMap.FindClosestFacilitiesParameters
  22951. * @category iServer NetworkAnalyst ClosestFacility
  22952. * @classdesc 最近设施分析参数类。
  22953. * @param {Object} options - 参数。
  22954. * @param {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)} options.event - 事件点,一般为需要获得服务设施服务的事件位置。
  22955. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.facilities - 设施点集合,一般为提供服务的服务设施位置。
  22956. * @param {number} [options.expectFacilityCount=1] - 要查找的设施点数量。
  22957. * @param {boolean} [options.fromEvent=false] - 是否从事件点到设施点进行查找。
  22958. * @param {boolean} [options.isAnalyzeById=false] - 事件点和设施点是否通过节点 ID 号来指定。
  22959. * @param {number} [options.maxWeight=0] - 查找半径。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  22960. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  22961. */
  22962. var FindClosestFacilitiesParameters = /*#__PURE__*/function () {
  22963. function FindClosestFacilitiesParameters(options) {
  22964. FindClosestFacilitiesParameters_classCallCheck(this, FindClosestFacilitiesParameters);
  22965. /**
  22966. * @member {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)} SuperMap.FindClosestFacilitiesParameters.prototype.event
  22967. * @description 事件点,一般为需要获得服务设施服务的事件位置。
  22968. * 可以通过两种方式赋予事件点:当该类中字段 isAnalyzeById = true 时,应输入事件点 ID 号;当 isAnalyzeById = false 时,应输入事件点坐标。
  22969. */
  22970. this.event = null;
  22971. /**
  22972. * @member {number} [SuperMap.FindClosestFacilitiesParameters.prototype.expectFacilityCount=1]
  22973. * @description 要查找的设施点数量。
  22974. */
  22975. this.expectFacilityCount = 1;
  22976. /**
  22977. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} [SuperMap.FindClosestFacilitiesParameters.prototype.facilities=false]
  22978. * @description 设施点集合,一般为提供服务的服务设施位置。
  22979. * 可以通过两种方式赋予设施点:当该类中字段 isAnalyzeById = true 时,应输入设施点 ID 号;当 isAnalyzeById = false 时,应输入设施点坐标。
  22980. */
  22981. this.facilities = null;
  22982. /**
  22983. * @member {boolean} [SuperMap.FindClosestFacilitiesParameters.prototype.fromEvent=false]
  22984. * @description 是否从事件点到设施点进行查找。最近设施分析主要是通过设施点和事件点之间最优的路线来分析在一定范围内哪个或哪些设施与事件点有最优路线的关系。
  22985. * 这个行走线路是通过网络图层进行网络分析算法计算出来的两点间的最优路线。由于存在从 A 点到 B 点与从 B 点到 A 点的耗费不一样的情况,因此起止点
  22986. * 不同可能会得到不同的最优路线。因此在进行最近设施分析之前,需要设置获取的最优路线的方向,即是以事件点作为起点到最近设施点的方向分析,还是以最
  22987. * 近设施点为起点到事件点的方向分析。如果需要以事件点作为起点到设施点方向进行查找,设置该字段值为 true;设置为 false,表示从设施点到事件点进行查找。
  22988. */
  22989. this.fromEvent = false;
  22990. /**
  22991. * @member {boolean} [SuperMap.FindClosestFacilitiesParameters.prototype.isAnalyzeById=false]
  22992. * @description 事件点和设施点是否通过节点 ID 号来指定,设置为 false,表示通过坐标点指定事件点和设施点。
  22993. */
  22994. this.isAnalyzeById = false;
  22995. /**
  22996. * @member {number} [SuperMap.FindClosestFacilitiesParameters.prototype.maxWeight=0]
  22997. * @description 查找半径。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  22998. * 例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,超过 10 分钟能到达的都不予考虑。
  22999. * 那么需要将网络分析参数中 parameter.weightFieldName 设置为表示时间的字段,然后设置查找范围的半径值为10。
  23000. */
  23001. this.maxWeight = 0;
  23002. /**
  23003. * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindClosestFacilitiesParameters.prototype.parameter]
  23004. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  23005. * 它为 SuperMap.TransportationAnalystParameter 类型,虽然为可选参数,但是如果不设置其中的 resultSetting 字段,
  23006. * 则返回结果空间信息等都为空。
  23007. */
  23008. this.parameter = new TransportationAnalystParameter();
  23009. Util.extend(this, options);
  23010. this.CLASS_NAME = "SuperMap.FindClosestFacilitiesParameters";
  23011. }
  23012. /**
  23013. * @function SuperMap.FindClosestFacilitiesParameters.prototype.destroy
  23014. * @description 释放资源,将引用资源的属性置空。
  23015. */
  23016. FindClosestFacilitiesParameters_createClass(FindClosestFacilitiesParameters, [{
  23017. key: "destroy",
  23018. value: function destroy() {
  23019. var me = this;
  23020. me.event = null;
  23021. me.expectFacilityCount = null;
  23022. me.facilities = null;
  23023. me.fromEvent = null;
  23024. me.isAnalyzeById = null;
  23025. me.maxWeight = null;
  23026. if (me.parameter) {
  23027. me.parameter.destroy();
  23028. me.parameter = null;
  23029. }
  23030. }
  23031. }]);
  23032. return FindClosestFacilitiesParameters;
  23033. }();
  23034. SuperMap.FindClosestFacilitiesParameters = FindClosestFacilitiesParameters;
  23035. ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesService.js
  23036. function FindClosestFacilitiesService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindClosestFacilitiesService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindClosestFacilitiesService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindClosestFacilitiesService_typeof(obj); }
  23037. function FindClosestFacilitiesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23038. 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); } }
  23039. function FindClosestFacilitiesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesService_defineProperties(Constructor, staticProps); return Constructor; }
  23040. function FindClosestFacilitiesService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindClosestFacilitiesService_get = Reflect.get; } else { FindClosestFacilitiesService_get = function _get(target, property, receiver) { var base = FindClosestFacilitiesService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FindClosestFacilitiesService_get(target, property, receiver || target); }
  23041. function FindClosestFacilitiesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindClosestFacilitiesService_getPrototypeOf(object); if (object === null) break; } return object; }
  23042. function FindClosestFacilitiesService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FindClosestFacilitiesService_setPrototypeOf(subClass, superClass); }
  23043. function FindClosestFacilitiesService_setPrototypeOf(o, p) { FindClosestFacilitiesService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindClosestFacilitiesService_setPrototypeOf(o, p); }
  23044. 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); }; }
  23045. function FindClosestFacilitiesService_possibleConstructorReturn(self, call) { if (call && (FindClosestFacilitiesService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindClosestFacilitiesService_assertThisInitialized(self); }
  23046. function FindClosestFacilitiesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23047. function FindClosestFacilitiesService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23048. function FindClosestFacilitiesService_getPrototypeOf(o) { FindClosestFacilitiesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindClosestFacilitiesService_getPrototypeOf(o); }
  23049. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23050. * This program are made available under the terms of the Apache License, Version 2.0
  23051. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23052. /**
  23053. * @class SuperMap.FindClosestFacilitiesService
  23054. * @category iServer NetworkAnalyst ClosestFacility
  23055. * @classdesc 最近设施分析服务类。
  23056. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  23057. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  23058. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  23059. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  23060. * @extends {SuperMap.NetworkAnalystServiceBase}
  23061. * @example
  23062. * var myfindClosestFacilitiesService = new SuperMap.FindClosestFacilitiesService(url, {
  23063. * eventListeners: {
  23064. * "processCompleted": findClosestFacilitiesCompleted,
  23065. * "processFailed": findClosestFacilitiesError
  23066. * }
  23067. * });
  23068. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  23069. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  23070. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  23071. * @param {Object} options - 参数。
  23072. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  23073. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23074. * @param {Object} [options.headers] - 请求头。
  23075. */
  23076. var FindClosestFacilitiesService = /*#__PURE__*/function (_NetworkAnalystServic) {
  23077. FindClosestFacilitiesService_inherits(FindClosestFacilitiesService, _NetworkAnalystServic);
  23078. var _super = FindClosestFacilitiesService_createSuper(FindClosestFacilitiesService);
  23079. /*
  23080. * @function SuperMap.FindClosestFacilitiesService.prototype.constructor
  23081. * @description 最近设施分析服务类构造函数。
  23082. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  23083. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  23084. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  23085. * @param {Object} options - 选参数。<br>
  23086. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  23087. */
  23088. function FindClosestFacilitiesService(url, options) {
  23089. var _this;
  23090. FindClosestFacilitiesService_classCallCheck(this, FindClosestFacilitiesService);
  23091. _this = _super.call(this, url, options);
  23092. _this.CLASS_NAME = "SuperMap.FindClosestFacilitiesService";
  23093. return _this;
  23094. }
  23095. /**
  23096. * @function SuperMap.FindClosestFacilitiesService.prototype.destroy
  23097. * @override
  23098. */
  23099. FindClosestFacilitiesService_createClass(FindClosestFacilitiesService, [{
  23100. key: "destroy",
  23101. value: function destroy() {
  23102. FindClosestFacilitiesService_get(FindClosestFacilitiesService_getPrototypeOf(FindClosestFacilitiesService.prototype), "destroy", this).call(this);
  23103. }
  23104. /**
  23105. * @function SuperMap.FindClosestFacilitiesService.prototype.processAsync
  23106. * @description 负责将客户端的查询参数传递到服务端。
  23107. * @param {SuperMap.FindClosestFacilitiesParameters} params - 最近设施分析服务参数类
  23108. */
  23109. }, {
  23110. key: "processAsync",
  23111. value: function processAsync(params) {
  23112. if (!(params instanceof FindClosestFacilitiesParameters)) {
  23113. return;
  23114. }
  23115. var me = this,
  23116. jsonObject;
  23117. me.url = Util.urlPathAppend(me.url, 'closestfacility');
  23118. jsonObject = {
  23119. expectFacilityCount: params.expectFacilityCount,
  23120. fromEvent: params.fromEvent,
  23121. maxWeight: params.maxWeight,
  23122. parameter: Util.toJSON(params.parameter),
  23123. event: Util.toJSON(params.event),
  23124. facilities: me.getJson(params.isAnalyzeById, params.facilities)
  23125. };
  23126. me.request({
  23127. method: "GET",
  23128. params: jsonObject,
  23129. scope: me,
  23130. success: me.serviceProcessCompleted,
  23131. failure: me.serviceProcessFailed
  23132. });
  23133. }
  23134. /**
  23135. * @function SuperMap.FindClosestFacilitiesService.prototype.getJson
  23136. * @description 将对象转化为JSON字符串。
  23137. * @param {boolean} isAnalyzeById - 是否通过ID来分析
  23138. * @param {Array} params - 分析参数数组
  23139. * @returns {Object} 转化后的JSON字符串。
  23140. */
  23141. }, {
  23142. key: "getJson",
  23143. value: function getJson(isAnalyzeById, params) {
  23144. var jsonString = "[",
  23145. len = params ? params.length : 0;
  23146. if (isAnalyzeById === false) {
  23147. for (var i = 0; i < len; i++) {
  23148. if (i > 0) {
  23149. jsonString += ",";
  23150. }
  23151. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  23152. }
  23153. } else if (isAnalyzeById === true) {
  23154. for (var _i = 0; _i < len; _i++) {
  23155. if (_i > 0) {
  23156. jsonString += ",";
  23157. }
  23158. jsonString += params[_i];
  23159. }
  23160. }
  23161. jsonString += ']';
  23162. return jsonString;
  23163. }
  23164. /**
  23165. * @function SuperMap.FindClosestFacilitiesService.prototype.toGeoJSONResult
  23166. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  23167. * @param {Object} result - 服务器返回的结果对象。
  23168. */
  23169. }, {
  23170. key: "toGeoJSONResult",
  23171. value: function toGeoJSONResult(result) {
  23172. if (!result || !result.facilityPathList) {
  23173. return result;
  23174. }
  23175. var geoJSONFormat = new GeoJSON();
  23176. result.facilityPathList.map(function (path) {
  23177. if (path.route) {
  23178. path.route = geoJSONFormat.toGeoJSON(path.route);
  23179. }
  23180. if (path.pathGuideItems) {
  23181. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  23182. }
  23183. if (path.edgeFeatures) {
  23184. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  23185. }
  23186. if (path.nodeFeatures) {
  23187. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  23188. }
  23189. return path;
  23190. });
  23191. return result;
  23192. }
  23193. }]);
  23194. return FindClosestFacilitiesService;
  23195. }(NetworkAnalystServiceBase);
  23196. SuperMap.FindClosestFacilitiesService = FindClosestFacilitiesService;
  23197. ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationParameters.js
  23198. function FindLocationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23199. 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); } }
  23200. function FindLocationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23201. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23202. * This program are made available under the terms of the Apache License, Version 2.0
  23203. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23204. /**
  23205. * @class SuperMap.FindLocationParameters
  23206. * @category iServer NetworkAnalyst Location
  23207. * @classdesc 选址分区分析参数类。
  23208. * @param {Object} options - 参数。
  23209. * @param {string} options.turnWeightField - 转向权值字段的名称。
  23210. * @param {string} options.weightName - 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  23211. * @param {Array.<SuperMap.SupplyCenter>} options.supplyCenters - 资源供给中心集合。
  23212. * @param {number} [options.expectedSupplyCenterCount=1] - 期望用于最终设施选址的资源供给中心数量。
  23213. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分配资源。
  23214. */
  23215. var FindLocationParameters = /*#__PURE__*/function () {
  23216. function FindLocationParameters(options) {
  23217. FindLocationParameters_classCallCheck(this, FindLocationParameters);
  23218. /**
  23219. * @member {number} [SuperMap.FindLocationParameters.prototype.expectedSupplyCenterCount=1]
  23220. * @description 期望用于最终设施选址的资源供给中心数量。
  23221. * 当输入值为 0 时,最终设施选址的资源供给中心数量默认为覆盖分析区域内的所需最少的供给中心数。
  23222. */
  23223. this.expectedSupplyCenterCount = null;
  23224. /**
  23225. * @member {boolean} [SuperMap.FindLocationParameters.prototype.isFromCenter=false]
  23226. * @description 是否从中心点开始分配资源。
  23227. * 由于网路数据中的弧段具有正反阻力,即弧段的正向阻力值与其反向阻力值可能不同,
  23228. * 因此,在进行分析时,从资源供给中心开始分配资源到需求点与从需求点向资源供给中心分配这两种分配形式下,所得的分析结果会不同。
  23229. */
  23230. this.isFromCenter = false;
  23231. /**
  23232. * @member {Array.<SuperMap.SupplyCenter>} SuperMap.FindLocationParameters.prototype.supplyCenters
  23233. * @description 资源供给中心集合。
  23234. * 资源供给中心是提供资源和服务的设施,对应于网络结点,
  23235. * 资源供给中心的相关信息包括资源量、最大阻力值、资源供给中心类型,资源供给中心在网络中所处结点的 ID 等,以便在进行选址分区分析时使用。
  23236. */
  23237. this.supplyCenters = null;
  23238. /**
  23239. * @member {string} SuperMap.FindLocationParameters.prototype.turnWeightField
  23240. * @description 转向权值字段的名称。
  23241. */
  23242. this.turnWeightField = null;
  23243. /**
  23244. * @member {string} SuperMap.FindLocationParameters.prototype.weightName
  23245. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  23246. */
  23247. this.weightName = null;
  23248. Util.extend(this, options);
  23249. this.CLASS_NAME = "SuperMap.FindLocationParameters";
  23250. }
  23251. /**
  23252. * @function SuperMap.FindLocationParameters.prototype.destroy
  23253. * @description 释放资源,将引用资源的属性置空。
  23254. */
  23255. FindLocationParameters_createClass(FindLocationParameters, [{
  23256. key: "destroy",
  23257. value: function destroy() {
  23258. var me = this;
  23259. me.expectedSupplyCenterCount = null;
  23260. me.isFromCenter = null;
  23261. me.turnWeightField = null;
  23262. me.weightName = null;
  23263. if (me.supplyCenters) {
  23264. for (var i = 0, supplyCenters = me.supplyCenters, len = supplyCenters.length; i < len; i++) {
  23265. supplyCenters[i].destroy();
  23266. }
  23267. me.supplyCenters = null;
  23268. }
  23269. }
  23270. }]);
  23271. return FindLocationParameters;
  23272. }();
  23273. SuperMap.FindLocationParameters = FindLocationParameters;
  23274. ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationService.js
  23275. function FindLocationService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindLocationService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindLocationService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindLocationService_typeof(obj); }
  23276. function FindLocationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23277. 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); } }
  23278. function FindLocationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationService_defineProperties(Constructor, staticProps); return Constructor; }
  23279. function FindLocationService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindLocationService_get = Reflect.get; } else { FindLocationService_get = function _get(target, property, receiver) { var base = FindLocationService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FindLocationService_get(target, property, receiver || target); }
  23280. function FindLocationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindLocationService_getPrototypeOf(object); if (object === null) break; } return object; }
  23281. function FindLocationService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FindLocationService_setPrototypeOf(subClass, superClass); }
  23282. function FindLocationService_setPrototypeOf(o, p) { FindLocationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindLocationService_setPrototypeOf(o, p); }
  23283. 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); }; }
  23284. function FindLocationService_possibleConstructorReturn(self, call) { if (call && (FindLocationService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindLocationService_assertThisInitialized(self); }
  23285. function FindLocationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23286. function FindLocationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23287. function FindLocationService_getPrototypeOf(o) { FindLocationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindLocationService_getPrototypeOf(o); }
  23288. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23289. * This program are made available under the terms of the Apache License, Version 2.0
  23290. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23291. /**
  23292. * @class SuperMap.FindLocationService
  23293. * @category iServer NetworkAnalyst Location
  23294. * @classdesc 选址分区分析服务类。
  23295. * 选址分区分析是为了确定一个或多个待建设施的最佳或最优位置,使得设施可以用一种最经济有效的方式为需求方提供服务或者商品。
  23296. * 选址分区不仅仅是一个选址过程,还要将需求点的需求分配到相应的新建设施的服务区中,因此称之为选址与分区。
  23297. * 选址分区分析结果通过该类支持的事件的监听函数参数获取
  23298. * @extends {SuperMap.NetworkAnalystServiceBase}
  23299. * @example
  23300. * (start code)
  23301. * var findLocationService = new SuperMap.FindLocationService(url, {
  23302. * eventListeners: {
  23303. * "processCompleted": findLocationCompleted,
  23304. * "processFailed": findLocationError
  23305. * }
  23306. * });
  23307. * (end)
  23308. * @param {string} url - 服务的访问地址。
  23309. * 如 http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  23310. * @param {Object} options - 参数。
  23311. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  23312. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23313. * @param {Object} [options.headers] - 请求头。
  23314. */
  23315. var FindLocationService = /*#__PURE__*/function (_NetworkAnalystServic) {
  23316. FindLocationService_inherits(FindLocationService, _NetworkAnalystServic);
  23317. var _super = FindLocationService_createSuper(FindLocationService);
  23318. function FindLocationService(url, options) {
  23319. var _this;
  23320. FindLocationService_classCallCheck(this, FindLocationService);
  23321. _this = _super.call(this, url, options);
  23322. _this.CLASS_NAME = "SuperMap.FindLocationService";
  23323. return _this;
  23324. }
  23325. /**
  23326. * @function SuperMap.FindLocationService.prototype.destroy
  23327. * @override
  23328. */
  23329. FindLocationService_createClass(FindLocationService, [{
  23330. key: "destroy",
  23331. value: function destroy() {
  23332. FindLocationService_get(FindLocationService_getPrototypeOf(FindLocationService.prototype), "destroy", this).call(this);
  23333. }
  23334. /**
  23335. * @function SuperMap.FindLocationService.prototype.processAsync
  23336. * @description 负责将客户端的查询参数传递到服务端。
  23337. * @param {SuperMap.FindLocationParameters} params - 选址分区分析服务参数类
  23338. */
  23339. }, {
  23340. key: "processAsync",
  23341. value: function processAsync(params) {
  23342. if (!(params instanceof FindLocationParameters)) {
  23343. return;
  23344. }
  23345. var me = this,
  23346. jsonObject;
  23347. me.url = Util.urlPathAppend(me.url, 'location');
  23348. jsonObject = {
  23349. isFromCenter: params.isFromCenter,
  23350. expectedSupplyCenterCount: params.expectedSupplyCenterCount,
  23351. weightName: params.weightName,
  23352. turnWeightField: params.turnWeightField,
  23353. returnEdgeFeature: true,
  23354. returnEdgeGeometry: true,
  23355. returnNodeFeature: true,
  23356. mapParameter: Util.toJSON(params.mapParameter),
  23357. supplyCenters: me.getCentersJson(params.supplyCenters)
  23358. };
  23359. me.request({
  23360. method: "GET",
  23361. params: jsonObject,
  23362. scope: me,
  23363. success: me.serviceProcessCompleted,
  23364. failure: me.serviceProcessFailed
  23365. });
  23366. }
  23367. /**
  23368. * @function SuperMap.FindLocationService.prototype.getCentersJson
  23369. * @description 将数组对象转化为JSON字符串。
  23370. * @param {Array} params - 需要转换的参数
  23371. * @returns {string} 转化后的JSON字符串。
  23372. */
  23373. }, {
  23374. key: "getCentersJson",
  23375. value: function getCentersJson(params) {
  23376. var json = "[",
  23377. len = params ? params.length : 0;
  23378. for (var i = 0; i < len; i++) {
  23379. if (i > 0) {
  23380. json += ",";
  23381. }
  23382. json += Util.toJSON(params[i]);
  23383. }
  23384. json += "]";
  23385. return json;
  23386. }
  23387. /**
  23388. * @function SuperMap.FindLocationService.prototype.toGeoJSONResult
  23389. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  23390. * @param {Object} result - 服务器返回的结果对象。
  23391. */
  23392. }, {
  23393. key: "toGeoJSONResult",
  23394. value: function toGeoJSONResult(result) {
  23395. if (!result) {
  23396. return null;
  23397. }
  23398. var geoJSONFormat = new GeoJSON();
  23399. if (result.demandResults) {
  23400. result.demandResults = geoJSONFormat.toGeoJSON(result.demandResults);
  23401. }
  23402. if (result.supplyResults) {
  23403. result.supplyResults = geoJSONFormat.toGeoJSON(result.supplyResults);
  23404. }
  23405. return result;
  23406. }
  23407. }]);
  23408. return FindLocationService;
  23409. }(NetworkAnalystServiceBase);
  23410. SuperMap.FindLocationService = FindLocationService;
  23411. ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsParameters.js
  23412. function FindMTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23413. 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); } }
  23414. function FindMTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23415. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23416. * This program are made available under the terms of the Apache License, Version 2.0
  23417. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23418. /**
  23419. * @class SuperMap.FindMTSPPathsParameters
  23420. * @category iServer NetworkAnalyst MTSPPath
  23421. * @classdesc 多旅行商分析参数类
  23422. * @param {Object} options - 参数。
  23423. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.centers - 配送中心集合。
  23424. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 配送目标集合。
  23425. * @param {boolean} [options.hasLeastTotalCost=false] - 配送模式是否为总花费最小方案。
  23426. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  23427. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  23428. */
  23429. var FindMTSPPathsParameters = /*#__PURE__*/function () {
  23430. function FindMTSPPathsParameters(options) {
  23431. FindMTSPPathsParameters_classCallCheck(this, FindMTSPPathsParameters);
  23432. /**
  23433. * @member SuperMap.FindMTSPPathsParameters.prototype.centers - {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>}
  23434. * @description 配送中心集合。
  23435. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = false 时,centers 应为点的坐标数组;
  23436. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = true 时,centers 应为点的 ID 数组。
  23437. */
  23438. this.centers = null;
  23439. /**
  23440. * @member {boolean} [SuperMap.FindMTSPPathsParameters.prototype.hasLeastTotalCost=false]
  23441. * @description 配送模式是否为总花费最小方案。
  23442. * 若为 true,则按照总花费最小的模式进行配送,此时可能会出现某几个配送中心点配送的花费较多而其他配送中心点的花费很少的情况。
  23443. * 若为 false,则为局部最优,此方案会控制每个配送中心点的花费,使各个中心点花费相对平均,此时总花费不一定最小。
  23444. */
  23445. this.hasLeastTotalCost = false;
  23446. /**
  23447. * @member {boolean} [SuperMap.FindMTSPPathsParameters.prototype.isAnalyzeById=false]
  23448. * @description 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  23449. */
  23450. this.isAnalyzeById = false;
  23451. /**
  23452. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindMTSPPathsParameters.prototype.nodes
  23453. * @description 配送目标集合。
  23454. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  23455. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  23456. */
  23457. this.nodes = null;
  23458. /**
  23459. * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindMTSPPathsParameters.prototype.parameter]
  23460. * @description 交通网络分析通用参数。
  23461. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  23462. * SuperMap.TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting 字段,则返回结果空间信息等都为空。
  23463. */
  23464. this.parameter = new TransportationAnalystParameter();
  23465. Util.extend(this, options);
  23466. this.CLASS_NAME = "SuperMap.FindMTSPPathsParameters";
  23467. }
  23468. /**
  23469. * @function SuperMap.FindMTSPPathsParameters.prototype.destroy
  23470. * @description 释放资源,将引用资源的属性置空。
  23471. */
  23472. FindMTSPPathsParameters_createClass(FindMTSPPathsParameters, [{
  23473. key: "destroy",
  23474. value: function destroy() {
  23475. var me = this;
  23476. me.centers = null;
  23477. me.hasLeastTotalCost = null;
  23478. me.isAnalyzeById = null;
  23479. me.nodes = null;
  23480. me.maxWeight = null;
  23481. if (me.parameter) {
  23482. me.parameter.destroy();
  23483. me.parameter = null;
  23484. }
  23485. }
  23486. }]);
  23487. return FindMTSPPathsParameters;
  23488. }();
  23489. SuperMap.FindMTSPPathsParameters = FindMTSPPathsParameters;
  23490. ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsService.js
  23491. function FindMTSPPathsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindMTSPPathsService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindMTSPPathsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindMTSPPathsService_typeof(obj); }
  23492. function FindMTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23493. 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); } }
  23494. function FindMTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsService_defineProperties(Constructor, staticProps); return Constructor; }
  23495. function FindMTSPPathsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindMTSPPathsService_get = Reflect.get; } else { FindMTSPPathsService_get = function _get(target, property, receiver) { var base = FindMTSPPathsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FindMTSPPathsService_get(target, property, receiver || target); }
  23496. function FindMTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindMTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  23497. function FindMTSPPathsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FindMTSPPathsService_setPrototypeOf(subClass, superClass); }
  23498. function FindMTSPPathsService_setPrototypeOf(o, p) { FindMTSPPathsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindMTSPPathsService_setPrototypeOf(o, p); }
  23499. 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); }; }
  23500. function FindMTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindMTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindMTSPPathsService_assertThisInitialized(self); }
  23501. function FindMTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23502. function FindMTSPPathsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23503. function FindMTSPPathsService_getPrototypeOf(o) { FindMTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindMTSPPathsService_getPrototypeOf(o); }
  23504. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23505. * This program are made available under the terms of the Apache License, Version 2.0
  23506. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23507. /**
  23508. * @class SuperMap.FindMTSPPathsService
  23509. * @category iServer NetworkAnalyst MTSPPath
  23510. * @classdesc 多旅行商分析服务类
  23511. * 多旅行商分析也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。
  23512. * 查找经济有效的配送路径,并给出相应的行走路线。
  23513. * 物流配送功能就是解决如何合理分配配送次序和送货路线,使配送总花费达到最小或每个配送中心的花费达到最小。
  23514. * 该类负责将客户端指定的多旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  23515. * 多旅行商分析结果通过该类支持的事件的监听函数参数获取
  23516. * @extends {SuperMap.NetworkAnalystServiceBase}
  23517. * @example
  23518. * var myFindMTSPPathsService = new SuperMap.FindMTSPPathsService(url, {
  23519. * eventListeners: {
  23520. * "processCompleted": findMTSPPathsCompleted,
  23521. * "processFailed": findMTSPPathsError
  23522. * }
  23523. * });
  23524. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  23525. * http://{服务器地址}:{服务端口号}/iserver/services/网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  23526. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  23527. * @param {Object} options - 互服务时所需可选参数。如:
  23528. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  23529. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23530. * @param {Object} [options.headers] - 请求头。
  23531. */
  23532. var FindMTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  23533. FindMTSPPathsService_inherits(FindMTSPPathsService, _NetworkAnalystServic);
  23534. var _super = FindMTSPPathsService_createSuper(FindMTSPPathsService);
  23535. function FindMTSPPathsService(url, options) {
  23536. var _this;
  23537. FindMTSPPathsService_classCallCheck(this, FindMTSPPathsService);
  23538. _this = _super.call(this, url, options);
  23539. _this.CLASS_NAME = "SuperMap.FindMTSPPathsService";
  23540. return _this;
  23541. }
  23542. /**
  23543. * @function SuperMap.FindMTSPPathsService.prototype.destroy
  23544. * @override
  23545. */
  23546. FindMTSPPathsService_createClass(FindMTSPPathsService, [{
  23547. key: "destroy",
  23548. value: function destroy() {
  23549. FindMTSPPathsService_get(FindMTSPPathsService_getPrototypeOf(FindMTSPPathsService.prototype), "destroy", this).call(this);
  23550. }
  23551. /**
  23552. * @function SuperMap.FindMTSPPathsService..prototype.processAsync
  23553. * @description 负责将客户端的查询参数传递到服务端。
  23554. * @param {SuperMap.FindMTSPPathsParameters} params - 多旅行商分析服务参数类
  23555. */
  23556. }, {
  23557. key: "processAsync",
  23558. value: function processAsync(params) {
  23559. if (!(params instanceof FindMTSPPathsParameters)) {
  23560. return;
  23561. }
  23562. var me = this,
  23563. jsonObject,
  23564. //end = me.url.substr(me.url.length - 1, 1),
  23565. centers = me.getJson(params.isAnalyzeById, params.centers),
  23566. nodes = me.getJson(params.isAnalyzeById, params.nodes);
  23567. me.url = Util.urlPathAppend(me.url, 'mtsppath');
  23568. jsonObject = {
  23569. centers: centers,
  23570. nodes: nodes,
  23571. parameter: Util.toJSON(params.parameter),
  23572. hasLeastTotalCost: params.hasLeastTotalCost
  23573. };
  23574. me.request({
  23575. method: "GET",
  23576. params: jsonObject,
  23577. scope: me,
  23578. success: me.serviceProcessCompleted,
  23579. failure: me.serviceProcessFailed
  23580. });
  23581. }
  23582. /**
  23583. * @function SuperMap.FindMTSPPathsService.prototype.getJson
  23584. * @description 将对象转化为JSON字符串。
  23585. * @param {boolean} isAnalyzeById - 是否通过id分析
  23586. * @param {Array} params - 需要转换的数字
  23587. * @returns {Object} 转化后的JSON字符串。
  23588. */
  23589. }, {
  23590. key: "getJson",
  23591. value: function getJson(isAnalyzeById, params) {
  23592. var jsonString = "[",
  23593. len = params ? params.length : 0;
  23594. if (isAnalyzeById === false) {
  23595. for (var i = 0; i < len; i++) {
  23596. if (i > 0) {
  23597. jsonString += ",";
  23598. }
  23599. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  23600. }
  23601. } else if (isAnalyzeById === true) {
  23602. for (var _i = 0; _i < len; _i++) {
  23603. if (_i > 0) {
  23604. jsonString += ",";
  23605. }
  23606. jsonString += params[_i];
  23607. }
  23608. }
  23609. jsonString += ']';
  23610. return jsonString;
  23611. }
  23612. /**
  23613. * @function SuperMap.FindMTSPPathsService.prototype.toGeoJSONResult
  23614. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  23615. * @param {Object} result - 服务器返回的结果对象。
  23616. */
  23617. }, {
  23618. key: "toGeoJSONResult",
  23619. value: function toGeoJSONResult(result) {
  23620. if (!result || !result.pathList) {
  23621. return null;
  23622. }
  23623. var geoJSONFormat = new GeoJSON();
  23624. result.pathList.map(function (path) {
  23625. if (path.route) {
  23626. path.route = geoJSONFormat.toGeoJSON(path.route);
  23627. }
  23628. if (path.pathGuideItems) {
  23629. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  23630. }
  23631. if (path.edgeFeatures) {
  23632. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  23633. }
  23634. if (path.nodeFeatures) {
  23635. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  23636. }
  23637. return path;
  23638. });
  23639. return result;
  23640. }
  23641. }]);
  23642. return FindMTSPPathsService;
  23643. }(NetworkAnalystServiceBase);
  23644. SuperMap.FindMTSPPathsService = FindMTSPPathsService;
  23645. ;// CONCATENATED MODULE: ./src/common/iServer/FindPathParameters.js
  23646. function FindPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23647. 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); } }
  23648. function FindPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23649. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23650. * This program are made available under the terms of the Apache License, Version 2.0
  23651. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23652. /**
  23653. * @class SuperMap.FindPathParameters
  23654. * @category iServer NetworkAnalyst Path
  23655. * @classdesc 最佳路径分析参数类。最佳路径是在网络数据集中指定一些结点,按照顺序访问结点从而求解起止点之间阻抗最小的路径。
  23656. * 例如如果要顺序访问 1、2、3、4 四个结点,则需要分别找到1、2结点间的最佳路径 R1—2,2、3 间的最佳路径 R2—3 和 3、4 结点间的最佳路径 R3—4,
  23657. * 顺序访问 1、2、3、4 四个结点的最佳路径就是 R = R1—2 + R2—3 + R3—4。
  23658. * 阻抗就是指从一点到另一点的耗费,在实际应用中我们可以将距离、时间、花费等作为阻抗条件。
  23659. * 阻抗最小也就可以理解为从一点到另一点距离最短、时间最少、花费最低等。当两点间距离最短时为最短路径,它是最佳路径问题的一个特例。
  23660. * 阻抗值通过 SuperMap.TransportationAnalystParameter.weightFieldName 设置。
  23661. * 计算最佳路径除了受阻抗影响外,还受转向字段的影响。转向值通过 {@link SuperMap.TransportationAnalystParameter.turnWeightField} 设置。
  23662. *
  23663. * @param {Object} options - 参数。
  23664. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 最佳路径分析经过的结点或设施点数组。该字段至少包含两个点。
  23665. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  23666. * @param {boolean} [options.hasLeastEdgeCount=false] - 是否按照弧段数最少的进行最佳路径分析。
  23667. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  23668. */
  23669. var FindPathParameters = /*#__PURE__*/function () {
  23670. function FindPathParameters(options) {
  23671. FindPathParameters_classCallCheck(this, FindPathParameters);
  23672. /**
  23673. * @member {boolean} [SuperMap.FindPathParameters.prototype.isAnalyzeById=false]
  23674. * @description 是否通过节点 ID 指定路径分析的结点。
  23675. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  23676. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 SuperMap.FindPathParameters.nodes = [ID1,ID2,...];
  23677. * 反之表示通过结点坐标指定途经点,即 SuperMap.FindPathParameters.nodes = [{x1,y1},{x2,y2},...] 。
  23678. */
  23679. this.isAnalyzeById = false;
  23680. /**
  23681. * @member {boolean} [SuperMap.FindPathParameters.prototype.hasLeastEdgeCount=false]
  23682. * @description 是否按照弧段数最少的进行最佳路径分析。
  23683. * true 表示按照弧段数最少进行分析,返回弧段数最少的路径中一个阻抗最小的最佳路径;
  23684. * false 表示直接返回阻抗最小的路径,而不考虑弧段的多少。
  23685. */
  23686. this.hasLeastEdgeCount = null;
  23687. /**
  23688. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindPathParameters.prototype.nodes
  23689. * @description 最佳路径分析经过的结点或设施点数组,必设字段。该字段至少包含两个点。
  23690. * 当 SuperMap.FindPathParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  23691. * 当 SuperMap.FindPathParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  23692. */
  23693. this.nodes = null;
  23694. /**
  23695. * @member {SuperMap.TransportationAnalystParameter} SuperMap.FindPathParameters.prototype.parameter
  23696. * @description 交通网络分析通用参数。
  23697. */
  23698. this.parameter = new TransportationAnalystParameter();
  23699. Util.extend(this, options);
  23700. this.CLASS_NAME = "SuperMap.FindPathParameters";
  23701. }
  23702. /**
  23703. * @function SuperMap.FindPathParameters.prototype.destroy
  23704. * @description 释放资源,将引用资源的属性置空。
  23705. */
  23706. FindPathParameters_createClass(FindPathParameters, [{
  23707. key: "destroy",
  23708. value: function destroy() {
  23709. var me = this;
  23710. me.isAnalyzeById = null;
  23711. me.hasLeastEdgeCount = null;
  23712. me.nodes = null;
  23713. if (me.parameter) {
  23714. me.parameter.destroy();
  23715. me.parameter = null;
  23716. }
  23717. }
  23718. }]);
  23719. return FindPathParameters;
  23720. }();
  23721. SuperMap.FindPathParameters = FindPathParameters;
  23722. ;// CONCATENATED MODULE: ./src/common/iServer/FindPathService.js
  23723. function FindPathService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindPathService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindPathService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindPathService_typeof(obj); }
  23724. function FindPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23725. 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); } }
  23726. function FindPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathService_defineProperties(Constructor, staticProps); return Constructor; }
  23727. function FindPathService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindPathService_get = Reflect.get; } else { FindPathService_get = function _get(target, property, receiver) { var base = FindPathService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FindPathService_get(target, property, receiver || target); }
  23728. function FindPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  23729. function FindPathService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FindPathService_setPrototypeOf(subClass, superClass); }
  23730. function FindPathService_setPrototypeOf(o, p) { FindPathService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindPathService_setPrototypeOf(o, p); }
  23731. 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); }; }
  23732. function FindPathService_possibleConstructorReturn(self, call) { if (call && (FindPathService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindPathService_assertThisInitialized(self); }
  23733. function FindPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23734. function FindPathService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23735. function FindPathService_getPrototypeOf(o) { FindPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindPathService_getPrototypeOf(o); }
  23736. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23737. * This program are made available under the terms of the Apache License, Version 2.0
  23738. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23739. /**
  23740. * @class SuperMap.FindPathService
  23741. * @category iServer NetworkAnalyst Path
  23742. * @classdesc 最佳路径分析服务类。
  23743. * 最佳路径是在网络数据集中指定一些节点,按照节点的选择顺序,
  23744. * 顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  23745. * 该类负责将客户端指定的最佳路径分析参数传递给服务端,并接收服务端返回的结果数据。
  23746. * 最佳路径分析结果通过该类支持的事件的监听函数参数获取
  23747. * @extends {SuperMap.NetworkAnalystServiceBase}
  23748. * @example
  23749. * var myFindPathService = new SuperMap.FindPathService(url, {
  23750. * eventListeners: {
  23751. * "processCompleted": findPathCompleted,
  23752. * "processFailed": findPathError
  23753. * }
  23754. * });
  23755. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  23756. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  23757. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  23758. * @param {Object} options - 参数。
  23759. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  23760. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23761. * @param {Object} [options.headers] - 请求头。
  23762. */
  23763. var FindPathService = /*#__PURE__*/function (_NetworkAnalystServic) {
  23764. FindPathService_inherits(FindPathService, _NetworkAnalystServic);
  23765. var _super = FindPathService_createSuper(FindPathService);
  23766. function FindPathService(url, options) {
  23767. var _this;
  23768. FindPathService_classCallCheck(this, FindPathService);
  23769. _this = _super.call(this, url, options);
  23770. _this.CLASS_NAME = "SuperMap.FindPathService";
  23771. return _this;
  23772. }
  23773. /**
  23774. * @function SuperMap.FindPathService.prototype.destroy
  23775. * @override
  23776. */
  23777. FindPathService_createClass(FindPathService, [{
  23778. key: "destroy",
  23779. value: function destroy() {
  23780. FindPathService_get(FindPathService_getPrototypeOf(FindPathService.prototype), "destroy", this).call(this);
  23781. }
  23782. /**
  23783. * @function SuperMap.FindPathService.prototype.processAsync
  23784. * @description 负责将客户端的查询参数传递到服务端。
  23785. * @param {SuperMap.FindPathParameters} params - 最佳路径分析服务参数类
  23786. */
  23787. }, {
  23788. key: "processAsync",
  23789. value: function processAsync(params) {
  23790. if (!(params instanceof FindPathParameters)) {
  23791. return;
  23792. }
  23793. var me = this,
  23794. jsonObject;
  23795. me.url = Util.urlPathAppend(me.url, 'path');
  23796. jsonObject = {
  23797. hasLeastEdgeCount: params.hasLeastEdgeCount,
  23798. parameter: Util.toJSON(params.parameter),
  23799. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  23800. };
  23801. me.request({
  23802. method: "GET",
  23803. params: jsonObject,
  23804. scope: me,
  23805. success: me.serviceProcessCompleted,
  23806. failure: me.serviceProcessFailed
  23807. });
  23808. }
  23809. /**
  23810. * @function SuperMap.FindPathService.prototype.getJson
  23811. * @description 将对象转化为JSON字符串。
  23812. * @param {boolean} isAnalyzeById - 是否通过id分析
  23813. * @param {Array} params - 需要转换的数字
  23814. * @returns {Object} 转化后的JSON字符串。
  23815. */
  23816. }, {
  23817. key: "getJson",
  23818. value: function getJson(isAnalyzeById, params) {
  23819. var jsonString = "[",
  23820. len = params ? params.length : 0;
  23821. if (isAnalyzeById === false) {
  23822. for (var i = 0; i < len; i++) {
  23823. if (i > 0) {
  23824. jsonString += ",";
  23825. }
  23826. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  23827. }
  23828. } else if (isAnalyzeById === true) {
  23829. for (var _i = 0; _i < len; _i++) {
  23830. if (_i > 0) {
  23831. jsonString += ",";
  23832. }
  23833. jsonString += params[_i];
  23834. }
  23835. }
  23836. jsonString += ']';
  23837. return jsonString;
  23838. }
  23839. /**
  23840. * @function SuperMap.FindMTSPPathsService.prototype.toGeoJSONResult
  23841. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  23842. * @param {Object} result - 服务器返回的结果对象。
  23843. */
  23844. }, {
  23845. key: "toGeoJSONResult",
  23846. value: function toGeoJSONResult(result) {
  23847. if (!result || !result.pathList || result.pathList.length < 1) {
  23848. return null;
  23849. }
  23850. var geoJSONFormat = new GeoJSON();
  23851. result.pathList.forEach(function (path) {
  23852. if (path.route) {
  23853. path.route = geoJSONFormat.toGeoJSON(path.route);
  23854. }
  23855. if (path.pathGuideItems) {
  23856. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  23857. }
  23858. if (path.edgeFeatures) {
  23859. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  23860. }
  23861. if (path.nodeFeatures) {
  23862. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  23863. }
  23864. });
  23865. return result;
  23866. }
  23867. }]);
  23868. return FindPathService;
  23869. }(NetworkAnalystServiceBase);
  23870. SuperMap.FindPathService = FindPathService;
  23871. ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasParameters.js
  23872. function FindServiceAreasParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23873. 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); } }
  23874. function FindServiceAreasParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23875. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23876. * This program are made available under the terms of the Apache License, Version 2.0
  23877. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23878. /**
  23879. * @class SuperMap.FindServiceAreasParameters
  23880. * @category iServer NetworkAnalyst ServiceArea
  23881. * @classdesc 服务区分析参数类。
  23882. * 服务区分析是以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  23883. * 例如:计算某快餐店能够在30分钟内送达快餐的区域。
  23884. * @param {Object} options - 参数。
  23885. * @param {Array.<number>} options.weights - 每个服务站点提供服务的阻力半径,超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  23886. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.centers - 服务站点数组。
  23887. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  23888. * @param {boolean} [options.isCenterMutuallyExclusive=false] - 是否中心点互斥。
  23889. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分析。
  23890. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  23891. */
  23892. var FindServiceAreasParameters = /*#__PURE__*/function () {
  23893. function FindServiceAreasParameters(options) {
  23894. FindServiceAreasParameters_classCallCheck(this, FindServiceAreasParameters);
  23895. /**
  23896. * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isAnalyzeById=false]
  23897. * @description 是否通过节点 ID 指定路径分析的结点。
  23898. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  23899. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 SuperMap.FindServiceAreasParameters.centers = [ID1,ID2,...];
  23900. * 反之表示通过结点坐标指定途经点,即 SuperMap.FindServiceAreasParameters.centers = [{x1,y1},{x2,y2},...]。
  23901. */
  23902. this.isAnalyzeById = false;
  23903. /**
  23904. * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isCenterMutuallyExclusive=false]
  23905. * @description 是否中心点互斥,即按照中心点的距离进行判断是否要进行互斥处理。
  23906. * 若分析出的服务区有重叠的部分,则通过设置该参数进行互斥处理。
  23907. */
  23908. this.isCenterMutuallyExclusive = false;
  23909. /**
  23910. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindServiceAreasParameters.prototype.centers
  23911. * @description 服务站点数组。
  23912. * 当该类的 iSAnalyzeById = true 时,通过结点 ID 号指定服务站点;当 iSAnalyzeById = false 时,通过点坐标指定服务站点。
  23913. */
  23914. this.centers = null;
  23915. /**
  23916. * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isFromCenter=false]
  23917. * @description 是否从中心点开始分析。
  23918. * 从中心点开始分析和不从中心点开始分析,体现了服务中心和需要该服务的需求地的关系模式。
  23919. * 从中心点开始分析,是一个服务中心向服务需求地提供服务;
  23920. * 而不从中心点开始分析,是一个服务需求地主动到服务中心获得服务。
  23921. */
  23922. this.isFromCenter = false;
  23923. /**
  23924. * APIProperty: weights
  23925. * @member {Array.<number>} SuperMap.FindServiceAreasParameters.prototype.weights
  23926. * @description 每个服务站点提供服务的阻力半径,即超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  23927. * 该字段为一个数组,数组长度跟服务中心个数一致,按照索引顺序与站点一一对应,每个元素表示了在对每个服务中心进行服务区分析时,所用的服务半径。
  23928. */
  23929. this.weights = null;
  23930. /**
  23931. * @member {SuperMap.TransportationAnalystParameter} SuperMap.FindServiceAreasParameters.prototype.parameter
  23932. * @description 交通网络分析通用参数。
  23933. */
  23934. this.parameter = new TransportationAnalystParameter();
  23935. Util.extend(this, options);
  23936. this.CLASS_NAME = "SuperMap.FindServiceAreasParameters";
  23937. }
  23938. /**
  23939. * @function SuperMap.FindServiceAreasParameters.prototype.destroy
  23940. * @description 释放资源,将引用资源的属性置空。
  23941. */
  23942. FindServiceAreasParameters_createClass(FindServiceAreasParameters, [{
  23943. key: "destroy",
  23944. value: function destroy() {
  23945. var me = this;
  23946. me.isAnalyzeById = null;
  23947. me.isCenterMutuallyExclusive = null;
  23948. me.centers = null;
  23949. me.isFromCenter = null;
  23950. me.weights = null;
  23951. if (me.parameter) {
  23952. me.parameter.destroy();
  23953. me.parameter = null;
  23954. }
  23955. }
  23956. }]);
  23957. return FindServiceAreasParameters;
  23958. }();
  23959. SuperMap.FindServiceAreasParameters = FindServiceAreasParameters;
  23960. ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasService.js
  23961. function FindServiceAreasService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindServiceAreasService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindServiceAreasService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindServiceAreasService_typeof(obj); }
  23962. function FindServiceAreasService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23963. 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); } }
  23964. function FindServiceAreasService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasService_defineProperties(Constructor, staticProps); return Constructor; }
  23965. function FindServiceAreasService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindServiceAreasService_get = Reflect.get; } else { FindServiceAreasService_get = function _get(target, property, receiver) { var base = FindServiceAreasService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FindServiceAreasService_get(target, property, receiver || target); }
  23966. function FindServiceAreasService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindServiceAreasService_getPrototypeOf(object); if (object === null) break; } return object; }
  23967. function FindServiceAreasService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FindServiceAreasService_setPrototypeOf(subClass, superClass); }
  23968. function FindServiceAreasService_setPrototypeOf(o, p) { FindServiceAreasService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindServiceAreasService_setPrototypeOf(o, p); }
  23969. 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); }; }
  23970. function FindServiceAreasService_possibleConstructorReturn(self, call) { if (call && (FindServiceAreasService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindServiceAreasService_assertThisInitialized(self); }
  23971. function FindServiceAreasService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23972. function FindServiceAreasService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23973. function FindServiceAreasService_getPrototypeOf(o) { FindServiceAreasService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindServiceAreasService_getPrototypeOf(o); }
  23974. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23975. * This program are made available under the terms of the Apache License, Version 2.0
  23976. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23977. /**
  23978. * @class SuperMap.FindServiceAreasService
  23979. * @category iServer NetworkAnalyst ServiceArea
  23980. * @classdesc 服务区分析服务类。
  23981. * 服务区分析是以指定服务站点为中心,
  23982. * 在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  23983. * 该类负责将客户端指定的服务区分析参数传递给服务端,并接收服务端返回的结果数据。
  23984. * 服务区分析结果通过该类支持的事件的监听函数参数获取
  23985. * @extends {SuperMap.NetworkAnalystServiceBase}
  23986. * @example
  23987. * var myFindServiceAreasService = new SuperMap.FindServiceAreasService(url, {
  23988. * eventListeners: {
  23989. * "processCompleted": findServiceAreasCompleted,
  23990. * "processFailed": findServiceAreasError
  23991. * }
  23992. * });
  23993. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  23994. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  23995. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  23996. * @param {Object} options - 互服务时所需可选参数。如:
  23997. * @param {Object} options.eventListeners - 需要被注册的监听器对象
  23998. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23999. * @param {Object} [options.headers] - 请求头。
  24000. */
  24001. var FindServiceAreasService = /*#__PURE__*/function (_NetworkAnalystServic) {
  24002. FindServiceAreasService_inherits(FindServiceAreasService, _NetworkAnalystServic);
  24003. var _super = FindServiceAreasService_createSuper(FindServiceAreasService);
  24004. function FindServiceAreasService(url, options) {
  24005. var _this;
  24006. FindServiceAreasService_classCallCheck(this, FindServiceAreasService);
  24007. _this = _super.call(this, url, options);
  24008. _this.CLASS_NAME = "SuperMap.FindServiceAreasService";
  24009. return _this;
  24010. }
  24011. /**
  24012. * @function SuperMap.FindServiceAreasService.prototype.destroy
  24013. * @override
  24014. */
  24015. FindServiceAreasService_createClass(FindServiceAreasService, [{
  24016. key: "destroy",
  24017. value: function destroy() {
  24018. FindServiceAreasService_get(FindServiceAreasService_getPrototypeOf(FindServiceAreasService.prototype), "destroy", this).call(this);
  24019. }
  24020. /**
  24021. * @function SuperMap.FindServiceAreasService.prototype.processAsync
  24022. * @description 负责将客户端的查询参数传递到服务端。
  24023. * @param {SuperMap.FindServiceAreasParameters} params - 服务区分析服务参数类
  24024. */
  24025. }, {
  24026. key: "processAsync",
  24027. value: function processAsync(params) {
  24028. if (!(params instanceof FindServiceAreasParameters)) {
  24029. return;
  24030. }
  24031. var me = this,
  24032. jsonObject;
  24033. me.url = Util.urlPathAppend(me.url, 'servicearea');
  24034. jsonObject = {
  24035. isFromCenter: params.isFromCenter,
  24036. isCenterMutuallyExclusive: params.isCenterMutuallyExclusive,
  24037. parameter: Util.toJSON(params.parameter),
  24038. centers: me.getJson(params.isAnalyzeById, params.centers),
  24039. weights: me.getJson(true, params.weights)
  24040. };
  24041. me.request({
  24042. method: "GET",
  24043. params: jsonObject,
  24044. scope: me,
  24045. success: me.serviceProcessCompleted,
  24046. failure: me.serviceProcessFailed
  24047. });
  24048. }
  24049. /**
  24050. * @function SuperMap.FindServiceAreasService.prototype.getJson
  24051. * @description 将对象转化为JSON字符串。
  24052. * @param {boolean} isAnalyzeById - 是否通过id分析
  24053. * @param {Array} params - 需要转换的数字
  24054. * @returns {Object} 转化后的JSON字符串。
  24055. */
  24056. }, {
  24057. key: "getJson",
  24058. value: function getJson(isAnalyzeById, params) {
  24059. var jsonString = "[",
  24060. len = params ? params.length : 0;
  24061. if (isAnalyzeById === false) {
  24062. for (var i = 0; i < len; i++) {
  24063. if (i > 0) {
  24064. jsonString += ",";
  24065. }
  24066. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  24067. }
  24068. } else if (isAnalyzeById === true) {
  24069. for (var _i = 0; _i < len; _i++) {
  24070. if (_i > 0) {
  24071. jsonString += ",";
  24072. }
  24073. jsonString += params[_i];
  24074. }
  24075. }
  24076. jsonString += ']';
  24077. return jsonString;
  24078. }
  24079. /**
  24080. * @function SuperMap.FindServiceAreasService.prototype.toGeoJSONResult
  24081. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  24082. * @param {Object} result - 服务器返回的结果对象。。
  24083. */
  24084. }, {
  24085. key: "toGeoJSONResult",
  24086. value: function toGeoJSONResult(result) {
  24087. if (!result || !result.serviceAreaList) {
  24088. return result;
  24089. }
  24090. var geoJSONFormat = new GeoJSON();
  24091. result.serviceAreaList.map(function (serviceArea) {
  24092. if (serviceArea.serviceRegion) {
  24093. serviceArea.serviceRegion = geoJSONFormat.toGeoJSON(serviceArea.serviceRegion);
  24094. }
  24095. if (serviceArea.edgeFeatures) {
  24096. serviceArea.edgeFeatures = geoJSONFormat.toGeoJSON(serviceArea.edgeFeatures);
  24097. }
  24098. if (serviceArea.nodeFeatures) {
  24099. serviceArea.nodeFeatures = geoJSONFormat.toGeoJSON(serviceArea.nodeFeatures);
  24100. }
  24101. if (serviceArea.routes) {
  24102. serviceArea.routes = geoJSONFormat.toGeoJSON(serviceArea.routes);
  24103. }
  24104. return serviceArea;
  24105. });
  24106. return result;
  24107. }
  24108. }]);
  24109. return FindServiceAreasService;
  24110. }(NetworkAnalystServiceBase);
  24111. SuperMap.FindServiceAreasService = FindServiceAreasService;
  24112. ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsParameters.js
  24113. function FindTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24114. 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); } }
  24115. function FindTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  24116. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24117. * This program are made available under the terms of the Apache License, Version 2.0
  24118. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24119. /**
  24120. * @class SuperMap.FindTSPPathsParameters
  24121. * @category iServer NetworkAnalyst TSPPath
  24122. * @classdesc 旅行商分析参数类。
  24123. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  24124. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  24125. * 旅行商分析和最佳路径分析都是在网络中寻找遍历所有站点的最经济的路径,区别是在遍历网络所有站点的过程中对结点访问顺序不同
  24126. * 最佳路径分析必须按照指定顺序对站点进行访问,而旅行商分析是无序的路径分析。
  24127. * @param {Object} options - 参数。
  24128. * @param {boolean} [options.endNodeAssigned=false] - 是否指定终止点,将指定的途经点的最后一个点作为终止点。true 表示指定终止点,则旅行商必须最后一个访问终止点。
  24129. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点。
  24130. * @param {Array.<(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)>} options.nodes - 配送目标集合。
  24131. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  24132. */
  24133. var FindTSPPathsParameters = /*#__PURE__*/function () {
  24134. function FindTSPPathsParameters(options) {
  24135. FindTSPPathsParameters_classCallCheck(this, FindTSPPathsParameters);
  24136. /**
  24137. * @member {boolean} [SuperMap.FindTSPPathsParameters.prototype.endNodeAssigned=false]
  24138. * @description 是否指定终止点,将指定的途经点的最后一个点作为终止点。
  24139. * true 表示指定终止点,则旅行商必须最后一个访问终止点。
  24140. */
  24141. this.endNodeAssigned = false;
  24142. /**
  24143. * @member {boolean} [SuperMap.FindTSPPathsParameters.prototype.isAnalyzeById=false]
  24144. * @description 是否通过节点 ID 号来指定途经点。
  24145. */
  24146. this.isAnalyzeById = false;
  24147. /**
  24148. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindTSPPathsParameters.prototype.nodes
  24149. * @description 旅行商分析途经点数组。
  24150. * 当 SuperMap.FindTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  24151. * 当 SuperMap.FindTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  24152. */
  24153. this.nodes = null;
  24154. /**
  24155. * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindTSPPathsParameters.prototype.parameter]
  24156. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  24157. * SuperMap.TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting
  24158. * 字段,则返回结果空间信息等都为空。
  24159. */
  24160. this.parameter = new TransportationAnalystParameter();
  24161. Util.extend(this, options);
  24162. this.CLASS_NAME = "SuperMap.FindTSPPathsParameters";
  24163. }
  24164. /**
  24165. * @function SuperMap.FindTSPPathsParameters.prototype.destroy
  24166. * @description 释放资源,将引用资源的属性置空。
  24167. */
  24168. FindTSPPathsParameters_createClass(FindTSPPathsParameters, [{
  24169. key: "destroy",
  24170. value: function destroy() {
  24171. var me = this;
  24172. me.endNodeAssigned = null;
  24173. me.isAnalyzeById = null;
  24174. me.nodes = null;
  24175. if (me.parameter) {
  24176. me.parameter.destroy();
  24177. me.parameter = null;
  24178. }
  24179. }
  24180. }]);
  24181. return FindTSPPathsParameters;
  24182. }();
  24183. SuperMap.FindTSPPathsParameters = FindTSPPathsParameters;
  24184. ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsService.js
  24185. function FindTSPPathsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindTSPPathsService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindTSPPathsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindTSPPathsService_typeof(obj); }
  24186. function FindTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24187. 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); } }
  24188. function FindTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsService_defineProperties(Constructor, staticProps); return Constructor; }
  24189. function FindTSPPathsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindTSPPathsService_get = Reflect.get; } else { FindTSPPathsService_get = function _get(target, property, receiver) { var base = FindTSPPathsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FindTSPPathsService_get(target, property, receiver || target); }
  24190. function FindTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  24191. function FindTSPPathsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FindTSPPathsService_setPrototypeOf(subClass, superClass); }
  24192. function FindTSPPathsService_setPrototypeOf(o, p) { FindTSPPathsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindTSPPathsService_setPrototypeOf(o, p); }
  24193. 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); }; }
  24194. function FindTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindTSPPathsService_assertThisInitialized(self); }
  24195. function FindTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24196. function FindTSPPathsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  24197. function FindTSPPathsService_getPrototypeOf(o) { FindTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindTSPPathsService_getPrototypeOf(o); }
  24198. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24199. * This program are made available under the terms of the Apache License, Version 2.0
  24200. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24201. /**
  24202. * @class SuperMap.FindTSPPathsService
  24203. * @category iServer NetworkAnalyst TSPPath
  24204. * @classdesc 旅行商分析服务类
  24205. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  24206. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  24207. * 该类负责将客户端指定的旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  24208. * 旅行商分析结果通过该类支持的事件的监听函数参数获取
  24209. * @extends {SuperMap.NetworkAnalystServiceBase}
  24210. * @example
  24211. * (start code)
  24212. * var myFindTSPPathsService = new SuperMap.FindTSPPathsService(url, {
  24213. * eventListeners: {
  24214. * "processCompleted": findTSPPathsCompleted,
  24215. * "processFailed": findTSPPathsError
  24216. * }
  24217. * });
  24218. * (end)
  24219. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  24220. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  24221. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  24222. * @param {Object} options - 参数。
  24223. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  24224. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24225. * @param {Object} [options.headers] - 请求头。
  24226. */
  24227. var FindTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  24228. FindTSPPathsService_inherits(FindTSPPathsService, _NetworkAnalystServic);
  24229. var _super = FindTSPPathsService_createSuper(FindTSPPathsService);
  24230. function FindTSPPathsService(url, options) {
  24231. var _this;
  24232. FindTSPPathsService_classCallCheck(this, FindTSPPathsService);
  24233. _this = _super.call(this, url, options);
  24234. _this.CLASS_NAME = "SuperMap.FindTSPPathsService";
  24235. return _this;
  24236. }
  24237. /**
  24238. * @function SuperMap.FindTSPPathsService.prototype.destroy
  24239. * @override
  24240. */
  24241. FindTSPPathsService_createClass(FindTSPPathsService, [{
  24242. key: "destroy",
  24243. value: function destroy() {
  24244. FindTSPPathsService_get(FindTSPPathsService_getPrototypeOf(FindTSPPathsService.prototype), "destroy", this).call(this);
  24245. }
  24246. /**
  24247. * @function SuperMap.FindTSPPathsService.prototype.processAsync
  24248. * @description 负责将客户端的查询参数传递到服务端。
  24249. * @param {SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
  24250. */
  24251. }, {
  24252. key: "processAsync",
  24253. value: function processAsync(params) {
  24254. if (!(params instanceof FindTSPPathsParameters)) {
  24255. return;
  24256. }
  24257. var me = this,
  24258. jsonObject;
  24259. me.url = Util.urlPathAppend(me.url, 'tsppath');
  24260. jsonObject = {
  24261. parameter: SuperMap.Util.toJSON(params.parameter),
  24262. endNodeAssigned: params.endNodeAssigned,
  24263. nodes: me.getNodesJson(params)
  24264. };
  24265. me.request({
  24266. method: "GET",
  24267. params: jsonObject,
  24268. scope: me,
  24269. success: me.serviceProcessCompleted,
  24270. failure: me.serviceProcessFailed
  24271. });
  24272. }
  24273. /**
  24274. * @function SuperMap.FindTSPPathsService.prototype.getNodesJson
  24275. * @description 将节点对象转化为JSON字符串。
  24276. * @param {SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
  24277. * @returns {string} 转化后的JSON字符串。
  24278. */
  24279. }, {
  24280. key: "getNodesJson",
  24281. value: function getNodesJson(params) {
  24282. var jsonParameters = "",
  24283. nodesString,
  24284. i,
  24285. len,
  24286. nodes;
  24287. if (params.isAnalyzeById === false) {
  24288. for (nodesString = "[", i = 0, nodes = params.nodes, len = nodes.length; i < len; i++) {
  24289. if (i > 0) {
  24290. nodesString += ",";
  24291. }
  24292. nodesString += '{"x":' + nodes[i].x + ',"y":' + nodes[i].y + '}';
  24293. }
  24294. nodesString += ']';
  24295. jsonParameters += nodesString;
  24296. } else if (params.isAnalyzeById === true) {
  24297. var nodeIDsString = "[",
  24298. _nodes = params.nodes,
  24299. _len = _nodes.length;
  24300. for (var _i = 0; _i < _len; _i++) {
  24301. if (_i > 0) {
  24302. nodeIDsString += ",";
  24303. }
  24304. nodeIDsString += _nodes[_i];
  24305. }
  24306. nodeIDsString += ']';
  24307. jsonParameters += nodeIDsString;
  24308. }
  24309. return jsonParameters;
  24310. }
  24311. /**
  24312. * @function SuperMap.FindTSPPathsService.prototype.toGeoJSONResult
  24313. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  24314. * @param {Object} result - 服务器返回的结果对象。
  24315. */
  24316. }, {
  24317. key: "toGeoJSONResult",
  24318. value: function toGeoJSONResult(result) {
  24319. if (!result || !result.tspPathList) {
  24320. return null;
  24321. }
  24322. var geoJSONFormat = new GeoJSON();
  24323. result.tspPathList.forEach(function (path) {
  24324. if (path.route) {
  24325. path.route = geoJSONFormat.toGeoJSON(path.route);
  24326. }
  24327. if (path.pathGuideItems) {
  24328. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  24329. }
  24330. if (path.edgeFeatures) {
  24331. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  24332. }
  24333. if (path.nodeFeatures) {
  24334. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  24335. }
  24336. });
  24337. return result;
  24338. }
  24339. }]);
  24340. return FindTSPPathsService;
  24341. }(NetworkAnalystServiceBase);
  24342. SuperMap.FindTSPPathsService = FindTSPPathsService;
  24343. ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataParameters.js
  24344. function GenerateSpatialDataParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24345. 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); } }
  24346. function GenerateSpatialDataParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataParameters_defineProperties(Constructor, staticProps); return Constructor; }
  24347. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24348. * This program are made available under the terms of the Apache License, Version 2.0
  24349. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24350. /**
  24351. * @class SuperMap.GenerateSpatialDataParameters
  24352. * @category iServer SpatialAnalyst GenerateSpatialData
  24353. * @classdesc 动态分段操作参数类。通过该类可以为动态分段提供参数信息。
  24354. * @param {Object} options - 参数。
  24355. * @param {string} options.routeTable - 路由数据集。
  24356. * @param {string} options.routeIDField - 路由数据集的标识字段。
  24357. * @param {string} options.eventTable - 用于生成空间数据的事件表名。
  24358. * @param {SuperMap.DataReturnOption} options.dataReturnOption - 设置数据返回选项。
  24359. * @param {string} [options.attributeFilter] - 属性过滤条件。
  24360. * @param {string} options.eventRouteIDField - 用于生成空间数据的事件表的路由标识字段。
  24361. * @param {string} [options.measureField] - 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义。
  24362. * @param {string} [options.measureStartField] - 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  24363. * @param {string} [options.measureEndField] - 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  24364. * @param {string} [options.measureOffsetField] - 刻度偏移量字段。
  24365. * @param {string} [options.errorInfoField] - 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  24366. * @param {Array.<string>} [options.retainedFields] - 欲保留到结果空间数据中的字段集合(系统字段除外)。
  24367. */
  24368. var GenerateSpatialDataParameters = /*#__PURE__*/function () {
  24369. function GenerateSpatialDataParameters(options) {
  24370. GenerateSpatialDataParameters_classCallCheck(this, GenerateSpatialDataParameters);
  24371. /**
  24372. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.routeTable
  24373. * @description 路由数据集。
  24374. */
  24375. this.routeTable = null;
  24376. /**
  24377. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.routeIDField
  24378. * @description 路由数据集的标识字段。
  24379. */
  24380. this.routeIDField = null;
  24381. /**
  24382. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.attributeFilter]
  24383. * @description 属性过滤条件。
  24384. * 当 {@link SuperMap.GenerateSpatialDataParameters.prototype.dataReturnOption.dataReturnMode} 为 {@link DataReturnMode.DATASET_AND_RECORDSET} 或 {@link DataReturnMode.RECORDSET_ONLY} 时有效。
  24385. */
  24386. this.attributeFilter = null;
  24387. /**
  24388. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.eventTable
  24389. * @description 用于生成空间数据的事件表名。
  24390. */
  24391. this.eventTable = null;
  24392. /**
  24393. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.eventRouteIDField
  24394. * @description 用于生成空间数据的事件表的路由标识字段。
  24395. */
  24396. this.eventRouteIDField = null;
  24397. /**
  24398. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureField]
  24399. * @description 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义
  24400. */
  24401. this.measureField = null;
  24402. /**
  24403. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureStartField]
  24404. * @description 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  24405. */
  24406. this.measureStartField = null;
  24407. /**
  24408. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureEndField]
  24409. * @description 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  24410. */
  24411. this.measureEndField = null;
  24412. /**
  24413. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureOffsetField]
  24414. * @description 刻度偏移量字段。
  24415. */
  24416. this.measureOffsetField = null;
  24417. /**
  24418. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.errorInfoField]
  24419. * @description 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  24420. */
  24421. this.errorInfoField = null;
  24422. /**
  24423. * @member {Array.<string>} [SuperMap.GenerateSpatialDataParameters.prototype.retainedFields]
  24424. * @description 欲保留到结果空间数据中的字段集合(系统字段除外)。
  24425. * 生成空间数据时,无论是否指定保留字段,路由 ID 字段、刻度偏移量字段、刻度值字段(点事件为刻度字段,线事件是起始和终止刻度字段)都会保留到结果空间数据中;
  24426. * 如果没有指定 retainedFields 参数或者 retainedFields 参数数组长度为 0,则返回所有用户字段。
  24427. */
  24428. this.retainedFields = null;
  24429. /**
  24430. * @member {SuperMap.DataReturnOption} SuperMap.GenerateSpatialDataParameters.prototype.dataReturnOption
  24431. * @description 设置数据返回的选项。
  24432. */
  24433. this.dataReturnOption = null;
  24434. if (options) {
  24435. Util.extend(this, options);
  24436. }
  24437. this.CLASS_NAME = "SuperMap.GenerateSpatialDataParameters";
  24438. }
  24439. /**
  24440. * @function SuperMap.GenerateSpatialDataParameters.prototype.destroy
  24441. * @description 释放资源,将引用资源的属性置空。
  24442. */
  24443. GenerateSpatialDataParameters_createClass(GenerateSpatialDataParameters, [{
  24444. key: "destroy",
  24445. value: function destroy() {
  24446. var me = this;
  24447. if (me.routeTable) {
  24448. me.routeTable = null;
  24449. }
  24450. me.routeIDField = null;
  24451. me.attributeFilter = null;
  24452. me.eventTable = null;
  24453. me.eventRouteIDField = null;
  24454. me.measureField = null;
  24455. me.measureStartField = null;
  24456. me.measureEndField = null;
  24457. me.measureOffsetField = null;
  24458. me.errorInfoField = null;
  24459. if (me.dataReturnOption) {
  24460. me.dataReturnOption.destroy();
  24461. me.dataReturnOption = null;
  24462. }
  24463. }
  24464. }]);
  24465. return GenerateSpatialDataParameters;
  24466. }();
  24467. SuperMap.GenerateSpatialDataParameters = GenerateSpatialDataParameters;
  24468. ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataService.js
  24469. function GenerateSpatialDataService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GenerateSpatialDataService_typeof = function _typeof(obj) { return typeof obj; }; } else { GenerateSpatialDataService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GenerateSpatialDataService_typeof(obj); }
  24470. function GenerateSpatialDataService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24471. 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); } }
  24472. function GenerateSpatialDataService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataService_defineProperties(Constructor, staticProps); return Constructor; }
  24473. function GenerateSpatialDataService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GenerateSpatialDataService_get = Reflect.get; } else { GenerateSpatialDataService_get = function _get(target, property, receiver) { var base = GenerateSpatialDataService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GenerateSpatialDataService_get(target, property, receiver || target); }
  24474. function GenerateSpatialDataService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GenerateSpatialDataService_getPrototypeOf(object); if (object === null) break; } return object; }
  24475. function GenerateSpatialDataService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GenerateSpatialDataService_setPrototypeOf(subClass, superClass); }
  24476. function GenerateSpatialDataService_setPrototypeOf(o, p) { GenerateSpatialDataService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GenerateSpatialDataService_setPrototypeOf(o, p); }
  24477. 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); }; }
  24478. function GenerateSpatialDataService_possibleConstructorReturn(self, call) { if (call && (GenerateSpatialDataService_typeof(call) === "object" || typeof call === "function")) { return call; } return GenerateSpatialDataService_assertThisInitialized(self); }
  24479. function GenerateSpatialDataService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24480. function GenerateSpatialDataService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  24481. function GenerateSpatialDataService_getPrototypeOf(o) { GenerateSpatialDataService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GenerateSpatialDataService_getPrototypeOf(o); }
  24482. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24483. * This program are made available under the terms of the Apache License, Version 2.0
  24484. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24485. /**
  24486. * @class SuperMap.GenerateSpatialDataService
  24487. * @category iServer SpatialAnalyst GenerateSpatialData
  24488. * @classdesc 动态分段分析服务类。该类负责将客户设置的动态分段分析服务参数传递给服务端,并接收服务端返回的动态分段分析结果数据。
  24489. * 获取的结果数据包括 originResult 、result 两种,其中,originResult 为服务端返回的用 JSON 对象表示的动态分段分析结果数据,result 为服务端返回的动态分段分析结果数据。
  24490. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  24491. * @param {Object} options - 参数。</br>
  24492. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  24493. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24494. * @param {Object} [options.headers] - 请求头。
  24495. * @extends {SuperMap.SpatialAnalystBase}
  24496. * @example 实例化该类如下例所示:
  24497. * (start code)
  24498. * function GenerateSpatialData(){
  24499. *
  24500. * //配置数据返回选项(option)
  24501. * var option = new SuperMap.DataReturnOption({
  24502. * expectCount: 1000,
  24503. * dataset: "generateSpatialData",
  24504. * deleteExistResultDataset: true,
  24505. * dataReturnMode: SuperMap.DataReturnMode.DATASET_ONLY
  24506. * }),
  24507. * //配置动态分段参数(Parameters)
  24508. * parameters = new SuperMap.GenerateSpatialDataParameters({
  24509. * routeTable: "RouteDT_road@Changchun",
  24510. * routeIDField: "RouteID",
  24511. * eventTable: "LinearEventTabDT@Changchun",
  24512. * eventRouteIDField: "RouteID",
  24513. * measureField: "",
  24514. * measureStartField: "LineMeasureFrom",
  24515. * measureEndField: "LineMeasureTo",
  24516. * measureOffsetField: "",
  24517. * errorInfoField: "",
  24518. * retainedFields:[],
  24519. * dataReturnOption: option
  24520. * }),
  24521. * //配置动态分段iService
  24522. * iService = new SuperMap.GenerateSpatialDataService(Changchun_spatialanalyst, {
  24523. * eventListeners: {
  24524. * processCompleted: generateCompleted,
  24525. * processFailed: generateFailded
  24526. * }
  24527. * });
  24528. * //执行
  24529. * iService.processAsync(parameters);
  24530. * function Completed(generateSpatialDataEventArgs){//todo};
  24531. * function Error(generateSpatialDataEventArgs){//todo};
  24532. * (end)
  24533. */
  24534. var GenerateSpatialDataService = /*#__PURE__*/function (_SpatialAnalystBase) {
  24535. GenerateSpatialDataService_inherits(GenerateSpatialDataService, _SpatialAnalystBase);
  24536. var _super = GenerateSpatialDataService_createSuper(GenerateSpatialDataService);
  24537. function GenerateSpatialDataService(url, options) {
  24538. var _this;
  24539. GenerateSpatialDataService_classCallCheck(this, GenerateSpatialDataService);
  24540. _this = _super.call(this, url, options);
  24541. _this.CLASS_NAME = "SuperMap.GenerateSpatialDataService";
  24542. return _this;
  24543. }
  24544. /**
  24545. * @function SuperMap.GenerateSpatialDataService.prototype.destroy
  24546. * @override
  24547. */
  24548. GenerateSpatialDataService_createClass(GenerateSpatialDataService, [{
  24549. key: "destroy",
  24550. value: function destroy() {
  24551. GenerateSpatialDataService_get(GenerateSpatialDataService_getPrototypeOf(GenerateSpatialDataService.prototype), "destroy", this).call(this);
  24552. }
  24553. /**
  24554. * @function SuperMap.GenerateSpatialDataService.prototype.processAsync
  24555. * @description 负责将客户端的动态分段服务参数传递到服务端。
  24556. * @param {SuperMap.GenerateSpatialDataParameters} params - 动态分段操作参数类。
  24557. */
  24558. }, {
  24559. key: "processAsync",
  24560. value: function processAsync(params) {
  24561. if (!(params instanceof GenerateSpatialDataParameters)) {
  24562. return;
  24563. }
  24564. var me = this,
  24565. jsonParameters;
  24566. jsonParameters = me.getJsonParameters(params);
  24567. me.request({
  24568. method: "POST",
  24569. data: jsonParameters,
  24570. scope: me,
  24571. success: me.serviceProcessCompleted,
  24572. failure: me.serviceProcessFailed
  24573. });
  24574. }
  24575. /**
  24576. * @function SuperMap.GenerateSpatialDataService.prototype.getJsonParameters
  24577. * @description 将参数转化为 JSON 字符串。
  24578. * @param {SuperMap.GenerateSpatialDataParameters} params - 动态分段操作参数类。
  24579. * @returns {string}转化后的JSON字符串。
  24580. */
  24581. }, {
  24582. key: "getJsonParameters",
  24583. value: function getJsonParameters(params) {
  24584. var jsonParameters = "",
  24585. jsonStr = "datasets/" + params.routeTable + "/linearreferencing/generatespatialdata",
  24586. me = this;
  24587. me.url = Util.urlPathAppend(me.url, jsonStr);
  24588. me.url = Util.urlAppend(me.url, 'returnContent=true');
  24589. jsonParameters = Util.toJSON(params);
  24590. return jsonParameters;
  24591. }
  24592. }]);
  24593. return GenerateSpatialDataService;
  24594. }(SpatialAnalystBase);
  24595. SuperMap.GenerateSpatialDataService = GenerateSpatialDataService;
  24596. ;// CONCATENATED MODULE: ./src/common/iServer/GeoBoundingBoxQueryBuilderParameter.js
  24597. function GeoBoundingBoxQueryBuilderParameter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoBoundingBoxQueryBuilderParameter_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoBoundingBoxQueryBuilderParameter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoBoundingBoxQueryBuilderParameter_typeof(obj); }
  24598. function GeoBoundingBoxQueryBuilderParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24599. function GeoBoundingBoxQueryBuilderParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24600. function GeoBoundingBoxQueryBuilderParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoBoundingBoxQueryBuilderParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoBoundingBoxQueryBuilderParameter_defineProperties(Constructor, staticProps); return Constructor; }
  24601. function GeoBoundingBoxQueryBuilderParameter_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoBoundingBoxQueryBuilderParameter_get = Reflect.get; } else { GeoBoundingBoxQueryBuilderParameter_get = function _get(target, property, receiver) { var base = GeoBoundingBoxQueryBuilderParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeoBoundingBoxQueryBuilderParameter_get(target, property, receiver || target); }
  24602. function GeoBoundingBoxQueryBuilderParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  24603. function GeoBoundingBoxQueryBuilderParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeoBoundingBoxQueryBuilderParameter_setPrototypeOf(subClass, superClass); }
  24604. function GeoBoundingBoxQueryBuilderParameter_setPrototypeOf(o, p) { GeoBoundingBoxQueryBuilderParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoBoundingBoxQueryBuilderParameter_setPrototypeOf(o, p); }
  24605. function GeoBoundingBoxQueryBuilderParameter_createSuper(Derived) { var hasNativeReflectConstruct = GeoBoundingBoxQueryBuilderParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoBoundingBoxQueryBuilderParameter_possibleConstructorReturn(this, result); }; }
  24606. function GeoBoundingBoxQueryBuilderParameter_possibleConstructorReturn(self, call) { if (call && (GeoBoundingBoxQueryBuilderParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(self); }
  24607. function GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24608. function GeoBoundingBoxQueryBuilderParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  24609. function GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(o) { GeoBoundingBoxQueryBuilderParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(o); }
  24610. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24611. * This program are made available under the terms of the Apache License, Version 2.0
  24612. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24613. /**
  24614. * @class SuperMap.GeoBoundingBoxQueryBuilderParameter
  24615. * @classdesc bounds 查询参数设置类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  24616. * @category iServer Data FeatureResults
  24617. * @param {Object} options - 参数。
  24618. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 查询范围。
  24619. * @param {SuperMap.AggregationQueryBuilderType} [options.queryType=SuperMap.AggregationQueryBuilderType.GEO_BOUNDING_BOX] - 查询类型。
  24620. */
  24621. var GeoBoundingBoxQueryBuilderParameter = /*#__PURE__*/function (_AggQueryBuilderParam) {
  24622. GeoBoundingBoxQueryBuilderParameter_inherits(GeoBoundingBoxQueryBuilderParameter, _AggQueryBuilderParam);
  24623. var _super = GeoBoundingBoxQueryBuilderParameter_createSuper(GeoBoundingBoxQueryBuilderParameter);
  24624. function GeoBoundingBoxQueryBuilderParameter(options) {
  24625. var _this;
  24626. GeoBoundingBoxQueryBuilderParameter_classCallCheck(this, GeoBoundingBoxQueryBuilderParameter);
  24627. _this = _super.call(this, options);
  24628. /**
  24629. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.GeoBoundingBoxQueryBuilderParameter.prototype.bounds
  24630. * @description 查询范围。
  24631. */
  24632. _this.bounds = null;
  24633. /**
  24634. * @member {SuperMap.AggregationQueryBuilderType} [SuperMap.GeoBoundingBoxQueryBuilderParameter.prototype.queryType=SuperMap.AggregationQueryBuilderType.GEO_BOUNDING_BOX]
  24635. * @description 查询类型。
  24636. */
  24637. _this.queryType = AggregationQueryBuilderType.GEO_BOUNDING_BOX;
  24638. _this.CLASS_NAME = "SuperMap.GeoBoundingBoxQueryBuilderParameter";
  24639. Util.extend(GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(_this), options);
  24640. return _this;
  24641. }
  24642. GeoBoundingBoxQueryBuilderParameter_createClass(GeoBoundingBoxQueryBuilderParameter, [{
  24643. key: "destroy",
  24644. value: function destroy() {
  24645. GeoBoundingBoxQueryBuilderParameter_get(GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(GeoBoundingBoxQueryBuilderParameter.prototype), "destroy", this).call(this);
  24646. this.bounds = null;
  24647. this.queryType = null;
  24648. }
  24649. }]);
  24650. return GeoBoundingBoxQueryBuilderParameter;
  24651. }(AggQueryBuilderParameter);
  24652. SuperMap.GeoBoundingBoxQueryBuilderParameter = GeoBoundingBoxQueryBuilderParameter;
  24653. ;// CONCATENATED MODULE: ./src/common/iServer/GeoHashGridAggParameter.js
  24654. function GeoHashGridAggParameter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoHashGridAggParameter_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoHashGridAggParameter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoHashGridAggParameter_typeof(obj); }
  24655. function GeoHashGridAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24656. 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); } }
  24657. function GeoHashGridAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoHashGridAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoHashGridAggParameter_defineProperties(Constructor, staticProps); return Constructor; }
  24658. function GeoHashGridAggParameter_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoHashGridAggParameter_get = Reflect.get; } else { GeoHashGridAggParameter_get = function _get(target, property, receiver) { var base = GeoHashGridAggParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeoHashGridAggParameter_get(target, property, receiver || target); }
  24659. function GeoHashGridAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoHashGridAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  24660. function GeoHashGridAggParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeoHashGridAggParameter_setPrototypeOf(subClass, superClass); }
  24661. function GeoHashGridAggParameter_setPrototypeOf(o, p) { GeoHashGridAggParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoHashGridAggParameter_setPrototypeOf(o, p); }
  24662. 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); }; }
  24663. function GeoHashGridAggParameter_possibleConstructorReturn(self, call) { if (call && (GeoHashGridAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoHashGridAggParameter_assertThisInitialized(self); }
  24664. function GeoHashGridAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24665. function GeoHashGridAggParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  24666. function GeoHashGridAggParameter_getPrototypeOf(o) { GeoHashGridAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoHashGridAggParameter_getPrototypeOf(o); }
  24667. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24668. * This program are made available under the terms of the Apache License, Version 2.0
  24669. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24670. /**
  24671. * @class SuperMap.GeoHashGridAggParameter
  24672. * @classdesc 格网聚合查询参数类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  24673. * @category iServer Data FeatureResults
  24674. * @param {Object} option - 初始化参数。
  24675. * @param {number} [option.precision=5] - 网格中数字的精度。
  24676. * @param {SuperMap.AggregationType} [option.aggType=SuperMap.AggregationType.GEOHASH_GRID] - 格网聚合类型。
  24677. */
  24678. var GeoHashGridAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  24679. GeoHashGridAggParameter_inherits(GeoHashGridAggParameter, _AggregationParameter);
  24680. var _super = GeoHashGridAggParameter_createSuper(GeoHashGridAggParameter);
  24681. function GeoHashGridAggParameter(option) {
  24682. var _this;
  24683. GeoHashGridAggParameter_classCallCheck(this, GeoHashGridAggParameter);
  24684. _this = _super.call(this, option);
  24685. /**
  24686. * @member {number} [SuperMap.GeoHashGridAggParameter.prototype.precision=5]
  24687. * @description 网格中数字的精度。
  24688. */
  24689. _this.precision = 5;
  24690. /**
  24691. * @member {SuperMap.AggregationType} [SuperMap.GeoHashGridAggParameter.prototype.aggType=SuperMap.AggregationType.GEOHASH_GRID]
  24692. * @description 格网聚合类型。
  24693. */
  24694. _this.aggType = AggregationType.GEOHASH_GRID;
  24695. Util.extend(GeoHashGridAggParameter_assertThisInitialized(_this), option);
  24696. _this.CLASS_NAME = "SuperMap.GeoHashGridAggParameter";
  24697. return _this;
  24698. }
  24699. GeoHashGridAggParameter_createClass(GeoHashGridAggParameter, [{
  24700. key: "destroy",
  24701. value: function destroy() {
  24702. GeoHashGridAggParameter_get(GeoHashGridAggParameter_getPrototypeOf(GeoHashGridAggParameter.prototype), "destroy", this).call(this);
  24703. this.aggType = null;
  24704. }
  24705. /**
  24706. * @function SuperMap.GeoHashGridAggParameter.toJsonParameters
  24707. * @description 将对象转为 JSON 格式。
  24708. * @param param 转换对象。
  24709. * @returns {string|object}
  24710. */
  24711. }], [{
  24712. key: "toJsonParameters",
  24713. value: function toJsonParameters(param) {
  24714. var parameters = {
  24715. aggName: param.aggName,
  24716. aggFieldName: param.aggFieldName,
  24717. aggType: param.aggType,
  24718. precision: param.precision
  24719. };
  24720. if (param.subAgg) {
  24721. parameters.subAgg = param.subAgg;
  24722. }
  24723. return Util.toJson(parameters);
  24724. }
  24725. }]);
  24726. return GeoHashGridAggParameter;
  24727. }(AggregationParameter);
  24728. SuperMap.GeoHashGridAggParameter = GeoHashGridAggParameter;
  24729. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryOverlayAnalystParameters.js
  24730. function GeometryOverlayAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeometryOverlayAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GeometryOverlayAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeometryOverlayAnalystParameters_typeof(obj); }
  24731. function GeometryOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24732. 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); } }
  24733. function GeometryOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryOverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  24734. function GeometryOverlayAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryOverlayAnalystParameters_get = Reflect.get; } else { GeometryOverlayAnalystParameters_get = function _get(target, property, receiver) { var base = GeometryOverlayAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeometryOverlayAnalystParameters_get(target, property, receiver || target); }
  24735. function GeometryOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  24736. function GeometryOverlayAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeometryOverlayAnalystParameters_setPrototypeOf(subClass, superClass); }
  24737. function GeometryOverlayAnalystParameters_setPrototypeOf(o, p) { GeometryOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryOverlayAnalystParameters_setPrototypeOf(o, p); }
  24738. 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); }; }
  24739. function GeometryOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryOverlayAnalystParameters_assertThisInitialized(self); }
  24740. function GeometryOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24741. function GeometryOverlayAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  24742. function GeometryOverlayAnalystParameters_getPrototypeOf(o) { GeometryOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryOverlayAnalystParameters_getPrototypeOf(o); }
  24743. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24744. * This program are made available under the terms of the Apache License, Version 2.0
  24745. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24746. /**
  24747. * @class SuperMap.GeometryOverlayAnalystParameters
  24748. * @category iServer SpatialAnalyst OverlayAnalyst
  24749. * @classdesc
  24750. * 几何对象叠加分析参数类。对指定的某两个几何对象做叠加分析。通过该类可以指定要做叠加分析的几何对象、叠加操作类型。
  24751. * @param {Object} options - 参数。
  24752. * @param {Object} options.operateGeometry - 叠加分析的操作几何对象。 </br>
  24753. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  24754. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link GeoJSONObject}。</br>
  24755. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link GeoJSONObject}。
  24756. * @param {Object} options.sourceGeometry - 叠加分析的源几何对象。
  24757. * @param {Array.<Object>} [options.operateGeometries] - 批量叠加分析的操作几何对象数组。
  24758. * @param {Array.<Object>} [options.sourceGeometries] -批量叠加分析的源几何对象数组。
  24759. * @param {SuperMap.OverlayOperationType} [options.operation] - 叠加操作枚举值。
  24760. * @extends {SuperMap.OverlayAnalystParameters}
  24761. */
  24762. var GeometryOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  24763. GeometryOverlayAnalystParameters_inherits(GeometryOverlayAnalystParameters, _OverlayAnalystParame);
  24764. var _super = GeometryOverlayAnalystParameters_createSuper(GeometryOverlayAnalystParameters);
  24765. function GeometryOverlayAnalystParameters(options) {
  24766. var _this;
  24767. GeometryOverlayAnalystParameters_classCallCheck(this, GeometryOverlayAnalystParameters);
  24768. _this = _super.call(this, options);
  24769. if (options && options.operateGeometry) {
  24770. _this.operateGeometry = options.operateGeometry;
  24771. }
  24772. if (options && options.sourceGeometry) {
  24773. _this.sourceGeometry = options.sourceGeometry;
  24774. }
  24775. if (options && options.operateGeometries) {
  24776. _this.operateGeometries = options.operateGeometries;
  24777. }
  24778. if (options && options.sourceGeometries) {
  24779. _this.sourceGeometries = options.sourceGeometries;
  24780. }
  24781. if (options) {
  24782. Util.extend(GeometryOverlayAnalystParameters_assertThisInitialized(_this), options);
  24783. }
  24784. _this.CLASS_NAME = "SuperMap.GeometryOverlayAnalystParameters";
  24785. return _this;
  24786. }
  24787. /**
  24788. * @function SuperMap.GeometryOverlayAnalystParameters.prototype.destroy
  24789. * @override
  24790. */
  24791. GeometryOverlayAnalystParameters_createClass(GeometryOverlayAnalystParameters, [{
  24792. key: "destroy",
  24793. value: function destroy() {
  24794. GeometryOverlayAnalystParameters_get(GeometryOverlayAnalystParameters_getPrototypeOf(GeometryOverlayAnalystParameters.prototype), "destroy", this).call(this);
  24795. var me = this;
  24796. if (me.sourceGeometry) {
  24797. me.sourceGeometry.destroy();
  24798. me.sourceGeometry = null;
  24799. }
  24800. if (me.sourceGeometries) {
  24801. me.sourceGeometries.destroy();
  24802. me.sourceGeometries = null;
  24803. }
  24804. if (me.sourceGeometry) {
  24805. me.sourceGeometry.destroy();
  24806. me.sourceGeometry = null;
  24807. }
  24808. if (me.operateGeometries) {
  24809. me.operateGeometries.destroy();
  24810. me.operateGeometries = null;
  24811. }
  24812. }
  24813. /**
  24814. * @function SuperMap.GeometryOverlayAnalystParameters.toObject
  24815. * @param {SuperMap.GeometryOverlayAnalystParameters} geometryOverlayAnalystParameters - 几何对象叠加分析参数类。
  24816. * @param {SuperMap.GeometryOverlayAnalystParameters} tempObj - 几何对象叠加分析参数对象。
  24817. * @description 将几何对象叠加分析参数对象转换为 JSON 对象。
  24818. * @returns {Object} JSON 对象。
  24819. */
  24820. }], [{
  24821. key: "toObject",
  24822. value: function toObject(geometryOverlayAnalystParameters, tempObj) {
  24823. for (var name in geometryOverlayAnalystParameters) {
  24824. if (name === "sourceGeometry") {
  24825. tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometry);
  24826. } else if (name === "sourceGeometries") {
  24827. var sourceGeometries = [];
  24828. for (var i = 0; i < geometryOverlayAnalystParameters.sourceGeometries.length; i++) {
  24829. sourceGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometries[i]));
  24830. }
  24831. tempObj.sourceGeometries = sourceGeometries;
  24832. } else if (name === "operateGeometry") {
  24833. tempObj.operateGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometry);
  24834. } else if (name === "operateGeometries") {
  24835. var operateGeometries = [];
  24836. for (var j = 0; j < geometryOverlayAnalystParameters.operateGeometries.length; j++) {
  24837. operateGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometries[j]));
  24838. }
  24839. tempObj.operateGeometries = operateGeometries;
  24840. } else {
  24841. tempObj[name] = geometryOverlayAnalystParameters[name];
  24842. }
  24843. }
  24844. }
  24845. }]);
  24846. return GeometryOverlayAnalystParameters;
  24847. }(OverlayAnalystParameters);
  24848. SuperMap.GeometryOverlayAnalystParameters = GeometryOverlayAnalystParameters;
  24849. ;// CONCATENATED MODULE: ./src/common/iServer/GeometrySurfaceAnalystParameters.js
  24850. function GeometrySurfaceAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeometrySurfaceAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GeometrySurfaceAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeometrySurfaceAnalystParameters_typeof(obj); }
  24851. function GeometrySurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24852. 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); } }
  24853. function GeometrySurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  24854. function GeometrySurfaceAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeometrySurfaceAnalystParameters_get = Reflect.get; } else { GeometrySurfaceAnalystParameters_get = function _get(target, property, receiver) { var base = GeometrySurfaceAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeometrySurfaceAnalystParameters_get(target, property, receiver || target); }
  24855. function GeometrySurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometrySurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  24856. function GeometrySurfaceAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeometrySurfaceAnalystParameters_setPrototypeOf(subClass, superClass); }
  24857. function GeometrySurfaceAnalystParameters_setPrototypeOf(o, p) { GeometrySurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometrySurfaceAnalystParameters_setPrototypeOf(o, p); }
  24858. 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); }; }
  24859. function GeometrySurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometrySurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometrySurfaceAnalystParameters_assertThisInitialized(self); }
  24860. function GeometrySurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24861. function GeometrySurfaceAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  24862. function GeometrySurfaceAnalystParameters_getPrototypeOf(o) { GeometrySurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometrySurfaceAnalystParameters_getPrototypeOf(o); }
  24863. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24864. * This program are made available under the terms of the Apache License, Version 2.0
  24865. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24866. /**
  24867. * @class SuperMap.GeometrySurfaceAnalystParameters
  24868. * @category iServer SpatialAnalyst SurfaceAnalyst
  24869. * @classdesc 几何对象表面分析参数类。该类对几何对象表面分析所用到的参数进行设置。
  24870. * @param {Object} options - 参数。
  24871. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} options.points - 表面分析的坐标点数组。
  24872. * @param {Array.<number>} options.zValues - 表面分析的坐标点的 Z 值数组。
  24873. * @param {number} [options.resolution] - 获取或设置指定中间结果(栅格数据集)的分辨率。
  24874. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  24875. * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
  24876. * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod = SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  24877. * @extends {SuperMap.SurfaceAnalystParameters}
  24878. */
  24879. var GeometrySurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  24880. GeometrySurfaceAnalystParameters_inherits(GeometrySurfaceAnalystParameters, _SurfaceAnalystParame);
  24881. var _super = GeometrySurfaceAnalystParameters_createSuper(GeometrySurfaceAnalystParameters);
  24882. function GeometrySurfaceAnalystParameters(options) {
  24883. var _this;
  24884. GeometrySurfaceAnalystParameters_classCallCheck(this, GeometrySurfaceAnalystParameters);
  24885. _this = _super.call(this, options);
  24886. /**
  24887. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} SuperMap.GeometrySurfaceAnalystParameters.prototype.points
  24888. * @description 获取或设置用于表面分析的坐标点数组。
  24889. */
  24890. _this.points = null;
  24891. /**
  24892. * @member {Array.<number>} SuperMap.GeometrySurfaceAnalystParameters.prototype.zValues
  24893. * @description 获取或设置用于提取操作的值。提取等值线时,将使用该数组中的值,
  24894. * 对几何对象中的坐标点数组进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  24895. */
  24896. _this.zValues = null;
  24897. if (options) {
  24898. Util.extend(GeometrySurfaceAnalystParameters_assertThisInitialized(_this), options);
  24899. }
  24900. _this.CLASS_NAME = "SuperMap.GeometrySurfaceAnalystParameters";
  24901. return _this;
  24902. }
  24903. /**
  24904. * @function SuperMap.GeometrySurfaceAnalystParameters.prototype.destroy
  24905. * @override
  24906. */
  24907. GeometrySurfaceAnalystParameters_createClass(GeometrySurfaceAnalystParameters, [{
  24908. key: "destroy",
  24909. value: function destroy() {
  24910. GeometrySurfaceAnalystParameters_get(GeometrySurfaceAnalystParameters_getPrototypeOf(GeometrySurfaceAnalystParameters.prototype), "destroy", this).call(this);
  24911. var me = this;
  24912. if (me.points) {
  24913. for (var i = 0, points = me.points, len = points.length; i < len; i++) {
  24914. points[i].destroy();
  24915. }
  24916. me.points = null;
  24917. }
  24918. me.zValues = null;
  24919. }
  24920. }]);
  24921. return GeometrySurfaceAnalystParameters;
  24922. }(SurfaceAnalystParameters);
  24923. SuperMap.GeometrySurfaceAnalystParameters = GeometrySurfaceAnalystParameters;
  24924. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryThiessenAnalystParameters.js
  24925. function GeometryThiessenAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeometryThiessenAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GeometryThiessenAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeometryThiessenAnalystParameters_typeof(obj); }
  24926. function GeometryThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24927. 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); } }
  24928. function GeometryThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  24929. function GeometryThiessenAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryThiessenAnalystParameters_get = Reflect.get; } else { GeometryThiessenAnalystParameters_get = function _get(target, property, receiver) { var base = GeometryThiessenAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeometryThiessenAnalystParameters_get(target, property, receiver || target); }
  24930. function GeometryThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  24931. function GeometryThiessenAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeometryThiessenAnalystParameters_setPrototypeOf(subClass, superClass); }
  24932. function GeometryThiessenAnalystParameters_setPrototypeOf(o, p) { GeometryThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryThiessenAnalystParameters_setPrototypeOf(o, p); }
  24933. 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); }; }
  24934. function GeometryThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryThiessenAnalystParameters_assertThisInitialized(self); }
  24935. function GeometryThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24936. function GeometryThiessenAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  24937. function GeometryThiessenAnalystParameters_getPrototypeOf(o) { GeometryThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryThiessenAnalystParameters_getPrototypeOf(o); }
  24938. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24939. * This program are made available under the terms of the Apache License, Version 2.0
  24940. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24941. /**
  24942. * @class SuperMap.GeometryThiessenAnalystParameters
  24943. * @constructs SuperMap.GeometryThiessenAnalystParameters
  24944. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  24945. * @classdesc 几何对象泰森多边形分析参数类。对指定的某个几何对象做泰森多边形分析。通过该类可以指定要做泰森多边形分析的几何对象、返回数据集名称等。
  24946. * @param {Object} options - 参数。
  24947. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} options.points - 使用点数组进行分析时使用的几何对象。
  24948. * @extends {SuperMap.ThiessenAnalystParameters}
  24949. */
  24950. var GeometryThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  24951. GeometryThiessenAnalystParameters_inherits(GeometryThiessenAnalystParameters, _ThiessenAnalystParam);
  24952. var _super = GeometryThiessenAnalystParameters_createSuper(GeometryThiessenAnalystParameters);
  24953. function GeometryThiessenAnalystParameters(options) {
  24954. var _this;
  24955. GeometryThiessenAnalystParameters_classCallCheck(this, GeometryThiessenAnalystParameters);
  24956. _this = _super.call(this, options);
  24957. /**
  24958. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} SuperMap.GeometryThiessenAnalystParameters.prototype.points
  24959. * @description 使用点数组进行分析时使用的几何对象。
  24960. */
  24961. _this.points = null;
  24962. if (options) {
  24963. Util.extend(GeometryThiessenAnalystParameters_assertThisInitialized(_this), options);
  24964. }
  24965. _this.CLASS_NAME = "SuperMap.GeometryThiessenAnalystParameters";
  24966. return _this;
  24967. }
  24968. /**
  24969. * @function SuperMap.GeometryThiessenAnalystParameters.prototype.destroy
  24970. * @override
  24971. */
  24972. GeometryThiessenAnalystParameters_createClass(GeometryThiessenAnalystParameters, [{
  24973. key: "destroy",
  24974. value: function destroy() {
  24975. GeometryThiessenAnalystParameters_get(GeometryThiessenAnalystParameters_getPrototypeOf(GeometryThiessenAnalystParameters.prototype), "destroy", this).call(this);
  24976. var me = this;
  24977. if (me.points) {
  24978. for (var i = me.points.length - 1; i >= 0; i--) {
  24979. me.points[i].destroy();
  24980. }
  24981. me.points = null;
  24982. }
  24983. }
  24984. /**
  24985. * @function SuperMap.GeometryThiessenAnalystParameters.toObject
  24986. * @param {SuperMap.GeometryThiessenAnalystParameters} geometryThiessenAnalystParameters - 几何对象泰森多边形分析参数类。
  24987. * @param {SuperMap.GeometryThiessenAnalystParameters} tempObj - 几何对象泰森多边形分析参数对象。
  24988. * @description 将几何对象泰森多边形分析参数对象转换为 JSON 对象。
  24989. * @returns {Object} JSON 对象。
  24990. */
  24991. }], [{
  24992. key: "toObject",
  24993. value: function toObject(geometryThiessenAnalystParameters, tempObj) {
  24994. for (var name in geometryThiessenAnalystParameters) {
  24995. if (name === "clipRegion") {
  24996. tempObj.clipRegion = ServerGeometry.fromGeometry(geometryThiessenAnalystParameters.clipRegion);
  24997. } else {
  24998. tempObj[name] = geometryThiessenAnalystParameters[name];
  24999. }
  25000. }
  25001. }
  25002. }]);
  25003. return GeometryThiessenAnalystParameters;
  25004. }(ThiessenAnalystParameters);
  25005. SuperMap.GeometryThiessenAnalystParameters = GeometryThiessenAnalystParameters;
  25006. ;// CONCATENATED MODULE: ./src/common/iServer/GeoprocessingService.js
  25007. function GeoprocessingService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoprocessingService_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoprocessingService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoprocessingService_typeof(obj); }
  25008. function GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25009. 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); } }
  25010. function GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoprocessingService_defineProperties(Constructor, staticProps); return Constructor; }
  25011. function GeoprocessingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeoprocessingService_setPrototypeOf(subClass, superClass); }
  25012. function GeoprocessingService_setPrototypeOf(o, p) { GeoprocessingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoprocessingService_setPrototypeOf(o, p); }
  25013. 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); }; }
  25014. function GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoprocessingService_assertThisInitialized(self); }
  25015. function GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25016. function GeoprocessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  25017. function GeoprocessingService_getPrototypeOf(o) { GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoprocessingService_getPrototypeOf(o); }
  25018. /**
  25019. * @class SuperMap.GeoprocessingService
  25020. * @category iServer GeoprocessingService
  25021. * @classdesc 地理处理服务接口的基类。
  25022. * @version 10.1.0
  25023. * @extends {SuperMap.CommonServiceBase}
  25024. * @param {string} url - 服务地址。
  25025. * @param {Object} options - 参数。
  25026. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  25027. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,iServer|iPortal|Online。
  25028. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  25029. */
  25030. var GeoprocessingService_GeoprocessingService = /*#__PURE__*/function (_CommonServiceBase) {
  25031. GeoprocessingService_inherits(GeoprocessingService, _CommonServiceBase);
  25032. var _super = GeoprocessingService_createSuper(GeoprocessingService);
  25033. function GeoprocessingService(url, options) {
  25034. var _this;
  25035. GeoprocessingService_classCallCheck(this, GeoprocessingService);
  25036. options = options || {};
  25037. options.EVENT_TYPES = ['processCompleted', 'processFailed', 'processRunning'];
  25038. _this = _super.call(this, url, options);
  25039. _this.CLASS_NAME = 'SuperMap.GeoprocessingService';
  25040. _this.headers = {};
  25041. _this.crossOrigin = true;
  25042. return _this;
  25043. }
  25044. /**
  25045. * @function SuperMap.GeoprocessingService.prototype.getTools
  25046. * @description 获取地理处理工具列表。
  25047. */
  25048. GeoprocessingService_createClass(GeoprocessingService, [{
  25049. key: "getTools",
  25050. value: function getTools() {
  25051. this._get("".concat(this.url, "/list"));
  25052. }
  25053. /**
  25054. * @function SuperMap.GeoprocessingService.prototype.getTool
  25055. * @description 获取地理处理工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  25056. * @param {string} identifier - 地理处理工具ID。
  25057. */
  25058. }, {
  25059. key: "getTool",
  25060. value: function getTool(identifier) {
  25061. this._get("".concat(this.url, "/").concat(identifier));
  25062. }
  25063. /**
  25064. * @function SuperMap.GeoprocessingService.prototype.execute
  25065. * @description 同步执行地理处理工具。
  25066. * @param {string} identifier - 地理处理工具ID。
  25067. * @param {Object} parameter - 地理处理工具的输入参数。
  25068. * @param {Object} environment - 地理处理工具的环境参数。
  25069. */
  25070. }, {
  25071. key: "execute",
  25072. value: function execute(identifier, parameter, environment) {
  25073. parameter = parameter ? parameter : null;
  25074. environment = environment ? environment : null;
  25075. var executeParamter = {
  25076. parameter: parameter,
  25077. environment: environment
  25078. };
  25079. this._get("".concat(this.url, "/").concat(identifier, "/execute"), executeParamter);
  25080. }
  25081. /**
  25082. * @function SuperMap.GeoprocessingService.prototype.submitJob
  25083. * @description 异步执行地理处理工具。
  25084. * @param {string} identifier - 地理处理工具ID。
  25085. * @param {Object} parameter - 地理处理工具的输入参数。
  25086. * @param {Object} environments - 地理处理工具的环境参数。
  25087. */
  25088. }, {
  25089. key: "submitJob",
  25090. value: function submitJob(identifier, parameter, environments) {
  25091. parameter = parameter ? parameter : null;
  25092. environments = environments ? environments : null;
  25093. var asyncParamter = {
  25094. parameter: parameter,
  25095. environments: environments
  25096. };
  25097. this.request({
  25098. url: "".concat(this.url, "/").concat(identifier, "/jobs"),
  25099. headers: {
  25100. 'Content-type': 'application/json'
  25101. },
  25102. method: 'POST',
  25103. data: JSON.stringify(asyncParamter),
  25104. scope: this,
  25105. success: this.serviceProcessCompleted,
  25106. failure: this.serviceProcessFailed
  25107. });
  25108. }
  25109. /**
  25110. * @function SuperMap.GeoprocessingService.prototype.waitForJobCompletion
  25111. * @description 获取地理处理异步执行状态信息。
  25112. * @param {string} jobId - 地理处理任务ID。
  25113. * @param {string} identifier - 地理处理工具ID。
  25114. * @param {Object} options - 状态信息参数。
  25115. * @param {number} options.interval - 定时器时间间隔。
  25116. * @param {Callback} options.statusCallback - 任务状态的回调函数。
  25117. */
  25118. }, {
  25119. key: "waitForJobCompletion",
  25120. value: function waitForJobCompletion(jobId, identifier, options) {
  25121. var me = this;
  25122. var timer = setInterval(function () {
  25123. var serviceProcessCompleted = function serviceProcessCompleted(serverResult) {
  25124. var state = serverResult.state.runState;
  25125. if (options.statusCallback) {
  25126. options.statusCallback(state);
  25127. }
  25128. switch (state) {
  25129. case 'FINISHED':
  25130. clearInterval(timer);
  25131. me.events.triggerEvent('processCompleted', {
  25132. result: serverResult
  25133. });
  25134. break;
  25135. case 'FAILED':
  25136. clearInterval(timer);
  25137. me.events.triggerEvent('processFailed', {
  25138. result: serverResult
  25139. });
  25140. break;
  25141. case 'CANCELED':
  25142. clearInterval(timer);
  25143. me.events.triggerEvent('processFailed', {
  25144. result: serverResult
  25145. });
  25146. break;
  25147. }
  25148. };
  25149. me._get("".concat(me.url, "/").concat(identifier, "/jobs/").concat(jobId), null, serviceProcessCompleted);
  25150. }, options.interval);
  25151. }
  25152. /**
  25153. * @function SuperMap.GeoprocessingService.prototype.getJobInfo
  25154. * @description 获取地理处理任务的执行信息。
  25155. * @param {string} identifier - 地理处理工具ID。
  25156. * @param {string} jobId - 地理处理任务ID。
  25157. */
  25158. }, {
  25159. key: "getJobInfo",
  25160. value: function getJobInfo(identifier, jobId) {
  25161. this._get("".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId));
  25162. }
  25163. /**
  25164. * @function SuperMap.GeoprocessingService.prototype.cancelJob
  25165. * @description 取消地理处理任务的异步执行。
  25166. * @param {string} identifier - 地理处理工具ID。
  25167. * @param {string} jobId - 地理处理任务ID。
  25168. */
  25169. }, {
  25170. key: "cancelJob",
  25171. value: function cancelJob(identifier, jobId) {
  25172. this._get("".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/cancel"));
  25173. }
  25174. /**
  25175. * @function SuperMap.GeoprocessingService.prototype.getJobs
  25176. * @description 获取地理处理服务任务列表。
  25177. * @param {string} identifier - 地理处理工具ID。(传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  25178. */
  25179. }, {
  25180. key: "getJobs",
  25181. value: function getJobs(identifier) {
  25182. var url = "".concat(this.url, "/jobs");
  25183. if (identifier) {
  25184. url = "".concat(this.url, "/").concat(identifier, "/jobs");
  25185. }
  25186. this._get(url);
  25187. }
  25188. /**
  25189. * @function SuperMap.GeoprocessingService.prototype.getResults
  25190. * @description 地理处理工具执行的结果等,支持结果过滤。
  25191. * @param {string} identifier - 地理处理工具ID。
  25192. * @param {string} jobId - 地理处理任务ID。
  25193. * @param {string} filter - 输出异步结果的id。(可选,传入filter参数时对该地理处理工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  25194. */
  25195. }, {
  25196. key: "getResults",
  25197. value: function getResults(identifier, jobId, filter) {
  25198. var url = "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/results");
  25199. if (filter) {
  25200. url = "".concat(url, "/").concat(filter);
  25201. }
  25202. this._get(url);
  25203. }
  25204. }, {
  25205. key: "_get",
  25206. value: function _get(url, paramter, serviceProcessCompleted, serviceProcessFailed) {
  25207. this.request({
  25208. url: url,
  25209. method: 'GET',
  25210. params: paramter,
  25211. headers: {
  25212. 'Content-type': 'application/json'
  25213. },
  25214. scope: this,
  25215. success: serviceProcessCompleted ? serviceProcessCompleted : this.serviceProcessCompleted,
  25216. failure: serviceProcessFailed ? serviceProcessFailed : this.serviceProcessFailed
  25217. });
  25218. }
  25219. }]);
  25220. return GeoprocessingService;
  25221. }(CommonServiceBase);
  25222. SuperMap.GeoprocessingService = GeoprocessingService_GeoprocessingService;
  25223. ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystParameters.js
  25224. function GeoRelationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25225. 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); } }
  25226. function GeoRelationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  25227. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25228. * This program are made available under the terms of the Apache License, Version 2.0
  25229. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25230. /**
  25231. * @class SuperMap.GeoRelationAnalystParameters
  25232. * @category iServer SpatialAnalyst GeoRelationAnalyst
  25233. * @classdesc 空间关系分析服务参数类。使用该类可以为空间关系分析服务提供所需的参数信息。
  25234. * @param {Object} options - 参数。
  25235. * @param {SuperMap.FilterParameter} options.sourceFilter - 空间关系分析中的源数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  25236. * @param {SuperMap.FilterParameter} options.referenceFilter - 空间关系分析中的参考数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  25237. * @param {SuperMap.SpatialRelationType} options.spatialRelationType - 指定的空间关系类型。
  25238. * @param {boolean} [options.isBorderInside] - 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  25239. * @param {boolean} [options.returnFeature] - 是否返回 Feature 信息。
  25240. * @param {boolean} [options.returnGeoRelatedOnly=true] - 仅返回满足指定空间关系的空间对象。
  25241. * @param {number} [options.startRecord=0] - 分析结果起始记录位置。
  25242. * @param {number} [options.expectCount=500] - 空间关系分析期望返回结果记录数,如果实际不足500条结果则返回所有分析结果。
  25243. */
  25244. var GeoRelationAnalystParameters = /*#__PURE__*/function () {
  25245. function GeoRelationAnalystParameters(options) {
  25246. GeoRelationAnalystParameters_classCallCheck(this, GeoRelationAnalystParameters);
  25247. /**
  25248. * @member {string} SuperMap.GeoRelationAnalystParameters.prototype.dataset
  25249. * @description 源数据集名称。
  25250. */
  25251. this.dataset = null;
  25252. /**
  25253. * @member {SuperMap.FilterParameter} SuperMap.GeoRelationAnalystParameters.prototype.sourceFilter
  25254. * @description 空间关系分析中的源数据集查询参数。仅 ids、attributeFilter 和 fields 字段有效。
  25255. */
  25256. this.sourceFilter = null;
  25257. /**
  25258. * @member {SuperMap.FilterParameter} SuperMap.GeoRelationAnalystParameters.prototype.referenceFilter
  25259. * @description 空间关系分析中的参考数据集查询参数。仅 name,ids,attributeFilter 和 fields 字段有效。
  25260. */
  25261. this.referenceFilter = null;
  25262. /**
  25263. * @member {SuperMap.SpatialRelationType} SuperMap.GeoRelationAnalystParameters.prototype.spatialRelationType
  25264. * @description 指定的空间关系类型。
  25265. */
  25266. this.spatialRelationType = null;
  25267. /**
  25268. * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.isBorderInside]
  25269. * @description 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  25270. */
  25271. this.isBorderInside = null;
  25272. /**
  25273. * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.returnFeature]
  25274. * @description 是否返回 Feature 信息。
  25275. */
  25276. this.returnFeature = null;
  25277. /**
  25278. * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=true]
  25279. * @description 是否仅返回满足指定空间关系的空间对象。
  25280. */
  25281. this.returnGeoRelatedOnly = null;
  25282. /**
  25283. * @member {number} [SuperMap.GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=0]
  25284. * @description 分析结果起始记录位置。
  25285. */
  25286. this.startRecord = 0;
  25287. /**
  25288. * @member {number} [SuperMap.GeoRelationAnalystParameters.prototype.expectCount=500]
  25289. * @description 空间关系分析期望返回结果记录数,如果实际不足 500 条结果则返回所有分析结果。
  25290. */
  25291. this.expectCount = 500;
  25292. if (options) {
  25293. Util.extend(this, options);
  25294. }
  25295. this.CLASS_NAME = "SuperMap.GeoRelationAnalystParameters";
  25296. }
  25297. /**
  25298. * @function SuperMap.GeoRelationAnalystParameters.prototype.destroy
  25299. * @description 释放资源,将引用资源的属性置空。
  25300. */
  25301. GeoRelationAnalystParameters_createClass(GeoRelationAnalystParameters, [{
  25302. key: "destroy",
  25303. value: function destroy() {
  25304. var me = this;
  25305. if (me.sourceFilter) {
  25306. me.sourceFilter.destroy();
  25307. }
  25308. me.sourceFilter = null;
  25309. if (me.referenceFilter) {
  25310. me.referenceFilter.destroy();
  25311. }
  25312. me.referenceFilter = null;
  25313. me.dataset = null;
  25314. me.spatialRelationType = null;
  25315. me.isBorderInside = null;
  25316. me.returnFeature = null;
  25317. me.returnGeoRelatedOnly = null;
  25318. me.startRecord = null;
  25319. me.expectCount = null;
  25320. }
  25321. }]);
  25322. return GeoRelationAnalystParameters;
  25323. }();
  25324. SuperMap.GeoRelationAnalystParameters = GeoRelationAnalystParameters;
  25325. ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystService.js
  25326. function GeoRelationAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoRelationAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoRelationAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoRelationAnalystService_typeof(obj); }
  25327. function GeoRelationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25328. 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); } }
  25329. function GeoRelationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  25330. function GeoRelationAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoRelationAnalystService_get = Reflect.get; } else { GeoRelationAnalystService_get = function _get(target, property, receiver) { var base = GeoRelationAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeoRelationAnalystService_get(target, property, receiver || target); }
  25331. function GeoRelationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoRelationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  25332. function GeoRelationAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeoRelationAnalystService_setPrototypeOf(subClass, superClass); }
  25333. function GeoRelationAnalystService_setPrototypeOf(o, p) { GeoRelationAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoRelationAnalystService_setPrototypeOf(o, p); }
  25334. 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); }; }
  25335. function GeoRelationAnalystService_possibleConstructorReturn(self, call) { if (call && (GeoRelationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoRelationAnalystService_assertThisInitialized(self); }
  25336. function GeoRelationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25337. function GeoRelationAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  25338. function GeoRelationAnalystService_getPrototypeOf(o) { GeoRelationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoRelationAnalystService_getPrototypeOf(o); }
  25339. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25340. * This program are made available under the terms of the Apache License, Version 2.0
  25341. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25342. /**
  25343. * @class SuperMap.GeoRelationAnalystService
  25344. * @category iServer SpatialAnalyst GeoRelationAnalyst
  25345. * @classdesc 空间关系分析服务类。该类负责将客户设置的空间关系分析服务参数传递给服务端,并接收服务端返回的空间关系分析结果数据。
  25346. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  25347. * @param {Object} options - 参数。</br>
  25348. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  25349. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  25350. * @param {Object} [options.headers] - 请求头。
  25351. * @extends {SuperMap.SpatialAnalystBase}
  25352. * @example 实例化该类如下例所示:
  25353. * (start code)
  25354. * function datasetGeoRelationAnalystProcess() {
  25355. * var referenceFilter = new SuperMap.FilterParameter({
  25356. * name:"Frame_R@Changchun",
  25357. * attributeFilter:"SmID>0"});
  25358. * var sourceFilter = new SuperMap.FilterParameter({
  25359. * attributeFilter:"SmID>0"});
  25360. * //初始化服务类
  25361. * var datasetGeoRelationService = new SuperMap.GeoRelationAnalystService(
  25362. * "http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/"),
  25363. * //构建参数类
  25364. * datasetGeoRelationParameters = new SuperMap.GeoRelationAnalystParameters({
  25365. * dataset: "Park@Changchun",
  25366. * startRecord: 0,
  25367. * expectCount: 20,
  25368. * sourceFilter: sourceFilter,
  25369. * referenceFilter: referenceFilter,
  25370. * spatialRelationType: SuperMap.SpatialRelationType.INTERSECT,
  25371. * isBorderInside: true,
  25372. * returnFeature: true,
  25373. * returnGeoRelatedOnly: true
  25374. * });
  25375. * datasetGeoRelationService.events.on({
  25376. * "processCompleted": datasetGeoRelationAnalystCompleted,
  25377. * "processFailed": datasetGeoRelationAnalystFailed});
  25378. * //执行
  25379. * datasetGeoRelationService.processAsync(datasetGeoRelationParameters);
  25380. * }
  25381. * function Completed(datasetGeoRelationAnalystCompleted){//todo};
  25382. * function Error(datasetGeoRelationAnalystFailed){//todo};
  25383. * (end)
  25384. *
  25385. */
  25386. var GeoRelationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  25387. GeoRelationAnalystService_inherits(GeoRelationAnalystService, _SpatialAnalystBase);
  25388. var _super = GeoRelationAnalystService_createSuper(GeoRelationAnalystService);
  25389. function GeoRelationAnalystService(url, options) {
  25390. var _this;
  25391. GeoRelationAnalystService_classCallCheck(this, GeoRelationAnalystService);
  25392. _this = _super.call(this, url, options);
  25393. _this.CLASS_NAME = "SuperMap.GeoRelationAnalystService";
  25394. return _this;
  25395. }
  25396. /**
  25397. * @function SuperMap.GeoRelationAnalystService.prototype.destroy
  25398. * @override
  25399. */
  25400. GeoRelationAnalystService_createClass(GeoRelationAnalystService, [{
  25401. key: "destroy",
  25402. value: function destroy() {
  25403. GeoRelationAnalystService_get(GeoRelationAnalystService_getPrototypeOf(GeoRelationAnalystService.prototype), "destroy", this).call(this);
  25404. }
  25405. /**
  25406. * @function SuperMap.GeoRelationAnalystService.prototype.processAsync
  25407. * @description 负责将客户端的空间关系分析参数传递到服务端
  25408. * @param {SuperMap.GeoRelationAnalystParameters} parameter - 空间关系分析所需的参数信息。
  25409. */
  25410. }, {
  25411. key: "processAsync",
  25412. value: function processAsync(parameter) {
  25413. if (!(parameter instanceof GeoRelationAnalystParameters)) {
  25414. return;
  25415. }
  25416. var me = this;
  25417. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/georelation');
  25418. var jsonParameters = SuperMap.Util.toJSON(parameter);
  25419. me.url = Util.urlAppend(me.url, 'returnContent=true');
  25420. me.request({
  25421. method: "POST",
  25422. data: jsonParameters,
  25423. scope: me,
  25424. success: me.serviceProcessCompleted,
  25425. failure: me.serviceProcessFailed
  25426. });
  25427. }
  25428. }]);
  25429. return GeoRelationAnalystService;
  25430. }(SpatialAnalystBase);
  25431. SuperMap.GeoRelationAnalystService = GeoRelationAnalystService;
  25432. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesParametersBase.js
  25433. function GetFeaturesParametersBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25434. 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); } }
  25435. function GetFeaturesParametersBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesParametersBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesParametersBase_defineProperties(Constructor, staticProps); return Constructor; }
  25436. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25437. * This program are made available under the terms of the Apache License, Version 2.0
  25438. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25439. /**
  25440. * @class SuperMap.GetFeaturesParametersBase
  25441. * @category iServer Data FeatureResults
  25442. * @classdesc 要素查询参数基类。
  25443. * @param {Object} options - 参数。
  25444. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  25445. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  25446. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  25447. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  25448. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  25449. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  25450. */
  25451. var GetFeaturesParametersBase = /*#__PURE__*/function () {
  25452. function GetFeaturesParametersBase(options) {
  25453. GetFeaturesParametersBase_classCallCheck(this, GetFeaturesParametersBase);
  25454. /**
  25455. * @member {Array.<string>} SuperMap.GetFeaturesParametersBase.prototype.datasetName
  25456. * @description 数据集集合中的数据集名称列表。
  25457. */
  25458. this.datasetNames = null;
  25459. /**
  25460. * @member {string} SuperMap.GetFeaturesParametersBase.prototype.targetEpsgCode
  25461. * @description 动态投影的目标坐标系对应的 EPSG Code,使用时需设置 returnContent 参数为 true。
  25462. */
  25463. this.targetEpsgCode = null;
  25464. /**
  25465. * @member {Object} SuperMap.GetFeaturesParametersBase.prototype.targetEpsgCode
  25466. * @description 动态投影的目标坐标系。使用时需设置 returnContent 参数为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  25467. */
  25468. this.targetPrj = null;
  25469. /**
  25470. * @member {boolean} [SuperMap.GetFeaturesParametersBase.prototype.returnContent=true]
  25471. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  25472. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  25473. * 如果为 false,则返回的是查询结果资源的 URI。
  25474. */
  25475. this.returnContent = true;
  25476. /**
  25477. * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.fromIndex=0]
  25478. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  25479. */
  25480. this.fromIndex = 0;
  25481. /**
  25482. * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.toIndex=19]
  25483. * @description 查询结果的最大索引号。如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  25484. */
  25485. this.toIndex = 19;
  25486. /**
  25487. * @member {boolean} [SuperMap.GetFeaturesParametersBase.prototype.returnCountOnly=false]
  25488. * @description 只返回查询结果的总数。
  25489. */
  25490. this.returnCountOnly = false;
  25491. /**
  25492. * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.maxFeatures=1000]
  25493. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  25494. */
  25495. this.maxFeatures = null;
  25496. /**
  25497. * @member {Object} SuperMap.GetFeaturesParametersBase.prototype.aggregations
  25498. * @description 聚合查询参数,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  25499. */
  25500. this.aggregations = null;
  25501. Util.extend(this, options);
  25502. this.CLASS_NAME = "SuperMap.GetFeaturesParametersBase";
  25503. }
  25504. /**
  25505. *
  25506. * @function SuperMap.GetFeaturesParametersBase.prototype.destroy
  25507. * @description 释放资源,将引用资源的属性置空。
  25508. */
  25509. GetFeaturesParametersBase_createClass(GetFeaturesParametersBase, [{
  25510. key: "destroy",
  25511. value: function destroy() {
  25512. var me = this;
  25513. me.datasetNames = null;
  25514. me.returnContent = null;
  25515. me.fromIndex = null;
  25516. me.toIndex = null;
  25517. me.maxFeatures = null;
  25518. me.targetEpsgCode = null;
  25519. me.targetPrj = null;
  25520. if (me.aggregation) {
  25521. me.aggregation = null;
  25522. }
  25523. }
  25524. }]);
  25525. return GetFeaturesParametersBase;
  25526. }();
  25527. SuperMap.GetFeaturesParametersBase = GetFeaturesParametersBase;
  25528. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsParameters.js
  25529. function GetFeaturesByBoundsParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByBoundsParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByBoundsParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByBoundsParameters_typeof(obj); }
  25530. function GetFeaturesByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25531. 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); } }
  25532. function GetFeaturesByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  25533. function GetFeaturesByBoundsParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBoundsParameters_get = Reflect.get; } else { GetFeaturesByBoundsParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByBoundsParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesByBoundsParameters_get(target, property, receiver || target); }
  25534. function GetFeaturesByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  25535. function GetFeaturesByBoundsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesByBoundsParameters_setPrototypeOf(subClass, superClass); }
  25536. function GetFeaturesByBoundsParameters_setPrototypeOf(o, p) { GetFeaturesByBoundsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsParameters_setPrototypeOf(o, p); }
  25537. 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); }; }
  25538. function GetFeaturesByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBoundsParameters_assertThisInitialized(self); }
  25539. function GetFeaturesByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25540. function GetFeaturesByBoundsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  25541. function GetFeaturesByBoundsParameters_getPrototypeOf(o) { GetFeaturesByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsParameters_getPrototypeOf(o); }
  25542. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25543. * This program are made available under the terms of the Apache License, Version 2.0
  25544. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25545. /**
  25546. * @class SuperMap.GetFeaturesByBoundsParameters
  25547. * @category iServer Data FeatureResults
  25548. * @classdesc 数据集范围查询参数类,该类用于设置数据集范围查询的相关参数。
  25549. * @param {Object} options - 参数。
  25550. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 用于查询的范围对象。
  25551. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  25552. * @param {string} [options.attributeFilter] - 范围查询属性过滤条件。
  25553. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  25554. * @param {SuperMap.SpatialQueryMode} [options.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  25555. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  25556. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  25557. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  25558. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  25559. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  25560. * @extends {SuperMap.GetFeaturesParametersBase}
  25561. */
  25562. var GetFeaturesByBoundsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  25563. GetFeaturesByBoundsParameters_inherits(GetFeaturesByBoundsParameters, _GetFeaturesParameter);
  25564. var _super = GetFeaturesByBoundsParameters_createSuper(GetFeaturesByBoundsParameters);
  25565. function GetFeaturesByBoundsParameters(options) {
  25566. var _this;
  25567. GetFeaturesByBoundsParameters_classCallCheck(this, GetFeaturesByBoundsParameters);
  25568. _this = _super.call(this, options);
  25569. /**
  25570. * @member {string} SuperMap.GetFeaturesByBoundsParameters.prototype.getFeatureMode
  25571. * @description 数据集查询模式。范围查询有 "BOUNDS","BOUNDS_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 BOUNDS_ATTRIBUTEFILTER 访问服务。
  25572. */
  25573. _this.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS;
  25574. /**
  25575. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.GetFeaturesByBoundsParameters.prototype.bounds
  25576. * @description 用于查询的范围对象。
  25577. *
  25578. */
  25579. _this.bounds = null;
  25580. /**
  25581. * @member {Array.<string>} SuperMap.GetFeaturesByBoundsParameters.prototype.fields
  25582. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  25583. */
  25584. _this.fields = null;
  25585. /**
  25586. * @member {string} SuperMap.GetFeaturesByBoundsParameters.prototype.attributeFilter
  25587. * @description 范围查询属性过滤条件。
  25588. */
  25589. _this.attributeFilter = null;
  25590. /**
  25591. * @member {SuperMap.SpatialQueryMode} [SuperMap.GetFeaturesByBoundsParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN]
  25592. * @description 空间查询模式常量。
  25593. */
  25594. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  25595. Util.extend(GetFeaturesByBoundsParameters_assertThisInitialized(_this), options);
  25596. _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsParameters";
  25597. return _this;
  25598. }
  25599. /**
  25600. * @function SuperMap.GetFeaturesByBoundsParameters.prototype.destroy
  25601. * @override
  25602. */
  25603. GetFeaturesByBoundsParameters_createClass(GetFeaturesByBoundsParameters, [{
  25604. key: "destroy",
  25605. value: function destroy() {
  25606. GetFeaturesByBoundsParameters_get(GetFeaturesByBoundsParameters_getPrototypeOf(GetFeaturesByBoundsParameters.prototype), "destroy", this).call(this);
  25607. var me = this;
  25608. if (me.bounds) {
  25609. me.bounds.destroy();
  25610. me.bounds = null;
  25611. }
  25612. if (me.fields) {
  25613. while (me.fields.length > 0) {
  25614. me.fields.pop();
  25615. }
  25616. me.fields = null;
  25617. }
  25618. me.attributeFilter = null;
  25619. me.spatialQueryMode = null;
  25620. me.getFeatureMode = null;
  25621. }
  25622. /**
  25623. * @function SuperMap.GetFeaturesByBoundsParameters.toJsonParameters
  25624. * @description 将 {@link SuperMap.GetFeaturesByBoundsParameters} 对象参数转换为 JSON 字符串。
  25625. * @param {SuperMap.GetFeaturesByBoundsParameters} params - 范围查询参数。
  25626. * @returns {string} 转化后的 JSON 字符串。
  25627. *
  25628. */
  25629. }], [{
  25630. key: "toJsonParameters",
  25631. value: function toJsonParameters(params) {
  25632. var filterParameter, bounds, parasByBounds;
  25633. bounds = {
  25634. "leftBottom": {
  25635. "x": params.bounds.left,
  25636. "y": params.bounds.bottom
  25637. },
  25638. "rightTop": {
  25639. "x": params.bounds.right,
  25640. "y": params.bounds.top
  25641. }
  25642. };
  25643. parasByBounds = {
  25644. datasetNames: params.datasetNames,
  25645. getFeatureMode: GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS,
  25646. bounds: bounds,
  25647. spatialQueryMode: params.spatialQueryMode
  25648. };
  25649. if (params.fields) {
  25650. filterParameter = new FilterParameter();
  25651. filterParameter.name = params.datasetNames;
  25652. filterParameter.fields = params.fields;
  25653. parasByBounds.queryParameter = filterParameter;
  25654. }
  25655. if (params.attributeFilter) {
  25656. parasByBounds.attributeFilter = params.attributeFilter;
  25657. parasByBounds.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS_ATTRIBUTEFILTER;
  25658. }
  25659. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  25660. parasByBounds.maxFeatures = params.maxFeatures;
  25661. }
  25662. if (params.targetEpsgCode) {
  25663. parasByBounds.targetEpsgCode = params.targetEpsgCode;
  25664. }
  25665. if (!params.targetEpsgCode && params.targetPrj) {
  25666. parasByBounds.targetPrj = params.targetPrj;
  25667. }
  25668. return Util.toJSON(parasByBounds);
  25669. }
  25670. }]);
  25671. return GetFeaturesByBoundsParameters;
  25672. }(GetFeaturesParametersBase);
  25673. GetFeaturesByBoundsParameters.getFeatureMode = {
  25674. "BOUNDS": "BOUNDS",
  25675. "BOUNDS_ATTRIBUTEFILTER": "BOUNDS_ATTRIBUTEFILTER"
  25676. };
  25677. SuperMap.GetFeaturesByBoundsParameters = GetFeaturesByBoundsParameters;
  25678. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesServiceBase.js
  25679. function GetFeaturesServiceBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesServiceBase_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesServiceBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesServiceBase_typeof(obj); }
  25680. function GetFeaturesServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25681. 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); } }
  25682. function GetFeaturesServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  25683. function GetFeaturesServiceBase_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesServiceBase_get = Reflect.get; } else { GetFeaturesServiceBase_get = function _get(target, property, receiver) { var base = GetFeaturesServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesServiceBase_get(target, property, receiver || target); }
  25684. function GetFeaturesServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  25685. function GetFeaturesServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesServiceBase_setPrototypeOf(subClass, superClass); }
  25686. function GetFeaturesServiceBase_setPrototypeOf(o, p) { GetFeaturesServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesServiceBase_setPrototypeOf(o, p); }
  25687. 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); }; }
  25688. function GetFeaturesServiceBase_possibleConstructorReturn(self, call) { if (call && (GetFeaturesServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesServiceBase_assertThisInitialized(self); }
  25689. function GetFeaturesServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25690. function GetFeaturesServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  25691. function GetFeaturesServiceBase_getPrototypeOf(o) { GetFeaturesServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesServiceBase_getPrototypeOf(o); }
  25692. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25693. * This program are made available under the terms of the Apache License, Version 2.0
  25694. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25695. /**
  25696. * @class SuperMap.GetFeaturesServiceBase
  25697. * @category iServer Data FeatureResults
  25698. * @classdesc 数据服务中数据集查询服务基类。获取结果数据类型为 Object。包含 result 属性,result 的数据格式根据 format 参数决定为 GeoJSON 或者 iServerJSON。
  25699. * @extends SuperMap.CommonServiceBase
  25700. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
  25701. * URL应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/
  25702. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  25703. * @param {Object} options - 参数。
  25704. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  25705. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  25706. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  25707. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  25708. * @param {Object} [options.headers] - 请求头。
  25709. * @example
  25710. * var myService = new SuperMap.GetFeaturesServiceBase(url, {
  25711. * eventListeners: {
  25712. * "processCompleted": getFeatureCompleted,
  25713. * "processFailed": getFeatureError
  25714. * }
  25715. * });
  25716. */
  25717. var GetFeaturesServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  25718. GetFeaturesServiceBase_inherits(GetFeaturesServiceBase, _CommonServiceBase);
  25719. var _super = GetFeaturesServiceBase_createSuper(GetFeaturesServiceBase);
  25720. function GetFeaturesServiceBase(url, options) {
  25721. var _this;
  25722. GetFeaturesServiceBase_classCallCheck(this, GetFeaturesServiceBase);
  25723. _this = _super.call(this, url, options);
  25724. options = options || {};
  25725. /**
  25726. * @member {boolean} [SuperMap.GetFeaturesServiceBase.prototype.returnContent=true]
  25727. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  25728. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  25729. * 如果为 false,则返回的是查询结果资源的 URI。
  25730. */
  25731. _this.returnContent = true;
  25732. /**
  25733. * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.fromIndex=0]
  25734. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  25735. */
  25736. _this.fromIndex = 0;
  25737. /**
  25738. * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.toIndex=19]
  25739. * @description 查询结果的最大索引号。
  25740. * 如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  25741. */
  25742. _this.toIndex = 19;
  25743. /**
  25744. * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.maxFeatures=1000]
  25745. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  25746. */
  25747. _this.maxFeatures = null;
  25748. /**
  25749. * @member {string} [SuperMap.GetFeaturesServiceBase.prototype.format=SuperMap.DataFormat.GEOJSON]
  25750. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。
  25751. * 参数格式为 "ISERVER","GEOJSON"。
  25752. */
  25753. _this.format = DataFormat.GEOJSON;
  25754. Util.extend(GetFeaturesServiceBase_assertThisInitialized(_this), options);
  25755. _this.url = Util.urlPathAppend(_this.url, 'featureResults');
  25756. _this.CLASS_NAME = "SuperMap.GetFeaturesServiceBase";
  25757. return _this;
  25758. }
  25759. /**
  25760. * @function SuperMap.GetFeaturesServiceBase.prototype.destroy
  25761. * @description 释放资源,将引用资源的属性置空。
  25762. */
  25763. GetFeaturesServiceBase_createClass(GetFeaturesServiceBase, [{
  25764. key: "destroy",
  25765. value: function destroy() {
  25766. GetFeaturesServiceBase_get(GetFeaturesServiceBase_getPrototypeOf(GetFeaturesServiceBase.prototype), "destroy", this).call(this);
  25767. var me = this;
  25768. me.returnContent = null;
  25769. me.fromIndex = null;
  25770. me.toIndex = null;
  25771. me.maxFeatures = null;
  25772. me.format = null;
  25773. }
  25774. /**
  25775. * @function SuperMap.GetFeaturesServiceBase.prototype.processAsync
  25776. * @description 将客户端的查询参数传递到服务端。
  25777. * @param {Object} params - 查询参数。
  25778. */
  25779. }, {
  25780. key: "processAsync",
  25781. value: function processAsync(params) {
  25782. if (!params) {
  25783. return;
  25784. }
  25785. var me = this,
  25786. jsonParameters = null,
  25787. firstPara = true;
  25788. me.returnContent = params.returnContent;
  25789. me.fromIndex = params.fromIndex;
  25790. me.toIndex = params.toIndex;
  25791. me.maxFeatures = params.maxFeatures;
  25792. if (me.returnContent) {
  25793. me.url = Util.urlAppend(me.url, 'returnContent=' + me.returnContent);
  25794. firstPara = false;
  25795. }
  25796. var isValidNumber = me.fromIndex != null && me.toIndex != null && !isNaN(me.fromIndex) && !isNaN(me.toIndex);
  25797. if (isValidNumber && me.fromIndex >= 0 && me.toIndex >= 0 && !firstPara) {
  25798. me.url = Util.urlAppend(me.url, "fromIndex=".concat(me.fromIndex, "&toIndex=").concat(me.toIndex));
  25799. }
  25800. if (params.returnCountOnly) {
  25801. me.url = Util.urlAppend(me.url, "&returnCountOnly=" + params.returnContent);
  25802. }
  25803. jsonParameters = me.getJsonParameters(params);
  25804. me.request({
  25805. method: "POST",
  25806. data: jsonParameters,
  25807. scope: me,
  25808. success: me.serviceProcessCompleted,
  25809. failure: me.serviceProcessFailed
  25810. });
  25811. }
  25812. /**
  25813. * @function SuperMap.GetFeaturesServiceBase.prototype.getFeatureComplete
  25814. * @description 查询完成,执行此方法。
  25815. * @param {Object} result - 服务器返回的结果对象。
  25816. */
  25817. }, {
  25818. key: "serviceProcessCompleted",
  25819. value: function serviceProcessCompleted(result) {
  25820. var me = this;
  25821. result = Util.transformResult(result);
  25822. if (me.format === DataFormat.GEOJSON && result.features) {
  25823. var geoJSONFormat = new GeoJSON();
  25824. result.features = geoJSONFormat.toGeoJSON(result.features);
  25825. }
  25826. me.events.triggerEvent("processCompleted", {
  25827. result: result
  25828. });
  25829. }
  25830. }]);
  25831. return GetFeaturesServiceBase;
  25832. }(CommonServiceBase);
  25833. SuperMap.GetFeaturesServiceBase = GetFeaturesServiceBase;
  25834. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsService.js
  25835. function GetFeaturesByBoundsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByBoundsService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByBoundsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByBoundsService_typeof(obj); }
  25836. function GetFeaturesByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25837. 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); } }
  25838. function GetFeaturesByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsService_defineProperties(Constructor, staticProps); return Constructor; }
  25839. function GetFeaturesByBoundsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBoundsService_get = Reflect.get; } else { GetFeaturesByBoundsService_get = function _get(target, property, receiver) { var base = GetFeaturesByBoundsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesByBoundsService_get(target, property, receiver || target); }
  25840. function GetFeaturesByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  25841. function GetFeaturesByBoundsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesByBoundsService_setPrototypeOf(subClass, superClass); }
  25842. function GetFeaturesByBoundsService_setPrototypeOf(o, p) { GetFeaturesByBoundsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsService_setPrototypeOf(o, p); }
  25843. 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); }; }
  25844. function GetFeaturesByBoundsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBoundsService_assertThisInitialized(self); }
  25845. function GetFeaturesByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25846. function GetFeaturesByBoundsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  25847. function GetFeaturesByBoundsService_getPrototypeOf(o) { GetFeaturesByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsService_getPrototypeOf(o); }
  25848. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25849. * This program are made available under the terms of the Apache License, Version 2.0
  25850. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25851. /**
  25852. * @class SuperMap.GetFeaturesByBoundsService
  25853. * @category iServer Data FeatureResults
  25854. * @classdesc 数据集范围查询服务类,查询与指定范围对象符合一定空间关系的矢量要素。
  25855. * @description 数据集范围查询服务类构造函数。
  25856. * @extends {SuperMap.GetFeaturesServiceBase}
  25857. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  25858. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  25859. * @param {Object} options - 参数。
  25860. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  25861. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  25862. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  25863. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  25864. * @param {Object} [options.headers] - 请求头。
  25865. * @example
  25866. * var myGetFeaturesByBoundsService = new SuperMa.GetFeaturesByBoundsService(url, {
  25867. * eventListeners: {
  25868. * "processCompleted": getFeatureCompleted,
  25869. * "processFailed": getFeatureError
  25870. * }
  25871. * });
  25872. * function getFeatureCompleted(object){//todo};
  25873. * function getFeatureError(object){//todo}
  25874. */
  25875. var GetFeaturesByBoundsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  25876. GetFeaturesByBoundsService_inherits(GetFeaturesByBoundsService, _GetFeaturesServiceBa);
  25877. var _super = GetFeaturesByBoundsService_createSuper(GetFeaturesByBoundsService);
  25878. function GetFeaturesByBoundsService(url, options) {
  25879. var _this;
  25880. GetFeaturesByBoundsService_classCallCheck(this, GetFeaturesByBoundsService);
  25881. _this = _super.call(this, url, options);
  25882. _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsService";
  25883. return _this;
  25884. }
  25885. /**
  25886. * @function SuperMap.GetFeaturesByBoundsService.prototype.destroy
  25887. * @override
  25888. */
  25889. GetFeaturesByBoundsService_createClass(GetFeaturesByBoundsService, [{
  25890. key: "destroy",
  25891. value: function destroy() {
  25892. GetFeaturesByBoundsService_get(GetFeaturesByBoundsService_getPrototypeOf(GetFeaturesByBoundsService.prototype), "destroy", this).call(this);
  25893. }
  25894. /**
  25895. * @function SuperMap.GetFeaturesByBoundsService.prototype.getJsonParameters
  25896. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry,Bounds等)。
  25897. * @param params {SuperMap.GetFeaturesByBoundsParameters}
  25898. * @returns {string} 转化后的 JSON 字符串。
  25899. *
  25900. */
  25901. }, {
  25902. key: "getJsonParameters",
  25903. value: function getJsonParameters(params) {
  25904. return GetFeaturesByBoundsParameters.toJsonParameters(params);
  25905. }
  25906. }]);
  25907. return GetFeaturesByBoundsService;
  25908. }(GetFeaturesServiceBase);
  25909. SuperMap.GetFeaturesByBoundsService = GetFeaturesByBoundsService;
  25910. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferParameters.js
  25911. function GetFeaturesByBufferParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByBufferParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByBufferParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByBufferParameters_typeof(obj); }
  25912. function GetFeaturesByBufferParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25913. 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); } }
  25914. function GetFeaturesByBufferParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferParameters_defineProperties(Constructor, staticProps); return Constructor; }
  25915. function GetFeaturesByBufferParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBufferParameters_get = Reflect.get; } else { GetFeaturesByBufferParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByBufferParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesByBufferParameters_get(target, property, receiver || target); }
  25916. function GetFeaturesByBufferParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  25917. function GetFeaturesByBufferParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesByBufferParameters_setPrototypeOf(subClass, superClass); }
  25918. function GetFeaturesByBufferParameters_setPrototypeOf(o, p) { GetFeaturesByBufferParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferParameters_setPrototypeOf(o, p); }
  25919. 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); }; }
  25920. function GetFeaturesByBufferParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBufferParameters_assertThisInitialized(self); }
  25921. function GetFeaturesByBufferParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25922. function GetFeaturesByBufferParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  25923. function GetFeaturesByBufferParameters_getPrototypeOf(o) { GetFeaturesByBufferParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferParameters_getPrototypeOf(o); }
  25924. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25925. * This program are made available under the terms of the Apache License, Version 2.0
  25926. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25927. /**
  25928. * @class SuperMap.GetFeaturesByBufferParameters
  25929. * @category iServer Data FeatureResults
  25930. * @classdesc 数据服务中数据集缓冲区查询参数类。
  25931. * @param {Object} options - 参数。
  25932. * @param {number} options.bufferDistance - buffer 距离,单位与所查询图层对应的数据集单位相同。
  25933. * @param {Object} options.geometry - 空间查询条件。</br>
  25934. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  25935. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  25936. * @param {string} [options.attributeFilter] - 属性查询条件。
  25937. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  25938. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  25939. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  25940. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  25941. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  25942. * @extends {SuperMap.GetFeaturesParametersBase}
  25943. */
  25944. var GetFeaturesByBufferParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  25945. GetFeaturesByBufferParameters_inherits(GetFeaturesByBufferParameters, _GetFeaturesParameter);
  25946. var _super = GetFeaturesByBufferParameters_createSuper(GetFeaturesByBufferParameters);
  25947. function GetFeaturesByBufferParameters(options) {
  25948. var _this;
  25949. GetFeaturesByBufferParameters_classCallCheck(this, GetFeaturesByBufferParameters);
  25950. _this = _super.call(this, options);
  25951. /**
  25952. * @member {number} SuperMap.GetFeaturesByBufferParameters.prototype.bufferDistance
  25953. * @description buffer 距离,单位与所查询图层对应的数据集单位相同。
  25954. */
  25955. _this.bufferDistance = null;
  25956. /**
  25957. * @member {string} SuperMap.GetFeaturesByBufferParameters.prototype.attributeFilter
  25958. * @description 属性查询条件。
  25959. */
  25960. _this.attributeFilter = null;
  25961. /**
  25962. * @member {Object} SuperMap.GetFeaturesByBufferParameters.prototype.geometry
  25963. * @description 空间查询条件。 <br>
  25964. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  25965. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  25966. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  25967. */
  25968. _this.geometry = null;
  25969. /**
  25970. * @member {Array.<string>} SuperMap.GetFeaturesByBufferParameters.prototype.fields
  25971. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  25972. */
  25973. _this.fields = null;
  25974. Util.extend(GetFeaturesByBufferParameters_assertThisInitialized(_this), options);
  25975. _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferParameters";
  25976. return _this;
  25977. }
  25978. /**
  25979. * @function SuperMap.GetFeaturesByBufferParameters.prototype.destroy
  25980. * @override
  25981. */
  25982. GetFeaturesByBufferParameters_createClass(GetFeaturesByBufferParameters, [{
  25983. key: "destroy",
  25984. value: function destroy() {
  25985. GetFeaturesByBufferParameters_get(GetFeaturesByBufferParameters_getPrototypeOf(GetFeaturesByBufferParameters.prototype), "destroy", this).call(this);
  25986. var me = this;
  25987. me.bufferDistance = null;
  25988. me.attributeFilter = null;
  25989. if (me.fields) {
  25990. while (me.fields.length > 0) {
  25991. me.fields.pop();
  25992. }
  25993. me.fields = null;
  25994. }
  25995. if (me.geometry) {
  25996. me.geometry.destroy();
  25997. me.geometry = null;
  25998. }
  25999. }
  26000. /**
  26001. * @function SuperMap.GetFeaturesByBufferParameters.toJsonParameters
  26002. * @description 将 SuperMap.GetFeaturesByBufferParameters 对象转换为 JSON 字符串。
  26003. * @param {SuperMap.GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数对象。
  26004. * @returns {string} 转化后的 JSON 字符串。
  26005. */
  26006. }], [{
  26007. key: "toJsonParameters",
  26008. value: function toJsonParameters(params) {
  26009. var filterParameter, paramsBySql, geometry;
  26010. geometry = ServerGeometry.fromGeometry(params.geometry);
  26011. paramsBySql = {
  26012. datasetNames: params.datasetNames,
  26013. getFeatureMode: "BUFFER",
  26014. bufferDistance: params.bufferDistance,
  26015. geometry: geometry
  26016. };
  26017. if (params.fields) {
  26018. filterParameter = new FilterParameter();
  26019. filterParameter.name = params.datasetNames;
  26020. filterParameter.fields = params.fields;
  26021. paramsBySql.queryParameter = filterParameter;
  26022. }
  26023. if (params.attributeFilter) {
  26024. paramsBySql.attributeFilter = params.attributeFilter;
  26025. paramsBySql.getFeatureMode = "BUFFER_ATTRIBUTEFILTER";
  26026. }
  26027. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  26028. paramsBySql.maxFeatures = params.maxFeatures;
  26029. }
  26030. if (params.targetEpsgCode) {
  26031. paramsBySql.targetEpsgCode = params.targetEpsgCode;
  26032. }
  26033. if (!params.targetEpsgCode && params.targetPrj) {
  26034. paramsBySql.targetPrj = params.targetPrj;
  26035. }
  26036. return Util.toJSON(paramsBySql);
  26037. }
  26038. }]);
  26039. return GetFeaturesByBufferParameters;
  26040. }(GetFeaturesParametersBase);
  26041. SuperMap.GetFeaturesByBufferParameters = GetFeaturesByBufferParameters;
  26042. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferService.js
  26043. function GetFeaturesByBufferService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByBufferService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByBufferService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByBufferService_typeof(obj); }
  26044. function GetFeaturesByBufferService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26045. 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); } }
  26046. function GetFeaturesByBufferService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferService_defineProperties(Constructor, staticProps); return Constructor; }
  26047. function GetFeaturesByBufferService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBufferService_get = Reflect.get; } else { GetFeaturesByBufferService_get = function _get(target, property, receiver) { var base = GetFeaturesByBufferService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesByBufferService_get(target, property, receiver || target); }
  26048. function GetFeaturesByBufferService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferService_getPrototypeOf(object); if (object === null) break; } return object; }
  26049. function GetFeaturesByBufferService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesByBufferService_setPrototypeOf(subClass, superClass); }
  26050. function GetFeaturesByBufferService_setPrototypeOf(o, p) { GetFeaturesByBufferService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferService_setPrototypeOf(o, p); }
  26051. 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); }; }
  26052. function GetFeaturesByBufferService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBufferService_assertThisInitialized(self); }
  26053. function GetFeaturesByBufferService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26054. function GetFeaturesByBufferService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26055. function GetFeaturesByBufferService_getPrototypeOf(o) { GetFeaturesByBufferService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferService_getPrototypeOf(o); }
  26056. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26057. * This program are made available under the terms of the Apache License, Version 2.0
  26058. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26059. /**
  26060. * @class SuperMap.GetFeaturesByBufferService
  26061. * @category iServer Data FeatureResults
  26062. * @classdesc 数据服务中数据集缓冲区查询服务类。
  26063. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
  26064. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  26065. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  26066. * @param {Object} options - 参数。
  26067. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  26068. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  26069. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  26070. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  26071. * @param {Object} [options.headers] - 请求头。
  26072. * @extends {SuperMap.GetFeaturesServiceBase}
  26073. * @example
  26074. * var myGetFeaturesByBufferService = new SuperMap.GetFeaturesByBufferService(url, {
  26075. * eventListeners: {
  26076. * "processCompleted": GetFeaturesCompleted,
  26077. * "processFailed": GetFeaturesError
  26078. * }
  26079. * });
  26080. * function GetFeaturesCompleted(object){//todo};
  26081. * function GetFeaturesError(object){//todo};
  26082. */
  26083. var GetFeaturesByBufferService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  26084. GetFeaturesByBufferService_inherits(GetFeaturesByBufferService, _GetFeaturesServiceBa);
  26085. var _super = GetFeaturesByBufferService_createSuper(GetFeaturesByBufferService);
  26086. function GetFeaturesByBufferService(url, options) {
  26087. var _this;
  26088. GetFeaturesByBufferService_classCallCheck(this, GetFeaturesByBufferService);
  26089. _this = _super.call(this, url, options);
  26090. _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferService";
  26091. return _this;
  26092. }
  26093. /**
  26094. * @function SuperMap.GetFeaturesByBufferService.prototype.destroy
  26095. * @override
  26096. */
  26097. GetFeaturesByBufferService_createClass(GetFeaturesByBufferService, [{
  26098. key: "destroy",
  26099. value: function destroy() {
  26100. GetFeaturesByBufferService_get(GetFeaturesByBufferService_getPrototypeOf(GetFeaturesByBufferService.prototype), "destroy", this).call(this);
  26101. }
  26102. /**
  26103. * @function SuperMap.GetFeaturesByBufferService.prototype.getJsonParameters
  26104. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(IDs, SQL, Buffer, Geometry等)。
  26105. * @param {SuperMap.GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  26106. * @returns {Object} 转化后的 JSON 字符串。
  26107. */
  26108. }, {
  26109. key: "getJsonParameters",
  26110. value: function getJsonParameters(params) {
  26111. if (!(params instanceof GetFeaturesByBufferParameters)) {
  26112. return;
  26113. }
  26114. return SuperMap.GetFeaturesByBufferParameters.toJsonParameters(params);
  26115. }
  26116. }]);
  26117. return GetFeaturesByBufferService;
  26118. }(GetFeaturesServiceBase);
  26119. SuperMap.GetFeaturesByBufferService = GetFeaturesByBufferService;
  26120. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryParameters.js
  26121. function GetFeaturesByGeometryParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByGeometryParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByGeometryParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByGeometryParameters_typeof(obj); }
  26122. function GetFeaturesByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26123. 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); } }
  26124. function GetFeaturesByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  26125. function GetFeaturesByGeometryParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByGeometryParameters_get = Reflect.get; } else { GetFeaturesByGeometryParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByGeometryParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesByGeometryParameters_get(target, property, receiver || target); }
  26126. function GetFeaturesByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  26127. function GetFeaturesByGeometryParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesByGeometryParameters_setPrototypeOf(subClass, superClass); }
  26128. function GetFeaturesByGeometryParameters_setPrototypeOf(o, p) { GetFeaturesByGeometryParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryParameters_setPrototypeOf(o, p); }
  26129. 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); }; }
  26130. function GetFeaturesByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByGeometryParameters_assertThisInitialized(self); }
  26131. function GetFeaturesByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26132. function GetFeaturesByGeometryParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26133. function GetFeaturesByGeometryParameters_getPrototypeOf(o) { GetFeaturesByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryParameters_getPrototypeOf(o); }
  26134. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26135. * This program are made available under the terms of the Apache License, Version 2.0
  26136. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26137. /**
  26138. * @class SuperMap.GetFeaturesByGeometryParameters
  26139. * @category iServer Data FeatureResults
  26140. * @classdesc 数据集几何查询参数类。该类用于设置数据集几何查询的相关参数。
  26141. * @param {Object} options - 参数。
  26142. * @param {Object} options.geometry - 用于查询的几何对象。
  26143. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  26144. * @param {string} [options.attributeFilter] - 几何查询属性过滤条件。
  26145. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  26146. * @param {SuperMap.SpatialQueryMode} [options.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  26147. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  26148. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  26149. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  26150. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  26151. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  26152. * @extends {SuperMap.GetFeaturesParametersBase}
  26153. */
  26154. var GetFeaturesByGeometryParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  26155. GetFeaturesByGeometryParameters_inherits(GetFeaturesByGeometryParameters, _GetFeaturesParameter);
  26156. var _super = GetFeaturesByGeometryParameters_createSuper(GetFeaturesByGeometryParameters);
  26157. function GetFeaturesByGeometryParameters(options) {
  26158. var _this;
  26159. GetFeaturesByGeometryParameters_classCallCheck(this, GetFeaturesByGeometryParameters);
  26160. _this = _super.call(this, options);
  26161. /**
  26162. * @member {string} SuperMap.GetFeaturesByGeometryParameters.prototype.getFeatureMode
  26163. * @description 数据集查询模式。几何查询有 "SPATIAL","SPATIAL_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 SPATIAL_ATTRIBUTEFILTER 访问服务。
  26164. */
  26165. _this.getFeatureMode = "SPATIAL";
  26166. /**
  26167. * @member {Object} SuperMap.GetFeaturesByGeometryParameters.prototype.geometry
  26168. * @description 用于查询的几何对象。 </br>
  26169. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  26170. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  26171. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  26172. */
  26173. _this.geometry = null;
  26174. /**
  26175. * @member {Array.<string>} SuperMap.GetFeaturesByGeometryParameters.prototype.fields
  26176. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  26177. */
  26178. _this.fields = null;
  26179. /**
  26180. * @member {string} SuperMap.GetFeaturesByGeometryParameters.prototype.attributeFilter
  26181. * @description 几何查询属性过滤条件。
  26182. */
  26183. _this.attributeFilter = null;
  26184. /**
  26185. * @member {SuperMap.SpatialQueryMode} [SuperMap.GetFeaturesByGeometryParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN]
  26186. * @description 空间查询模式常量。
  26187. */
  26188. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  26189. Util.extend(GetFeaturesByGeometryParameters_assertThisInitialized(_this), options);
  26190. _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryParameters";
  26191. return _this;
  26192. }
  26193. /**
  26194. * @function SuperMap.GetFeaturesByGeometryParameters.prototype.destroy
  26195. * @description 释放资源,将引用资源的属性置空。
  26196. */
  26197. GetFeaturesByGeometryParameters_createClass(GetFeaturesByGeometryParameters, [{
  26198. key: "destroy",
  26199. value: function destroy() {
  26200. GetFeaturesByGeometryParameters_get(GetFeaturesByGeometryParameters_getPrototypeOf(GetFeaturesByGeometryParameters.prototype), "destroy", this).call(this);
  26201. var me = this;
  26202. if (me.geometry) {
  26203. me.geometry.destroy();
  26204. me.geometry = null;
  26205. }
  26206. if (me.fields) {
  26207. while (me.fields.length > 0) {
  26208. me.fields.pop();
  26209. }
  26210. me.fields = null;
  26211. }
  26212. me.attributeFilter = null;
  26213. me.spatialQueryMode = null;
  26214. me.getFeatureMode = null;
  26215. }
  26216. /**
  26217. * @function SuperMap.GetFeaturesByGeometryParameters.toJsonParameters
  26218. * @description 将 SuperMap.GetFeaturesByGeometryParameters 对象参数转换为 JSON 字符串。
  26219. * @param {SuperMap.GetFeaturesByGeometryParameters} params - 查询参数对象。
  26220. * @returns {string} 转化后的 JSON 字符串。
  26221. */
  26222. }], [{
  26223. key: "toJsonParameters",
  26224. value: function toJsonParameters(params) {
  26225. var filterParameter, geometry, parasByGeometry;
  26226. geometry = ServerGeometry.fromGeometry(params.geometry);
  26227. parasByGeometry = {
  26228. datasetNames: params.datasetNames,
  26229. getFeatureMode: "SPATIAL",
  26230. geometry: geometry,
  26231. spatialQueryMode: params.spatialQueryMode
  26232. };
  26233. if (params.fields) {
  26234. filterParameter = new FilterParameter();
  26235. filterParameter.name = params.datasetNames;
  26236. filterParameter.fields = params.fields;
  26237. parasByGeometry.queryParameter = filterParameter;
  26238. }
  26239. if (params.attributeFilter) {
  26240. parasByGeometry.attributeFilter = params.attributeFilter;
  26241. parasByGeometry.getFeatureMode = "SPATIAL_ATTRIBUTEFILTER";
  26242. }
  26243. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  26244. parasByGeometry.maxFeatures = params.maxFeatures;
  26245. }
  26246. if (params.targetEpsgCode) {
  26247. parasByGeometry.targetEpsgCode = params.targetEpsgCode;
  26248. }
  26249. if (!params.targetEpsgCode && params.targetPrj) {
  26250. parasByGeometry.targetPrj = params.targetPrj;
  26251. }
  26252. return Util.toJSON(parasByGeometry);
  26253. }
  26254. }]);
  26255. return GetFeaturesByGeometryParameters;
  26256. }(GetFeaturesParametersBase);
  26257. SuperMap.GetFeaturesByGeometryParameters = GetFeaturesByGeometryParameters;
  26258. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryService.js
  26259. function GetFeaturesByGeometryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByGeometryService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByGeometryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByGeometryService_typeof(obj); }
  26260. function GetFeaturesByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26261. 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); } }
  26262. function GetFeaturesByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryService_defineProperties(Constructor, staticProps); return Constructor; }
  26263. function GetFeaturesByGeometryService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByGeometryService_get = Reflect.get; } else { GetFeaturesByGeometryService_get = function _get(target, property, receiver) { var base = GetFeaturesByGeometryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesByGeometryService_get(target, property, receiver || target); }
  26264. function GetFeaturesByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  26265. function GetFeaturesByGeometryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesByGeometryService_setPrototypeOf(subClass, superClass); }
  26266. function GetFeaturesByGeometryService_setPrototypeOf(o, p) { GetFeaturesByGeometryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryService_setPrototypeOf(o, p); }
  26267. 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); }; }
  26268. function GetFeaturesByGeometryService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByGeometryService_assertThisInitialized(self); }
  26269. function GetFeaturesByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26270. function GetFeaturesByGeometryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26271. function GetFeaturesByGeometryService_getPrototypeOf(o) { GetFeaturesByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryService_getPrototypeOf(o); }
  26272. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26273. * This program are made available under the terms of the Apache License, Version 2.0
  26274. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26275. /**
  26276. * @class SuperMap.GetFeaturesByGeometryService
  26277. * @category iServer Data FeatureResults
  26278. * @classdesc 数据集几何查询服务类,查询与指定几何对象符合一定空间关系的矢量要素。
  26279. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务。
  26280. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data;
  26281. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data"
  26282. * @param {Object} options - 参数。</br>
  26283. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  26284. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  26285. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  26286. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  26287. * @param {Object} [options.headers] - 请求头。
  26288. * @extends {SuperMap.GetFeaturesServiceBase}
  26289. * @example
  26290. * var myService = new SuperMap.GetFeaturesByGeometryService(url, {
  26291. * eventListeners: {
  26292. * "processCompleted": getFeatureCompleted,
  26293. * "processFailed": getFeatureError
  26294. * }
  26295. * });
  26296. * function getFeatureCompleted(object){//todo};
  26297. * function getFeatureError(object){//todo}
  26298. */
  26299. var GetFeaturesByGeometryService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  26300. GetFeaturesByGeometryService_inherits(GetFeaturesByGeometryService, _GetFeaturesServiceBa);
  26301. var _super = GetFeaturesByGeometryService_createSuper(GetFeaturesByGeometryService);
  26302. function GetFeaturesByGeometryService(url, options) {
  26303. var _this;
  26304. GetFeaturesByGeometryService_classCallCheck(this, GetFeaturesByGeometryService);
  26305. _this = _super.call(this, url, options);
  26306. _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryService";
  26307. return _this;
  26308. }
  26309. /**
  26310. * @function SuperMap.GetFeaturesByGeometryService.prototype.destroy
  26311. * @override
  26312. */
  26313. GetFeaturesByGeometryService_createClass(GetFeaturesByGeometryService, [{
  26314. key: "destroy",
  26315. value: function destroy() {
  26316. GetFeaturesByGeometryService_get(GetFeaturesByGeometryService_getPrototypeOf(GetFeaturesByGeometryService.prototype), "destroy", this).call(this);
  26317. }
  26318. /**
  26319. * @function SuperMap.GetFeaturesByGeometryService.prototype.getJsonParameters
  26320. * @param {SuperMap.GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  26321. * @description 将查询参数转化为 JSON 字符串。
  26322. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  26323. * @returns {Object} 转化后的 JSON 字符串。
  26324. */
  26325. }, {
  26326. key: "getJsonParameters",
  26327. value: function getJsonParameters(params) {
  26328. return GetFeaturesByGeometryParameters.toJsonParameters(params);
  26329. }
  26330. }]);
  26331. return GetFeaturesByGeometryService;
  26332. }(GetFeaturesServiceBase);
  26333. SuperMap.GetFeaturesByGeometryService = GetFeaturesByGeometryService;
  26334. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsParameters.js
  26335. function GetFeaturesByIDsParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByIDsParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByIDsParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByIDsParameters_typeof(obj); }
  26336. function GetFeaturesByIDsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26337. 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); } }
  26338. function GetFeaturesByIDsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  26339. function GetFeaturesByIDsParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByIDsParameters_get = Reflect.get; } else { GetFeaturesByIDsParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByIDsParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesByIDsParameters_get(target, property, receiver || target); }
  26340. function GetFeaturesByIDsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  26341. function GetFeaturesByIDsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesByIDsParameters_setPrototypeOf(subClass, superClass); }
  26342. function GetFeaturesByIDsParameters_setPrototypeOf(o, p) { GetFeaturesByIDsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsParameters_setPrototypeOf(o, p); }
  26343. 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); }; }
  26344. function GetFeaturesByIDsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByIDsParameters_assertThisInitialized(self); }
  26345. function GetFeaturesByIDsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26346. function GetFeaturesByIDsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26347. function GetFeaturesByIDsParameters_getPrototypeOf(o) { GetFeaturesByIDsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsParameters_getPrototypeOf(o); }
  26348. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26349. * This program are made available under the terms of the Apache License, Version 2.0
  26350. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26351. /**
  26352. * @class SuperMap.GetFeaturesByIDsParameters
  26353. * @category iServer Data FeatureResults
  26354. * @classdesc ID查询参数类。
  26355. * @param {Object} options - 参数。
  26356. * @param {Array.<number>} options.IDs - 所要查询指定的元素 ID 信息。
  26357. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  26358. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  26359. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  26360. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  26361. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  26362. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  26363. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  26364. * @extends {SuperMap.GetFeaturesParametersBase}
  26365. */
  26366. var GetFeaturesByIDsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  26367. GetFeaturesByIDsParameters_inherits(GetFeaturesByIDsParameters, _GetFeaturesParameter);
  26368. var _super = GetFeaturesByIDsParameters_createSuper(GetFeaturesByIDsParameters);
  26369. function GetFeaturesByIDsParameters(options) {
  26370. var _this;
  26371. GetFeaturesByIDsParameters_classCallCheck(this, GetFeaturesByIDsParameters);
  26372. _this = _super.call(this, options);
  26373. /**
  26374. * @member {string} SuperMap.GetFeaturesByIDsParameters.prototype.getFeatureMode
  26375. * @description 数据集查询模式。
  26376. */
  26377. _this.getFeatureMode = "ID";
  26378. /**
  26379. * @member {Array.<number>} SuperMap.GetFeaturesByIDsParameters.prototype.IDs
  26380. * @description 所要查询指定的元素 ID 信息。
  26381. */
  26382. _this.IDs = null;
  26383. /**
  26384. * @member {Array.<string>} SuperMap.GetFeaturesByIDsParameters.prototype.fields
  26385. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  26386. */
  26387. _this.fields = null;
  26388. Util.extend(GetFeaturesByIDsParameters_assertThisInitialized(_this), options);
  26389. _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsParameters";
  26390. return _this;
  26391. }
  26392. /**
  26393. * @function SuperMap.GetFeaturesByIDsParameters.prototype.destroy
  26394. * @override
  26395. */
  26396. GetFeaturesByIDsParameters_createClass(GetFeaturesByIDsParameters, [{
  26397. key: "destroy",
  26398. value: function destroy() {
  26399. GetFeaturesByIDsParameters_get(GetFeaturesByIDsParameters_getPrototypeOf(GetFeaturesByIDsParameters.prototype), "destroy", this).call(this);
  26400. var me = this;
  26401. me.IDs = null;
  26402. me.getFeatureMode = null;
  26403. if (me.fields) {
  26404. while (me.fields.length > 0) {
  26405. me.fields.pop();
  26406. }
  26407. me.fields = null;
  26408. }
  26409. }
  26410. /**
  26411. * @function SuperMap.GetFeaturesByIDsParameters.toJsonParameters
  26412. * @description 将 SuperMap.GetFeaturesByIDsParameters 对象转换为 JSON 字符串。
  26413. * @param {SuperMap.GetFeaturesByIDsParameters} params - ID 查询参数对象。
  26414. * @returns {string} 转化后的 JSON 字符串。
  26415. */
  26416. }], [{
  26417. key: "toJsonParameters",
  26418. value: function toJsonParameters(params) {
  26419. var parasByIDs, filterParameter;
  26420. parasByIDs = {
  26421. datasetNames: params.datasetNames,
  26422. getFeatureMode: "ID",
  26423. ids: params.IDs
  26424. };
  26425. if (params.fields) {
  26426. filterParameter = new FilterParameter();
  26427. filterParameter.name = params.datasetNames;
  26428. filterParameter.fields = params.fields;
  26429. parasByIDs.queryParameter = filterParameter;
  26430. }
  26431. if (params.targetEpsgCode) {
  26432. parasByIDs.targetEpsgCode = params.targetEpsgCode;
  26433. }
  26434. if (!params.targetEpsgCode && params.targetPrj) {
  26435. parasByIDs.targetPrj = params.targetPrj;
  26436. }
  26437. return Util.toJSON(parasByIDs);
  26438. }
  26439. }]);
  26440. return GetFeaturesByIDsParameters;
  26441. }(GetFeaturesParametersBase);
  26442. SuperMap.GetFeaturesByIDsParameters = GetFeaturesByIDsParameters;
  26443. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsService.js
  26444. function GetFeaturesByIDsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByIDsService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByIDsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByIDsService_typeof(obj); }
  26445. function GetFeaturesByIDsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26446. 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); } }
  26447. function GetFeaturesByIDsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsService_defineProperties(Constructor, staticProps); return Constructor; }
  26448. function GetFeaturesByIDsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByIDsService_get = Reflect.get; } else { GetFeaturesByIDsService_get = function _get(target, property, receiver) { var base = GetFeaturesByIDsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesByIDsService_get(target, property, receiver || target); }
  26449. function GetFeaturesByIDsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsService_getPrototypeOf(object); if (object === null) break; } return object; }
  26450. function GetFeaturesByIDsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesByIDsService_setPrototypeOf(subClass, superClass); }
  26451. function GetFeaturesByIDsService_setPrototypeOf(o, p) { GetFeaturesByIDsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsService_setPrototypeOf(o, p); }
  26452. 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); }; }
  26453. function GetFeaturesByIDsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByIDsService_assertThisInitialized(self); }
  26454. function GetFeaturesByIDsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26455. function GetFeaturesByIDsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26456. function GetFeaturesByIDsService_getPrototypeOf(o) { GetFeaturesByIDsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsService_getPrototypeOf(o); }
  26457. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26458. * This program are made available under the terms of the Apache License, Version 2.0
  26459. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26460. /**
  26461. * @class SuperMap.GetFeaturesByIDsService
  26462. * @category iServer Data FeatureResults
  26463. * @classdesc 数据集ID查询服务类。在数据集集合中查找指定 ID 号对应的空间地物要素。
  26464. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务。
  26465. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  26466. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  26467. * @param {Object} options - 参数。</br>
  26468. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  26469. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  26470. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  26471. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  26472. * @param {Object} [options.headers] - 请求头。
  26473. * @extends {SuperMap.GetFeaturesServiceBase}
  26474. * @example
  26475. * var myGetFeaturesByIDsService = new SuperMap.GetFeaturesByIDsService(url, {
  26476. * eventListeners: {
  26477. * "processCompleted": getFeatureCompleted,
  26478. * "processFailed": getFeatureError
  26479. * }
  26480. * });
  26481. * function getFeatureCompleted(object){//todo};
  26482. * function getFeatureError(object){//todo}
  26483. */
  26484. var GetFeaturesByIDsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  26485. GetFeaturesByIDsService_inherits(GetFeaturesByIDsService, _GetFeaturesServiceBa);
  26486. var _super = GetFeaturesByIDsService_createSuper(GetFeaturesByIDsService);
  26487. function GetFeaturesByIDsService(url, options) {
  26488. var _this;
  26489. GetFeaturesByIDsService_classCallCheck(this, GetFeaturesByIDsService);
  26490. _this = _super.call(this, url, options);
  26491. _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsService";
  26492. return _this;
  26493. }
  26494. /**
  26495. * @function SuperMap.GetFeaturesByIDsService.prototype.destroy
  26496. * @override
  26497. */
  26498. GetFeaturesByIDsService_createClass(GetFeaturesByIDsService, [{
  26499. key: "destroy",
  26500. value: function destroy() {
  26501. GetFeaturesByIDsService_get(GetFeaturesByIDsService_getPrototypeOf(GetFeaturesByIDsService.prototype), "destroy", this).call(this);
  26502. }
  26503. /**
  26504. * @function SuperMap.GetFeaturesByIDsService.prototype.getJsonParameters
  26505. * @description 将查询参数转化为 JSON 字符串。
  26506. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  26507. * @param {SuperMap.GetFeaturesByIDsParameters} params - ID查询参数类。
  26508. * @returns {string} 转化后的 JSON 字符串。
  26509. */
  26510. }, {
  26511. key: "getJsonParameters",
  26512. value: function getJsonParameters(params) {
  26513. return GetFeaturesByIDsParameters.toJsonParameters(params);
  26514. }
  26515. }]);
  26516. return GetFeaturesByIDsService;
  26517. }(GetFeaturesServiceBase);
  26518. SuperMap.GetFeaturesByIDsService = GetFeaturesByIDsService;
  26519. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLParameters.js
  26520. function GetFeaturesBySQLParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesBySQLParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesBySQLParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesBySQLParameters_typeof(obj); }
  26521. function GetFeaturesBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26522. 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); } }
  26523. function GetFeaturesBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLParameters_defineProperties(Constructor, staticProps); return Constructor; }
  26524. function GetFeaturesBySQLParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesBySQLParameters_get = Reflect.get; } else { GetFeaturesBySQLParameters_get = function _get(target, property, receiver) { var base = GetFeaturesBySQLParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesBySQLParameters_get(target, property, receiver || target); }
  26525. function GetFeaturesBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  26526. function GetFeaturesBySQLParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesBySQLParameters_setPrototypeOf(subClass, superClass); }
  26527. function GetFeaturesBySQLParameters_setPrototypeOf(o, p) { GetFeaturesBySQLParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLParameters_setPrototypeOf(o, p); }
  26528. 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); }; }
  26529. function GetFeaturesBySQLParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesBySQLParameters_assertThisInitialized(self); }
  26530. function GetFeaturesBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26531. function GetFeaturesBySQLParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26532. function GetFeaturesBySQLParameters_getPrototypeOf(o) { GetFeaturesBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLParameters_getPrototypeOf(o); }
  26533. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26534. * This program are made available under the terms of the Apache License, Version 2.0
  26535. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26536. /**
  26537. * @class SuperMap.GetFeaturesBySQLParameters
  26538. * @category iServer Data FeatureResults
  26539. * @classdesc 数据服务中数据集 SQL 查询参数类。
  26540. * @param {Object} options - 参数。
  26541. * @param {SuperMap.FilterParameter} options.queryParameter - 查询过滤条件参数。
  26542. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  26543. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  26544. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  26545. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  26546. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  26547. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  26548. * @extends {SuperMap.GetFeaturesParametersBase}
  26549. */
  26550. var GetFeaturesBySQLParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  26551. GetFeaturesBySQLParameters_inherits(GetFeaturesBySQLParameters, _GetFeaturesParameter);
  26552. var _super = GetFeaturesBySQLParameters_createSuper(GetFeaturesBySQLParameters);
  26553. function GetFeaturesBySQLParameters(options) {
  26554. var _this;
  26555. GetFeaturesBySQLParameters_classCallCheck(this, GetFeaturesBySQLParameters);
  26556. _this = _super.call(this, options);
  26557. /**
  26558. * @member {string} SuperMap.GetFeaturesBySQLParameters.prototype.getFeatureMode
  26559. * @description 数据集查询模式。
  26560. */
  26561. _this.getFeatureMode = "SQL";
  26562. /**
  26563. * @member {SuperMap.FilterParameter} SuperMap.GetFeaturesBySQLParameters.prototype.queryParameter
  26564. * @description 查询过滤条件参数类。
  26565. */
  26566. _this.queryParameter = null;
  26567. Util.extend(GetFeaturesBySQLParameters_assertThisInitialized(_this), options);
  26568. _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLParameters";
  26569. return _this;
  26570. }
  26571. /**
  26572. * @function SuperMap.GetFeaturesBySQLParameters.prototype.destroy
  26573. * @override
  26574. */
  26575. GetFeaturesBySQLParameters_createClass(GetFeaturesBySQLParameters, [{
  26576. key: "destroy",
  26577. value: function destroy() {
  26578. GetFeaturesBySQLParameters_get(GetFeaturesBySQLParameters_getPrototypeOf(GetFeaturesBySQLParameters.prototype), "destroy", this).call(this);
  26579. var me = this;
  26580. me.getFeatureMode = null;
  26581. if (me.queryParameter) {
  26582. me.queryParameter.destroy();
  26583. me.queryParameter = null;
  26584. }
  26585. }
  26586. /**
  26587. * @function SuperMap.GetFeaturesBySQLParameters.prototype.toJsonParameters
  26588. * @description 将 SuperMap.GetFeaturesBySQLParameters 对象转换为 JSON 字符串。
  26589. * @param {SuperMap.GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数对象。
  26590. * @returns {string} 转化后的 JSON 字符串。
  26591. */
  26592. }], [{
  26593. key: "toJsonParameters",
  26594. value: function toJsonParameters(params) {
  26595. var paramsBySql = {
  26596. datasetNames: params.datasetNames,
  26597. getFeatureMode: "SQL",
  26598. queryParameter: params.queryParameter
  26599. };
  26600. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  26601. paramsBySql.maxFeatures = params.maxFeatures;
  26602. }
  26603. if (params.aggregations) {
  26604. paramsBySql.aggregations = params.aggregations;
  26605. }
  26606. if (params.targetEpsgCode) {
  26607. paramsBySql.targetEpsgCode = params.targetEpsgCode;
  26608. }
  26609. if (!params.targetEpsgCode && params.targetPrj) {
  26610. paramsBySql.targetPrj = params.targetPrj;
  26611. }
  26612. return Util.toJSON(paramsBySql);
  26613. }
  26614. }]);
  26615. return GetFeaturesBySQLParameters;
  26616. }(GetFeaturesParametersBase);
  26617. SuperMap.GetFeaturesBySQLParameters = GetFeaturesBySQLParameters;
  26618. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLService.js
  26619. function GetFeaturesBySQLService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesBySQLService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesBySQLService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesBySQLService_typeof(obj); }
  26620. function GetFeaturesBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26621. 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); } }
  26622. function GetFeaturesBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLService_defineProperties(Constructor, staticProps); return Constructor; }
  26623. function GetFeaturesBySQLService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesBySQLService_get = Reflect.get; } else { GetFeaturesBySQLService_get = function _get(target, property, receiver) { var base = GetFeaturesBySQLService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFeaturesBySQLService_get(target, property, receiver || target); }
  26624. function GetFeaturesBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  26625. function GetFeaturesBySQLService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFeaturesBySQLService_setPrototypeOf(subClass, superClass); }
  26626. function GetFeaturesBySQLService_setPrototypeOf(o, p) { GetFeaturesBySQLService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLService_setPrototypeOf(o, p); }
  26627. 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); }; }
  26628. function GetFeaturesBySQLService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesBySQLService_assertThisInitialized(self); }
  26629. function GetFeaturesBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26630. function GetFeaturesBySQLService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26631. function GetFeaturesBySQLService_getPrototypeOf(o) { GetFeaturesBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLService_getPrototypeOf(o); }
  26632. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26633. * This program are made available under the terms of the Apache License, Version 2.0
  26634. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26635. /**
  26636. * @class SuperMap.GetFeaturesBySQLService
  26637. * @constructs SuperMap.GetFeaturesBySQLService
  26638. * @category iServer Data FeatureResults
  26639. * @classdesc 数据服务中数据集 SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  26640. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
  26641. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  26642. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  26643. * @param {Object} options - 参数。</br>
  26644. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  26645. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  26646. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  26647. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  26648. * @param {Object} [options.headers] - 请求头。
  26649. * @extends {SuperMap.GetFeaturesServiceBase}
  26650. * @example
  26651. * var myGetFeaturesBySQLService = new SuperMap.GetFeaturesBySQLService(url, {
  26652. * eventListeners: {
  26653. * "processCompleted": GetFeaturesCompleted,
  26654. * "processFailed": GetFeaturesError
  26655. * }
  26656. * });
  26657. * function getFeaturesCompleted(object){//todo};
  26658. * function getFeaturesError(object){//todo};
  26659. *
  26660. */
  26661. var GetFeaturesBySQLService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  26662. GetFeaturesBySQLService_inherits(GetFeaturesBySQLService, _GetFeaturesServiceBa);
  26663. var _super = GetFeaturesBySQLService_createSuper(GetFeaturesBySQLService);
  26664. function GetFeaturesBySQLService(url, options) {
  26665. var _this;
  26666. GetFeaturesBySQLService_classCallCheck(this, GetFeaturesBySQLService);
  26667. _this = _super.call(this, url, options);
  26668. _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLService";
  26669. return _this;
  26670. }
  26671. /**
  26672. * @function SuperMap.GetFeaturesBySQLService.prototype.destroy
  26673. * @override
  26674. */
  26675. GetFeaturesBySQLService_createClass(GetFeaturesBySQLService, [{
  26676. key: "destroy",
  26677. value: function destroy() {
  26678. GetFeaturesBySQLService_get(GetFeaturesBySQLService_getPrototypeOf(GetFeaturesBySQLService.prototype), "destroy", this).call(this);
  26679. }
  26680. /*
  26681. * @function SuperMap.GetFeaturesBySQLService.prototype.getJsonParameters
  26682. * @description 将查询参数转化为 JSON 字符串。
  26683. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  26684. * @param {SuperMap.GetFeaturesBySQLParameters} params - 数据集SQL查询参数类。
  26685. * @returns {string} 转化后的 JSON 字符串。
  26686. */
  26687. }, {
  26688. key: "getJsonParameters",
  26689. value: function getJsonParameters(params) {
  26690. return GetFeaturesBySQLParameters.toJsonParameters(params);
  26691. }
  26692. }]);
  26693. return GetFeaturesBySQLService;
  26694. }(GetFeaturesServiceBase);
  26695. SuperMap.GetFeaturesBySQLService = GetFeaturesBySQLService;
  26696. ;// CONCATENATED MODULE: ./src/common/iServer/GetFieldsService.js
  26697. function GetFieldsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFieldsService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFieldsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFieldsService_typeof(obj); }
  26698. function GetFieldsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26699. 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); } }
  26700. function GetFieldsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFieldsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFieldsService_defineProperties(Constructor, staticProps); return Constructor; }
  26701. function GetFieldsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFieldsService_get = Reflect.get; } else { GetFieldsService_get = function _get(target, property, receiver) { var base = GetFieldsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetFieldsService_get(target, property, receiver || target); }
  26702. function GetFieldsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFieldsService_getPrototypeOf(object); if (object === null) break; } return object; }
  26703. function GetFieldsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetFieldsService_setPrototypeOf(subClass, superClass); }
  26704. function GetFieldsService_setPrototypeOf(o, p) { GetFieldsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFieldsService_setPrototypeOf(o, p); }
  26705. 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); }; }
  26706. function GetFieldsService_possibleConstructorReturn(self, call) { if (call && (GetFieldsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFieldsService_assertThisInitialized(self); }
  26707. function GetFieldsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26708. function GetFieldsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26709. function GetFieldsService_getPrototypeOf(o) { GetFieldsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFieldsService_getPrototypeOf(o); }
  26710. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26711. * This program are made available under the terms of the Apache License, Version 2.0
  26712. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26713. /**
  26714. * @class SuperMap.GetFieldsService
  26715. * @category iServer Data Field
  26716. * @classdesc 字段查询服务,支持查询指定数据集的中所有属性字段(field)的集合。
  26717. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  26718. * @param {Object} options - 参数。</br>
  26719. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  26720. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  26721. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  26722. * @param {string}options.datasource - 要查询的数据集所在的数据源名称。</br>
  26723. * @param {string}options.dataset - 要查询的数据集名称。</br>
  26724. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  26725. * @param {Object} [options.headers] - 请求头。
  26726. * @extends {SuperMap.CommonServiceBase}
  26727. * @example
  26728. * var myService = new SuperMap.GetFieldsService(url, {eventListeners: {
  26729. * "processCompleted": getFieldsCompleted,
  26730. * "processFailed": getFieldsError
  26731. * },
  26732. * datasource: "World",
  26733. * dataset: "Countries"
  26734. * };
  26735. *
  26736. */
  26737. var GetFieldsService = /*#__PURE__*/function (_CommonServiceBase) {
  26738. GetFieldsService_inherits(GetFieldsService, _CommonServiceBase);
  26739. var _super = GetFieldsService_createSuper(GetFieldsService);
  26740. function GetFieldsService(url, options) {
  26741. var _this;
  26742. GetFieldsService_classCallCheck(this, GetFieldsService);
  26743. _this = _super.call(this, url, options);
  26744. /**
  26745. * @member {string} SuperMap.GetFieldsService.prototype.datasource
  26746. * @description 要查询的数据集所在的数据源名称。
  26747. */
  26748. _this.datasource = null;
  26749. /**
  26750. * @member {string} SuperMap.GetFieldsService.prototype.dataset
  26751. * @description 要查询的数据集名称。
  26752. */
  26753. _this.dataset = null;
  26754. if (options) {
  26755. Util.extend(GetFieldsService_assertThisInitialized(_this), options);
  26756. }
  26757. _this.CLASS_NAME = "SuperMap.GetFieldsService";
  26758. return _this;
  26759. }
  26760. /**
  26761. * @function SuperMap.GetFieldsService.prototype.destroy
  26762. * @override
  26763. */
  26764. GetFieldsService_createClass(GetFieldsService, [{
  26765. key: "destroy",
  26766. value: function destroy() {
  26767. GetFieldsService_get(GetFieldsService_getPrototypeOf(GetFieldsService.prototype), "destroy", this).call(this);
  26768. var me = this;
  26769. me.datasource = null;
  26770. me.dataset = null;
  26771. }
  26772. /**
  26773. * @function SuperMap.GetFieldsService.prototype.processAsync
  26774. * @description 执行服务,查询指定数据集的字段信息。
  26775. */
  26776. }, {
  26777. key: "processAsync",
  26778. value: function processAsync() {
  26779. var me = this;
  26780. me.url = Util.urlPathAppend(me.url, "datasources/".concat(me.datasource, "/datasets/").concat(me.dataset, "/fields"));
  26781. me.request({
  26782. method: "GET",
  26783. data: null,
  26784. scope: me,
  26785. success: me.serviceProcessCompleted,
  26786. failure: me.serviceProcessFailed
  26787. });
  26788. }
  26789. }]);
  26790. return GetFieldsService;
  26791. }(CommonServiceBase);
  26792. SuperMap.GetFieldsService = GetFieldsService;
  26793. ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosParameters.js
  26794. function GetGridCellInfosParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26795. 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); } }
  26796. function GetGridCellInfosParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosParameters_defineProperties(Constructor, staticProps); return Constructor; }
  26797. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26798. * This program are made available under the terms of the Apache License, Version 2.0
  26799. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26800. /**
  26801. * @class SuperMap.GetGridCellInfosParameters
  26802. * @category iServer Data Grid
  26803. * @classdesc 数据服务栅格查询参数类。
  26804. * @param {Object} options - 参数。
  26805. * @param {string} options.datasetName - 数据集名称。
  26806. * @param {string} options.dataSourceName - 数据源名称。
  26807. * @param {number} options.X - 要查询的地理位置 X 轴。
  26808. * @param {number} options.Y - 要查询的地理位置 Y 轴。
  26809. */
  26810. var GetGridCellInfosParameters = /*#__PURE__*/function () {
  26811. function GetGridCellInfosParameters(options) {
  26812. GetGridCellInfosParameters_classCallCheck(this, GetGridCellInfosParameters);
  26813. /**
  26814. * @member {string} SuperMap.GetGridCellInfosParameters.prototype.datasetName
  26815. * @description 数据集名称。
  26816. */
  26817. this.datasetName = null;
  26818. /**
  26819. * @member {string} SuperMap.GetGridCellInfosParameters.prototype.dataSourceName
  26820. * @description 数据源名称。
  26821. */
  26822. this.dataSourceName = null;
  26823. /**
  26824. * @member {number} SuperMap.GetGridCellInfosParameters.prototype.X
  26825. * @description 要查询的地理位置 X 轴。
  26826. */
  26827. this.X = null;
  26828. /**
  26829. * @member {number} SuperMap.GetGridCellInfosParameters.prototype.Y
  26830. * @description 要查询的地理位置 Y 轴。
  26831. */
  26832. this.Y = null;
  26833. Util.extend(this, options);
  26834. this.CLASS_NAME = "SuperMap.GetGridCellInfosParameters";
  26835. }
  26836. /**
  26837. * @function SuperMap.GetGridCellInfosParameters.prototype.destroy
  26838. * @description 释放资源,将引用的资源属性置空。
  26839. */
  26840. GetGridCellInfosParameters_createClass(GetGridCellInfosParameters, [{
  26841. key: "destroy",
  26842. value: function destroy() {
  26843. var me = this;
  26844. me.datasetName = null;
  26845. me.dataSourceName = null;
  26846. me.X = null;
  26847. me.Y = null;
  26848. }
  26849. }]);
  26850. return GetGridCellInfosParameters;
  26851. }();
  26852. SuperMap.GetGridCellInfosParameters = GetGridCellInfosParameters;
  26853. ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosService.js
  26854. function GetGridCellInfosService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetGridCellInfosService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetGridCellInfosService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetGridCellInfosService_typeof(obj); }
  26855. function GetGridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26856. 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); } }
  26857. function GetGridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosService_defineProperties(Constructor, staticProps); return Constructor; }
  26858. function GetGridCellInfosService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetGridCellInfosService_get = Reflect.get; } else { GetGridCellInfosService_get = function _get(target, property, receiver) { var base = GetGridCellInfosService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetGridCellInfosService_get(target, property, receiver || target); }
  26859. function GetGridCellInfosService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetGridCellInfosService_getPrototypeOf(object); if (object === null) break; } return object; }
  26860. function GetGridCellInfosService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetGridCellInfosService_setPrototypeOf(subClass, superClass); }
  26861. function GetGridCellInfosService_setPrototypeOf(o, p) { GetGridCellInfosService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetGridCellInfosService_setPrototypeOf(o, p); }
  26862. 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); }; }
  26863. function GetGridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GetGridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetGridCellInfosService_assertThisInitialized(self); }
  26864. function GetGridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26865. function GetGridCellInfosService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26866. function GetGridCellInfosService_getPrototypeOf(o) { GetGridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetGridCellInfosService_getPrototypeOf(o); }
  26867. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26868. * This program are made available under the terms of the Apache License, Version 2.0
  26869. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26870. /**
  26871. * @class SuperMap.GetGridCellInfosService
  26872. * @category iServer Data Grid
  26873. * @classdesc 数据栅格查询服务,支持查询指定地理位置的栅格信息。
  26874. * @param {string} url - 查询服务地址。例如: http://localhost:8090/iserver/services/data-jingjin/rest/data
  26875. * @param {Object} options - 参数。</br>
  26876. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  26877. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  26878. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  26879. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  26880. * @param {Object} [options.headers] - 请求头。
  26881. * @extends {SuperMap.CommonServiceBase}
  26882. * @example
  26883. * var myService = new SuperMap.GetGridCellInfosService(url, {eventListeners: {
  26884. * "processCompleted": queryCompleted,
  26885. * "processFailed": queryError
  26886. * }
  26887. * });
  26888. *
  26889. */
  26890. var GetGridCellInfosService = /*#__PURE__*/function (_CommonServiceBase) {
  26891. GetGridCellInfosService_inherits(GetGridCellInfosService, _CommonServiceBase);
  26892. var _super = GetGridCellInfosService_createSuper(GetGridCellInfosService);
  26893. function GetGridCellInfosService(url, options) {
  26894. var _this;
  26895. GetGridCellInfosService_classCallCheck(this, GetGridCellInfosService);
  26896. _this = _super.call(this, url, options);
  26897. /**
  26898. * @member {string} SuperMap.GetGridCellInfosService.prototype.datasetName
  26899. * @description 数据集名称。
  26900. */
  26901. _this.datasetName = null;
  26902. /**
  26903. * @member {string} SuperMap.GetGridCellInfosService.prototype.dataSourceName
  26904. * @description 数据源名称。
  26905. */
  26906. _this.dataSourceName = null;
  26907. /**
  26908. * @member {string} SuperMap.GetGridCellInfosService.prototype.datasetType
  26909. * @description 数据集类型。
  26910. */
  26911. _this.datasetType = null;
  26912. /**
  26913. * @member {number} SuperMap.GetGridCellInfosService.prototype.X
  26914. * @description 要查询的地理位置X轴
  26915. */
  26916. _this.X = null;
  26917. /**
  26918. * @member {number} SuperMap.GetGridCellInfosService.prototype.Y
  26919. * @description 要查询的地理位置Y轴
  26920. */
  26921. _this.Y = null;
  26922. if (options) {
  26923. Util.extend(GetGridCellInfosService_assertThisInitialized(_this), options);
  26924. }
  26925. _this.CLASS_NAME = "SuperMap.GetGridCellInfosService";
  26926. return _this;
  26927. }
  26928. /**
  26929. * @function SuperMap.GetGridCellInfosService.prototype.destroy
  26930. * @override
  26931. */
  26932. GetGridCellInfosService_createClass(GetGridCellInfosService, [{
  26933. key: "destroy",
  26934. value: function destroy() {
  26935. GetGridCellInfosService_get(GetGridCellInfosService_getPrototypeOf(GetGridCellInfosService.prototype), "destroy", this).call(this);
  26936. var me = this;
  26937. me.X = null;
  26938. me.Y = null;
  26939. me.datasetName = null;
  26940. me.dataSourceName = null;
  26941. me.datasetType = null;
  26942. }
  26943. /**
  26944. * @function SuperMap.GetGridCellInfosService.prototype.processAsync
  26945. * @description 执行服务,查询数据集信息。
  26946. * @param {SuperMap.GetGridCellInfosParameters} params - 查询参数。
  26947. */
  26948. }, {
  26949. key: "processAsync",
  26950. value: function processAsync(params) {
  26951. if (!(params instanceof GetGridCellInfosParameters)) {
  26952. return;
  26953. }
  26954. Util.extend(this, params);
  26955. var me = this;
  26956. me.url = Util.urlPathAppend(me.url, "datasources/".concat(me.dataSourceName, "/datasets/").concat(me.datasetName));
  26957. me.queryRequest(me.getDatasetInfoCompleted, me.getDatasetInfoFailed);
  26958. }
  26959. /**
  26960. * @function SuperMap.GetGridCellInfosService.prototype.queryRequest
  26961. * @description 执行服务,查询。
  26962. * @callback {function} successFun - 成功后执行的函数。
  26963. * @callback {function} failedFunc - 失败后执行的函数。
  26964. */
  26965. }, {
  26966. key: "queryRequest",
  26967. value: function queryRequest(successFun, failedFunc) {
  26968. var me = this;
  26969. me.request({
  26970. method: "GET",
  26971. data: null,
  26972. scope: me,
  26973. success: successFun,
  26974. failure: failedFunc
  26975. });
  26976. }
  26977. /**
  26978. * @function SuperMap.GetGridCellInfosService.prototype.getDatasetInfoCompleted
  26979. * @description 数据集查询完成,执行此方法。
  26980. * @param {Object} result - 服务器返回的结果对象。
  26981. */
  26982. }, {
  26983. key: "getDatasetInfoCompleted",
  26984. value: function getDatasetInfoCompleted(result) {
  26985. var me = this;
  26986. result = Util.transformResult(result);
  26987. me.datasetType = result.datasetInfo.type;
  26988. me.queryGridInfos();
  26989. }
  26990. /**
  26991. * @function SuperMap.GetGridCellInfosService.prototype.queryGridInfos
  26992. * @description 执行服务,查询数据集栅格信息信息。
  26993. */
  26994. }, {
  26995. key: "queryGridInfos",
  26996. value: function queryGridInfos() {
  26997. var me = this;
  26998. me.url = Util.urlPathAppend(me.url, me.datasetType == 'GRID' ? 'gridValue' : 'imageValue');
  26999. if (me.X != null && me.Y != null) {
  27000. me.url = Util.urlAppend(me.url, "x=".concat(me.X, "&y=").concat(me.Y));
  27001. }
  27002. me.queryRequest(me.serviceProcessCompleted, me.serviceProcessFailed);
  27003. }
  27004. /**
  27005. * @function SuperMap.GetGridCellInfosService.prototype.getDatasetInfoFailed
  27006. * @description 数据集查询失败,执行此方法。
  27007. * @param {Object} result - 服务器返回的结果对象。
  27008. */
  27009. }, {
  27010. key: "getDatasetInfoFailed",
  27011. value: function getDatasetInfoFailed(result) {
  27012. var me = this;
  27013. me.serviceProcessFailed(result);
  27014. }
  27015. }]);
  27016. return GetGridCellInfosService;
  27017. }(CommonServiceBase);
  27018. SuperMap.GetGridCellInfosService = GetGridCellInfosService;
  27019. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeMemoryData.js
  27020. function ThemeMemoryData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27021. 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); } }
  27022. function ThemeMemoryData_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeMemoryData_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeMemoryData_defineProperties(Constructor, staticProps); return Constructor; }
  27023. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27024. * This program are made available under the terms of the Apache License, Version 2.0
  27025. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27026. /**
  27027. * @class SuperMap.ThemeMemoryData
  27028. * @category iServer Map Theme
  27029. * @classdesc 专题图内存数据类。
  27030. * @param {Array} srcData - 原始值数组。
  27031. * @param {Array} targetData - 外部值数组。
  27032. */
  27033. var ThemeMemoryData = /*#__PURE__*/function () {
  27034. function ThemeMemoryData(srcData, targetData) {
  27035. ThemeMemoryData_classCallCheck(this, ThemeMemoryData);
  27036. /**
  27037. * @member {Array} SuperMap.ThemeMemoryData.prototype.srcData
  27038. * @description 原始值数组,该属性值将被 targetData 属性所指定的值替换掉,然后制作专题图,但数据库中的值并不会改变。
  27039. */
  27040. this.srcData = srcData;
  27041. /**
  27042. * @member {Array} SuperMap.ThemeMemoryData.prototype.targetData
  27043. * @description 外部值数组,即用于制作专题图的内存数据,设定该属性值后,会将 srcData 属性所指定的原始值替换掉制作专题图,但数据库中的值并不会改变。
  27044. */
  27045. this.targetData = targetData;
  27046. this.CLASS_NAME = "SuperMap.ThemeMemoryData";
  27047. }
  27048. /**
  27049. * @function SuperMap.ThemeMemoryData.prototype.destroy
  27050. * @description 释放资源,将引用资源的属性置空。
  27051. */
  27052. ThemeMemoryData_createClass(ThemeMemoryData, [{
  27053. key: "destroy",
  27054. value: function destroy() {
  27055. var me = this;
  27056. me.srcData = null;
  27057. me.targetData = null;
  27058. }
  27059. /**
  27060. * @function SuperMap.ThemeMemoryData.prototype.toJSON
  27061. * @description 将 SuperMap.ThemeMemoryData 对象转化为 JSON 字符串。
  27062. * @returns {string} 返回转换后的 JSON 字符串。
  27063. */
  27064. }, {
  27065. key: "toJSON",
  27066. value: function toJSON() {
  27067. if (this.srcData && this.targetData) {
  27068. var memoryDataStr = "";
  27069. var count = Math.min(this.srcData.length, this.targetData.length);
  27070. for (var i = 0; i < count; i++) {
  27071. memoryDataStr += "\'" + this.srcData[i] + "\':\'" + this.targetData[i] + "\',";
  27072. } //去除多余的逗号
  27073. if (i > 0) {
  27074. memoryDataStr = memoryDataStr.substring(0, memoryDataStr.length - 1);
  27075. }
  27076. return "{" + memoryDataStr + "}";
  27077. } else {
  27078. return null;
  27079. }
  27080. }
  27081. }]);
  27082. return ThemeMemoryData;
  27083. }();
  27084. SuperMap.ThemeMemoryData = ThemeMemoryData;
  27085. ;// CONCATENATED MODULE: ./src/common/iServer/Theme.js
  27086. function Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27087. 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); } }
  27088. function Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) Theme_defineProperties(Constructor, staticProps); return Constructor; }
  27089. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27090. * This program are made available under the terms of the Apache License, Version 2.0
  27091. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27092. /**
  27093. * @class SuperMap.Theme
  27094. * @category iServer Map Theme
  27095. * @classdesc 专题图基类。
  27096. * @param {string} type - 专题图类型。
  27097. * @param {Object} options - 参数。
  27098. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  27099. */
  27100. var Theme = /*#__PURE__*/function () {
  27101. function Theme(type, options) {
  27102. Theme_classCallCheck(this, Theme);
  27103. if (!type) {
  27104. return this;
  27105. }
  27106. /**
  27107. * @member {SuperMap.ThemeMemoryData} SuperMap.Theme.prototype.memoryData
  27108. * @description 专题图内存数据。<br>
  27109. * 用内存数据制作专题图的方式与表达式制作专题图的方式互斥,前者优先级较高。
  27110. * 第一个参数代表专题值,即数据集中用来做专题图的字段或表达式的值;第二个参数代表外部值。在制作专题图时,会用外部值代替专题值来制作相应的专题图。
  27111. */
  27112. this.memoryData = null;
  27113. /**
  27114. * @member {string} SuperMap.Theme.prototype.type
  27115. * @description 专题图类型。
  27116. */
  27117. this.type = type;
  27118. if (options) {
  27119. Util.extend(this, options);
  27120. }
  27121. this.CLASS_NAME = "SuperMap.Theme";
  27122. }
  27123. /**
  27124. * @function SuperMap.Theme.prototype.destroy
  27125. * @description 释放资源,将引用资源的属性置空。
  27126. */
  27127. Theme_createClass(Theme, [{
  27128. key: "destroy",
  27129. value: function destroy() {
  27130. var me = this;
  27131. if (me.memoryData) {
  27132. me.memoryData.destroy();
  27133. me.memoryData = null;
  27134. }
  27135. me.type = null;
  27136. }
  27137. /**
  27138. * @function SuperMap.Theme.prototype.toServerJSONObject
  27139. * @description 转换成对应的 JSON 格式对象。
  27140. * @returns {Object} 对应的 JSON 格式对象。
  27141. */
  27142. }, {
  27143. key: "toServerJSONObject",
  27144. value: function toServerJSONObject() {
  27145. //return 子类实现
  27146. return;
  27147. }
  27148. }]);
  27149. return Theme;
  27150. }();
  27151. SuperMap.Theme = Theme;
  27152. ;// CONCATENATED MODULE: ./src/common/iServer/ServerTextStyle.js
  27153. function ServerTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27154. 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); } }
  27155. function ServerTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTextStyle_defineProperties(Constructor, staticProps); return Constructor; }
  27156. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27157. * This program are made available under the terms of the Apache License, Version 2.0
  27158. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27159. /**
  27160. * @class SuperMap.ServerTextStyle
  27161. * @category iServer Map Theme
  27162. * @classdesc 服务端文本风格类。
  27163. * @description 该类用于定义文本风格的相关属性。
  27164. * @param {Object} options - 参数。
  27165. * @param {SuperMap.TextAlignment} [options.align=SuperMap.TextAlignment.BASELINECENTER] - 文本的对齐方式。
  27166. * @param {SuperMap.ServerColor} [options.backColor] - 文本的背景色。默认 backColor = new ServerColor(255, 255, 255)。
  27167. * @param {SuperMap.ServerColor} [options.foreColor] - 文本的前景色。默认 foreColor = new ServerColor(0, 0, 0)。
  27168. * @param {boolean} [options.backOpaque=false] - 文本背景是否不透明。
  27169. * @param {boolean} [options.sizeFixed=true] - 文本大小是否固定。
  27170. * @param {number} [options.fontHeight=6] - 文本字体的高度。
  27171. * @param {number} [options.fontWidth=0] - 文本字体的宽度。
  27172. * @param {number} [options.fontWeight=400] - 文本字体的磅数。
  27173. * @param {string} [options.fontName='Times New Roman'] - 文本字体的名称。
  27174. * @param {boolean} [options.bold=false] - 文本是否为粗体字。
  27175. * @param {boolean} [options.italic=false] - 文本是否采用斜体。
  27176. * @param {number} [options.italicAngle=0] - 字体倾斜角度。
  27177. * @param {boolean} [options.shadow=false] - 文本是否有阴影。
  27178. * @param {boolean} [options.strikeout=false] - 文本字体是否加删除线。
  27179. * @param {boolean} [options.outline=false] - 是否以轮廓的方式来显示文本的背景。
  27180. * @param {number} [options.opaqueRate=0] - 注记文字的不透明度。
  27181. * @param {boolean} [options.underline=false] - 文本字体是否加下划线。
  27182. * @param {number} [options.rotation=0.0] - 文本旋转的角度。
  27183. */
  27184. var ServerTextStyle = /*#__PURE__*/function () {
  27185. function ServerTextStyle(options) {
  27186. ServerTextStyle_classCallCheck(this, ServerTextStyle);
  27187. /**
  27188. * @member {SuperMap.TextAlignment} [SuperMap.ServerTextStyle.prototype.align= SuperMap.TextAlignment.BASELINECENTER]
  27189. * @description 文本的对齐方式。
  27190. */
  27191. this.align = TextAlignment.BASELINECENTER;
  27192. /**
  27193. * @member {SuperMap.ServerColor} [SuperMap.ServerTextStyle.prototype.backColor=(255, 255, 255)]
  27194. * @description 文本的背景色。
  27195. */
  27196. this.backColor = new ServerColor(255, 255, 255);
  27197. /**
  27198. * @member {SuperMap.ServerColor} [SuperMap.ServerTextStyle.prototype.foreColor=(0, 0, 0)]
  27199. * @description 文本的前景色。
  27200. */
  27201. this.foreColor = new ServerColor(0, 0, 0);
  27202. /**
  27203. * @member {boolean} [SuperMap.ServerTextStyle.prototype.backOpaque=false]
  27204. * @description 文本背景是否不透明。true 表示文本背景不透明。
  27205. */
  27206. this.backOpaque = false;
  27207. /**
  27208. * @member {boolean} [SuperMap.ServerTextStyle.prototype.sizeFixed=true]
  27209. * @description 文本大小是否固定。设置为 true,表示图片为固定像素大小,具体大小请参考 fontHeight。当设为 false 时,图片会随着地图缩放而缩放。
  27210. */
  27211. this.sizeFixed = true;
  27212. /**
  27213. * @member {number} [SuperMap.ServerTextStyle.prototype.fontHeight=6]
  27214. * @description 文本字体的高度,单位与 sizeFixed 有关,当 sizeFixed 为 False 时,即非固定文本大小时使用地图坐标单位,
  27215. * 如地理坐标系下的地图中单位为度;当 sizeFixed 为 True 时,单位为毫米(mm)。
  27216. */
  27217. this.fontHeight = 6;
  27218. /**
  27219. * @member {number} [SuperMap.ServerTextStyle.prototype.fontWidth=0]
  27220. * @description 文本字体的宽度。字体的宽度以英文字符为标准,由于一个中文字符相当于两个英文字符。
  27221. */
  27222. this.fontWidth = 0;
  27223. /**
  27224. * @member {number} [SuperMap.ServerTextStyle.prototype.fontWeight=400]
  27225. * @description 文本字体的磅数。表示粗体的具体数值。取值范围为从0-900之间的整百数。
  27226. */
  27227. this.fontWeight = 400;
  27228. /**
  27229. * @member {string} [SuperMap.ServerTextStyle.prototype.fontName="Times New Roman"]
  27230. * @description 文本字体的名称。
  27231. */
  27232. this.fontName = "Times New Roman";
  27233. /**
  27234. * @member {boolean} [SuperMap.ServerTextStyle.prototype.bold=false]
  27235. * @description 文本是否为粗体字。true 表示为粗体。false 表示文本不是粗体字。
  27236. */
  27237. this.bold = false;
  27238. /**
  27239. * @member {boolean} [SuperMap.ServerTextStyle.prototype.italic=false]
  27240. * @description 文本是否采用斜体。true 表示采用斜体。
  27241. */
  27242. this.italic = false;
  27243. /**
  27244. * @member {number} [SuperMap.ServerTextStyle.prototype.italicAngle=0]
  27245. * @description 字体倾斜角度。正负度之间,以度为单位,精确到0.1度。当倾斜角度为0度,为系统默认的字体倾斜样式。
  27246. * 正负度是指以纵轴为起始零度线,其纵轴左侧为正,右侧为负。允许的最大角度为60,最小-60。大于60按照60处理,小于-60按照-60处理。目前只对标签专题图有效。
  27247. */
  27248. this.italicAngle = 0;
  27249. /**
  27250. * @member {boolean} [SuperMap.ServerTextStyle.prototype.shadow=false]
  27251. * @description 文本是否有阴影。true 表示给文本增加阴影。false 表示文本没有阴影。
  27252. */
  27253. this.shadow = false;
  27254. /**
  27255. * @member {boolean} [SuperMap.ServerTextStyle.prototype.strikeout=false]
  27256. * @description 文本字体是否加删除线。true 表示加删除线。false 表示文本字体不加删除线。
  27257. */
  27258. this.strikeout = false;
  27259. /**
  27260. * @member {boolean} [SuperMap.ServerTextStyle.prototype.outline=false]
  27261. * @description 是否以轮廓的方式来显示文本的背景。true 表示以轮廓的方式来显示文本的背景。false 表示不以轮廓的方式来显示文本的背景。
  27262. */
  27263. this.outline = false;
  27264. /**
  27265. * @member {number} [SuperMap.ServerTextStyle.prototype.opaqueRate=0]
  27266. * @description 注记文字的不透明度。不透明度的范围为0-100。0表示透明。
  27267. */
  27268. this.opaqueRate = 0;
  27269. /**
  27270. * @member {boolean} [SuperMap.ServerTextStyle.prototype.underline=false]
  27271. * @description 文本字体是否加下划线。true 表示加下划线。
  27272. */
  27273. this.underline = false;
  27274. /**
  27275. * @member {number} [SuperMap.ServerTextStyle.prototype.rotation=0.0]
  27276. * @description 文本旋转的角度。逆时针方向为正方向,单位为度,精确到0.1度。
  27277. */
  27278. this.rotation = 0.0;
  27279. if (options) {
  27280. Util.extend(this, options);
  27281. }
  27282. this.CLASS_NAME = "SuperMap.ServerTextStyle";
  27283. }
  27284. /**
  27285. * @function SuperMap.ServerTextStyle.prototype.destroy
  27286. * @description 释放资源,将引用资源的属性置空。
  27287. */
  27288. ServerTextStyle_createClass(ServerTextStyle, [{
  27289. key: "destroy",
  27290. value: function destroy() {
  27291. var me = this;
  27292. me.align = null;
  27293. if (me.backColor) {
  27294. me.backColor.destroy();
  27295. me.backColor = null;
  27296. }
  27297. if (me.foreColor) {
  27298. me.foreColor.destroy();
  27299. me.foreColor = null;
  27300. }
  27301. me.backOpaque = null;
  27302. me.sizeFixed = null;
  27303. me.fontHeight = null;
  27304. me.fontWidth = null;
  27305. me.fontWeight = null;
  27306. me.fontName = null;
  27307. me.bold = null;
  27308. me.italic = null;
  27309. me.italicAngle = null;
  27310. me.shadow = null;
  27311. me.strikeout = null;
  27312. me.outline = null;
  27313. me.opaqueRate = null;
  27314. me.underline = null;
  27315. me.rotation = null;
  27316. }
  27317. /**
  27318. * @function SuperMap.ServerTextStyle.fromObj
  27319. * @description 从传入对象获服务端文本风格类。
  27320. * @param {Object} obj - 传入对象
  27321. * @returns {SuperMap.ServerTextStyle} 返回服务端文本风格对象
  27322. */
  27323. }], [{
  27324. key: "fromObj",
  27325. value: function fromObj(obj) {
  27326. var res = new ServerTextStyle(obj);
  27327. Util.copy(res, obj);
  27328. res.backColor = ServerColor.fromJson(obj.backColor);
  27329. res.foreColor = ServerColor.fromJson(obj.foreColor);
  27330. return res;
  27331. }
  27332. }]);
  27333. return ServerTextStyle;
  27334. }();
  27335. SuperMap.ServerTextStyle = ServerTextStyle;
  27336. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelItem.js
  27337. function ThemeLabelItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27338. 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); } }
  27339. function ThemeLabelItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelItem_defineProperties(Constructor, staticProps); return Constructor; }
  27340. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27341. * This program are made available under the terms of the Apache License, Version 2.0
  27342. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27343. /**
  27344. * @class SuperMap.ThemeLabelItem
  27345. * @category iServer Map Theme
  27346. * @classdesc 分段标签专题图的子项。
  27347. * @description 标签专题图用专题值对点、线、面等对象做标注,值得注意的是,分段标签专题图允许用户通过 rangeExpression
  27348. * 字段指定用于分段的数值型字段,同一范围段内的标签具有相同的显示风格,其中每一个范围段就是一个专题图子项,
  27349. * 每一个子项都具有其名称、风格、起始值和终止值。注意:每个分段所表示的范围为 [Start, End)。例如:标签专题图的分段点有两个子项,
  27350. * 他们所代表的分段区间分别为[0,5),[5,10)。那么需要分别设置 SuperMap.ThemeLabelItem[0].start=0,
  27351. * SuperMap.ThemeLabelItem[0].end=5,SuperMap.ThemeLabelItem[1].start=5,SuperMap.ThemeLabelItem[1].end=10。
  27352. * @param {Object} options - 参数。
  27353. * @param {string} [options.caption] - 专题图子项的名称。
  27354. * @param {number} [options.end=0] - 标签专题图子项的终止值。
  27355. * @param {number} [options.start=0] - 标签专题图子项的分段起始值。
  27356. * @param {boolean} [options.visible=true] - 标签专题图子项是否可见。
  27357. * @param {SuperMap.ServerTextStyle} [options.style] - 标签专题图子项文本的显示风格。
  27358. */
  27359. var ThemeLabelItem = /*#__PURE__*/function () {
  27360. function ThemeLabelItem(options) {
  27361. ThemeLabelItem_classCallCheck(this, ThemeLabelItem);
  27362. /**
  27363. * @member {string} [SuperMap.ThemeLabelItem.prototype.caption]
  27364. * @description 标签专题子项的标题。
  27365. */
  27366. this.caption = null;
  27367. /**
  27368. * @member {number} [SuperMap.ThemeLabelItem.prototype.end=0]
  27369. * @description 标签专题图子项的终止值。如果该子项是分段中最后一个子项,那么该终止值就是分段的最大值;
  27370. * 如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常。
  27371. */
  27372. this.end = 0;
  27373. /**
  27374. * @member {number} [SuperMap.ThemeLabelItem.prototype.start=0]
  27375. * @description 标签专题图子项的分段起始值。如果该子项是分段中第一项,那么该起始值就是分段的最小值;
  27376. * 如果该子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  27377. */
  27378. this.start = 0;
  27379. /**
  27380. * @member {boolean} [SuperMap.ThemeLabelItem.prototype.visible=true]
  27381. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  27382. */
  27383. this.visible = true;
  27384. /**
  27385. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeLabelItem.prototype.style
  27386. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  27387. * uniformMixedStyle(标签文本的复合风格),SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  27388. */
  27389. this.style = new ServerTextStyle();
  27390. if (options) {
  27391. Util.extend(this, options);
  27392. }
  27393. this.CLASS_NAME = "SuperMap.ThemeLabelItem";
  27394. }
  27395. /**
  27396. * @function SuperMap.ThemeLabelItem.prototype.destroy
  27397. * @description 释放资源,将引用资源的属性置空。
  27398. */
  27399. ThemeLabelItem_createClass(ThemeLabelItem, [{
  27400. key: "destroy",
  27401. value: function destroy() {
  27402. var me = this;
  27403. me.caption = null;
  27404. me.end = null;
  27405. me.start = null;
  27406. if (me.style) {
  27407. me.style.destroy();
  27408. me.style = null;
  27409. }
  27410. me.visible = null;
  27411. }
  27412. /**
  27413. * @function SuperMap.ThemeLabelItem.fromObj
  27414. * @description 从传入对象获取分段标签专题图的子项类。
  27415. * @param {Object} obj - 传入对象。
  27416. * @returns {SuperMap.ThemeLabelItem} ThemeLabelItem 对象。
  27417. */
  27418. }], [{
  27419. key: "fromObj",
  27420. value: function fromObj(obj) {
  27421. if (!obj) {
  27422. return;
  27423. }
  27424. var t = new ThemeLabelItem();
  27425. Util.copy(t, obj);
  27426. return t;
  27427. }
  27428. }]);
  27429. return ThemeLabelItem;
  27430. }();
  27431. SuperMap.ThemeLabelItem = ThemeLabelItem;
  27432. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUniqueItem.js
  27433. function ThemeUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27434. 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); } }
  27435. function ThemeUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
  27436. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27437. * This program are made available under the terms of the Apache License, Version 2.0
  27438. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27439. /**
  27440. * @class SuperMap.ThemeUniqueItem
  27441. * @category iServer Map Theme
  27442. * @classdesc 单值专题图子项类。
  27443. * @description 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,Name 字段代表
  27444. * 省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有 5 种不同值,则该行政区划图有 5 个专题图子项。
  27445. * @param {Object} options - 参数。
  27446. * @param {string} options.unique - 单值专题图子项的单值。
  27447. * @param {string} [options.caption] - 单值专题图子项的标题。
  27448. * @param {SuperMap.ServerStyle} [options.style] - 单值专题图子项的风格。
  27449. * @param {boolean} [options.visible=true] - 单值专题图子项是否可见。
  27450. */
  27451. var ThemeUniqueItem = /*#__PURE__*/function () {
  27452. function ThemeUniqueItem(options) {
  27453. ThemeUniqueItem_classCallCheck(this, ThemeUniqueItem);
  27454. /**
  27455. * @member {string} [SuperMap.ThemeUniqueItem.prototype.caption]
  27456. * @description 单值专题图子项的标题。
  27457. */
  27458. this.caption = null;
  27459. /**
  27460. * @member {SuperMap.ServerStyle} [SuperMap.ThemeUniqueItem.prototype.style]
  27461. * @description 单值专题图子项的显示风格。
  27462. */
  27463. this.style = new ServerStyle();
  27464. /**
  27465. * @member {string} SuperMap.ThemeUniqueItem.prototype.unique
  27466. * @description 单值专题图子项的值,可以为数字、字符串等。
  27467. */
  27468. this.unique = null;
  27469. /**
  27470. * @member {boolean} [SuperMap.ThemeUniqueItem.prototype.visible=true]
  27471. * @description 单值专题图子项的可见性。
  27472. */
  27473. this.visible = true;
  27474. if (options) {
  27475. Util.extend(this, options);
  27476. }
  27477. this.CLASS_NAME = "SuperMap.ThemeUniqueItem";
  27478. }
  27479. /**
  27480. * @function SuperMap.ThemeUniqueItem.prototype.destroy
  27481. * @description 释放资源,将引用资源的属性置空。
  27482. */
  27483. ThemeUniqueItem_createClass(ThemeUniqueItem, [{
  27484. key: "destroy",
  27485. value: function destroy() {
  27486. var me = this;
  27487. me.caption = null;
  27488. me.unique = null;
  27489. if (me.style) {
  27490. me.style.destroy();
  27491. me.style = null;
  27492. }
  27493. me.visible = null;
  27494. }
  27495. /**
  27496. * @function SuperMap.ThemeUniqueItem.prototype.toServerJSONObject
  27497. * @description 转换成对应的 JSON 格式对象。
  27498. * @returns {Object} 对应的 JSON 格式对象。
  27499. */
  27500. }, {
  27501. key: "toServerJSONObject",
  27502. value: function toServerJSONObject() {
  27503. var obj = {};
  27504. obj = Util.copyAttributes(obj, this);
  27505. if (obj.style) {
  27506. if (obj.style.toServerJSONObject) {
  27507. obj.style = obj.style.toServerJSONObject();
  27508. }
  27509. }
  27510. return obj;
  27511. }
  27512. /**
  27513. * @function SuperMap.ThemeUniqueItem.fromObj
  27514. * @description 从传入对象获取单值专题图子项类。
  27515. * @param {Object} obj - 传入对象。
  27516. * @returns {SuperMap.ThemeUniqueItem} ThemeUniqueItem 对象。
  27517. */
  27518. }], [{
  27519. key: "fromObj",
  27520. value: function fromObj(obj) {
  27521. var res = new ThemeUniqueItem();
  27522. Util.copy(res, obj);
  27523. res.style = ServerStyle.fromJson(obj.style);
  27524. return res;
  27525. }
  27526. }]);
  27527. return ThemeUniqueItem;
  27528. }();
  27529. SuperMap.ThemeUniqueItem = ThemeUniqueItem;
  27530. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeFlow.js
  27531. function ThemeFlow_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27532. 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); } }
  27533. function ThemeFlow_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeFlow_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeFlow_defineProperties(Constructor, staticProps); return Constructor; }
  27534. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27535. * This program are made available under the terms of the Apache License, Version 2.0
  27536. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27537. /**
  27538. * @class SuperMap.ThemeFlow
  27539. * @category iServer Map Theme
  27540. * @classdesc 标签或符号流动显示和牵引线风格设置类。
  27541. * 通过该类可以设置专题图中符号是否流动显示、是否使用牵引线以及牵引线风格。
  27542. * @param {Object} options - 参数。
  27543. * @param {boolean} [options.flowEnabled=false] - 是否流动显示标签或符号。
  27544. * @param {boolean} [options.leaderLineDisplayed=false] - 是否显示标签或符号和它标注的对象之间的牵引线。
  27545. * @param {SuperMap.ServerStyle} [options.leaderLineStyle] - 标签或符号与其标注对象之间牵引线的风格。
  27546. */
  27547. var ThemeFlow = /*#__PURE__*/function () {
  27548. function ThemeFlow(options) {
  27549. ThemeFlow_classCallCheck(this, ThemeFlow);
  27550. /**
  27551. * @member {boolean} [SuperMap.ThemeFlow.prototype.flowEnabled=false]
  27552. * @description 是否流动显示标签或符号。<br>
  27553. * 对于标签专题图而言,对于跨越比较大的区域和线条状的几何对象,在一个地图窗口中不能完全显示的情况下,如果其标签位置比较固定,
  27554. * 在当前地图窗口中该对象的标签不可见,则需要通过平移地图来查看对象的标签信息。如果采用了流动显示的效果,在当前地图窗口中,对象即使是部分显示,
  27555. * 其标签也会显示在当前地图窗口中。当平移地图时,对象的标签会随之移动,以保证在当前地图窗口中部分或全部显示的对象其标签都可见,从而可以方便地查看各要素的标签信息。
  27556. */
  27557. this.flowEnabled = false;
  27558. /**
  27559. * @member {boolean} [SuperMap.ThemeFlow.prototype.leaderLineDisplayed=false]
  27560. * @description 是否显示标签或符号和它标注的对象之间的牵引线。false表示不显示标签或符号和它标注的对象之间的牵引线。<br>
  27561. * 只有当 flowEnabled 为 true 时,牵引线才起作用。在当标签流动显示时,其位置不固定,由于牵引线始终指向要素的内点,
  27562. * 因而通过牵引线显示功能可以找到流动的标签或符号实际对应的要素。或者渲染符号偏移它所指向的对象时,图与对象之间可以采用牵引线进行连接。
  27563. */
  27564. this.leaderLineDisplayed = false;
  27565. /**
  27566. * @member {SuperMap.ServerStyle} SuperMap.ThemeFlow.prototype.leaderLineStyle
  27567. * @description 标签或符号与其标注对象之间牵引线的风格。
  27568. */
  27569. this.leaderLineStyle = new ServerStyle();
  27570. if (options) {
  27571. Util.extend(this, options);
  27572. }
  27573. this.CLASS_NAME = "SuperMap.ThemeFlow";
  27574. }
  27575. /**
  27576. * @function SuperMap.ThemeFlow.prototype.destroy
  27577. * @description 释放资源,将引用资源的属性置空。
  27578. */
  27579. ThemeFlow_createClass(ThemeFlow, [{
  27580. key: "destroy",
  27581. value: function destroy() {
  27582. var me = this;
  27583. me.flowEnabled = null;
  27584. me.leaderLineDisplayed = null;
  27585. if (me.leaderLineStyle) {
  27586. me.leaderLineStyle.destroy();
  27587. me.leaderLineStyle = null;
  27588. }
  27589. }
  27590. /**
  27591. * @function SuperMap.ThemeFlow.fromObj
  27592. * @description 从传入对象获取标签或符号流动显示和牵引线风格设置类。
  27593. * @param {Object} obj - 传入对象。
  27594. * @returns {SuperMap.ThemeFlow} ThemeFlow 对象。
  27595. */
  27596. }], [{
  27597. key: "fromObj",
  27598. value: function fromObj(obj) {
  27599. if (!obj) {
  27600. return;
  27601. }
  27602. var res = new ThemeFlow();
  27603. Util.copy(res, obj);
  27604. res.leaderLineStyle = ServerStyle.fromJson(obj.leaderLineStyle);
  27605. return res;
  27606. }
  27607. }]);
  27608. return ThemeFlow;
  27609. }();
  27610. SuperMap.ThemeFlow = ThemeFlow;
  27611. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeOffset.js
  27612. function ThemeOffset_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27613. 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); } }
  27614. function ThemeOffset_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeOffset_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeOffset_defineProperties(Constructor, staticProps); return Constructor; }
  27615. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27616. * This program are made available under the terms of the Apache License, Version 2.0
  27617. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27618. /**
  27619. * @class SuperMap.ThemeOffset
  27620. * @category iServer Map Theme
  27621. * @classdesc 专题图中文本或符号相对于要素内点的偏移量设置类。
  27622. * 通过该类可以设置专题图中标记文本或符号的偏移量以及偏移量是否随地图缩放而改变。
  27623. * @param {Object} options - 参数。
  27624. * @param {boolean} [options.offsetFixed=false] - 当前专题图是否固定标记文本或符号的偏移量。
  27625. * @param {string} [options.offsetX='0.0'] - 专题图中文本或符号相对于要素内点的水平偏移量。
  27626. * @param {string} [options.offsetY='0.0'] - 专题图中文本或符号相对于要素内点的垂直偏移量。
  27627. */
  27628. var ThemeOffset = /*#__PURE__*/function () {
  27629. function ThemeOffset(options) {
  27630. ThemeOffset_classCallCheck(this, ThemeOffset);
  27631. /**
  27632. * @member {boolean} [SuperMap.ThemeOffset.prototype.offsetFixed=false]
  27633. * @description 当前专题图是否固定标记文本或符号的偏移量。所谓固定偏移量,则文本或符号的偏移量不随地图的缩放而变化。
  27634. */
  27635. this.offsetFixed = false;
  27636. /**
  27637. * @member {string} [SuperMap.ThemeOffset.prototype.offsetX=0.0]
  27638. * @description 专题图中文本或符号相对于要素内点的水平偏移量。偏移量的单位为地图单位。
  27639. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么水平偏移量为2。
  27640. */
  27641. this.offsetX = "0.0";
  27642. /**
  27643. * @member {string} [SuperMap.ThemeOffset.prototype.offsetY=0.0]
  27644. * @description 专题图中文本或符号相对于要素内点的垂直偏移量。偏移量的单位为地图单位。
  27645. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么垂直偏移量为2。
  27646. */
  27647. this.offsetY = "0.0";
  27648. if (options) {
  27649. Util.extend(this, options);
  27650. }
  27651. this.CLASS_NAME = "SuperMap.ThemeOffset";
  27652. }
  27653. /**
  27654. * @function SuperMap.ThemeOffset.prototype.destroy
  27655. * @description 释放资源,将引用资源的属性置空。
  27656. */
  27657. ThemeOffset_createClass(ThemeOffset, [{
  27658. key: "destroy",
  27659. value: function destroy() {
  27660. var me = this;
  27661. me.offsetFixed = null;
  27662. me.offsetX = null;
  27663. me.offsetY = null;
  27664. }
  27665. /**
  27666. * @function SuperMap.ThemeOffset.fromObj
  27667. * @description 从传入对象获取专题图中文本或符号相对于要素内点的偏移量设置类。
  27668. * @param {Object} obj - 传入对象。
  27669. * @returns {SuperMap.ThemeOffset} ThemeOffset 对象。
  27670. */
  27671. }], [{
  27672. key: "fromObj",
  27673. value: function fromObj(obj) {
  27674. if (!obj) {
  27675. return;
  27676. }
  27677. var res = new ThemeOffset();
  27678. Util.copy(res, obj);
  27679. return res;
  27680. }
  27681. }]);
  27682. return ThemeOffset;
  27683. }();
  27684. SuperMap.ThemeOffset = ThemeOffset;
  27685. ;// CONCATENATED MODULE: ./src/common/iServer/LabelMixedTextStyle.js
  27686. function LabelMixedTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27687. 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); } }
  27688. function LabelMixedTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelMixedTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelMixedTextStyle_defineProperties(Constructor, staticProps); return Constructor; }
  27689. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27690. * This program are made available under the terms of the Apache License, Version 2.0
  27691. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27692. /**
  27693. * @class SuperMap.LabelMixedTextStyle
  27694. * @category iServer Map Theme
  27695. * @classdesc 标签文本复合风格类
  27696. * @description 该类主要用于对标签专题图中标签的文本内容进行风格设置。通过该类用户可以使标签的文字显示不同的风格,比如文本 “喜马拉雅山”,通过本类可以将前三个字用红色显示,后两个字用蓝色显示。对同一文本设置不同的风格实质上是对文本的字符进行分段,同一分段内的字符具有相同的显示风格。对字符分段有两种方式,一种是利用分隔符对文本进行分段;另一种是根据分段索引值进行分段。<br>
  27697. * 1. 利用分隔符对文本进行分段: 比如文本 “5&109” 被分隔符 “&” 分为 “5” 和 “109” 两部分,
  27698. * 在显示时,“5” 和分隔符 “&” 使用同一个风格,字符串 “109” 使用相同的风格。<br>
  27699. * 2. 利用分段索引值进行分段: 文本中字符的索引值是以0开始的整数,比如文本 “珠穆朗玛峰”,
  27700. * 第一个字符(“珠”)的索引值为 0,第二个字符(“穆”)的索引值为 1,以此类推;当设置分段索引值为 1,3,4,9 时,
  27701. * 字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),可以看出索引号为 0 的字符(即“珠” )在第一个分段内,
  27702. * 索引号为 1,2 的字符(即“穆”、“朗”)位于第二个分段内,索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  27703. * @param {Object} options - 参数。
  27704. * @param {SuperMap.ServerTextStyle} [options.defaultStyle] - 默认的文本复合风格。
  27705. * @param {string} [options.separator] - 文本的分隔符。
  27706. * @param {boolean} [options.separatorEnabled=false] - 文本的分隔符是否有效。
  27707. * @param {Array.<number>} [options.splitIndexes] - 分段索引值,分段索引值用来对文本中的字符进行分段。
  27708. * @param {Array.<SuperMap.ServerTextStyle>} [options.styles] - 文本样式集合。
  27709. */
  27710. var LabelMixedTextStyle = /*#__PURE__*/function () {
  27711. function LabelMixedTextStyle(options) {
  27712. LabelMixedTextStyle_classCallCheck(this, LabelMixedTextStyle);
  27713. /**
  27714. * @member {SuperMap.ServerTextStyle} SuperMap.LabelMixedTextStyle.prototype.defaultStyle
  27715. * @description 默认的文本复合风格,即 SuperMap.ServerTextStyle 各字段的默认值。
  27716. */
  27717. this.defaultStyle = null;
  27718. /**
  27719. * @member {string} SuperMap.LabelMixedTextStyle.prototype.separator
  27720. * @description 文本的分隔符,分隔符的风格与前一个字符的风格一样。文本的分隔符是一个将文本分割开的符号,
  27721. * 比如文本 “5_109” 被 “_” 隔符为 “5” 和 “109” 两部分,假设有风格数组:style1、style2。
  27722. * 在显示时,“5” 和分隔符 “_” 使用 Style1 风格渲染,字符串 “109” 使用 Style2 的风格。
  27723. */
  27724. this.separator = null;
  27725. /**
  27726. * @member {boolean} [SuperMap.LabelMixedTextStyle.prototype.separatorEnabled=false]
  27727. * @description 文本的分隔符是否有效。分隔符有效时利用分隔符对文本进行分段;无效时根据文本中字符的位置进行分段。
  27728. * 分段后,同一分段内的字符具有相同的显示风格。
  27729. */
  27730. this.separatorEnabled = false;
  27731. /**
  27732. * @member {Array.<number>} SuperMap.LabelMixedTextStyle.prototype.splitIndexes
  27733. * @description 分段索引值,分段索引值用来对文本中的字符进行分段。
  27734. * 文本中字符的索引值是以 0 开始的整数,比如文本“珠穆朗玛峰”,第一个字符(“珠”)的索引值为0,第二个字符(“穆”)的索引值为 1,
  27735. * 以此类推;当设置分段索引值数组为 [1,3,4,9] 时,字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),
  27736. * 可以看出索引号为 0 的字符(即 “珠”)在第一个分段内,索引号为 1,2 的字符(即 “穆”、“朗”)位于第二个分段内,
  27737. * 索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  27738. */
  27739. this.splitIndexes = null;
  27740. /**
  27741. * @member {Array.<SuperMap.ServerTextStyle>} SuperMap.LabelMixedTextStyle.prototype.styles
  27742. * @description 文本样式集合。文本样式集合中的样式根据索引与不同分段一一对应,
  27743. * 如果有分段没有风格对应则使用 defaultStyle。
  27744. */
  27745. this.styles = new ServerTextStyle();
  27746. if (options) {
  27747. Util.extend(this, options);
  27748. }
  27749. this.CLASS_NAME = "SuperMap.LabelMixedTextStyle";
  27750. }
  27751. /**
  27752. * @function SuperMap.LabelMixedTextStyle.prototype.destroy
  27753. * @description 释放资源,将引用资源的属性置空。
  27754. */
  27755. LabelMixedTextStyle_createClass(LabelMixedTextStyle, [{
  27756. key: "destroy",
  27757. value: function destroy() {
  27758. var me = this;
  27759. if (me.defaultStyle) {
  27760. me.defaultStyle.destroy();
  27761. me.defaultStyle = null;
  27762. }
  27763. me.separator = null;
  27764. me.separatorEnabled = null;
  27765. if (me.splitIndexes) {
  27766. me.splitIndexes = null;
  27767. }
  27768. if (me.styles) {
  27769. for (var i = 0, styles = me.styles, len = styles.length; i < len; i++) {
  27770. styles[i].destroy();
  27771. }
  27772. me.styles = null;
  27773. }
  27774. }
  27775. /**
  27776. * @function SuperMap.LabelMixedTextStyle.fromObj
  27777. * @description 从传入对象获取标签文本复合风格类。
  27778. * @param {Object} obj - 传入对象。
  27779. * @returns {SuperMap.LabelMixedTextStyle} 返回新的 LabelMixedTextStyle 对象。
  27780. */
  27781. }], [{
  27782. key: "fromObj",
  27783. value: function fromObj(obj) {
  27784. if (!obj) {
  27785. return;
  27786. }
  27787. var res = new LabelMixedTextStyle();
  27788. var stys = obj.styles;
  27789. Util.copy(res, obj);
  27790. res.defaultStyle = new ServerTextStyle(obj.defaultStyle);
  27791. if (stys) {
  27792. res.styles = [];
  27793. for (var i = 0, len = stys.length; i < len; i++) {
  27794. res.styles.push(new ServerTextStyle(stys[i]));
  27795. }
  27796. }
  27797. return res;
  27798. }
  27799. }]);
  27800. return LabelMixedTextStyle;
  27801. }();
  27802. SuperMap.LabelMixedTextStyle = LabelMixedTextStyle;
  27803. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelText.js
  27804. function ThemeLabelText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27805. 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); } }
  27806. function ThemeLabelText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelText_defineProperties(Constructor, staticProps); return Constructor; }
  27807. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27808. * This program are made available under the terms of the Apache License, Version 2.0
  27809. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27810. /**
  27811. * @class SuperMap.ThemeLabelText
  27812. * @category iServer Map Theme
  27813. * @classdesc 标签中文本风格类。
  27814. * 通过该类可以设置标签中的文本字体大小和显示风格。
  27815. * @param {Object} options - 参数。
  27816. * @param {number} [options.maxTextHeight=0] - 标签中文本的最大高度。
  27817. * @param {number} [options.maxTextWidth=0] - 标签中文本的最大宽度。
  27818. * @param {number} [options.minTextHeight=0] - 标签中文本的最小高度。
  27819. * @param {number} [options.minTextWidth=0] - 标签中文本的最小宽度。
  27820. * @param {SuperMap.ServerTextStyle} [options.uniformStyle] - 统一文本风格。
  27821. * @param {SuperMap.LabelMixedTextStyle} [options.uniformMixedStyle] - 标签专题图统一的文本复合风格。
  27822. */
  27823. var ThemeLabelText = /*#__PURE__*/function () {
  27824. function ThemeLabelText(options) {
  27825. ThemeLabelText_classCallCheck(this, ThemeLabelText);
  27826. /**
  27827. * @member {number} [SuperMap.ThemeLabelText.prototype.maxTextHeight=0]
  27828. * @description 标签中文本的最大高度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  27829. * 当放大后的文本高度超过最大高度之后就不再放大。高度单位为 0.1 毫米。
  27830. */
  27831. this.maxTextHeight = 0;
  27832. /**
  27833. * @member {number} [SuperMap.ThemeLabelText.prototype.maxTextWidth=0]
  27834. * @description 标签中文本的最大宽度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  27835. * 当放大后的文本宽度超过最大高度之后就不再放大。宽度单位为 0.1 毫米。
  27836. */
  27837. this.maxTextWidth = 0;
  27838. /**
  27839. * @member {number} [SuperMap.ThemeLabelText.prototype.minTextHeight=0]
  27840. * @description 标签中文本的最小高度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  27841. * 当缩小后的文本高度小于最小高度之后就不再缩小。高度单位为 0.1 毫米。
  27842. */
  27843. this.minTextHeight = 0;
  27844. /**
  27845. * @member {number} [SuperMap.ThemeLabelText.prototype.minTextWidth=0]
  27846. * @description 标签中文本的最小宽度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  27847. * 当缩小后的文本宽度小于最小宽度之后就不再缩小。宽度单位为 0.1 毫米。
  27848. */
  27849. this.minTextWidth = 0;
  27850. /**
  27851. * @member {SuperMap.ServerTextStyle} [SuperMap.ThemeLabelText.prototype.uniformStyle]
  27852. * @description 统一文本风格。当标签专题图子项的个数大于等于1时,
  27853. * uniformStyle 不起作用,各标签的风格使用子项中设置的风格。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  27854. * SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  27855. */
  27856. this.uniformStyle = new ServerTextStyle();
  27857. /**
  27858. *@member {SuperMap.LabelMixedTextStyle} [SuperMap.ThemeLabelText.prototype.uniformMixedStyle]
  27859. *@description 标签专题图统一的文本复合风格。通过该类可以使同一个标
  27860. * 签中的文字使用多种风格显示。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  27861. * SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  27862. */
  27863. this.uniformMixedStyle = null;
  27864. if (options) {
  27865. Util.extend(this, options);
  27866. }
  27867. this.CLASS_NAME = "SuperMap.ThemeLabelText";
  27868. }
  27869. /**
  27870. * @function SuperMap.ThemeLabelText.prototype.destroy
  27871. * @description 释放资源,将引用资源的属性置空。
  27872. */
  27873. ThemeLabelText_createClass(ThemeLabelText, [{
  27874. key: "destroy",
  27875. value: function destroy() {
  27876. var me = this;
  27877. me.maxTextHeight = null;
  27878. me.maxTextWidth = null;
  27879. me.minTextHeight = null;
  27880. me.minTextWidth = null;
  27881. if (me.uniformStyle) {
  27882. me.uniformStyle.destroy();
  27883. me.uniformStyle = null;
  27884. }
  27885. if (me.uniformMixedStyle) {
  27886. me.uniformMixedStyle.destroy();
  27887. me.uniformMixedStyle = null;
  27888. }
  27889. }
  27890. /**
  27891. * @function SuperMap.ThemeLabelText.fromObj
  27892. * @description 从传入对象获取标签中文本风格类。
  27893. * @param {Object} obj - 传入对象。
  27894. * @returns {SuperMap.ThemeLabelText} ThemeLabelText 对象。
  27895. */
  27896. }], [{
  27897. key: "fromObj",
  27898. value: function fromObj(obj) {
  27899. if (!obj) {
  27900. return;
  27901. }
  27902. var res = new ThemeLabelText();
  27903. Util.copy(res, obj);
  27904. res.uniformStyle = ServerTextStyle.fromObj(obj.uniformStyle);
  27905. res.uniformMixedStyle = LabelMixedTextStyle.fromObj(obj.uniformMixedStyle);
  27906. return res;
  27907. }
  27908. }]);
  27909. return ThemeLabelText;
  27910. }();
  27911. SuperMap.ThemeLabelText = ThemeLabelText;
  27912. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelAlongLine.js
  27913. function ThemeLabelAlongLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27914. 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); } }
  27915. function ThemeLabelAlongLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelAlongLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelAlongLine_defineProperties(Constructor, staticProps); return Constructor; }
  27916. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27917. * This program are made available under the terms of the Apache License, Version 2.0
  27918. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27919. /**
  27920. * @class SuperMap.ThemeLabelAlongLine
  27921. * @category iServer Map Theme
  27922. * @classdesc 标签沿线标注样式类。
  27923. * @param {Object} options - 参数。
  27924. * @param {boolean} [options.isAlongLine=true] - 是否沿线显示文本。
  27925. * @param {SuperMap.AlongLineDirection} [options.alongLineDirection=SuperMap.AlongLineDirection.LB_TO_RT] - 标签沿线标注方向。
  27926. * @param {boolean} [options.angleFixed=false] - 当沿线显示文本时,是否将文本角度固定。
  27927. * @param {boolean} [options.repeatedLabelAvoided=false] - 沿线循环标注时是否避免标签重复标注。
  27928. * @param {boolean} [options.repeatIntervalFixed=false] - 循环标注间隔是否固定。
  27929. * @param {number} [options.labelRepeatInterval=0] - 沿线且循环标注时循环标注的间隔。
  27930. */
  27931. var ThemeLabelAlongLine = /*#__PURE__*/function () {
  27932. function ThemeLabelAlongLine(options) {
  27933. ThemeLabelAlongLine_classCallCheck(this, ThemeLabelAlongLine);
  27934. /**
  27935. * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.isAlongLine=true]
  27936. * @description 是否沿线显示文本。true 表示沿线显示文本,false 表示正常显示文本。
  27937. */
  27938. this.isAlongLine = true;
  27939. /**
  27940. * @member {SuperMap.AlongLineDirection} [SuperMap.ThemeLabelAlongLine.prototype.alongLineDirection=SuperMap.AlongLineDirection.LB_TO_RT]
  27941. * @description 标签沿线标注方向。
  27942. */
  27943. this.alongLineDirection = AlongLineDirection.LB_TO_RT;
  27944. /**
  27945. * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.angleFixed=false]
  27946. * @description 当沿线显示文本时,是否将文本角度固定。true 表示按固定文本角度显示文本,false 表示按照沿线角度显示文本。
  27947. * 如果固定角度,则所有标签均按所设置的文本风格中字体的旋转角度来显示,不考虑沿线标注的方向;
  27948. * 如果不固定角度,在显示标签时会同时考虑字体的旋转角度和沿线标注的方向。
  27949. */
  27950. this.angleFixed = false;
  27951. /**
  27952. * @member {boolean} SuperMap.ThemeLabelAlongLine.prototype.repeatedLabelAvoided
  27953. * @description 沿线循环标注时是否避免标签重复标注。
  27954. */
  27955. this.repeatedLabelAvoided = false;
  27956. /**
  27957. * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.repeatIntervalFixed=false]
  27958. * @description 循环标注间隔是否固定。true 表示使用固定循环标注间隔,即使用逻辑坐标来显示循环标注间隔;
  27959. * false 表示循环标注间隔随地图的缩放而变化,即使用地理坐标来显示循环标注间隔。
  27960. */
  27961. this.repeatIntervalFixed = false;
  27962. /**
  27963. * @member {number} [SuperMap.ThemeLabelAlongLine.prototype.labelRepeatInterval=0]
  27964. * @description 沿线且循环标注时循环标注的间隔。长度的单位与地图的地理单位一致。只有设定 RepeatedLabelAvoided 为 true
  27965. * 的时候,labelRepeatInterval 属性才有效。
  27966. */
  27967. this.labelRepeatInterval = 0;
  27968. if (options) {
  27969. Util.extend(this, options);
  27970. }
  27971. this.CLASS_NAME = "SuperMap.ThemeLabelAlongLine";
  27972. }
  27973. /**
  27974. * @function SuperMap.ThemeLabelAlongLine.prototype.destroy
  27975. * @description 释放资源,将引用资源的属性置空。
  27976. */
  27977. ThemeLabelAlongLine_createClass(ThemeLabelAlongLine, [{
  27978. key: "destroy",
  27979. value: function destroy() {
  27980. var me = this;
  27981. me.isAlongLine = null;
  27982. me.alongLineDirection = null;
  27983. me.angleFixed = null;
  27984. me.repeatedLabelAvoided = null;
  27985. me.repeatIntervalFixed = null;
  27986. me.labelRepeatInterval = null;
  27987. }
  27988. /**
  27989. * @function SuperMap.ThemeLabelAlongLine.fromObj
  27990. * @description 从传入对象获取标签沿线标注样式类。
  27991. * @param {Object} obj - 传入对象。
  27992. * @returns {SuperMap.ThemeLabelAlongLine} ThemeLabelAlongLine 对象。
  27993. */
  27994. }], [{
  27995. key: "fromObj",
  27996. value: function fromObj(obj) {
  27997. if (!obj) {
  27998. return;
  27999. }
  28000. var t = new ThemeLabelAlongLine();
  28001. Util.copy(t, obj);
  28002. return t;
  28003. }
  28004. }]);
  28005. return ThemeLabelAlongLine;
  28006. }();
  28007. SuperMap.ThemeLabelAlongLine = ThemeLabelAlongLine;
  28008. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelBackground.js
  28009. function ThemeLabelBackground_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28010. 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); } }
  28011. function ThemeLabelBackground_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelBackground_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelBackground_defineProperties(Constructor, staticProps); return Constructor; }
  28012. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28013. * This program are made available under the terms of the Apache License, Version 2.0
  28014. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28015. /**
  28016. * @class SuperMap.ThemeLabelBackground
  28017. * @category iServer Map Theme
  28018. * @classdesc 标签背景风格类。通过该类可以设置标签的背景形状和风格。
  28019. * @param {Object} options - 参数。
  28020. * @param {SuperMap.LabelBackShape} [options.labelBackShape=SuperMap.LabelBackShape.NONE] - 标签专题图中标签背景风格。
  28021. * @param {SuperMap.ServerStyle} [options.backStyle=SuperMap.LabelBackShape.NONE] - 标签专题图中标签背景的形状枚举类。
  28022. */
  28023. var ThemeLabelBackground = /*#__PURE__*/function () {
  28024. function ThemeLabelBackground(options) {
  28025. ThemeLabelBackground_classCallCheck(this, ThemeLabelBackground);
  28026. /**
  28027. * @member {SuperMap.LabelBackShape} [SuperMap.ThemeLabelBackground.prototype.labelBackShape=SuperMap.LabelBackShape.NONE]
  28028. * @description 标签专题图中标签背景风格。当背景形状
  28029. * labelBackShape 属性设为 NONE(即无背景形状) 时,backStyle 属性无效。
  28030. */
  28031. this.labelBackShape = LabelBackShape.NONE;
  28032. /**
  28033. * @member {SuperMap.ServerStyle} [SuperMap.ThemeLabelBackground.prototype.backStyle=SuperMap.LabelBackShape.NON]
  28034. * @description 标签专题图中标签背景的形状枚举类。背景类型可
  28035. * 以是矩形、圆角矩形、菱形、椭圆形、三角形和符号等,即不使用任何的形状作为标签的背景。
  28036. */
  28037. this.backStyle = new ServerStyle();
  28038. if (options) {
  28039. Util.extend(this, options);
  28040. }
  28041. this.CLASS_NAME = "SuperMap.ThemeLabelBackground";
  28042. }
  28043. /**
  28044. * @function SuperMap.ThemeLabelBackground.prototype.destroy
  28045. * @description 释放资源,将引用资源的属性置空。
  28046. */
  28047. ThemeLabelBackground_createClass(ThemeLabelBackground, [{
  28048. key: "destroy",
  28049. value: function destroy() {
  28050. var me = this;
  28051. me.labelBackShape = null;
  28052. if (me.backStyle) {
  28053. me.backStyle.destroy();
  28054. me.backStyle = null;
  28055. }
  28056. }
  28057. /**
  28058. * @function SuperMap.ThemeLabelBackground.fromObj
  28059. * @description 从传入对象获取标签背景风格类。
  28060. * @param {Object} obj - 传入对象。
  28061. * @returns {SuperMap.ThemeLabelBackground} ThemeLabelBackground 对象。
  28062. */
  28063. }], [{
  28064. key: "fromObj",
  28065. value: function fromObj(obj) {
  28066. if (!obj) {
  28067. return;
  28068. }
  28069. var t = new ThemeLabelBackground();
  28070. t.labelBackShape = obj.labelBackShape;
  28071. t.backStyle = ServerStyle.fromJson(obj.backStyle);
  28072. return t;
  28073. }
  28074. }]);
  28075. return ThemeLabelBackground;
  28076. }();
  28077. SuperMap.ThemeLabelBackground = ThemeLabelBackground;
  28078. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabel.js
  28079. function ThemeLabel_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeLabel_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeLabel_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeLabel_typeof(obj); }
  28080. function ThemeLabel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28081. 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); } }
  28082. function ThemeLabel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabel_defineProperties(Constructor, staticProps); return Constructor; }
  28083. function ThemeLabel_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeLabel_get = Reflect.get; } else { ThemeLabel_get = function _get(target, property, receiver) { var base = ThemeLabel_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ThemeLabel_get(target, property, receiver || target); }
  28084. function ThemeLabel_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeLabel_getPrototypeOf(object); if (object === null) break; } return object; }
  28085. function ThemeLabel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThemeLabel_setPrototypeOf(subClass, superClass); }
  28086. function ThemeLabel_setPrototypeOf(o, p) { ThemeLabel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeLabel_setPrototypeOf(o, p); }
  28087. 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); }; }
  28088. function ThemeLabel_possibleConstructorReturn(self, call) { if (call && (ThemeLabel_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeLabel_assertThisInitialized(self); }
  28089. function ThemeLabel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28090. function ThemeLabel_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  28091. function ThemeLabel_getPrototypeOf(o) { ThemeLabel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeLabel_getPrototypeOf(o); }
  28092. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28093. * This program are made available under the terms of the Apache License, Version 2.0
  28094. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28095. /**
  28096. * @class SuperMap.ThemeLabel
  28097. * @category iServer Map Theme
  28098. * @classdesc 标签专题图类。
  28099. * @extends SuperMap.Theme
  28100. * @param {Object} options - 参数。
  28101. * @param {Array.<SuperMap.ThemeUniqueItem>} options.items - 分段标签专题图的子项数组。
  28102. * @param {string} options.labelExpression - 标注字段表达式。
  28103. * @param {Array.<SuperMap.LabelMatrixCell>} options.matrixCells - 矩阵标签元素数组。
  28104. * @param {SuperMap.ThemeLabelAlongLine} [options.alongLine] - 标签沿线标注方向样式类。
  28105. * @param {SuperMap.ThemeLabelBackground} [options.background] - 标签专题图中标签的背景风格类。
  28106. * @param {SuperMap.ThemeFlow} [options.flow] - 标签专题图标签流动显示与牵引线设置类。
  28107. * @param {SuperMap.LabelOverLengthMode} [options.labelOverLengthMode=SuperMap.LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
  28108. * @param {number} [options.maxLabelLength=256] - 标签在每一行显示的最大长度。
  28109. * @param {number} [options.numericPrecision=0] - 通过该字段设置其显示的精度。
  28110. * @param {SuperMap.ThemeOffset} [options.offset] - 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  28111. * @param {boolean} [options.overlapAvoided=true] - 是否允许以文本避让方式显示文本。
  28112. * @param {string} [options.rangeExpression] - 制作分段标签专题的分段字段或字段表达式。
  28113. * @param {boolean} [options.smallGeometryLabeled=false] - 是否显示长度大于被标注对象本身长度的标签。
  28114. * @param {SuperMap.ThemeLabelText} options.text - 标签中文本风格。
  28115. * @param {number} [options.textSpace=0] - 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  28116. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  28117. */
  28118. var ThemeLabel = /*#__PURE__*/function (_Theme) {
  28119. ThemeLabel_inherits(ThemeLabel, _Theme);
  28120. var _super = ThemeLabel_createSuper(ThemeLabel);
  28121. function ThemeLabel(options) {
  28122. var _this;
  28123. ThemeLabel_classCallCheck(this, ThemeLabel);
  28124. _this = _super.call(this, "LABEL", options);
  28125. /**
  28126. * @member {SuperMap.ThemeLabelAlongLine} [SuperMap.ThemeLabel.prototype.alongLine]
  28127. * @description 标签沿线标注方向样式类。
  28128. * 在该类中可以设置标签是否沿线标注以及沿线标注的多种方式。沿线标注属性只适用于线数据集专题图。
  28129. */
  28130. _this.alongLine = new ThemeLabelAlongLine();
  28131. /**
  28132. * @member {SuperMap.ThemeLabelBackground} [SuperMap.ThemeLabel.prototype.background]
  28133. * @description 标签专题图中标签的背景风格类。通过该字段可以设置标签的背景形状和风格。
  28134. */
  28135. _this.background = new ThemeLabelBackground();
  28136. /**
  28137. * @member {SuperMap.ThemeFlow} [SuperMap.ThemeLabel.prototype.flow]
  28138. * @description 标签专题图标签流动显示与牵引线设置类。通过该字段可以设置标签是否流动显示和牵引线风格。
  28139. */
  28140. _this.flow = new ThemeFlow();
  28141. /**
  28142. * @member {Array.<SuperMap.ThemeUniqueItem>} [SuperMap.ThemeLabel.prototype.items]
  28143. * @description 分段标签专题图的子项数组。分段标签专题图使用 rangeExpression
  28144. * 指定数字型的字段作为分段数据,items 中的每个子对象的 [start,end) 分段值必须来源于属性 rangeExpression 的字段值。每个子项拥有自己的风格。
  28145. */
  28146. _this.items = null;
  28147. /**
  28148. * @member {Array.<SuperMap.ThemeLabelUniqueItem>} SuperMap.ThemeLabel.prototype.uniqueItems
  28149. * @description 单值标签专题图子项数组。单值标签专题图使用 uniqueExpression单值标签专题图子项集合。
  28150. */
  28151. _this.uniqueItems = null;
  28152. /**
  28153. * @member {string} SuperMap.ThemeLabel.prototype.labelExpression
  28154. * @description 标注字段表达式。系统将 labelExpression 对应的字段或字段表达式的值以标签的形式显示在图层中。
  28155. */
  28156. _this.labelExpression = null;
  28157. /**
  28158. * @member {SuperMap.LabelOverLengthMode} [SuperMap.ThemeLabel.prototype.labelOverLengthMode=SuperMap.LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
  28159. * @description 对于标签的长度超过设置的标签最大长度 maxLabelLength 时称为超长标签。
  28160. */
  28161. _this.labelOverLengthMode = LabelOverLengthMode.NONE;
  28162. /**
  28163. * @member {Array.<SuperMap.LabelMatrixCell>} SuperMap.ThemeLabel.prototype.matrixCells
  28164. * @description 矩阵标签元素数组,用于制作矩阵标签专题图。
  28165. * 数组中可以放置符号类型的矩阵标签元素和图片类型的矩阵标签元素。
  28166. */
  28167. _this.matrixCells = null;
  28168. /**
  28169. * @member {number} [SuperMap.ThemeLabel.prototype.maxLabelLength=256]
  28170. * @description 标签在每一行显示的最大长度,一个中文为两个字符。
  28171. * 如果超过最大长度,可以采用两种方式来处理,一种是换行的模式进行显示,另一种是以省略号方式显示。单位为字符。
  28172. */
  28173. _this.maxLabelLength = 256;
  28174. /**
  28175. * @member {number} [SuperMap.ThemeLabel.prototype.numericPrecision=0]
  28176. * @description 如果显示的标签内容为数字,通过该字段设置其显示的精度。例如标签对应的数字是8071.64529347,
  28177. * 如果该属性为0时,显示8071;为1时,显示8071.6;为3时,则是8071.645。
  28178. */
  28179. _this.numericPrecision = 0;
  28180. /**
  28181. * @member {SuperMap.ThemeOffset} [SuperMap.ThemeLabel.prototype.offset]
  28182. * @description 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  28183. */
  28184. _this.offset = new ThemeOffset();
  28185. /**
  28186. * @member {boolean} [SuperMap.ThemeLabel.prototype.overlapAvoided=true]
  28187. * @description 是否允许以文本避让方式显示文本。true 表示自动避免文本叠盖。只针对该标签专题图层中的文本数据。
  28188. * 在标签重叠度很大的情况下,即使使用自动避让功能,可能也无法完全避免标签重叠现象。
  28189. */
  28190. _this.overlapAvoided = true;
  28191. /**
  28192. * @member {string} SuperMap.ThemeLabel.prototype.rangeExpression
  28193. * @description 制作分段标签专题的分段字段或字段表达式。该表达式对应的字段(或者字段表达式)的值应该为数值型。
  28194. * 该字段与 items 分段子项联合使用,每个子项的起始值 [start,end)来源于 rangeExpression 字段值。
  28195. * 最后 labelExpression 指定的标签字段(标签专题图要显示的具体内容)会根据分段子项的风格进行分段显示。
  28196. */
  28197. _this.rangeExpression = null;
  28198. /**
  28199. * @member {string} SuperMap.ThemeLabel.prototype.uniqueExpression
  28200. * @description 用于制作单值专题图的字段或字段表达式。
  28201. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。必须与labelExpression一起使用。
  28202. */
  28203. _this.uniqueExpression = null;
  28204. /**
  28205. * @member {boolean} [SuperMap.ThemeLabel.prototype.smallGeometryLabeled=false]
  28206. * @description 是否显示长度大于被标注对象本身长度的标签。在标签的长度大于线或者面对象本身的长度时,
  28207. * 如果该值为 true,则标签文字会叠加在一起显示,为了清楚完整的显示该标签,
  28208. * 可以采用换行模式来显示标签,但必须保证每行的长度小于对象本身的长度。
  28209. */
  28210. _this.smallGeometryLabeled = false;
  28211. /**
  28212. * @member {SuperMap.ThemeLabelText} SuperMap.ThemeLabel.prototype.text
  28213. * @description 标签中文本风格。
  28214. */
  28215. _this.text = new ThemeLabelText();
  28216. /**
  28217. * @member {number} [SuperMap.ThemeLabel.prototype.textSpace=0]
  28218. * @description 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  28219. */
  28220. _this.textSpace = 0;
  28221. if (options) {
  28222. Util.extend(ThemeLabel_assertThisInitialized(_this), options);
  28223. }
  28224. _this.CLASS_NAME = "SuperMap.ThemeLabel";
  28225. return _this;
  28226. }
  28227. /**
  28228. * @function SuperMap.ThemeLabel.prototype.destroy
  28229. * @override
  28230. */
  28231. ThemeLabel_createClass(ThemeLabel, [{
  28232. key: "destroy",
  28233. value: function destroy() {
  28234. ThemeLabel_get(ThemeLabel_getPrototypeOf(ThemeLabel.prototype), "destroy", this).call(this);
  28235. var me = this;
  28236. me.alongLine = null;
  28237. if (me.background) {
  28238. me.background.destroy();
  28239. me.background = null;
  28240. }
  28241. me.flow = null;
  28242. if (me.items) {
  28243. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  28244. items[i].destroy();
  28245. }
  28246. me.items = null;
  28247. }
  28248. if (me.uniqueItems) {
  28249. for (var j = 0, uniqueItems = me.uniqueItems, uniqueLen = uniqueItems.length; j < uniqueLen; j++) {
  28250. uniqueItems[j].destory();
  28251. }
  28252. me.uniqueItems = null;
  28253. }
  28254. me.labelExpression = null;
  28255. me.labelOverLengthMode = null;
  28256. me.matrixCells = null;
  28257. me.maxLabelLength = null;
  28258. me.numericPrecision = null;
  28259. me.overlapAvoided = null;
  28260. me.rangeExpression = null;
  28261. me.uniqueExpression = null;
  28262. if (me.offset) {
  28263. me.offset.destroy();
  28264. me.offset = null;
  28265. }
  28266. me.overlapAvoided = null;
  28267. me.smallGeometryLabeled = null;
  28268. if (me.text) {
  28269. me.text.destroy();
  28270. me.text = null;
  28271. }
  28272. me.textSpace = null;
  28273. }
  28274. /**
  28275. * @function SuperMap.ThemeLabel.prototype.toJSON
  28276. * @description 将themeLabel对象转化为 JSON 字符串。
  28277. * @returns {string} 返回转换后的 JSON 字符串。
  28278. */
  28279. }, {
  28280. key: "toJSON",
  28281. value: function toJSON() {
  28282. return Util.toJSON(this.toServerJSONObject());
  28283. }
  28284. /**
  28285. * @function SuperMap.ThemeLabel.prototype.toServerJSONObject
  28286. * @description 转换成对应的 JSON 格式对象。
  28287. * @returns {Object} 对应的 JSON 格式对象。
  28288. */
  28289. }, {
  28290. key: "toServerJSONObject",
  28291. value: function toServerJSONObject() {
  28292. var obj = {};
  28293. obj.type = this.type;
  28294. obj.memoryData = this.memoryData;
  28295. if (this.alongLine) {
  28296. obj.alongLine = this.alongLine.isAlongLine;
  28297. obj.alongLineDirection = this.alongLine.alongLineDirection;
  28298. obj.angleFixed = this.alongLine.angleFixed;
  28299. obj.isLabelRepeated = this.alongLine.isLabelRepeated;
  28300. obj.labelRepeatInterval = this.alongLine.labelRepeatInterval;
  28301. obj.repeatedLabelAvoided = this.alongLine.repeatedLabelAvoided;
  28302. obj.repeatIntervalFixed = this.alongLine.repeatIntervalFixed;
  28303. }
  28304. if (this.offset) {
  28305. obj.offsetFixed = this.offset.offsetFixed;
  28306. obj.offsetX = this.offset.offsetX;
  28307. obj.offsetY = this.offset.offsetY;
  28308. }
  28309. if (this.flow) {
  28310. obj.flowEnabled = this.flow.flowEnabled;
  28311. obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
  28312. obj.leaderLineStyle = this.flow.leaderLineStyle;
  28313. }
  28314. if (this.text) {
  28315. obj.maxTextHeight = this.text.maxTextHeight;
  28316. obj.maxTextWidth = this.text.maxTextWidth;
  28317. obj.minTextHeight = this.text.minTextHeight;
  28318. obj.minTextWidth = this.text.minTextWidth;
  28319. obj.uniformStyle = this.text.uniformStyle;
  28320. obj.uniformMixedStyle = this.text.uniformMixedStyle;
  28321. }
  28322. if (this.background) {
  28323. obj.labelBackShape = this.background.labelBackShape;
  28324. obj.backStyle = this.background.backStyle;
  28325. }
  28326. obj.labelOverLengthMode = this.labelOverLengthMode;
  28327. obj.maxLabelLength = this.maxLabelLength;
  28328. obj.smallGeometryLabeled = this.smallGeometryLabeled;
  28329. obj.rangeExpression = this.rangeExpression;
  28330. obj.uniqueExpression = this.uniqueExpression;
  28331. obj.numericPrecision = this.numericPrecision;
  28332. obj.items = this.items;
  28333. obj.uniqueItems = this.uniqueItems;
  28334. obj.labelExpression = this.labelExpression;
  28335. obj.overlapAvoided = this.overlapAvoided;
  28336. obj.matrixCells = this.matrixCells;
  28337. obj.textSpace = this.textSpace;
  28338. return obj;
  28339. }
  28340. /**
  28341. * @function SuperMap.ThemeLabel.fromObj
  28342. * @description 从传入对象获取标签专题图类。
  28343. * @param {Object} obj - 传入对象。
  28344. * @returns {SuperMap.ThemeLabel} ThemeLabel 对象。
  28345. */
  28346. }], [{
  28347. key: "fromObj",
  28348. value: function fromObj(obj) {
  28349. if (!obj) {
  28350. return;
  28351. }
  28352. var lab = new ThemeLabel();
  28353. var itemsL = obj.items,
  28354. itemsU = obj.uniqueItems,
  28355. cells = obj.matrixCells;
  28356. obj.matrixCells = null;
  28357. Util.copy(lab, obj);
  28358. lab.alongLine = ThemeLabelAlongLine.fromObj(obj);
  28359. lab.background = ThemeLabelBackground.fromObj(obj);
  28360. lab.flow = new ThemeFlow({
  28361. flowEnabled: obj.flowEnabled,
  28362. leaderLineDisplayed: obj.leaderLineDisplayed,
  28363. leaderLineStyle: obj.leaderLineStyle
  28364. });
  28365. if (itemsL) {
  28366. lab.items = [];
  28367. for (var i = 0, len = itemsL.length; i < len; i++) {
  28368. lab.items.push(ThemeLabelItem.fromObj(itemsL[i]));
  28369. }
  28370. }
  28371. if (itemsU) {
  28372. lab.uniqueItems = [];
  28373. for (var j = 0, uniqueLen = itemsU.length; j < uniqueLen; j++) {
  28374. lab.uniqueItems.push(ThemeUniqueItem.fromObj(itemsU[j]));
  28375. }
  28376. }
  28377. if (cells) {
  28378. lab.matrixCells = [];
  28379. for (var _i = 0, _len = cells.length; _i < _len; _i++) {//TODO
  28380. //lab.matrixCells.push(SuperMap.LabelMatrixCell.fromObj(cells[i]));
  28381. }
  28382. }
  28383. lab.offset = ThemeOffset.fromObj(obj);
  28384. lab.text = ThemeLabelText.fromObj(obj);
  28385. return lab;
  28386. }
  28387. }]);
  28388. return ThemeLabel;
  28389. }(Theme);
  28390. SuperMap.ThemeLabel = ThemeLabel;
  28391. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUnique.js
  28392. function ThemeUnique_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeUnique_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeUnique_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeUnique_typeof(obj); }
  28393. function ThemeUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28394. 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); } }
  28395. function ThemeUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUnique_defineProperties(Constructor, staticProps); return Constructor; }
  28396. function ThemeUnique_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeUnique_get = Reflect.get; } else { ThemeUnique_get = function _get(target, property, receiver) { var base = ThemeUnique_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ThemeUnique_get(target, property, receiver || target); }
  28397. function ThemeUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  28398. function ThemeUnique_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThemeUnique_setPrototypeOf(subClass, superClass); }
  28399. function ThemeUnique_setPrototypeOf(o, p) { ThemeUnique_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeUnique_setPrototypeOf(o, p); }
  28400. 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); }; }
  28401. function ThemeUnique_possibleConstructorReturn(self, call) { if (call && (ThemeUnique_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeUnique_assertThisInitialized(self); }
  28402. function ThemeUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28403. function ThemeUnique_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  28404. function ThemeUnique_getPrototypeOf(o) { ThemeUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeUnique_getPrototypeOf(o); }
  28405. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28406. * This program are made available under the terms of the Apache License, Version 2.0
  28407. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28408. /**
  28409. * @class SuperMap.ThemeUnique
  28410. * @category iServer Map Theme
  28411. * @classdesc 单值专题图。
  28412. * @description 单值专题图是利用不同的颜色或符号(线型、填充)表示图层中某一属性信息的不同属性值,属性值相同的要素具有相同的渲染风格。单值专题图多用于具有分类属性的地图上,
  28413. * 比如土壤类型分布图、土地利用图、行政区划图等。单值专题图着重表示现象质的差别,一般不表示数量的特征。尤其是有交叉或重叠现象时,此类不推荐使用,例如:民族分布区等。
  28414. * @extends {SuperMap.Theme}
  28415. * @param {Object} options - 参数。
  28416. * @param {Array.<SuperMap.ThemeUniqueItem>} options.items - 单值专题图子项类数组。
  28417. * @param {string} options.uniqueExpression - 用于制作单值专题图的字段或字段表达式。
  28418. * @param {SuperMap.ServerStyle} [options.defaultStyle] - 未参与单值专题图制作的对象的显示风格。
  28419. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  28420. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  28421. */
  28422. var ThemeUnique = /*#__PURE__*/function (_Theme) {
  28423. ThemeUnique_inherits(ThemeUnique, _Theme);
  28424. var _super = ThemeUnique_createSuper(ThemeUnique);
  28425. function ThemeUnique(options) {
  28426. var _this;
  28427. ThemeUnique_classCallCheck(this, ThemeUnique);
  28428. _this = _super.call(this, "UNIQUE", options);
  28429. /**
  28430. * @member {SuperMap.ServerStyle} SuperMap.ThemeUnique.prototype.defaultStyle
  28431. * @description 未参与单值专题图制作的对象的显示风格。
  28432. * 通过单值专题图子项数组 (items)可以指定某些要素参与单值专题图制作,对于那些没有被包含的要素,即不参加单值专题表达的要素,使用该风格显示。
  28433. */
  28434. _this.defaultStyle = new ServerStyle();
  28435. /**
  28436. * @member {Array.<SuperMap.ThemeUniqueItem>} SuperMap.ThemeUnique.prototype.items
  28437. * @description 单值专题图子项类数组。
  28438. * 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,
  28439. * Name 字段代表省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有5种不同值,则该行政区划图有 5 个专题图子项。
  28440. */
  28441. _this.items = null;
  28442. /**
  28443. * @member {string} SuperMap.ThemeUnique.prototype.uniqueExpression
  28444. * @description 用于制作单值专题图的字段或字段表达式。
  28445. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。
  28446. */
  28447. _this.uniqueExpression = null;
  28448. /**
  28449. * @member {SuperMap.ColorGradientType} [SuperMap.ThemeUnique.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  28450. * @description 渐变颜色枚举类。
  28451. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  28452. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色方案完成填充。
  28453. * 但如果为某几个子项的风格进行单独设置后(设置了 ThemeUniqueItem 或 ThemeRangeItem 类中Style属性),
  28454. * 该配色方案对于这几个子项将不起作用。
  28455. */
  28456. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  28457. if (options) {
  28458. Util.extend(ThemeUnique_assertThisInitialized(_this), options);
  28459. }
  28460. _this.CLASS_NAME = "SuperMap.ThemeUnique";
  28461. return _this;
  28462. }
  28463. /**
  28464. * @function SuperMap.ThemeUnique.prototype.destroy
  28465. * @override
  28466. */
  28467. ThemeUnique_createClass(ThemeUnique, [{
  28468. key: "destroy",
  28469. value: function destroy() {
  28470. ThemeUnique_get(ThemeUnique_getPrototypeOf(ThemeUnique.prototype), "destroy", this).call(this);
  28471. var me = this;
  28472. me.uniqueExpression = null;
  28473. me.colorGradientType = null;
  28474. if (me.items) {
  28475. if (me.items.length > 0) {
  28476. for (var item in me.items) {
  28477. me.items[item].destroy();
  28478. me.items[item] = null;
  28479. }
  28480. }
  28481. me.items = null;
  28482. }
  28483. if (me.defaultStyle) {
  28484. me.defaultStyle.destroy();
  28485. me.defaultStyle = null;
  28486. }
  28487. }
  28488. /**
  28489. * @function SuperMap.ThemeUnique.prototype.toServerJSONObject
  28490. * @description 转换成对应的 JSON 格式对象。
  28491. * @returns {Object} 对应的 JSON 格式对象。
  28492. */
  28493. }, {
  28494. key: "toServerJSONObject",
  28495. value: function toServerJSONObject() {
  28496. var obj = {};
  28497. obj = Util.copyAttributes(obj, this);
  28498. if (obj.defaultStyle) {
  28499. if (obj.defaultStyle.toServerJSONObject) {
  28500. obj.defaultStyle = obj.defaultStyle.toServerJSONObject();
  28501. }
  28502. }
  28503. if (obj.items) {
  28504. var items = [],
  28505. len = obj.items.length;
  28506. for (var i = 0; i < len; i++) {
  28507. items.push(obj.items[i].toServerJSONObject());
  28508. }
  28509. obj.items = items;
  28510. }
  28511. return obj;
  28512. }
  28513. /**
  28514. * @function SuperMap.ThemeUnique.fromObj
  28515. * @description 从传入对象获取单值专题图类。
  28516. * @param {Object} obj - 传入对象。
  28517. * @returns {SuperMap.ThemeUnique} ThemeUnique 对象。
  28518. */
  28519. }], [{
  28520. key: "fromObj",
  28521. value: function fromObj(obj) {
  28522. var res = new ThemeUnique();
  28523. var uItems = obj.items;
  28524. var len = uItems ? uItems.length : 0;
  28525. Util.extend(res, obj);
  28526. res.items = [];
  28527. res.defaultStyle = ServerStyle.fromJson(obj.defaultStyle);
  28528. for (var i = 0; i < len; i++) {
  28529. res.items.push(ThemeUniqueItem.fromObj(uItems[i]));
  28530. }
  28531. return res;
  28532. }
  28533. }]);
  28534. return ThemeUnique;
  28535. }(Theme);
  28536. SuperMap.ThemeUnique = ThemeUnique;
  28537. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphAxes.js
  28538. function ThemeGraphAxes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28539. 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); } }
  28540. function ThemeGraphAxes_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphAxes_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphAxes_defineProperties(Constructor, staticProps); return Constructor; }
  28541. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28542. * This program are made available under the terms of the Apache License, Version 2.0
  28543. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28544. /**
  28545. * @class SuperMap.ThemeGraphAxes
  28546. * @category iServer Map Theme
  28547. * @classdesc 统计专题图坐标轴样式类。
  28548. * @param {Object} options - 参数。
  28549. * @param {SuperMap.ServerColor} [options.axesColor=(0, 0, 0)] - 坐标轴颜色。
  28550. * @param {boolean} [options.axesDisplayed=false] - 是否显示坐标轴。
  28551. * @param {boolean} [options.axesGridDisplayed=false] - 是否在统计图坐标轴上显示网格。
  28552. * @param {boolean} [options.axesTextDisplayed=false] - 是否显示坐标轴的文本标注。
  28553. * @param {SuperMap.ServerTextStyle} [options.axesTextStyle] - 统计符号的最大最小尺寸。
  28554. */
  28555. var ThemeGraphAxes = /*#__PURE__*/function () {
  28556. function ThemeGraphAxes(options) {
  28557. ThemeGraphAxes_classCallCheck(this, ThemeGraphAxes);
  28558. /**
  28559. * @member {SuperMap.ServerColor} [SuperMap.ThemeGraphAxes.prototype.axesColor=(0, 0, 0)]
  28560. * @description 坐标轴颜色。当 axesDisplayed = true 时有效。
  28561. */
  28562. this.axesColor = new ServerColor(0, 0, 0);
  28563. /**
  28564. * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesDisplayed=false]
  28565. * @description 是否显示坐标轴。<br>
  28566. * 由于饼状图和环状图无坐标轴,故该属性以及所有与坐标轴设置相关的属性都不适用于它们。并且只有当该值为 true 时,其它设置坐标轴的属性才起作用。
  28567. */
  28568. this.axesDisplayed = false;
  28569. /**
  28570. * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesGridDisplayed=false]
  28571. * @description 是否在统计图坐标轴上显示网格。
  28572. */
  28573. this.axesGridDisplayed = false;
  28574. /**
  28575. * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesTextDisplayed=false]
  28576. * @description 是否显示坐标轴的文本标注。
  28577. */
  28578. this.axesTextDisplayed = false;
  28579. /**
  28580. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeGraphAxes.prototype.axesTextStyle
  28581. * @description 坐标轴文本风格。当 axesTextDisplayed = true 时有效。
  28582. */
  28583. this.axesTextStyle = new ServerTextStyle();
  28584. if (options) {
  28585. Util.extend(this, options);
  28586. }
  28587. this.CLASS_NAME = "SuperMap.ThemeGraphAxes";
  28588. }
  28589. /**
  28590. * @function SuperMap.ThemeGraphAxes.prototype.destroy
  28591. * @description 释放资源,将引用资源的属性置空。
  28592. */
  28593. ThemeGraphAxes_createClass(ThemeGraphAxes, [{
  28594. key: "destroy",
  28595. value: function destroy() {
  28596. var me = this;
  28597. if (me.axesColor) {
  28598. me.axesColor.destroy();
  28599. me.axesColor = null;
  28600. }
  28601. me.axesDisplayed = null;
  28602. me.axesGridDisplayed = null;
  28603. me.axesTextDisplayed = null;
  28604. if (me.axesTextStyle) {
  28605. me.axesTextStyle.destroy();
  28606. me.axesTextStyle = null;
  28607. }
  28608. }
  28609. /**
  28610. * @function SuperMap.ThemeGraphAxes.fromObj
  28611. * @description 从传入对象获取统计专题图坐标轴样式类。
  28612. * @param {Object} obj - 传入对象。
  28613. * @returns {SuperMap.ThemeGraphAxes} ThemeGraphAxes 对象。
  28614. */
  28615. }], [{
  28616. key: "fromObj",
  28617. value: function fromObj(obj) {
  28618. if (!obj) {
  28619. return;
  28620. }
  28621. var res = new ThemeGraphAxes();
  28622. Util.copy(res, obj);
  28623. res.axesColor = ServerColor.fromJson(obj.axesColor);
  28624. res.axesTextStyle = ServerTextStyle.fromObj(obj.axesTextStyle);
  28625. return res;
  28626. }
  28627. }]);
  28628. return ThemeGraphAxes;
  28629. }();
  28630. SuperMap.ThemeGraphAxes = ThemeGraphAxes;
  28631. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphSize.js
  28632. function ThemeGraphSize_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28633. 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); } }
  28634. function ThemeGraphSize_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphSize_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphSize_defineProperties(Constructor, staticProps); return Constructor; }
  28635. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28636. * This program are made available under the terms of the Apache License, Version 2.0
  28637. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28638. /**
  28639. * @class SuperMap.ThemeGraphSize
  28640. * @category iServer Map Theme
  28641. * @classdesc 统计专题图符号尺寸类。
  28642. * @param {Object} options - 参数。
  28643. * @param {number} [options.maxGraphSize=0] - 统计图中显示的最大图表尺寸基准值。
  28644. * @param {number} [options.minGraphSize=0] - 统计图中显示的最小图表尺寸基准值。
  28645. */
  28646. var ThemeGraphSize = /*#__PURE__*/function () {
  28647. function ThemeGraphSize(options) {
  28648. ThemeGraphSize_classCallCheck(this, ThemeGraphSize);
  28649. /**
  28650. * @member {number} [SuperMap.ThemeGraphSize.prototype.maxGraphSize=0]
  28651. * @description 获取或设置统计图中显示的最大图表尺寸基准值,单位为像素。
  28652. */
  28653. this.maxGraphSize = 0;
  28654. /**
  28655. * @member {number} [SuperMap.ThemeGraphSize.prototype.minGraphSize=0]
  28656. * @description 获取或设置统计图中显示的最小图表尺寸基准值,单位为像素。
  28657. */
  28658. this.minGraphSize = 0;
  28659. if (options) {
  28660. Util.extend(this, options);
  28661. }
  28662. this.CLASS_NAME = "SuperMap.ThemeGraphSize";
  28663. }
  28664. /**
  28665. * @function SuperMap.ThemeGraphSize.prototype.destroy
  28666. * @description 释放资源,将引用资源的属性置空。
  28667. */
  28668. ThemeGraphSize_createClass(ThemeGraphSize, [{
  28669. key: "destroy",
  28670. value: function destroy() {
  28671. var me = this;
  28672. me.maxGraphSize = null;
  28673. me.minGraphSize = null;
  28674. }
  28675. /**
  28676. * @function SuperMap.ThemeGraphSize.fromObj
  28677. * @description 从传入对象获统计专题图符号尺寸类。
  28678. * @param {Object} obj - 传入对象。
  28679. * @returns {SuperMap.ThemeGraphSize} ThemeGraphSize 对象。
  28680. */
  28681. }], [{
  28682. key: "fromObj",
  28683. value: function fromObj(obj) {
  28684. var res = new ThemeGraphSize();
  28685. Util.copy(res, obj);
  28686. return res;
  28687. }
  28688. }]);
  28689. return ThemeGraphSize;
  28690. }();
  28691. SuperMap.ThemeGraphSize = ThemeGraphSize;
  28692. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphText.js
  28693. function ThemeGraphText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28694. 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); } }
  28695. function ThemeGraphText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphText_defineProperties(Constructor, staticProps); return Constructor; }
  28696. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28697. * This program are made available under the terms of the Apache License, Version 2.0
  28698. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28699. /**
  28700. * @class SuperMap.ThemeGraphText
  28701. * @category iServer Map Theme
  28702. * @classdesc 统计图文字标注风格类。
  28703. * @param {Object} options - 可选参数。
  28704. * @param {boolean} [options.graphTextDisplayed=false] - 是否显示统计图上的文字标注。
  28705. * @param {SuperMap.ThemeGraphTextFormat} [options.graphTextFormat=SuperMap.ThemeGraphTextFormat.CAPTION] - 统计专题图文本显示格式。
  28706. * @param {SuperMap.ServerTextStyle} [options.graphTextStyle] - 统计图上的文字标注风格。
  28707. */
  28708. var ThemeGraphText = /*#__PURE__*/function () {
  28709. function ThemeGraphText(options) {
  28710. ThemeGraphText_classCallCheck(this, ThemeGraphText);
  28711. /**
  28712. * @member {boolean} [SuperMap.ThemeGraphText.prototype.graphTextDisplayed=false]
  28713. * @description 是否显示统计图上的文字标注。
  28714. */
  28715. this.graphTextDisplayed = false;
  28716. /**
  28717. * @member {SuperMap.ThemeGraphTextFormat} [SuperMap.ThemeGraphText.prototype.graphTextFormat=SuperMap.ThemeGraphTextFormat.CAPTION]
  28718. * @description 统计专题图文本显示格式。
  28719. * 文本显示格式包括百分数、真实数值、标题、标题+百分数、标题+真实数值。
  28720. */
  28721. this.graphTextFormat = ThemeGraphTextFormat.CAPTION;
  28722. /**
  28723. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeGraphText.prototype.graphTextStyle
  28724. * @description 统计图上的文字标注风格。
  28725. */
  28726. this.graphTextStyle = new ServerTextStyle();
  28727. if (options) {
  28728. Util.extend(this, options);
  28729. }
  28730. this.CLASS_NAME = "SuperMap.ThemeGraphText";
  28731. }
  28732. /**
  28733. * @function SuperMap.ThemeGraphText.prototype.destroy
  28734. * @description 释放资源,将引用资源的属性置空。
  28735. */
  28736. ThemeGraphText_createClass(ThemeGraphText, [{
  28737. key: "destroy",
  28738. value: function destroy() {
  28739. var me = this;
  28740. me.graphTextDisplayed = null;
  28741. me.graphTextFormat = null;
  28742. if (me.graphTextStyle) {
  28743. me.graphTextStyle.destroy();
  28744. me.graphTextStyle = null;
  28745. }
  28746. }
  28747. /**
  28748. * @function SuperMap.ThemeGraphText.fromObj
  28749. * @description 从传入对象获取统计图文字标注风格类。
  28750. * @param {Object} obj - 传入对象。
  28751. * @returns {SuperMap.ThemeGraphText} ThemeGraphText 对象。
  28752. */
  28753. }], [{
  28754. key: "fromObj",
  28755. value: function fromObj(obj) {
  28756. var res = new ThemeGraphText();
  28757. Util.copy(res, obj);
  28758. res.graphTextStyle = ServerTextStyle.fromObj(obj.graphTextStyle);
  28759. return res;
  28760. }
  28761. }]);
  28762. return ThemeGraphText;
  28763. }();
  28764. SuperMap.ThemeGraphText = ThemeGraphText;
  28765. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphItem.js
  28766. function ThemeGraphItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28767. 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); } }
  28768. function ThemeGraphItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphItem_defineProperties(Constructor, staticProps); return Constructor; }
  28769. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28770. * This program are made available under the terms of the Apache License, Version 2.0
  28771. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28772. /**
  28773. * @class SuperMap.ThemeGraphItem
  28774. * @category iServer Map Theme
  28775. * @classdesc 统计专题图子项类。
  28776. * @param {Object} options - 参数。
  28777. * @param {string} [options.caption] - 专题图子项的名称。
  28778. * @param {string} options.graphExpression - 统计专题图的专题变量。
  28779. * @param {Array.<number>} [options.memoryDoubleValues] - 内存数组方式制作专题图时的值数组。
  28780. * @param {SuperMap.ServerStyle} [options.uniformStyle] - 统计专题图子项的显示风格
  28781. */
  28782. var ThemeGraphItem = /*#__PURE__*/function () {
  28783. function ThemeGraphItem(options) {
  28784. ThemeGraphItem_classCallCheck(this, ThemeGraphItem);
  28785. /**
  28786. * @member {string} [SuperMap.ThemeGraphItem.prototype.caption]
  28787. * @description 专题图子项的名称。
  28788. */
  28789. this.caption = null;
  28790. /**
  28791. * @member {string} SuperMap.ThemeGraphItem.prototype.graphExpression
  28792. * @description 统计专题图的专题变量。专题变量可以是一个字段或字段表达式。字段必须为数值型;表达式只能为数值型的字段间的运算。
  28793. */
  28794. this.graphExpression = null;
  28795. /**
  28796. * @member {Array.<number>} [SuperMap.ThemeGraphItem.prototype.memoryDoubleValues]
  28797. * @description 内存数组方式制作专题图时的值数组。<br>
  28798. * 内存数组方式制作专题图时,只对 SmID 值在键数组({@link SuperMap.ThemeGraph.memoryKeys})中的记录制作专题图。
  28799. * 值数组的数值个数必须与键数组中数值的个数一致。 值数组中的值将代替原来的专题值来制作统计专题图。
  28800. * 比如:利用面积字段和周长字段(即有两个统计专题图子项 )作为专题变量制作统计专题图。
  28801. */
  28802. this.memoryDoubleValues = null;
  28803. /**
  28804. * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraphItem.prototype.uniformStyle]
  28805. * @description 统计专题图子项的显示风格。
  28806. * 每一个统计专题图子项都对应一种显示风格。
  28807. */
  28808. this.uniformStyle = new ServerStyle();
  28809. if (options) {
  28810. Util.extend(this, options);
  28811. }
  28812. this.CLASS_NAME = "SuperMap.ThemeGraphItem";
  28813. }
  28814. /**
  28815. * @function SuperMap.ThemeGraphItem.prototype.destroy
  28816. * @description 释放资源,将引用资源的属性置空。
  28817. */
  28818. ThemeGraphItem_createClass(ThemeGraphItem, [{
  28819. key: "destroy",
  28820. value: function destroy() {
  28821. var me = this;
  28822. me.caption = null;
  28823. me.graphExpression = null;
  28824. me.memoryDoubleValues = null;
  28825. me.uniformStyle = null;
  28826. }
  28827. /**
  28828. * @function SuperMap.ThemeGraphItem.fromObj
  28829. * @description 从传入对象获取统计专题图子项类。
  28830. * @param {Object} obj - 传入对象。
  28831. * @returns {SuperMap.ThemeGraphItem} ThemeGraphItem 对象。
  28832. */
  28833. }], [{
  28834. key: "fromObj",
  28835. value: function fromObj(obj) {
  28836. if (!obj) {
  28837. return;
  28838. }
  28839. var res = new ThemeGraphItem();
  28840. Util.copy(res, obj);
  28841. res.uniformStyle = ServerStyle.fromJson(obj.uniformStyle);
  28842. return res;
  28843. }
  28844. }]);
  28845. return ThemeGraphItem;
  28846. }();
  28847. SuperMap.ThemeGraphItem = ThemeGraphItem;
  28848. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraph.js
  28849. function ThemeGraph_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeGraph_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeGraph_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeGraph_typeof(obj); }
  28850. function ThemeGraph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28851. 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); } }
  28852. function ThemeGraph_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraph_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraph_defineProperties(Constructor, staticProps); return Constructor; }
  28853. function ThemeGraph_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGraph_get = Reflect.get; } else { ThemeGraph_get = function _get(target, property, receiver) { var base = ThemeGraph_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ThemeGraph_get(target, property, receiver || target); }
  28854. function ThemeGraph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraph_getPrototypeOf(object); if (object === null) break; } return object; }
  28855. function ThemeGraph_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThemeGraph_setPrototypeOf(subClass, superClass); }
  28856. function ThemeGraph_setPrototypeOf(o, p) { ThemeGraph_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraph_setPrototypeOf(o, p); }
  28857. 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); }; }
  28858. function ThemeGraph_possibleConstructorReturn(self, call) { if (call && (ThemeGraph_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGraph_assertThisInitialized(self); }
  28859. function ThemeGraph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28860. function ThemeGraph_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  28861. function ThemeGraph_getPrototypeOf(o) { ThemeGraph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraph_getPrototypeOf(o); }
  28862. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28863. * This program are made available under the terms of the Apache License, Version 2.0
  28864. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28865. /**
  28866. * @class SuperMap.ThemeGraph
  28867. * @category iServer Map Theme
  28868. * @classdesc 统计专题图类。
  28869. * @extends {SuperMap.Theme}
  28870. * @param {Object} options - 参数。
  28871. * @param {Array.<SuperMap.ThemeGraphItem>} options.items - 统计专题图子项集合。
  28872. * @param {number} [options.barWidth=0] - 柱状专题图中每一个柱的宽度。
  28873. * @param {SuperMap.ThemeFlow} [options.flow] - 统计专题图流动显示与牵引线设置。
  28874. * @param {SuperMap.GraduatedMode} [options.graduatedMode=SuperMap.GraduatedMode.CONSTANT] - 统计图中地理要素的值与图表尺寸间的映射关系。
  28875. * @param {SuperMap.ThemeGraphAxes} [options.graphAxes] - 统计图中坐标轴样式相关信息。
  28876. * @param {SuperMap.ThemeGraphSize} [options.graphSize=0] - 统计符号的最大最小尺寸。
  28877. * @param {boolean} [options.graphSizeFixed=false] - 缩放地图时统计图符号是否固定大小。
  28878. * @param {SuperMap.ThemeGraphText} [options.graphText] - 统计图上的文字是否可以见以及文字标注风格。
  28879. * @param {SuperMap.GraphAxesTextDisplayMode} [options.graphAxesTextDisplayMode=SuperMap.GraphAxesTextDisplayMode.NONE] - 统计专题图坐标轴文本显示模式。
  28880. * @param {SuperMap.ThemeGraphType} [options.graphType=SuperMap.ThemeGraphType.AREA] - 统计专题图类型。
  28881. * @param {Array.<number>} [options.memoryKeys] - 以内存数组方式制作专题图时的键数组。
  28882. * @param {boolean} [options.negativeDisplayed=false] - 专题图中是否显示属性为负值的数据。
  28883. * @param {SuperMap.ThemeOffset} [options.offset] - 统计图相对于要素内点的偏移量。
  28884. * @param {boolean} [options.overlapAvoided=true] - 统计图是否采用避让方式显示。
  28885. * @param {number} [options.roseAngle=0] - 统计图中玫瑰图或三维玫瑰图用于等分的角度。
  28886. * @param {number} [options.startAngle=0] - 饼状统计图扇形的起始角度。
  28887. */
  28888. var ThemeGraph = /*#__PURE__*/function (_Theme) {
  28889. ThemeGraph_inherits(ThemeGraph, _Theme);
  28890. var _super = ThemeGraph_createSuper(ThemeGraph);
  28891. function ThemeGraph(options) {
  28892. var _this;
  28893. ThemeGraph_classCallCheck(this, ThemeGraph);
  28894. _this = _super.call(this, "GRAPH", options);
  28895. /**
  28896. * @member {number} [SuperMap.ThemeGraph.prototype.barWidth=0]
  28897. * @description 柱状专题图中每一个柱的宽度。使用地图坐标单位。
  28898. * 只有选择的统计图类型为柱状图(柱状图、三维柱状图、堆叠柱状图、三维堆叠柱状图)时,此项才可设置。
  28899. */
  28900. _this.barWidth = 0;
  28901. /**
  28902. * @member {SuperMap.ThemeFlow} SuperMap.ThemeGraph.prototype.flow
  28903. * @description 统计专题图流动显示与牵引线设置。
  28904. * 通过该字段可以设置统计符号是否流动显示和牵引线风格。
  28905. */
  28906. _this.flow = new ThemeFlow();
  28907. /**
  28908. * @member {SuperMap.GraduatedMode} [SuperMap.ThemeGraph.prototype.graduatedMode=SuperMap.GraduatedMode.CONSTANT]
  28909. * @description 统计图中地理要素的值与图表尺寸间的映射关系(常数、对数、平方根),即分级方式。
  28910. * 分级主要是为了减少制作统计专题图中数据大小之间的差异,使得统计图的视觉效果比较好,同时不同类别之间的比较也还是有意义的。
  28911. * 提供三种分级模式:常数、对数和平方根,对于有值为负数的字段,不可以采用对数和平方根的分级方式。不同的等级方式用于确定符号大小的数值是不相同的。
  28912. */
  28913. _this.graduatedMode = GraduatedMode.CONSTANT;
  28914. /**
  28915. * @member {SuperMap.ThemeGraphAxes} SuperMap.ThemeGraph.prototype.graphAxes
  28916. * @description 用于设置统计图中坐标轴样式相关信息,如坐标轴颜色、是否显示、坐标文本样式等。
  28917. */
  28918. _this.graphAxes = new ThemeGraphAxes();
  28919. /**
  28920. * @member {SuperMap.ThemeGraphSize} [SuperMap.ThemeGraph.prototype.graphSize=0]
  28921. * @description 用于设置统计符号的最大最小尺寸。
  28922. */
  28923. _this.graphSize = new ThemeGraphSize();
  28924. /**
  28925. * @member {boolean} [SuperMap.ThemeGraph.prototype.graphSizeFixed=false]
  28926. * @description 缩放地图时统计图符号是否固定大小。即统计图符号将随地图缩放。
  28927. */
  28928. _this.graphSizeFixed = false;
  28929. /**
  28930. * @member {SuperMap.ThemeGraphText} SuperMap.ThemeGraph.prototype.graphText
  28931. * @description 统计图上的文字是否可以见以及文字标注风格。
  28932. */
  28933. _this.graphText = new ThemeGraphText();
  28934. /**
  28935. * @member {SuperMap.ThemeGraphType} [SuperMap.ThemeGraph.prototype.graphType=SuperMap.ThemeGraphType.AREA]
  28936. * @description 统计专题图类型。SuperMap 提供了多种类型的统计图,
  28937. * 分别为面积图、阶梯图、折线图、点状图、柱状图、三维柱状图、饼图、三维饼图、玫瑰图、三维玫瑰图、堆叠柱状图、三维堆叠柱状图、环状图。默认为面积图。
  28938. */
  28939. _this.graphType = ThemeGraphType.AREA;
  28940. /**
  28941. * @member {SuperMap.GraphAxesTextDisplayMode} [SuperMap.ThemeGraph.prototype.graphAxesTextDisplayMode=SuperMap.GraphAxesTextDisplayMode.NONE]
  28942. * @description 统计专题图坐标轴文本显示模式。
  28943. */
  28944. _this.graphAxesTextDisplayMode = GraphAxesTextDisplayMode.NONE;
  28945. /**
  28946. * @member {Array.<SuperMap.ThemeGraphItem>} SuperMap.ThemeGraph.prototype.items
  28947. * @description 统计专题图子项集合。
  28948. * 统计专题图可以基于多个变量,反映多种属性,即可以将多个专题变量的值绘制在一个统计图上。每一个专题变量对应的统计图即为一个专题图子项。
  28949. * 对于每个专题图子项可以为其设置标题、风格,甚至可以将该子项再制作成范围分段专题图。
  28950. */
  28951. _this.items = null;
  28952. /**
  28953. * @member {Array.<number>} SuperMap.ThemeGraph.prototype.memoryKeys
  28954. * @description 以内存数组方式制作专题图时的键数组。
  28955. * 键数组内的数值代表 SmID 值,它与 SuperMap.ThemeGraphItem 类中的值数组(SuperMap.ThemeGraphItem.memoryDoubleValues)要关联起来应用。
  28956. * 键数组中数值的个数必须要与值数组的数值个数一致。值数组中的值将代替原来的专题值来制作统计专题图。
  28957. * 目前所有的专题图都支持以内存数组的方式制作专题图,但统计专题图与其他专题图指定内存数组的方式不同,
  28958. * 统计专题图使用 memoryKeys 指定内存数组,而其他专题图则使用 memoryData 来指定内存数组。
  28959. * @example
  28960. * memoryKeys 的使用方法如下:
  28961. * function addThemeGraph() {
  28962. * removeTheme();
  28963. * //创建统计专题图对象,SuperMap.ThemeGraph 必设 items。
  28964. * //专题图参数 ThemeParameters 必设 theme(即以设置好的分段专题图对象)、dataSourceName 和 datasetName
  28965. * var style1 = new SuperMap.ServerStyle({
  28966. * fillForeColor: new SuperMap.ServerColor(92,73,234),
  28967. * lineWidth: 0.1
  28968. * }),
  28969. * style2 = new SuperMap.ServerStyle({
  28970. * fillForeColor: new SuperMap.ServerColor(211,111,240),
  28971. * lineWidth: 0.1
  28972. * }),
  28973. * item1 = new SuperMap.ThemeGraphItem({
  28974. * memoryDoubleValues:[1.18,0.95,0.37,1.31,0.8,1.5],
  28975. * caption: "1992-1995人口增长率",
  28976. * graphExpression: "Pop_Rate95",
  28977. * uniformStyle: style1
  28978. * }),
  28979. * item2 = new SuperMap.ThemeGraphItem({
  28980. * //以内存数组方式制作专题图时的值数组
  28981. * memoryDoubleValues:[2.71,0,0.74,3.1,2.2,3.5],
  28982. * caption: "1995-1999人口增长率", //专题图子项的名称
  28983. * graphExpression: "Pop_Rate99", //统计专题图的专题变量
  28984. * uniformStyle: style2 //统计专题图子项的显示风格
  28985. * }),
  28986. * themeGraph = new SuperMap.ThemeGraph({
  28987. * //以内存数组方式制作专题图时的键数组,键数组内的数值代表 SmID 值
  28988. * memoryKeys:[1,2,4,8,10,12],
  28989. * items: new Array(item1,item2),
  28990. * barWidth: 0.03,
  28991. * //统计图中地理要素的值与图表尺寸间的映射关系为平方根
  28992. * graduatedMode: SuperMap.GraduatedMode.SQUAREROOT,
  28993. * //graphAxes用于设置统计图中坐标轴样式相关信息
  28994. * graphAxes: new SuperMap.ThemeGraphAxes({
  28995. * axesDisplayed: true
  28996. * }),
  28997. * graphSize: new SuperMap.ThemeGraphSize({
  28998. * maxGraphSize: 1,
  28999. * minGraphSize: 0.35
  29000. * }),
  29001. * //统计图上的文字是否可以见以及文字标注风格
  29002. * graphText: new SuperMap.ThemeGraphText({
  29003. * graphTextDisplayed: true,
  29004. * graphTextFormat: SuperMap.ThemeGraphTextFormat.VALUE,
  29005. * graphTextStyle: new SuperMap.ServerTextStyle({
  29006. * sizeFixed: true,
  29007. * fontHeight: 9,
  29008. * fontWidth: 5
  29009. * })
  29010. * }),
  29011. * //统计专题图类型为三维柱状图
  29012. * graphType: SuperMap.ThemeGraphType.BAR3D
  29013. * }),
  29014. * //专题图参数对象
  29015. * themeParameters = new SuperMap.ThemeParameters({
  29016. * themes: [themeGraph],
  29017. * dataSourceNames: ["Jingjin"],
  29018. * datasetNames: ["BaseMap_R"]
  29019. * }),
  29020. * //与服务端交互
  29021. * themeService=new SuperMap.ThemeService(url, {
  29022. * eventListeners: {
  29023. * "processCompleted": ThemeCompleted,
  29024. * "processFailed": themeFailed
  29025. * }
  29026. * });
  29027. * themeService.processAsync(themeParameters);
  29028. * }
  29029. */
  29030. _this.memoryKeys = null;
  29031. /**
  29032. * @member {boolean} [SuperMap.ThemeGraph.prototype.negativeDisplayed=false]
  29033. * @description 专题图中是否显示属性为负值的数据。true 表示显示;falese 不显示。
  29034. */
  29035. _this.negativeDisplayed = false;
  29036. /**
  29037. * @member {SuperMap.ThemeOffset} SuperMap.ThemeGraph.prototype.offset
  29038. * @description 用于设置统计图相对于要素内点的偏移量。
  29039. */
  29040. _this.offset = new ThemeOffset();
  29041. /**
  29042. * @member {boolean} SuperMap.ThemeGraph.prototype.overlapAvoided
  29043. * @description 统计图是否采用避让方式显示。<br>
  29044. * 1.对数据集制作统计专题图:当统计图采用避让方式显示时,如果 overlapAvoided 为 true,则在统计图重叠度很大的情况下,
  29045. * 会出现无法完全避免统计图重叠的现象;如果 overlapAvoided 为 false,会过滤掉一些统计图,从而保证所有的统计图均不重叠。<br>
  29046. * 2.对数据集同时制作统计专题图和标签专题图:当统计图不显示子项文本时,标签专题图的标签即使和统计图重叠,两者也都可正常显示;
  29047. * 当统计图显示子项文本时,如果统计图中的子项文本和标签专题图中的标签不重叠,则两者均正常显示;如果重叠,则会过滤掉统计图的子项文本,只显示标签。
  29048. */
  29049. _this.overlapAvoided = true;
  29050. /**
  29051. * @member {number} [SuperMap.ThemeGraph.prototype.roseAngle=0]
  29052. * @description 统计图中玫瑰图或三维玫瑰图用于等分的角度,默认为 0 度,精确到 0.1 度。在角度为0或者大于 360 度的情况下均使用 360 度来等分制作统计图的字段数。
  29053. */
  29054. _this.roseAngle = 0;
  29055. /**
  29056. * @member {number} [SuperMap.ThemeGraph.prototype.startAngle=0]
  29057. * @description 饼状统计图扇形的起始角度。精确到 0.1 度,以水平方向为正向。只有选择的统计图类型为饼状图(饼图、三维饼图、玫瑰图、三维玫瑰图)时,此项才可设置。
  29058. */
  29059. _this.startAngle = 0;
  29060. if (options) {
  29061. Util.extend(ThemeGraph_assertThisInitialized(_this), options);
  29062. }
  29063. _this.CLASS_NAME = "SuperMap.ThemeGraph";
  29064. return _this;
  29065. }
  29066. /**
  29067. * @function SuperMap.ThemeGraph.prototype.destroy
  29068. * @override
  29069. */
  29070. ThemeGraph_createClass(ThemeGraph, [{
  29071. key: "destroy",
  29072. value: function destroy() {
  29073. ThemeGraph_get(ThemeGraph_getPrototypeOf(ThemeGraph.prototype), "destroy", this).call(this);
  29074. var me = this;
  29075. me.barWidth = null;
  29076. if (me.flow) {
  29077. me.flow.destroy();
  29078. me.flow = null;
  29079. }
  29080. me.graduatedMode = null;
  29081. if (me.graphAxes) {
  29082. me.graphAxes.destroy();
  29083. me.graphAxes = null;
  29084. }
  29085. if (me.graphSize) {
  29086. me.graphSize.destroy();
  29087. me.graphSize = null;
  29088. }
  29089. me.graphSizeFixed = null;
  29090. if (me.graphText) {
  29091. me.graphText.destroy();
  29092. me.graphText = null;
  29093. }
  29094. me.graphType = null;
  29095. if (me.items) {
  29096. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  29097. items[i].destroy();
  29098. }
  29099. me.items = null;
  29100. }
  29101. me.memoryKeys = null;
  29102. me.negativeDisplayed = null;
  29103. if (me.offset) {
  29104. me.offset.destroy();
  29105. me.offset = null;
  29106. }
  29107. me.overlapAvoided = null;
  29108. me.roseAngle = null;
  29109. me.startAngle = null;
  29110. me.graphAxesTextDisplayMode = null;
  29111. }
  29112. /**
  29113. * @function SuperMap.ThemeGraph.prototype.toJSON
  29114. * @description 将 SuperMap.ThemeGraph 对象转化为 JSON 字符串。
  29115. * @returns {string} 返回转换后的 JSON 字符串。
  29116. */
  29117. }, {
  29118. key: "toJSON",
  29119. value: function toJSON() {
  29120. return Util.toJSON(this.toServerJSONObject());
  29121. }
  29122. /**
  29123. * @function SuperMap.ThemeGraph.prototype.toServerJSONObject
  29124. * @description 转换成对应的 JSON 格式对象。
  29125. * @returns {Object} 对应的 JSON 格式对象。
  29126. */
  29127. }, {
  29128. key: "toServerJSONObject",
  29129. value: function toServerJSONObject() {
  29130. var obj = {};
  29131. obj.type = this.type;
  29132. if (this.graphText) {
  29133. obj.graphTextDisplayed = this.graphText.graphTextDisplayed;
  29134. obj.graphTextFormat = this.graphText.graphTextFormat;
  29135. obj.graphTextStyle = this.graphText.graphTextStyle;
  29136. }
  29137. if (this.flow) {
  29138. obj.flowEnabled = this.flow.flowEnabled;
  29139. obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
  29140. obj.leaderLineStyle = this.flow.leaderLineStyle;
  29141. }
  29142. if (this.graphAxes) {
  29143. obj.axesColor = this.graphAxes.axesColor;
  29144. obj.axesDisplayed = this.graphAxes.axesDisplayed;
  29145. obj.axesGridDisplayed = this.graphAxes.axesGridDisplayed;
  29146. obj.axesTextDisplayed = this.graphAxes.axesTextDisplayed;
  29147. obj.axesTextStyle = this.graphAxes.axesTextStyle;
  29148. }
  29149. if (this.graphSize) {
  29150. obj.maxGraphSize = this.graphSize.maxGraphSize;
  29151. obj.minGraphSize = this.graphSize.minGraphSize;
  29152. }
  29153. if (this.offset) {
  29154. obj.offsetFixed = this.offset.offsetFixed;
  29155. obj.offsetX = this.offset.offsetX;
  29156. obj.offsetY = this.offset.offsetY;
  29157. }
  29158. obj.barWidth = this.barWidth;
  29159. obj.graduatedMode = this.graduatedMode;
  29160. obj.graphSizeFixed = this.graphSizeFixed;
  29161. obj.graphType = this.graphType;
  29162. obj.graphAxesTextDisplayMode = this.graphAxesTextDisplayMode;
  29163. obj.items = this.items;
  29164. obj.memoryKeys = this.memoryKeys;
  29165. obj.negativeDisplayed = this.negativeDisplayed;
  29166. obj.overlapAvoided = this.overlapAvoided;
  29167. obj.roseAngle = this.roseAngle;
  29168. obj.startAngle = this.startAngle;
  29169. return obj;
  29170. }
  29171. /**
  29172. * @function SuperMap.ThemeGraph.fromObj
  29173. * @description 从传入对象获取统计专题图类。
  29174. * @param {Object} obj - 传入对象。
  29175. * @returns {SuperMap.ThemeGraph} ThemeGraph 对象。
  29176. */
  29177. }], [{
  29178. key: "fromObj",
  29179. value: function fromObj(obj) {
  29180. var res = new ThemeGraph();
  29181. var itemsG = obj.items;
  29182. var len = itemsG ? itemsG.length : 0;
  29183. Util.copy(res, obj);
  29184. res.items = [];
  29185. res.flow = ThemeFlow.fromObj(obj);
  29186. res.graphAxes = ThemeGraphAxes.fromObj(obj);
  29187. res.graphSize = ThemeGraphSize.fromObj(obj);
  29188. res.graphText = ThemeGraphText.fromObj(obj);
  29189. res.offset = ThemeOffset.fromObj(obj);
  29190. for (var i = 0; i < len; i++) {
  29191. res.items.push(ThemeGraphItem.fromObj(itemsG[i]));
  29192. }
  29193. return res;
  29194. }
  29195. }]);
  29196. return ThemeGraph;
  29197. }(Theme);
  29198. SuperMap.ThemeGraph = ThemeGraph;
  29199. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeDotDensity.js
  29200. function ThemeDotDensity_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeDotDensity_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeDotDensity_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeDotDensity_typeof(obj); }
  29201. function ThemeDotDensity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29202. 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); } }
  29203. function ThemeDotDensity_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeDotDensity_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeDotDensity_defineProperties(Constructor, staticProps); return Constructor; }
  29204. function ThemeDotDensity_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThemeDotDensity_setPrototypeOf(subClass, superClass); }
  29205. function ThemeDotDensity_setPrototypeOf(o, p) { ThemeDotDensity_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeDotDensity_setPrototypeOf(o, p); }
  29206. 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); }; }
  29207. function ThemeDotDensity_possibleConstructorReturn(self, call) { if (call && (ThemeDotDensity_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeDotDensity_assertThisInitialized(self); }
  29208. function ThemeDotDensity_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29209. function ThemeDotDensity_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  29210. function ThemeDotDensity_getPrototypeOf(o) { ThemeDotDensity_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeDotDensity_getPrototypeOf(o); }
  29211. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29212. * This program are made available under the terms of the Apache License, Version 2.0
  29213. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29214. /**
  29215. * @class SuperMap.ThemeDotDensity
  29216. * @category iServer Map Theme
  29217. * @classdesc 点密度专题图。
  29218. * @description 点密度专题图用一定大小、形状相同的点表示现象分布范围、数量特征和分布密度。点的多少和所代表的意义由地图的内容确定。
  29219. * 点密度专题图利用图层的某一数值属性信息(专题值)映射为不同等级,每一级别使用不同数量或表现为密度的点符号来表示。
  29220. * 该专题值在各个分区内的分布情况,体现不同区域的相对数量差异。多用于具有数量特征的地图上,
  29221. * 比如表示不同地区的粮食产量、GDP、人口等的分级,主要针对区域或面状的要素,因而,点密度专题图适用于面数据集。
  29222. * 注意:点密度专题图中点的分布是随机的,并不代表实际的分布位置。即使在相关设置完全相同的情况下,
  29223. * 每次制作出的专题图,点的数量相同,但点的位置都有差异。
  29224. * @extends {SuperMap.Theme}
  29225. * @param {Object} options - 参数。
  29226. * @param {string} options.dotExpression - 创建点密度专题图的字段或字段表达式。
  29227. * @param {SuperMap.ServerStyle} [options.style] - 点密度专题图中点的风格。
  29228. * @param {number} [options.value] - 专题图中每一个点所代表的数值。
  29229. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  29230. */
  29231. var ThemeDotDensity = /*#__PURE__*/function (_Theme) {
  29232. ThemeDotDensity_inherits(ThemeDotDensity, _Theme);
  29233. var _super = ThemeDotDensity_createSuper(ThemeDotDensity);
  29234. function ThemeDotDensity(options) {
  29235. var _this;
  29236. ThemeDotDensity_classCallCheck(this, ThemeDotDensity);
  29237. _this = _super.call(this, "DOTDENSITY", options);
  29238. /**
  29239. * @member {string} SuperMap.ThemeDotDensity.prototype.dotExpression
  29240. * @description 创建点密度专题图的字段或字段表达式。点的数目或密集程度的来源。
  29241. */
  29242. _this.dotExpression = null;
  29243. /**
  29244. * @member {SuperMap.ServerStyle} SuperMap.ThemeDotDensity.prototype.style
  29245. * @description 点密度专题图中点的风格。
  29246. */
  29247. _this.style = new ServerStyle();
  29248. /**
  29249. * @member {number} SuperMap.ThemeDotDensity.prototype.value
  29250. * @description 专题图中每一个点所代表的数值。<br>
  29251. * 点值的确定与地图比例尺以及点的大小有关。地图比例尺越大,相应的图面范围也越大,
  29252. * 点相应就可以越多,此时点值就可以设置相对小一些。点形状越大,
  29253. * 点值相应就应该设置的小一些。点值过大或过小都是不合适的。
  29254. */
  29255. _this.value = null;
  29256. if (options) {
  29257. Util.extend(ThemeDotDensity_assertThisInitialized(_this), options);
  29258. }
  29259. _this.CLASS_NAME = "SuperMap.ThemeDotDensity";
  29260. return _this;
  29261. }
  29262. /**
  29263. * @function SuperMap.ThemeDotDensity.prototype.destroy
  29264. * @description 释放资源,将引用资源的属性置空。
  29265. */
  29266. ThemeDotDensity_createClass(ThemeDotDensity, [{
  29267. key: "destroy",
  29268. value: function destroy() {
  29269. var me = this;
  29270. me.dotExpression = null;
  29271. me.value = null;
  29272. if (me.style) {
  29273. me.style.destroy();
  29274. me.style = null;
  29275. }
  29276. }
  29277. /**
  29278. * @function SuperMap.ThemeDotDensity.prototype.toServerJSONObject
  29279. * @description 转换成对应的 JSON 格式对象。
  29280. * @returns {Object} 对应的 JSON 格式对象。
  29281. */
  29282. }, {
  29283. key: "toServerJSONObject",
  29284. value: function toServerJSONObject() {
  29285. var obj = {};
  29286. obj = Util.copyAttributes(obj, this);
  29287. if (obj.style) {
  29288. if (obj.style.toServerJSONObject) {
  29289. obj.style = obj.style.toServerJSONObject();
  29290. }
  29291. }
  29292. return obj;
  29293. }
  29294. /**
  29295. * @function SuperMap.ThemeDotDensity.fromObj
  29296. * @description 从传入对象获取点密度专题图中点的风格。
  29297. * @param {Object} obj - 传入对象。
  29298. * @returns {SuperMap.ThemeDotDensity} ThemeDotDensity 对象。
  29299. */
  29300. }], [{
  29301. key: "fromObj",
  29302. value: function fromObj(obj) {
  29303. if (!obj) {
  29304. return;
  29305. }
  29306. var res = new ThemeDotDensity();
  29307. Util.copy(res, obj);
  29308. res.style = ServerStyle.fromJson(obj.style);
  29309. return res;
  29310. }
  29311. }]);
  29312. return ThemeDotDensity;
  29313. }(Theme);
  29314. SuperMap.ThemeDotDensity = ThemeDotDensity;
  29315. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbolStyle.js
  29316. function ThemeGraduatedSymbolStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29317. 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); } }
  29318. function ThemeGraduatedSymbolStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor, staticProps); return Constructor; }
  29319. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29320. * This program are made available under the terms of the Apache License, Version 2.0
  29321. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29322. /**
  29323. * @class SuperMap.ThemeGraduatedSymbolStyle
  29324. * @category iServer Map Theme
  29325. * @classdesc 等级符号专题图正负零值显示风格类。
  29326. * @param {Object} options - 参数。
  29327. * @param {boolean} [options.negativeDisplayed=false] - 是否显示负值。
  29328. * @param {SuperMap.ServerStyle} [options.negativeStyle] - 负值的等级符号风格。
  29329. * @param {SuperMap.ServerStyle} [options.positiveStyle] - 正值的等级符号风格。
  29330. * @param {boolean} [options.zeroDisplayed=false] - 是否显示 0 值。
  29331. * @param {SuperMap.ServerStyle} [options.zeroStyle] - 0 值的等级符号风格。
  29332. */
  29333. var ThemeGraduatedSymbolStyle = /*#__PURE__*/function () {
  29334. function ThemeGraduatedSymbolStyle(options) {
  29335. ThemeGraduatedSymbolStyle_classCallCheck(this, ThemeGraduatedSymbolStyle);
  29336. /**
  29337. * @member {boolean} [SuperMap.ThemeGraduatedSymbolStyle.prototype.negativeDisplayed=false]
  29338. * @description 是否显示负值。
  29339. */
  29340. this.negativeDisplayed = false;
  29341. /**
  29342. * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraduatedSymbolStyle.prototype.negativeStyle]
  29343. * @description 负值的等级符号风格。
  29344. */
  29345. this.negativeStyle = new ServerStyle();
  29346. /**
  29347. * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraduatedSymbolStyle.prototype.positiveStyle]
  29348. * @description 正值的等级符号风格。
  29349. */
  29350. this.positiveStyle = new ServerStyle();
  29351. /**
  29352. * @member {boolean} [SuperMap.ThemeGraduatedSymbolStyle.prototype.zeroDisplayed=false]
  29353. * @description 是否显示 0 值。
  29354. */
  29355. this.zeroDisplayed = false;
  29356. /**
  29357. * @member {SuperMap.ServerStyle} SuperMap.ThemeGraduatedSymbolStyle.prototype.zeroStyle
  29358. * @description 0 值的等级符号风格。
  29359. */
  29360. this.zeroStyle = new ServerStyle();
  29361. if (options) {
  29362. Util.extend(this, options);
  29363. }
  29364. this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbolStyle";
  29365. }
  29366. /**
  29367. * @function SuperMap.ThemeGraduatedSymbolStyle.prototype.destroy
  29368. * @description 释放资源,将引用资源的属性置空。
  29369. */
  29370. ThemeGraduatedSymbolStyle_createClass(ThemeGraduatedSymbolStyle, [{
  29371. key: "destroy",
  29372. value: function destroy() {
  29373. var me = this;
  29374. me.negativeDisplayed = null;
  29375. me.negativeStyle = null;
  29376. me.positiveStyle = null;
  29377. me.zeroDisplayed = null;
  29378. me.zeroStyle = null;
  29379. }
  29380. /**
  29381. * @function SuperMap.ThemeGraduatedSymbolStyle.fromObj
  29382. * @description 从传入对象获取等级符号专题图正负零值显示风格类。
  29383. * @param {Object} obj - 传入对象。
  29384. * @returns {SuperMap.ThemeGraduatedSymbolStyle} ThemeGraduatedSymbolStyle 对象。
  29385. */
  29386. }], [{
  29387. key: "fromObj",
  29388. value: function fromObj(obj) {
  29389. if (!obj) {
  29390. return;
  29391. }
  29392. var res = new ThemeGraduatedSymbolStyle();
  29393. Util.copy(res, obj);
  29394. res.negativeStyle = ServerStyle.fromJson(obj.negativeStyle);
  29395. res.positiveStyle = ServerStyle.fromJson(obj.positiveStyle);
  29396. res.zeroStyle = ServerStyle.fromJson(obj.zeroStyle);
  29397. return res;
  29398. }
  29399. }]);
  29400. return ThemeGraduatedSymbolStyle;
  29401. }();
  29402. SuperMap.ThemeGraduatedSymbolStyle = ThemeGraduatedSymbolStyle;
  29403. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbol.js
  29404. function ThemeGraduatedSymbol_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeGraduatedSymbol_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeGraduatedSymbol_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeGraduatedSymbol_typeof(obj); }
  29405. function ThemeGraduatedSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29406. 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); } }
  29407. function ThemeGraduatedSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbol_defineProperties(Constructor, staticProps); return Constructor; }
  29408. function ThemeGraduatedSymbol_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGraduatedSymbol_get = Reflect.get; } else { ThemeGraduatedSymbol_get = function _get(target, property, receiver) { var base = ThemeGraduatedSymbol_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ThemeGraduatedSymbol_get(target, property, receiver || target); }
  29409. function ThemeGraduatedSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraduatedSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  29410. function ThemeGraduatedSymbol_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThemeGraduatedSymbol_setPrototypeOf(subClass, superClass); }
  29411. function ThemeGraduatedSymbol_setPrototypeOf(o, p) { ThemeGraduatedSymbol_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraduatedSymbol_setPrototypeOf(o, p); }
  29412. 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); }; }
  29413. function ThemeGraduatedSymbol_possibleConstructorReturn(self, call) { if (call && (ThemeGraduatedSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGraduatedSymbol_assertThisInitialized(self); }
  29414. function ThemeGraduatedSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29415. function ThemeGraduatedSymbol_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  29416. function ThemeGraduatedSymbol_getPrototypeOf(o) { ThemeGraduatedSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraduatedSymbol_getPrototypeOf(o); }
  29417. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29418. * This program are made available under the terms of the Apache License, Version 2.0
  29419. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29420. /**
  29421. * @class SuperMap.ThemeGraduatedSymbol
  29422. * @category iServer Map Theme
  29423. * @classdesc 等级符号专题图。
  29424. * @extends {SuperMap.Theme}
  29425. * @param {Object} options - 参数。
  29426. * @param {SuperMap.ThemeGraduatedSymbolStyle} options.style - 用于设置等级符号图正负和零值显示风格。
  29427. * @param {string} options.expression - 等级符号专题图的字段或字段表达式。
  29428. * @param {number} [options.baseValue=0] - 等级符号专题图的基准值,单位同专题变量的单位。
  29429. * @param {SuperMap.ThemeFlow} [options.flow] - 等级符号专题图符号流动显示与牵引线设置类。
  29430. * @param {SuperMap.GraduatedMode} [options.graduatedMode=SuperMap.GraduatedMode.CONSTANT] - 等级符号专题图分级模式。
  29431. * @param {SuperMap.ThemeOffset} [options.offset] - 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  29432. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  29433. */
  29434. var ThemeGraduatedSymbol = /*#__PURE__*/function (_Theme) {
  29435. ThemeGraduatedSymbol_inherits(ThemeGraduatedSymbol, _Theme);
  29436. var _super = ThemeGraduatedSymbol_createSuper(ThemeGraduatedSymbol);
  29437. function ThemeGraduatedSymbol(options) {
  29438. var _this;
  29439. ThemeGraduatedSymbol_classCallCheck(this, ThemeGraduatedSymbol);
  29440. _this = _super.call(this, "GRADUATEDSYMBOL", options);
  29441. /**
  29442. * @member {number} [SuperMap.ThemeGraduatedSymbol.prototype.baseValue=0]
  29443. * @description 等级符号专题图的基准值,单位同专题变量的单位。<br>
  29444. * 依据此值系统会自动根据分级方式计算其余值对应的符号大小,每个符号的显示大小等于
  29445. * ThemeValueSection.positiveStyle(或 zeroStyle,negativeStyle).markerSize * value / basevalue,
  29446. * 其中 value 是 expression 所指定字段对应的值经过分级计算之后的值。默认值为0,建议通过多次尝试设置该值才能达到较好的显示效果。
  29447. */
  29448. _this.baseValue = 0;
  29449. /**
  29450. * @member {string} SuperMap.ThemeGraduatedSymbol.prototype.expression
  29451. * @description 用于创建等级符号专题图的字段或字段表达式,字段或字段表达式应为数值型。
  29452. */
  29453. _this.expression = null;
  29454. /**
  29455. * @member {SuperMap.ThemeFlow} SuperMap.ThemeGraduatedSymbol.prototype.flow
  29456. * @description 等级符号专题图符号流动显示与牵引线设置类。<br>
  29457. * 通过该字段可以设置等级符号是否流动显示和牵引线风格。
  29458. */
  29459. _this.flow = new ThemeFlow();
  29460. /**
  29461. * @member {SuperMap.GraduatedMode} [SuperMap.ThemeGraduatedSymbol.prototype.graduatedMode=SuperMap.GraduatedMode.CONSTANT]
  29462. * @description 等级符号专题图分级模式。<br>
  29463. * 分级主要是为了减少制作等级符号专题图中数据大小之间的差异。如果数据之间差距较大,则可以采用对数或者平方根的分级方式来进行,
  29464. * 这样就减少了数据之间的绝对大小的差异,使得等级符号图的视觉效果比较好,同时不同类别之间的比较也是有意义的。
  29465. * 有三种分级模式:常数、对数和平方根,对于有值为负数的字段,在用对数或平方根方式分级时,默认对负数取正。
  29466. * 不同的分级模式用于确定符号大小的数值是不相同的:常数按照字段的原始数据进行;对数则是对每条记录对应的专题变量取自然对数;
  29467. * 平方根则是对其取平方根,然后用最终得到的结果来确定其等级符号的大小。
  29468. */
  29469. _this.graduatedMode = SuperMap.GraduatedMode.CONSTAN;
  29470. /**
  29471. * @member {SuperMap.ThemeOffset} [SuperMap.ThemeGraduatedSymbol.prototype.offset]
  29472. * @description 用于设置等级符号图相对于要素内点的偏移量。
  29473. */
  29474. _this.offset = new ThemeOffset();
  29475. /**
  29476. * @member {SuperMap.ThemeGraduatedSymbolStyle} SuperMap.ThemeGraduatedSymbol.prototype.style
  29477. * @description 用于设置等级符号图正负和零值显示风格。
  29478. */
  29479. _this.style = new ThemeGraduatedSymbolStyle();
  29480. if (options) {
  29481. Util.extend(ThemeGraduatedSymbol_assertThisInitialized(_this), options);
  29482. }
  29483. _this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbol";
  29484. return _this;
  29485. }
  29486. /**
  29487. * @function SuperMap.ThemeGraduatedSymbol.prototype.destroy
  29488. * @description 释放资源,将引用资源的属性置空。
  29489. */
  29490. ThemeGraduatedSymbol_createClass(ThemeGraduatedSymbol, [{
  29491. key: "destroy",
  29492. value: function destroy() {
  29493. ThemeGraduatedSymbol_get(ThemeGraduatedSymbol_getPrototypeOf(ThemeGraduatedSymbol.prototype), "destroy", this).call(this);
  29494. var me = this;
  29495. me.expression = null;
  29496. if (me.flow) {
  29497. me.flow.destroy();
  29498. me.flow = null;
  29499. }
  29500. me.graduatedMode = GraduatedMode.CONSTANT;
  29501. if (me.offset) {
  29502. me.offset.destroy();
  29503. me.offset = null;
  29504. }
  29505. if (me.style) {
  29506. me.style.destroy();
  29507. me.style = null;
  29508. }
  29509. }
  29510. /**
  29511. * @function SuperMap.ThemeGraduatedSymbol.prototype.toJSON
  29512. * @description 将 themeLabel 对象转化为 JSON 字符串。
  29513. * @returns {string} 返回转换后的 JSON 字符串。
  29514. */
  29515. }, {
  29516. key: "toJSON",
  29517. value: function toJSON() {
  29518. return Util.toJSON(this.toServerJSONObject());
  29519. }
  29520. /**
  29521. * @function SuperMap.ThemeGraduatedSymbol.prototype.toServerJSONObject
  29522. * @description 转换成对应的 JSON 格式对象。
  29523. * @returns {Object} 对应的 JSON 格式对象。
  29524. */
  29525. }, {
  29526. key: "toServerJSONObject",
  29527. value: function toServerJSONObject() {
  29528. var obj = {};
  29529. obj.type = this.type;
  29530. obj.memoryData = this.memoryData;
  29531. obj.baseValue = this.baseValue;
  29532. obj.expression = this.expression;
  29533. obj.graduatedMode = this.graduatedMode;
  29534. if (this.flow) {
  29535. obj.flowEnabled = this.flow.flowEnabled;
  29536. obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
  29537. obj.leaderLineStyle = this.flow.leaderLineStyle;
  29538. }
  29539. if (this.offset) {
  29540. obj.offsetFixed = this.offset.offsetFixed;
  29541. obj.offsetX = this.offset.offsetX;
  29542. obj.offsetY = this.offset.offsetY;
  29543. }
  29544. if (this.style) {
  29545. obj.negativeStyle = this.style.negativeStyle;
  29546. obj.negativeDisplayed = this.style.negativeDisplayed;
  29547. obj.positiveStyle = this.style.positiveStyle;
  29548. obj.zeroDisplayed = this.style.zeroDisplayed;
  29549. obj.zeroStyle = this.style.zeroStyle;
  29550. }
  29551. return obj;
  29552. }
  29553. /**
  29554. * @function SuperMap.ThemeGraduatedSymbol.fromObj
  29555. * @description 从传入对象获取等级符号专题图。
  29556. * @param {Object} obj - 传入对象。
  29557. * @returns {SuperMap.ThemeGraduatedSymbol} 等级符号专题图对象。
  29558. */
  29559. }], [{
  29560. key: "fromObj",
  29561. value: function fromObj(obj) {
  29562. if (!obj) {
  29563. return;
  29564. }
  29565. var res = new SuperMap.ThemeGraduatedSymbol();
  29566. Util.copy(res, obj);
  29567. res.flow = ThemeFlow.fromObj(obj);
  29568. res.offset = ThemeOffset.fromObj(obj);
  29569. res.style = ThemeGraduatedSymbolStyle.fromObj(obj);
  29570. return res;
  29571. }
  29572. }]);
  29573. return ThemeGraduatedSymbol;
  29574. }(Theme);
  29575. SuperMap.ThemeGraduatedSymbol = ThemeGraduatedSymbol;
  29576. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRangeItem.js
  29577. function ThemeRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29578. 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); } }
  29579. function ThemeRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRangeItem_defineProperties(Constructor, staticProps); return Constructor; }
  29580. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29581. * This program are made available under the terms of the Apache License, Version 2.0
  29582. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29583. /**
  29584. * @class SuperMap.ThemeRangeItem
  29585. * @category iServer Map Theme
  29586. * @classdesc 范围分段专题图子项类。
  29587. * @description 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  29588. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为[start, end)。
  29589. * @param {Object} options - 参数。
  29590. * @param {string} [options.caption] - 分段专题图子项的标题。
  29591. * @param {number} [options.end=0] - 分段专题图子项的终止值。
  29592. * @param {number} [options.start=0] - 分段专题图子项的起始值。
  29593. * @param {SuperMap.ServerStyle} options.style - 分段专题图子项的风格。
  29594. * @param {boolean} [options.visible=true] - 分段专题图子项是否可见。
  29595. */
  29596. var ThemeRangeItem = /*#__PURE__*/function () {
  29597. function ThemeRangeItem(options) {
  29598. ThemeRangeItem_classCallCheck(this, ThemeRangeItem);
  29599. /**
  29600. * @member {string} [SuperMap.ThemeRangeItem.prototype.caption]
  29601. * @description 分段专题图子项的标题。
  29602. */
  29603. this.caption = null;
  29604. /**
  29605. * @member {number} [SuperMap.ThemeRangeItem.prototype.end=0]
  29606. * @description 分段专题图子项的终止值,即该段专题值范围的最大值。<br>
  29607. * 如果该子项是分段中最后一个子项,则该终止值应大于分段字段(ThemeRange 类的 rangeExpression 属性)的最大值,若该终止值小于分段字段最大值,
  29608. * 则剩余部分由内部随机定义其颜色;如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常;
  29609. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  29610. */
  29611. this.end = 0;
  29612. /**
  29613. * @member {number} [SuperMap.ThemeRangeItem.prototype.start=0]
  29614. * @description 分段专题图子项的起始值,即该段专题值范围的最小值。<br>
  29615. * 如果该子项是分段中第一个子项,那么该起始值就是分段的最小值;如果子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  29616. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  29617. */
  29618. this.start = 0;
  29619. /**
  29620. * @member {SuperMap.ServerStyle} SuperMap.ThemeRangeItem.prototype.style
  29621. * @description 分段专题图子项的风格。
  29622. * 每一个分段专题图子项都对应一种显示风格。
  29623. */
  29624. this.style = new ServerStyle();
  29625. /**
  29626. * @member {boolean} [SuperMap.ThemeRangeItem.prototype.visible=true]
  29627. * @description 分段专题图子项是否可见。
  29628. */
  29629. this.visible = true;
  29630. if (options) {
  29631. Util.extend(this, options);
  29632. }
  29633. this.CLASS_NAME = "SuperMap.ThemeRangeItem";
  29634. }
  29635. /**
  29636. * @function SuperMap.ThemeRangeItem.prototype.destroy
  29637. * @description 释放资源,将引用资源的属性置空。
  29638. */
  29639. ThemeRangeItem_createClass(ThemeRangeItem, [{
  29640. key: "destroy",
  29641. value: function destroy() {
  29642. var me = this;
  29643. me.caption = null;
  29644. me.end = null;
  29645. me.start = null;
  29646. if (me.style) {
  29647. me.style.destroy();
  29648. me.style = null;
  29649. }
  29650. me.visible = null;
  29651. }
  29652. /**
  29653. * @function SuperMap.ThemeRangeItem.prototypetoServerJSONObject
  29654. * @description 转换成对应的 JSON 格式对象。
  29655. * @returns {Object} 对应的 JSON 格式对象。
  29656. */
  29657. }, {
  29658. key: "toServerJSONObject",
  29659. value: function toServerJSONObject() {
  29660. var obj = {};
  29661. obj = Util.copyAttributes(obj, this);
  29662. if (obj.style) {
  29663. if (obj.style.toServerJSONObject) {
  29664. obj.style = obj.style.toServerJSONObject();
  29665. }
  29666. }
  29667. return obj;
  29668. }
  29669. /**
  29670. * @function SuperMap.ThemeRangeItem.fromObj
  29671. * @description 从传入对象获取范围分段专题图子项类。
  29672. * @param {Object} obj - 传入对象。
  29673. * @returns {SuperMap.ThemeRangeItem} ThemeRangeItem 对象。
  29674. */
  29675. }], [{
  29676. key: "fromObj",
  29677. value: function fromObj(obj) {
  29678. if (!obj) {
  29679. return;
  29680. }
  29681. var res = new ThemeRangeItem();
  29682. Util.copy(res, obj);
  29683. res.style = ServerStyle.fromJson(obj.style);
  29684. return res;
  29685. }
  29686. }]);
  29687. return ThemeRangeItem;
  29688. }();
  29689. SuperMap.ThemeRangeItem = ThemeRangeItem;
  29690. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRange.js
  29691. function ThemeRange_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeRange_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeRange_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeRange_typeof(obj); }
  29692. function ThemeRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29693. 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); } }
  29694. function ThemeRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRange_defineProperties(Constructor, staticProps); return Constructor; }
  29695. function ThemeRange_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeRange_get = Reflect.get; } else { ThemeRange_get = function _get(target, property, receiver) { var base = ThemeRange_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ThemeRange_get(target, property, receiver || target); }
  29696. function ThemeRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeRange_getPrototypeOf(object); if (object === null) break; } return object; }
  29697. function ThemeRange_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThemeRange_setPrototypeOf(subClass, superClass); }
  29698. function ThemeRange_setPrototypeOf(o, p) { ThemeRange_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeRange_setPrototypeOf(o, p); }
  29699. 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); }; }
  29700. function ThemeRange_possibleConstructorReturn(self, call) { if (call && (ThemeRange_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeRange_assertThisInitialized(self); }
  29701. function ThemeRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29702. function ThemeRange_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  29703. function ThemeRange_getPrototypeOf(o) { ThemeRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeRange_getPrototypeOf(o); }
  29704. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29705. * This program are made available under the terms of the Apache License, Version 2.0
  29706. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29707. /**
  29708. * @class SuperMap.ThemeRange
  29709. * @category iServer Map Theme
  29710. * @classdesc 范围分段专题图。
  29711. * @description 范围分段专题图是按照指定的分段方法(如:等距离分段法)对字段的属性值进行分段,使用不同的颜色或符号(线型、填充)表示不同范围段落的属性值在整体上的分布情况,体现区域的差异。
  29712. * 在分段专题图中,专题值按照某种分段方式被分成多个范围段,要素根据各自的专题值被分配到其中一个范围段中,在同一个范围段中的要素使用相同的颜色,填充,符号等风格进行显示。
  29713. * 分段专题图所基于的专题变量必须为数值型,分段专题图一般用来反映连续分布现象的数量或程度特征,如降水量的分布,土壤侵蚀强度的分布等。
  29714. * @extends {SuperMap.Theme}
  29715. * @param {Object} options - 参数。
  29716. * @param {Array.<SuperMap.ThemeRangeItem>} options.items - 分段专题图子项数组。
  29717. * @param {string} options.rangeExpression - 分段字段表达式。
  29718. * @param {number} options.rangeParameter - 分段参数。
  29719. * @param {number} options.rangeParameter - 分段参数。
  29720. * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
  29721. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  29722. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  29723. */
  29724. var ThemeRange = /*#__PURE__*/function (_Theme) {
  29725. ThemeRange_inherits(ThemeRange, _Theme);
  29726. var _super = ThemeRange_createSuper(ThemeRange);
  29727. function ThemeRange(options) {
  29728. var _this;
  29729. ThemeRange_classCallCheck(this, ThemeRange);
  29730. _this = _super.call(this, "RANGE", options);
  29731. /**
  29732. * @member {string} SuperMap.ThemeRange.prototype.precision
  29733. * @description 精准度
  29734. */
  29735. _this.precision = '1.0E-12';
  29736. /**
  29737. * @member {Array.<SuperMap.ThemeRangeItem>} SuperMap.ThemeRange.prototype.items
  29738. * @description 分段专题图子项数组。<br>
  29739. * 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  29740. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为 [start, end)。
  29741. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按照您设置的值对分段结果进行调整。
  29742. */
  29743. _this.items = null;
  29744. /**
  29745. * @member {string} SuperMap.ThemeRange.prototype.rangeExpression
  29746. * @description 分段字段表达式。<br>
  29747. * 由于范围分段专题图基于各种分段方法根据一定的距离进行分段,因而范围分段专题图所基于的字段值的数据类型必须为数值型。对于字段表达式,只能为数值型的字段间的运算。
  29748. */
  29749. _this.rangeExpression = null;
  29750. /**
  29751. * @member {SuperMap.RangeMode} [SuperMap.ThemeRange.prototype.rangeMode=SuperMap.RangeMode.EQUALINTERVAL]
  29752. * @description 分段专题图的分段模式。<br>
  29753. * 在分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  29754. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  29755. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  29756. */
  29757. _this.rangeMode = RangeMode.EQUALINTERVAL;
  29758. /**
  29759. * @member {number} SuperMap.ThemeRange.prototype.rangeParameter
  29760. * @description 分段参数。
  29761. * 当分段模式为等距离分段法,平方根分段,对数分段法,计数分段法其中一种模式时,该参数用于设置分段个数;当分段模式为标准差分段法时,
  29762. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  29763. */
  29764. _this.rangeParameter = 0;
  29765. /**
  29766. * @member {SuperMap.ColorGradientType} [SuperMap.ThemeRange.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  29767. * @description 渐变颜色枚举类。<br>
  29768. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  29769. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色
  29770. * 方案完成填*充。但如果为某几个子项的风格进行单独设置后(设置了 {@link SuperMap.ThemeUniqueItem} 或 {@link SuperMap.ThemeRangeItem} 类中Style属性),
  29771. * 该配色方案对于这几个子项将不起作用。
  29772. */
  29773. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  29774. if (options) {
  29775. Util.extend(ThemeRange_assertThisInitialized(_this), options);
  29776. }
  29777. _this.CLASS_NAME = "SuperMap.ThemeRange";
  29778. return _this;
  29779. }
  29780. /**
  29781. * @function SuperMap.ThemeRange.prototype.destroy
  29782. * @override
  29783. */
  29784. ThemeRange_createClass(ThemeRange, [{
  29785. key: "destroy",
  29786. value: function destroy() {
  29787. ThemeRange_get(ThemeRange_getPrototypeOf(ThemeRange.prototype), "destroy", this).call(this);
  29788. var me = this;
  29789. if (me.items) {
  29790. if (me.items.length > 0) {
  29791. for (var item in me.items) {
  29792. me.items[item].destroy();
  29793. me.items[item] = null;
  29794. }
  29795. }
  29796. me.items = null;
  29797. }
  29798. me.rangeExpression = null;
  29799. me.rangeMode = null;
  29800. me.rangeParameter = null;
  29801. me.colorGradientType = null;
  29802. }
  29803. /**
  29804. * @function SuperMap.ThemeRange.fromObj
  29805. * @description 从传入对象获取范围分段专题图类。
  29806. * @param {Object} obj - 传入对象。
  29807. * @returns {SuperMap.ThemeRange} ThemeRange 对象。
  29808. */
  29809. }], [{
  29810. key: "fromObj",
  29811. value: function fromObj(obj) {
  29812. if (!obj) {
  29813. return;
  29814. }
  29815. var res = new ThemeRange();
  29816. Util.copy(res, obj);
  29817. var itemsR = obj.items;
  29818. var len = itemsR ? itemsR.length : 0;
  29819. res.items = [];
  29820. for (var i = 0; i < len; i++) {
  29821. res.items.push(ThemeRangeItem.fromObj(itemsR[i]));
  29822. }
  29823. return res;
  29824. }
  29825. }]);
  29826. return ThemeRange;
  29827. }(Theme);
  29828. SuperMap.ThemeRange = ThemeRange;
  29829. ;// CONCATENATED MODULE: ./src/common/iServer/UGCLayer.js
  29830. function UGCLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29831. 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); } }
  29832. function UGCLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCLayer_defineProperties(Constructor, staticProps); return Constructor; }
  29833. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29834. * This program are made available under the terms of the Apache License, Version 2.0
  29835. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29836. /**
  29837. * @class SuperMap.UGCLayer
  29838. * @category iServer Map Layer
  29839. * @classdesc UGC 图层类。
  29840. * @param {Object} options - 参数。
  29841. * @param {SuperMap.Bounds} options.bounds - 图层范围。
  29842. * @param {string} options.name - 图层的名称。
  29843. * @param {SuperMap.UGCLayerType} options.type - 图层类型
  29844. * @param {string} [options.caption] - 图层的标题。
  29845. * @param {string} [options.description] - 图层的描述信息。
  29846. * @param {boolean} [options.queryable] - 图层中的对象是否可以查询。
  29847. * @param {boolean} [options.subUGCLayers] - 是否允许图层的符号大小随图缩放。
  29848. * @param {boolean} [options.visible=false] - 地图对象在同一范围内时,是否重叠显示。
  29849. */
  29850. var UGCLayer = /*#__PURE__*/function () {
  29851. function UGCLayer(options) {
  29852. UGCLayer_classCallCheck(this, UGCLayer);
  29853. options = options || {};
  29854. /**
  29855. * @member {SuperMap.Bounds} SuperMap.UGCLayer.prototype.bounds
  29856. * @description 图层范围。
  29857. */
  29858. this.bounds = null;
  29859. /**
  29860. * @member {string} [SuperMap.UGCLayer.prototype.caption]
  29861. * @description 图层的标题。默认情况下图层的标题与图层的名称一致。在图例、图层控制列表中显示的图层名称就是该图层的标题值。
  29862. */
  29863. this.caption = null;
  29864. /**
  29865. * @member {string} SuperMap.UGCLayer.prototype.description
  29866. * @description 图层的描述信息。
  29867. */
  29868. this.description = null;
  29869. /**
  29870. * @member {string} SuperMap.UGCLayer.prototype.name
  29871. * @description 图层的名称。图层的名称在图层所在的地图中唯一标识此图层。该属性区分大小写。
  29872. */
  29873. this.name = null;
  29874. /**
  29875. * @member {boolean} SuperMap.UGCLayer.prototype.queryable
  29876. * @description 图层中的对象是否可以查询。
  29877. */
  29878. this.queryable = null;
  29879. /**
  29880. * @member {Array} SuperMap.UGCLayer.prototype.subLayers
  29881. * @description 子图层集。
  29882. */
  29883. this.subLayers = null;
  29884. /**
  29885. * @member {SuperMap.UGCLayerType} SuperMap.UGCLayer.prototype.type
  29886. * @description 图层类型。
  29887. */
  29888. this.type = null;
  29889. /**
  29890. * @member {boolean} SuperMap.UGCLayer.prototype.visible
  29891. * @description 地图对象在同一范围内时,是否重叠显示。
  29892. */
  29893. this.visible = null;
  29894. Util.extend(this, options);
  29895. this.CLASS_NAME = "SuperMap.UGCLayer";
  29896. }
  29897. /**
  29898. * @function SuperMap.UGCLayer.prototype.destroy
  29899. * @description 释放资源,将引用资源的属性置空。
  29900. */
  29901. UGCLayer_createClass(UGCLayer, [{
  29902. key: "destroy",
  29903. value: function destroy() {
  29904. var me = this;
  29905. Util.reset(me);
  29906. }
  29907. /**
  29908. * @function SuperMap.UGCLayer.prototype.fromJson
  29909. * @description 将服务端 JSON 对象转换成当前客户端对象。
  29910. * @param {Object} jsonObject - 要转换的 JSON 对象。
  29911. */
  29912. }, {
  29913. key: "fromJson",
  29914. value: function fromJson(jsonObject) {
  29915. jsonObject = jsonObject ? jsonObject : {};
  29916. Util.extend(this, jsonObject);
  29917. var b = this.bounds;
  29918. if (b) {
  29919. this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  29920. }
  29921. }
  29922. /**
  29923. * @function SuperMap.UGCLayer.prototype.toServerJSONObject
  29924. * @description 转换成对应的 JSON 格式对象。
  29925. * @returns {Object} 对应的 JSON 格式对象。
  29926. */
  29927. }, {
  29928. key: "toServerJSONObject",
  29929. value: function toServerJSONObject() {
  29930. var jsonObject = {};
  29931. jsonObject = Util.copyAttributes(jsonObject, this);
  29932. if (jsonObject.bounds) {
  29933. if (jsonObject.bounds.toServerJSONObject) {
  29934. jsonObject.bounds = jsonObject.bounds.toServerJSONObject();
  29935. }
  29936. }
  29937. return jsonObject;
  29938. }
  29939. }]);
  29940. return UGCLayer;
  29941. }();
  29942. SuperMap.UGCLayer = UGCLayer;
  29943. ;// CONCATENATED MODULE: ./src/common/iServer/OverlapDisplayedOptions.js
  29944. function OverlapDisplayedOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29945. 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); } }
  29946. function OverlapDisplayedOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlapDisplayedOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlapDisplayedOptions_defineProperties(Constructor, staticProps); return Constructor; }
  29947. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29948. * This program are made available under the terms of the Apache License, Version 2.0
  29949. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29950. /**
  29951. * @class SuperMap.OverlapDisplayedOptions
  29952. * @category iServer Map Layer
  29953. * @classdesc 地图压盖过滤显示选项。
  29954. * @description 在文本或专题图元素显示较密集的区域,文本之间或专题元素之间会发生相互压盖的现象,
  29955. * 该类可以分别控制各种类型的对象的压盖显示情况,进而很好地处理地图中各种类型对象的压盖显示问题。
  29956. * @param {Object} options - 参数。
  29957. * @param {boolean} [options.allowPointOverlap=true] - 点和点压盖时是否显示压盖的点对象。
  29958. * @param {boolean} [options.allowPointWithTextDisplay=true] - 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  29959. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  29960. * @param {boolean} [options.allowTextOverlap=false] - 文本压盖时是否显示压盖的文本对象。
  29961. * @param {boolean} [options.allowTextAndPointOverlap=true] - 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  29962. * @param {boolean} [options.allowThemeGraduatedSymbolOverlap=false] - 等级符号元素压盖时是否显示压盖的等级符号元素。
  29963. * @param {boolean} [options.allowThemeGraphOverlap=false] - 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  29964. * @param {number} [options.horizontalOverlappedSpaceSize=0] - 两个对象之间的横向压盖间距,单位为 0.1 毫米,跟 verticalOverlappedSpaceSize 结合使用,
  29965. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  29966. * @param {number} [options.verticalOverlappedSpaceSize=0] - 两个对象之间的纵向压盖间距,单位为 0.1 毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  29967. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  29968. */
  29969. var OverlapDisplayedOptions = /*#__PURE__*/function () {
  29970. function OverlapDisplayedOptions(options) {
  29971. OverlapDisplayedOptions_classCallCheck(this, OverlapDisplayedOptions);
  29972. options = options || {};
  29973. /**
  29974. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowPointOverlap=true]
  29975. * @description 点和点压盖时是否显示压盖的点对象。
  29976. */
  29977. this.allowPointOverlap = true;
  29978. /**
  29979. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowPointWithTextDisplay=true]
  29980. * @description 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  29981. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  29982. */
  29983. this.allowPointWithTextDisplay = true;
  29984. /**
  29985. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowTextOverlap=false]
  29986. * @description 文本压盖时是否显示压盖的文本对象。
  29987. */
  29988. this.allowTextOverlap = false;
  29989. /**
  29990. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowTextAndPointOverlap=true]
  29991. * @description 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  29992. */
  29993. this.allowTextAndPointOverlap = true;
  29994. /**
  29995. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowThemeGraduatedSymbolOverlap=false]
  29996. * @description 等级符号元素压盖时是否显示压盖的等级符号元素。
  29997. */
  29998. this.allowThemeGraduatedSymbolOverlap = false;
  29999. /**
  30000. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowThemeGraphOverlap=false]
  30001. * @description 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  30002. */
  30003. this.allowThemeGraphOverlap = false;
  30004. /**
  30005. * @member {number} [SuperMap.OverlapDisplayedOptions.prototype.horizontalOverlappedSpaceSize=0]
  30006. * @description 两个对象之间的横向压盖间距,单位为0.1毫米,跟 verticalOverlappedSpaceSize 结合使用,
  30007. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  30008. */
  30009. this.horizontalOverlappedSpaceSize = 0;
  30010. /**
  30011. * @member {number} [SuperMap.OverlapDisplayedOptions.prototype.verticalOverlappedSpaceSize=0]
  30012. * @description 两个对象之间的纵向压盖间距,单位为0.1毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  30013. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  30014. */
  30015. this.verticalOverlappedSpaceSize = 0;
  30016. Util.extend(this, options);
  30017. this.ugcLayer = new UGCLayer(options);
  30018. this.CLASS_NAME = "SuperMap.OverlapDisplayedOptions";
  30019. }
  30020. /**
  30021. * @function SuperMap.OverlapDisplayedOptions.prototype.destroy
  30022. * @description 释放资源,将资源的属性置空。
  30023. */
  30024. OverlapDisplayedOptions_createClass(OverlapDisplayedOptions, [{
  30025. key: "destroy",
  30026. value: function destroy() {
  30027. Util.reset(this);
  30028. }
  30029. /**
  30030. * @function SuperMap.OverlapDisplayedOptions.prototype.fromJson
  30031. * @description 将服务端 JSON 对象转换成当前客户端对象。
  30032. * @param {Object} jsonObject - 要转换的 JSON 对象。
  30033. */
  30034. }, {
  30035. key: "fromJson",
  30036. value: function fromJson(jsonObject) {
  30037. this.ugcLayer.fromJson.apply(this, [jsonObject]);
  30038. }
  30039. /**
  30040. * @function SuperMap.OverlapDisplayedOptions.prototype.toServerJSONObject
  30041. * @description 转换成对应的 JSON 格式对象。
  30042. * @returns {Object} 对应的 JSON 格式对象。
  30043. */
  30044. }, {
  30045. key: "toServerJSONObject",
  30046. value: function toServerJSONObject() {
  30047. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  30048. return jsonObject;
  30049. }
  30050. /**
  30051. * @function SuperMap.OverlapDisplayedOptions.prototype.toString
  30052. * @description 转换成对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  30053. * @returns {string} 对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  30054. */
  30055. }, {
  30056. key: "toString",
  30057. value: function toString() {
  30058. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  30059. var str = "{";
  30060. for (var attr in jsonObject) {
  30061. if (jsonObject.hasOwnProperty(attr)) {
  30062. str += "'" + attr + "':" + jsonObject[attr] + ",";
  30063. }
  30064. }
  30065. str = str.substr(0, str.length - 1);
  30066. str += "}";
  30067. return str;
  30068. }
  30069. }]);
  30070. return OverlapDisplayedOptions;
  30071. }();
  30072. SuperMap.OverlapDisplayedOptions = OverlapDisplayedOptions;
  30073. ;// CONCATENATED MODULE: ./src/common/iServer/UGCMapLayer.js
  30074. function UGCMapLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { UGCMapLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { UGCMapLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return UGCMapLayer_typeof(obj); }
  30075. function UGCMapLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30076. 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); } }
  30077. function UGCMapLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCMapLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCMapLayer_defineProperties(Constructor, staticProps); return Constructor; }
  30078. function UGCMapLayer_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { UGCMapLayer_get = Reflect.get; } else { UGCMapLayer_get = function _get(target, property, receiver) { var base = UGCMapLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return UGCMapLayer_get(target, property, receiver || target); }
  30079. function UGCMapLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCMapLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  30080. function UGCMapLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) UGCMapLayer_setPrototypeOf(subClass, superClass); }
  30081. function UGCMapLayer_setPrototypeOf(o, p) { UGCMapLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCMapLayer_setPrototypeOf(o, p); }
  30082. 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); }; }
  30083. function UGCMapLayer_possibleConstructorReturn(self, call) { if (call && (UGCMapLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UGCMapLayer_assertThisInitialized(self); }
  30084. function UGCMapLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30085. function UGCMapLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30086. function UGCMapLayer_getPrototypeOf(o) { UGCMapLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCMapLayer_getPrototypeOf(o); }
  30087. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30088. * This program are made available under the terms of the Apache License, Version 2.0
  30089. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30090. /**
  30091. * @class SuperMap.UGCMapLayer
  30092. * @category iServer Map Layer
  30093. * @classdesc UGC 地图图层类。
  30094. * @extends {SuperMap.UGCLayer}
  30095. * @param {Object} options - 参数。
  30096. * @param {boolean} [options.completeLineSymbolDisplayed] - 是否显示完整线型。
  30097. * @param {number} [options.maxScale] - 地图最大比例尺。
  30098. * @param {number} [options.minScale] - 地图最小比例尺。
  30099. * @param {number} [options.minVisibleGeometrySize] - 几何对象的最小可见大小,以像素为单位。
  30100. * @param {number} [options.opaqueRate] - 图层的不透明度。
  30101. * @param {boolean} [options.symbolScalable] - 是否允许图层的符号大小随图缩放。
  30102. * @param {number} [options.symbolScale] - 图层的符号缩放基准比例尺。
  30103. * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。
  30104. * @param {SuperMap.OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 地图的压盖过滤显示选项,当overlapDisplayed 为 false 时有效。
  30105. */
  30106. var UGCMapLayer = /*#__PURE__*/function (_UGCLayer) {
  30107. UGCMapLayer_inherits(UGCMapLayer, _UGCLayer);
  30108. var _super = UGCMapLayer_createSuper(UGCMapLayer);
  30109. function UGCMapLayer(options) {
  30110. var _this;
  30111. UGCMapLayer_classCallCheck(this, UGCMapLayer);
  30112. options = options || {};
  30113. _this = _super.call(this, options);
  30114. /**
  30115. * @member {boolean} SuperMap.UGCMapLayer.prototype.completeLineSymbolDisplayed
  30116. * @description 是否显示完整线型。
  30117. */
  30118. _this.completeLineSymbolDisplayed = null;
  30119. /**
  30120. * @member {number} SuperMap.UGCMapLayer.prototype.maxScale
  30121. * @description 地图最大比例尺。
  30122. */
  30123. _this.maxScale = null;
  30124. /**
  30125. * @member {number} SuperMap.UGCMapLayer.prototype.minScale
  30126. * @description 地图最小比例尺。
  30127. */
  30128. _this.minScale = null;
  30129. /**
  30130. * @member {number} SuperMap.UGCMapLayer.prototype.minVisibleGeometrySize
  30131. * @description 几何对象的最小可见大小,以像素为单位。
  30132. */
  30133. _this.minVisibleGeometrySize = null;
  30134. /**
  30135. * @member {number} SuperMap.UGCMapLayer.prototype.opaqueRate
  30136. * @description 图层的不透明度。
  30137. */
  30138. _this.opaqueRate = null;
  30139. /**
  30140. * @member {boolean} SuperMap.UGCMapLayer.prototype.symbolScalable
  30141. * @description 是否允许图层的符号大小随图缩放。
  30142. */
  30143. _this.symbolScalable = null;
  30144. /**
  30145. * @member {number} SuperMap.UGCMapLayer.prototype.symbolScale
  30146. * @description 图层的符号缩放基准比例尺。
  30147. */
  30148. _this.symbolScale = null;
  30149. /**
  30150. * @member {boolean} [SuperMap.UGCMapLayer.prototype.overlapDisplayed=false]
  30151. * @description 地图对象在同一范围内时,是否重叠显示。
  30152. */
  30153. _this.overlapDisplayed = null;
  30154. /**
  30155. * @member {SuperMap.OverlapDisplayedOptions} SuperMap.UGCMapLayer.prototype.overlapDisplayedOptions
  30156. * @description 地图的压盖过滤显示选项,当 overlapDisplayed 为 false 时有效。
  30157. */
  30158. _this.overlapDisplayedOptions = null;
  30159. _this.CLASS_NAME = "SuperMap.UGCMapLayer";
  30160. return _this;
  30161. }
  30162. /**
  30163. * @function SuperMap.UGCMapLayer.prototype.destroy
  30164. * @override
  30165. */
  30166. UGCMapLayer_createClass(UGCMapLayer, [{
  30167. key: "destroy",
  30168. value: function destroy() {
  30169. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "destroy", this).call(this);
  30170. Util.reset(this);
  30171. }
  30172. /**
  30173. * @function SuperMap.UGCMapLayer.prototype.fromJson
  30174. * @description 将服务端 JSON 对象转换成当前客户端对象
  30175. * @param {Object} jsonObject - 要转换的 JSON 对象。
  30176. */
  30177. }, {
  30178. key: "fromJson",
  30179. value: function fromJson(jsonObject) {
  30180. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "fromJson", this).call(this, jsonObject);
  30181. }
  30182. /**
  30183. * @function SuperMap.UGCMapLayer.prototype.toServerJSONObject
  30184. * @description 转换成对应的 JSON 格式对象。
  30185. * @returns {Object} 对应的 JSON 格式对象。
  30186. */
  30187. }, {
  30188. key: "toServerJSONObject",
  30189. value: function toServerJSONObject() {
  30190. return UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "toServerJSONObject", this).call(this);
  30191. }
  30192. }]);
  30193. return UGCMapLayer;
  30194. }(UGCLayer);
  30195. SuperMap.UGCMapLayer = UGCMapLayer;
  30196. ;// CONCATENATED MODULE: ./src/common/iServer/UGCSubLayer.js
  30197. function UGCSubLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { UGCSubLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { UGCSubLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return UGCSubLayer_typeof(obj); }
  30198. function UGCSubLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30199. 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); } }
  30200. function UGCSubLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCSubLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCSubLayer_defineProperties(Constructor, staticProps); return Constructor; }
  30201. function UGCSubLayer_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { UGCSubLayer_get = Reflect.get; } else { UGCSubLayer_get = function _get(target, property, receiver) { var base = UGCSubLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return UGCSubLayer_get(target, property, receiver || target); }
  30202. function UGCSubLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCSubLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  30203. function UGCSubLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) UGCSubLayer_setPrototypeOf(subClass, superClass); }
  30204. function UGCSubLayer_setPrototypeOf(o, p) { UGCSubLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCSubLayer_setPrototypeOf(o, p); }
  30205. 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); }; }
  30206. function UGCSubLayer_possibleConstructorReturn(self, call) { if (call && (UGCSubLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UGCSubLayer_assertThisInitialized(self); }
  30207. function UGCSubLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30208. function UGCSubLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30209. function UGCSubLayer_getPrototypeOf(o) { UGCSubLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCSubLayer_getPrototypeOf(o); }
  30210. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30211. * This program are made available under the terms of the Apache License, Version 2.0
  30212. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30213. /**
  30214. * @class SuperMap.UGCSubLayer
  30215. * @category iServer Map Layer
  30216. * @classdesc 地图服务图层属性信息类。影像图层(Image)、专题图层(ServerTheme)、栅格图层(Grid)、矢量图层(Vector)等图层均继承该类。
  30217. * @extends {SuperMap.UGCMapLayer}
  30218. * @param {Object} options - 参数。
  30219. * @param {SuperMap.DatasetInfo} options.datasetInfo - 数据集信息。
  30220. * @param {string} [options.displayFilter] - 图层显示过滤条件。
  30221. * @param {SuperMap.JoinItem} [options.joinItems] - 连接信息类。
  30222. * @param {string} [options.representationField] - 存储制图表达信息的字段。
  30223. * @param {SuperMap.LayerType} [options.ugcLayerType] - 图层类型。
  30224. */
  30225. var UGCSubLayer = /*#__PURE__*/function (_UGCMapLayer) {
  30226. UGCSubLayer_inherits(UGCSubLayer, _UGCMapLayer);
  30227. var _super = UGCSubLayer_createSuper(UGCSubLayer);
  30228. function UGCSubLayer(options) {
  30229. var _this;
  30230. UGCSubLayer_classCallCheck(this, UGCSubLayer);
  30231. options = options || {};
  30232. _this = _super.call(this, options);
  30233. /**
  30234. * @member {SuperMap.DatasetInfo} SuperMap.UGCSubLayer.prototype.datasetInfo
  30235. * @description 数据集信息。
  30236. */
  30237. _this.datasetInfo = null;
  30238. /**
  30239. * @member {string} SuperMap.UGCSubLayer.prototype.displayFilter
  30240. * @description 图层显示过滤条件。
  30241. */
  30242. _this.displayFilter = null;
  30243. /**
  30244. * @member {SuperMap.JoinItem} SuperMap.UGCSubLayer.prototype.joinItems
  30245. * @description 连接信息类。
  30246. */
  30247. _this.joinItems = null;
  30248. /**
  30249. * @member {string} SuperMap.UGCSubLayer.prototype.representationField
  30250. * @description 存储制图表达信息的字段。
  30251. */
  30252. _this.representationField = null;
  30253. /**
  30254. * @member {SuperMap.LayerType} SuperMap.UGCSubLayer.prototype.ugcLayerType
  30255. * @description 图层类型。
  30256. */
  30257. _this.ugcLayerType = null;
  30258. _this.CLASS_NAME = "SuperMap.UGCSubLayer";
  30259. return _this;
  30260. }
  30261. /**
  30262. * @function SuperMap.UGCSubLayer.prototype.fromJson
  30263. * @description 将服务端 JSON 对象转换成当前客户端对象
  30264. * @param {Object} jsonObject - 要转换的 JSON 对象。
  30265. */
  30266. UGCSubLayer_createClass(UGCSubLayer, [{
  30267. key: "fromJson",
  30268. value: function fromJson(jsonObject) {
  30269. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "fromJson", this).call(this, jsonObject);
  30270. if (this.datasetInfo) {
  30271. this.datasetInfo = new DatasetInfo(this.datasetInfo);
  30272. }
  30273. if (this.joinItems && this.joinItems.length) {
  30274. var newJoinItems = [];
  30275. for (var i = 0; i < this.joinItems.length; i++) {
  30276. newJoinItems[i] = new JoinItem(this.joinItems[i]);
  30277. }
  30278. this.joinItems = newJoinItems;
  30279. }
  30280. }
  30281. /**
  30282. * @function SuperMap.UGCSubLayer.prototype.destroy
  30283. * @override
  30284. */
  30285. }, {
  30286. key: "destroy",
  30287. value: function destroy() {
  30288. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "destroy", this).call(this);
  30289. Util.reset(this);
  30290. }
  30291. /**
  30292. * @function SuperMap.UGCSubLayer.prototype.toServerJSONObject
  30293. * @description 转换成对应的 JSON 格式对象。
  30294. * @returns {Object} 对应的 JSON 格式对象。
  30295. */
  30296. }, {
  30297. key: "toServerJSONObject",
  30298. value: function toServerJSONObject() {
  30299. var jsonObject = UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "toServerJSONObject", this).call(this);
  30300. if (jsonObject.joinItems) {
  30301. var joinItems = [];
  30302. for (var i = 0; i < jsonObject.joinItems.length; i++) {
  30303. if (jsonObject.joinItems[i].toServerJSONObject) {
  30304. joinItems[i] = jsonObject.joinItems[i].toServerJSONObject();
  30305. }
  30306. }
  30307. jsonObject.joinItems = joinItems;
  30308. }
  30309. if (jsonObject.datasetInfo) {
  30310. if (jsonObject.datasetInfo.toServerJSONObject) {
  30311. jsonObject.datasetInfo = jsonObject.datasetInfo.toServerJSONObject();
  30312. }
  30313. }
  30314. return jsonObject;
  30315. }
  30316. }]);
  30317. return UGCSubLayer;
  30318. }(UGCMapLayer);
  30319. SuperMap.UGCSubLayer = UGCSubLayer;
  30320. ;// CONCATENATED MODULE: ./src/common/iServer/ServerTheme.js
  30321. function ServerTheme_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ServerTheme_typeof = function _typeof(obj) { return typeof obj; }; } else { ServerTheme_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ServerTheme_typeof(obj); }
  30322. function ServerTheme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30323. 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); } }
  30324. function ServerTheme_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTheme_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTheme_defineProperties(Constructor, staticProps); return Constructor; }
  30325. function ServerTheme_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ServerTheme_get = Reflect.get; } else { ServerTheme_get = function _get(target, property, receiver) { var base = ServerTheme_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ServerTheme_get(target, property, receiver || target); }
  30326. function ServerTheme_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ServerTheme_getPrototypeOf(object); if (object === null) break; } return object; }
  30327. function ServerTheme_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ServerTheme_setPrototypeOf(subClass, superClass); }
  30328. function ServerTheme_setPrototypeOf(o, p) { ServerTheme_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ServerTheme_setPrototypeOf(o, p); }
  30329. 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); }; }
  30330. function ServerTheme_possibleConstructorReturn(self, call) { if (call && (ServerTheme_typeof(call) === "object" || typeof call === "function")) { return call; } return ServerTheme_assertThisInitialized(self); }
  30331. function ServerTheme_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30332. function ServerTheme_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30333. function ServerTheme_getPrototypeOf(o) { ServerTheme_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServerTheme_getPrototypeOf(o); }
  30334. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30335. * This program are made available under the terms of the Apache License, Version 2.0
  30336. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30337. /**
  30338. * @class SuperMap.ServerTheme
  30339. * @category iServer Map Theme
  30340. * @classdesc UGC 专题图图层类。
  30341. * @extends {SuperMap.UGCSubLayer}
  30342. * @param {SuperMap.Theme} theme - 专题图对象。
  30343. * @param {SuperMap.LonLat} themeElementPosition - 专题图元素位置。
  30344. */
  30345. var ServerTheme = /*#__PURE__*/function (_UGCSubLayer) {
  30346. ServerTheme_inherits(ServerTheme, _UGCSubLayer);
  30347. var _super = ServerTheme_createSuper(ServerTheme);
  30348. function ServerTheme(options) {
  30349. var _this;
  30350. ServerTheme_classCallCheck(this, ServerTheme);
  30351. options = options || {};
  30352. _this = _super.call(this, options);
  30353. /**
  30354. * @member {SuperMap.Theme} SuperMap.ServerTheme.prototype.theme
  30355. * @description 专题图对象。
  30356. */
  30357. _this.theme = null;
  30358. /**
  30359. * @member {SuperMap.LonLat} SuperMap.ServerTheme.prototype.themeElementPosition
  30360. * @description 专题图元素位置。
  30361. */
  30362. _this.themeElementPosition = null;
  30363. _this.CLASS_NAME = "SuperMap.ServerTheme";
  30364. return _this;
  30365. }
  30366. /**
  30367. * @function SuperMap.ServerTheme.prototype.destroy
  30368. * @override
  30369. */
  30370. ServerTheme_createClass(ServerTheme, [{
  30371. key: "destroy",
  30372. value: function destroy() {
  30373. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "destroy", this).call(this);
  30374. Util.reset(this);
  30375. }
  30376. /**
  30377. * @function SuperMap.ServerTheme.prototype.fromJson
  30378. * @description 将服务端 JSON 对象转换成当前客户端对象
  30379. * @param {Object} jsonObject - 要转换的 JSON 对象。
  30380. */
  30381. }, {
  30382. key: "fromJson",
  30383. value: function fromJson(jsonObject) {
  30384. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "fromJson", this).call(this, jsonObject);
  30385. var themeObj = this.theme;
  30386. var themeT = themeObj && themeObj.type;
  30387. switch (themeT) {
  30388. case 'LABEL':
  30389. this.theme = ThemeLabel.fromObj(themeObj);
  30390. break;
  30391. case 'UNIQUE':
  30392. this.theme = ThemeUnique.fromObj(themeObj);
  30393. break;
  30394. case 'GRAPH':
  30395. this.theme = ThemeGraph.fromObj(themeObj);
  30396. break;
  30397. case 'DOTDENSITY':
  30398. this.theme = ThemeDotDensity.fromObj(themeObj);
  30399. break;
  30400. case 'GRADUATEDSYMBOL':
  30401. this.theme = ThemeGraduatedSymbol.fromObj(themeObj);
  30402. break;
  30403. case 'RANGE':
  30404. this.theme = ThemeRange.fromObj(themeObj);
  30405. break;
  30406. default:
  30407. break;
  30408. }
  30409. if (this.themeElementPosition) {
  30410. //待测试
  30411. this.themeElementPosition = new LonLat(this.themeElementPosition.x, this.themeElementPosition.y);
  30412. }
  30413. }
  30414. /**
  30415. * @function SuperMap.ServerTheme.prototype.toServerJSONObject
  30416. * @description 转换成对应的 JSON 格式对象。
  30417. */
  30418. }, {
  30419. key: "toServerJSONObject",
  30420. value: function toServerJSONObject() {
  30421. //普通属性直接赋值
  30422. var jsonObject = ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "toServerJSONObject", this).call(this);
  30423. if (jsonObject.themeElementPosition) {
  30424. if (jsonObject.themeElementPosition.toServerJSONObject) {
  30425. jsonObject.themeElementPosition = jsonObject.themeElementPosition.toServerJSONObject();
  30426. }
  30427. }
  30428. if (jsonObject.theme) {
  30429. if (jsonObject.theme.toServerJSONObject) {
  30430. jsonObject.theme = jsonObject.theme.toServerJSONObject();
  30431. }
  30432. }
  30433. return jsonObject;
  30434. }
  30435. }]);
  30436. return ServerTheme;
  30437. }(UGCSubLayer);
  30438. SuperMap.ServerTheme = ServerTheme;
  30439. ;// CONCATENATED MODULE: ./src/common/iServer/Grid.js
  30440. function Grid_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Grid_typeof = function _typeof(obj) { return typeof obj; }; } else { Grid_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Grid_typeof(obj); }
  30441. function Grid_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30442. 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); } }
  30443. function Grid_createClass(Constructor, protoProps, staticProps) { if (protoProps) Grid_defineProperties(Constructor.prototype, protoProps); if (staticProps) Grid_defineProperties(Constructor, staticProps); return Constructor; }
  30444. function Grid_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Grid_get = Reflect.get; } else { Grid_get = function _get(target, property, receiver) { var base = Grid_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Grid_get(target, property, receiver || target); }
  30445. function Grid_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Grid_getPrototypeOf(object); if (object === null) break; } return object; }
  30446. function Grid_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Grid_setPrototypeOf(subClass, superClass); }
  30447. function Grid_setPrototypeOf(o, p) { Grid_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Grid_setPrototypeOf(o, p); }
  30448. 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); }; }
  30449. function Grid_possibleConstructorReturn(self, call) { if (call && (Grid_typeof(call) === "object" || typeof call === "function")) { return call; } return Grid_assertThisInitialized(self); }
  30450. function Grid_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30451. function Grid_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30452. function Grid_getPrototypeOf(o) { Grid_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Grid_getPrototypeOf(o); }
  30453. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30454. * This program are made available under the terms of the Apache License, Version 2.0
  30455. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30456. /**
  30457. * @class SuperMap.Grid
  30458. * @category iServer Map Layer
  30459. * @classdesc UGC 栅格图层类。
  30460. * @extends {SuperMap.UGCSubLayer}
  30461. * @param {Object} options - 参数。
  30462. * @param {Array.<Object>} [options.colorDictionary] - 颜色对照表对象。
  30463. * @param {number} [options.brightness] - Grid 图层的亮度。
  30464. * @param {SuperMap.ColorGradientType} [options.colorGradientType] - 颜色渐变枚举。
  30465. * @param {SuperMap.ServerColor} [options.colors] - 颜色表对象。
  30466. * @param {number} [options.contrast] - Grid 图层的对比度。
  30467. * @param {SuperMap.GridType} [options.gridType] - 格网类型。
  30468. * @param {number} [options.horizontalSpacing] - 格网水平间隔大小。
  30469. * @param {boolean} [options.sizeFixed] - 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  30470. * @param {SuperMap.ServerStyle} [options.solidStyle] - 格网实线的样式。
  30471. * @param {SuperMap.ServerColor} [options.specialColor] - 栅格数据集无值数据的颜色。
  30472. * @param {number} [options.specialValue] - 图层的特殊值。
  30473. * @param {boolean} [options.specialValueTransparent] - 图层的特殊值(specialValue)所处区域是否透明。
  30474. * @param {number} [options.verticalSpacing] - 格网垂直间隔大小。
  30475. */
  30476. var Grid = /*#__PURE__*/function (_UGCSubLayer) {
  30477. Grid_inherits(Grid, _UGCSubLayer);
  30478. var _super = Grid_createSuper(Grid);
  30479. function Grid(options) {
  30480. var _this;
  30481. Grid_classCallCheck(this, Grid);
  30482. options = options || {};
  30483. _this = _super.call(this, options);
  30484. /**
  30485. * @member {Array.<SuperMap.ColorDictionary>} SuperMap.Grid.prototype.colorDictionarys
  30486. * @description 颜色对照表对象。
  30487. */
  30488. _this.colorDictionarys = null;
  30489. /**
  30490. * @member {number} SuperMap.Grid.prototype.brightness
  30491. * @description Grid 图层的亮度。
  30492. */
  30493. _this.brightness = null;
  30494. /**
  30495. * @member {SuperMap.ColorGradientType} SuperMap.Grid.prototype.colorGradientType
  30496. * @description 渐变颜色枚举值。
  30497. */
  30498. _this.colorGradientType = null;
  30499. /**
  30500. * @member {SuperMap.ServerColor} SuperMap.Grid.prototype.colors
  30501. * @description 颜色表对象。
  30502. */
  30503. _this.colors = null;
  30504. /**
  30505. * @member {number} SuperMap.Grid.prototype.contrast
  30506. * @description Grid 图层的对比度。
  30507. */
  30508. _this.contrast = null;
  30509. /**
  30510. * @member {SuperMap.ServerStyle} SuperMap.Grid.prototype.dashStyle
  30511. * @description 栅格数据集特殊值数据的颜色。
  30512. */
  30513. _this.dashStyle = null;
  30514. /**
  30515. * @member {SuperMap.GridType} SuperMap.Grid.prototype.gridType
  30516. * @description 格网类型。
  30517. */
  30518. _this.gridType = null;
  30519. /**
  30520. * @member {number} SuperMap.Grid.prototype.horizontalSpacing
  30521. * @description 格网水平间隔大小。
  30522. */
  30523. _this.horizontalSpacing = null;
  30524. /**
  30525. * @member {boolean} SuperMap.Grid.prototype.sizeFixed
  30526. * @description 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  30527. */
  30528. _this.sizeFixed = null;
  30529. /**
  30530. * @member {SuperMap.ServerStyle} SuperMap.Grid.prototype.solidStyle
  30531. * @description 格网实线的样式。
  30532. */
  30533. _this.solidStyle = null;
  30534. /**
  30535. * @member {SuperMap.ServerColor} SuperMap.Grid.prototype.specialColor
  30536. * @description 栅格数据集无值数据的颜色。
  30537. */
  30538. _this.specialColor = null;
  30539. /**
  30540. * @member {number} SuperMap.Grid.prototype.specialValue
  30541. * @description 图层的特殊值。
  30542. */
  30543. _this.specialValue = null;
  30544. /**
  30545. * @member {boolean} SuperMap.Grid.prototype.specialValueTransparent
  30546. * @description 图层的特殊值(specialValue)所处区域是否透明。
  30547. */
  30548. _this.specialValueTransparent = null;
  30549. /**
  30550. * @member {number} SuperMap.Grid.prototype.verticalSpacing
  30551. * @description 格网垂直间隔大小。
  30552. */
  30553. _this.verticalSpacing = null;
  30554. _this.CLASS_NAME = "SuperMap.Grid";
  30555. return _this;
  30556. }
  30557. /**
  30558. * @function SuperMap.Grid.prototype.destroy
  30559. * @description 释放资源,将引用资源的属性置空。
  30560. */
  30561. Grid_createClass(Grid, [{
  30562. key: "destroy",
  30563. value: function destroy() {
  30564. Grid_get(Grid_getPrototypeOf(Grid.prototype), "destroy", this).call(this);
  30565. Util.reset(this);
  30566. }
  30567. /**
  30568. * @function SuperMap.Grid.prototype.fromJson
  30569. * @description 将服务端 JSON 对象转换成当前客户端对象。
  30570. * @param {Object} jsonObject - 要转换的 JSON 对象。
  30571. */
  30572. }, {
  30573. key: "fromJson",
  30574. value: function fromJson(jsonObject) {
  30575. Grid_get(Grid_getPrototypeOf(Grid.prototype), "fromJson", this).call(this, jsonObject);
  30576. if (this.specialColor) {
  30577. this.specialColor = new ServerColor(this.specialColor.red, this.specialColor.green, this.specialColor.blue);
  30578. }
  30579. if (this.colors) {
  30580. var colors = [],
  30581. color;
  30582. for (var i in this.colors) {
  30583. color = this.colors[i];
  30584. colors.push(new ServerColor(color.red, color.green, color.blue));
  30585. }
  30586. this.colors = colors;
  30587. }
  30588. if (this.dashStyle) {
  30589. this.dashStyle = new ServerStyle(this.dashStyle);
  30590. }
  30591. if (this.solidStyle) {
  30592. this.solidStyle = new ServerStyle(this.solidStyle);
  30593. }
  30594. if (this.colorDictionary) {
  30595. var colorDics = [],
  30596. colorDic;
  30597. for (var key in this.colorDictionary) {
  30598. colorDic = this.colorDictionary[key];
  30599. colorDics.push(new ColorDictionary({
  30600. elevation: key,
  30601. color: colorDic
  30602. }));
  30603. }
  30604. this.colorDictionarys = colorDics;
  30605. }
  30606. delete this.colorDictionary;
  30607. }
  30608. /**
  30609. * @function SuperMap.Grid.prototype.toServerJSONObject
  30610. * @description 转换成对应的 JSON 对象。
  30611. * @returns JSON 对象。
  30612. */
  30613. }, {
  30614. key: "toServerJSONObject",
  30615. value: function toServerJSONObject() {
  30616. var jsonObject = Grid_get(Grid_getPrototypeOf(Grid.prototype), "toServerJSONObject", this).call(this);
  30617. if (jsonObject.dashStyle) {
  30618. if (jsonObject.dashStyle.toServerJSONObject) {
  30619. jsonObject.dashStyle = jsonObject.dashStyle.toServerJSONObject();
  30620. }
  30621. }
  30622. if (jsonObject.solidStyle) {
  30623. if (jsonObject.solidStyle.toServerJSONObject) {
  30624. jsonObject.solidStyle = jsonObject.solidStyle.toServerJSONObject();
  30625. }
  30626. }
  30627. return jsonObject;
  30628. }
  30629. }]);
  30630. return Grid;
  30631. }(UGCSubLayer);
  30632. SuperMap.Grid = Grid;
  30633. ;// CONCATENATED MODULE: ./src/common/iServer/Image.js
  30634. function Image_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Image_typeof = function _typeof(obj) { return typeof obj; }; } else { Image_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Image_typeof(obj); }
  30635. function Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30636. 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); } }
  30637. function Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) Image_defineProperties(Constructor, staticProps); return Constructor; }
  30638. function Image_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Image_get = Reflect.get; } else { Image_get = function _get(target, property, receiver) { var base = Image_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Image_get(target, property, receiver || target); }
  30639. function Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Image_getPrototypeOf(object); if (object === null) break; } return object; }
  30640. function Image_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Image_setPrototypeOf(subClass, superClass); }
  30641. function Image_setPrototypeOf(o, p) { Image_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Image_setPrototypeOf(o, p); }
  30642. 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); }; }
  30643. function Image_possibleConstructorReturn(self, call) { if (call && (Image_typeof(call) === "object" || typeof call === "function")) { return call; } return Image_assertThisInitialized(self); }
  30644. function Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30645. function Image_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30646. function Image_getPrototypeOf(o) { Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Image_getPrototypeOf(o); }
  30647. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30648. * This program are made available under the terms of the Apache License, Version 2.0
  30649. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30650. /**
  30651. * @class SuperMap.Image
  30652. * @category iServer Map Layer
  30653. * @classdesc UGC 影像图层类
  30654. * @extends {SuperMap.UGCSubLayer}
  30655. * @param {Object} options - 参数。
  30656. * @param {SuperMap.ColorSpaceType} [options.colorSpaceType] - 返回影像图层的色彩显示模式。
  30657. * @param {number} [options.brightness] - 影像图层的亮度。
  30658. * @param {Array.<number>} [options.displayBandIndexes] - 返回当前影像图层显示的波段索引。
  30659. * @param {number} [options.contrast] - 影像图层的对比度。
  30660. * @param {boolean} [options.transparent] - 是否背景透明。
  30661. * @param {SuperMap.ServerColor} [options.transparentColor] - 返回背景透明色。
  30662. * @param {number} [options.transparentColorTolerance] - 背景透明色容限。
  30663. */
  30664. var UGCImage = /*#__PURE__*/function (_UGCSubLayer) {
  30665. Image_inherits(UGCImage, _UGCSubLayer);
  30666. var _super = Image_createSuper(UGCImage);
  30667. function UGCImage(options) {
  30668. var _this;
  30669. Image_classCallCheck(this, UGCImage);
  30670. options = options || {};
  30671. _this = _super.call(this, options);
  30672. /**
  30673. * @member {number} SuperMap.Image.prototype.brightness
  30674. * @description 影像图层的亮度。
  30675. */
  30676. _this.brightness = null;
  30677. /**
  30678. * @member {SuperMap.ColorSpaceType} SuperMap.Image.prototype.colorSpaceType
  30679. * @description 返回影像图层的色彩显示模式。
  30680. */
  30681. _this.colorSpaceType = null;
  30682. /**
  30683. * @member {number} SuperMap.Image.prototype.contrast
  30684. * @description 影像图层的对比度。
  30685. */
  30686. _this.contrast = null;
  30687. /**
  30688. * @member {Array.<number>} SuperMap.Image.prototype.displayBandIndexes
  30689. * @description 返回当前影像图层显示的波段索引。
  30690. */
  30691. _this.displayBandIndexes = null;
  30692. /**
  30693. * @member {boolean} SuperMap.Image.prototype.transparent
  30694. * @description 是否背景透明。
  30695. */
  30696. _this.transparent = null;
  30697. /**
  30698. * @member {SuperMap.ServerColor} SuperMap.Image.prototype.transparentColor
  30699. * @description 返回背景透明色。
  30700. */
  30701. _this.transparentColor = null;
  30702. /**
  30703. * @member {number} SuperMap.Image.prototype.transparentColorTolerance
  30704. * @description 背景透明色容限。
  30705. */
  30706. _this.transparentColorTolerance = null;
  30707. _this.CLASS_NAME = "SuperMap.Image";
  30708. return _this;
  30709. }
  30710. /**
  30711. * @function SuperMap.Image.prototype.destroy
  30712. * @override
  30713. */
  30714. Image_createClass(UGCImage, [{
  30715. key: "destroy",
  30716. value: function destroy() {
  30717. Image_get(Image_getPrototypeOf(UGCImage.prototype), "destroy", this).call(this);
  30718. Util.reset(this);
  30719. }
  30720. /**
  30721. * @function SuperMap.Image.prototype.fromJson
  30722. * @description 将服务端 JSON 对象转换成当前客户端对象。
  30723. * @param {Object} jsonObject - 要转换的 JSON 对象。
  30724. */
  30725. }, {
  30726. key: "fromJson",
  30727. value: function fromJson(jsonObject) {
  30728. Image_get(Image_getPrototypeOf(UGCImage.prototype), "fromJson", this).call(this, jsonObject);
  30729. if (this.transparentColor) {
  30730. this.transparentColor = new ServerColor(this.transparentColor.red, this.transparentColor.green, this.transparentColor.blue);
  30731. }
  30732. }
  30733. /**
  30734. * @function SuperMap.Image.prototype.toServerJSONObject
  30735. * @description 转换成对应的 JSON 格式对象。
  30736. */
  30737. }, {
  30738. key: "toServerJSONObject",
  30739. value: function toServerJSONObject() {
  30740. return Image_get(Image_getPrototypeOf(UGCImage.prototype), "toServerJSONObject", this).call(this);
  30741. }
  30742. }]);
  30743. return UGCImage;
  30744. }(UGCSubLayer);
  30745. SuperMap.Image = UGCImage;
  30746. ;// CONCATENATED MODULE: ./src/common/iServer/Vector.js
  30747. function iServer_Vector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { iServer_Vector_typeof = function _typeof(obj) { return typeof obj; }; } else { iServer_Vector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return iServer_Vector_typeof(obj); }
  30748. function iServer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30749. 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); } }
  30750. function iServer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) iServer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) iServer_Vector_defineProperties(Constructor, staticProps); return Constructor; }
  30751. function iServer_Vector_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { iServer_Vector_get = Reflect.get; } else { iServer_Vector_get = function _get(target, property, receiver) { var base = iServer_Vector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return iServer_Vector_get(target, property, receiver || target); }
  30752. function iServer_Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = iServer_Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  30753. function iServer_Vector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) iServer_Vector_setPrototypeOf(subClass, superClass); }
  30754. function iServer_Vector_setPrototypeOf(o, p) { iServer_Vector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iServer_Vector_setPrototypeOf(o, p); }
  30755. 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); }; }
  30756. function iServer_Vector_possibleConstructorReturn(self, call) { if (call && (iServer_Vector_typeof(call) === "object" || typeof call === "function")) { return call; } return iServer_Vector_assertThisInitialized(self); }
  30757. function iServer_Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30758. function iServer_Vector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30759. function iServer_Vector_getPrototypeOf(o) { iServer_Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iServer_Vector_getPrototypeOf(o); }
  30760. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30761. * This program are made available under the terms of the Apache License, Version 2.0
  30762. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30763. /**
  30764. * @class SuperMap.Vector
  30765. * @category iServer Map TileFeature
  30766. * @classdesc UGC 矢量图层类。
  30767. * @extends {SuperMap.UGCSubLayer}
  30768. * @param {Object} options - 参数。
  30769. * @param {SuperMap.ServerStyle} [options.style] - 矢量图层的风格。
  30770. */
  30771. var Vector_Vector = /*#__PURE__*/function (_UGCSubLayer) {
  30772. iServer_Vector_inherits(Vector, _UGCSubLayer);
  30773. var _super = iServer_Vector_createSuper(Vector);
  30774. function Vector(options) {
  30775. var _this;
  30776. iServer_Vector_classCallCheck(this, Vector);
  30777. options = options || {};
  30778. _this = _super.call(this, options);
  30779. /**
  30780. * @member {SuperMap.ServerStyle} SuperMap.Vector.prototype.style
  30781. * @description 矢量图层的风格。
  30782. */
  30783. _this.style = null;
  30784. _this.CLASS_NAME = "SuperMap.Vector";
  30785. return _this;
  30786. }
  30787. /**
  30788. * @function SuperMap.Vector.prototype.destroy
  30789. * @override
  30790. */
  30791. iServer_Vector_createClass(Vector, [{
  30792. key: "destroy",
  30793. value: function destroy() {
  30794. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  30795. Util.reset(this);
  30796. }
  30797. /**
  30798. * @function SuperMap.Vector.prototype.fromJson
  30799. * @description 将服务端 JSON 对象转换成当前客户端对象。
  30800. * @param {Object} jsonObject - 要转换的 JSON 对象。
  30801. */
  30802. }, {
  30803. key: "fromJson",
  30804. value: function fromJson(jsonObject) {
  30805. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "fromJson", this).call(this, jsonObject);
  30806. var sty = this.style;
  30807. if (sty) {
  30808. this.style = new ServerStyle(sty);
  30809. }
  30810. }
  30811. /**
  30812. * @function SuperMap.Vector.prototype.toServerJSONObject
  30813. * @description 转换成对应的 JSON 格式对象。
  30814. * @returns {Object} 对应的 JSON 格式对象
  30815. */
  30816. }, {
  30817. key: "toServerJSONObject",
  30818. value: function toServerJSONObject() {
  30819. var jsonObject = SuperMap.toServerJSONObject();
  30820. if (jsonObject.style) {
  30821. if (jsonObject.style.toServerJSONObject) {
  30822. jsonObject.style = jsonObject.style.toServerJSONObject();
  30823. }
  30824. }
  30825. return jsonObject;
  30826. }
  30827. }]);
  30828. return Vector;
  30829. }(UGCSubLayer);
  30830. SuperMap.Vector = Vector_Vector;
  30831. ;// CONCATENATED MODULE: ./src/common/iServer/GetLayersInfoService.js
  30832. function GetLayersInfoService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetLayersInfoService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetLayersInfoService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetLayersInfoService_typeof(obj); }
  30833. function GetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30834. 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); } }
  30835. function GetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetLayersInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  30836. function GetLayersInfoService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetLayersInfoService_get = Reflect.get; } else { GetLayersInfoService_get = function _get(target, property, receiver) { var base = GetLayersInfoService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GetLayersInfoService_get(target, property, receiver || target); }
  30837. function GetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  30838. function GetLayersInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GetLayersInfoService_setPrototypeOf(subClass, superClass); }
  30839. function GetLayersInfoService_setPrototypeOf(o, p) { GetLayersInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetLayersInfoService_setPrototypeOf(o, p); }
  30840. 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); }; }
  30841. function GetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (GetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetLayersInfoService_assertThisInitialized(self); }
  30842. function GetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30843. function GetLayersInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30844. function GetLayersInfoService_getPrototypeOf(o) { GetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetLayersInfoService_getPrototypeOf(o); }
  30845. /* Copyright© 2000 - 2021 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 SuperMap.GetLayersInfoService
  30850. * @category iServer Map Layer
  30851. * @classdesc 获取图层信息服务类构造函数。
  30852. * @extends {SuperMap.CommonServiceBase}
  30853. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  30854. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  30855. * 如 http://localhost:8090/iserver/services/map-world/rest/maps/World 。
  30856. * 如果查询临时图层的信息,请指定完成的url,包含临时图层ID信息,如:
  30857. * http://localhost:8090/iserver/services/map-world/rest/maps/World/tempLayersSet/resourceID
  30858. * @param {Object} options - 参数。
  30859. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  30860. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  30861. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  30862. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30863. * @param {Object} [options.headers] - 请求头。
  30864. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  30865. */
  30866. var GetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  30867. GetLayersInfoService_inherits(GetLayersInfoService, _CommonServiceBase);
  30868. var _super = GetLayersInfoService_createSuper(GetLayersInfoService);
  30869. function GetLayersInfoService(url, options) {
  30870. var _this;
  30871. GetLayersInfoService_classCallCheck(this, GetLayersInfoService);
  30872. _this = _super.call(this, url, options);
  30873. /**
  30874. * @member {boolean} SuperMap.GetLayersInfoService.prototype.isTempLayers
  30875. * @description 当前url对应的图层是否是临时图层。
  30876. */
  30877. _this.isTempLayers = false;
  30878. if (options) {
  30879. Util.extend(GetLayersInfoService_assertThisInitialized(_this), options);
  30880. }
  30881. _this.CLASS_NAME = "SuperMap.GetLayersInfoService";
  30882. return _this;
  30883. }
  30884. /**
  30885. * @function SuperMap.GetLayersInfoService.prototype.destroy
  30886. * @override
  30887. */
  30888. GetLayersInfoService_createClass(GetLayersInfoService, [{
  30889. key: "destroy",
  30890. value: function destroy() {
  30891. GetLayersInfoService_get(GetLayersInfoService_getPrototypeOf(GetLayersInfoService.prototype), "destroy", this).call(this);
  30892. Util.reset(this);
  30893. }
  30894. /**
  30895. * @function SuperMap.GetLayersInfoService.prototype.processAsync
  30896. * @description 负责将客户端的更新参数传递到服务端。
  30897. */
  30898. }, {
  30899. key: "processAsync",
  30900. value: function processAsync() {
  30901. var me = this,
  30902. method = "GET";
  30903. if (!me.isTempLayers) {
  30904. me.url = Util.urlPathAppend(me.url, 'layers');
  30905. }
  30906. me.request({
  30907. method: method,
  30908. params: null,
  30909. scope: me,
  30910. success: me.serviceProcessCompleted,
  30911. failure: me.serviceProcessFailed
  30912. });
  30913. }
  30914. /**
  30915. * @function SuperMap.GetLayersInfoService.prototype.serviceProcessCompleted
  30916. * @description 编辑完成,执行此方法。
  30917. * @param {Object} result - 服务器返回的结果对象。
  30918. */
  30919. }, {
  30920. key: "serviceProcessCompleted",
  30921. value: function serviceProcessCompleted(result) {
  30922. var me = this,
  30923. existRes,
  30924. layers,
  30925. len;
  30926. result = Util.transformResult(result);
  30927. existRes = !!result && result.length > 0;
  30928. layers = existRes ? result[0].subLayers.layers : null;
  30929. len = layers ? layers.length : 0;
  30930. me.handleLayers(len, layers);
  30931. me.events.triggerEvent("processCompleted", {
  30932. result: result[0]
  30933. });
  30934. }
  30935. /**
  30936. * TODO 专题图时候可能会用到
  30937. * @function SuperMap.GetLayersInfoService.prototype.handleLayers
  30938. * @description 处理 iServer 新增图层组数据 (subLayers.layers 中可能还会含有 subLayers.layers)
  30939. * @param {number} len - subLayers.layers的长度
  30940. * @param {Array.<number>} layers - subLayers.layers的长度数组
  30941. */
  30942. }, {
  30943. key: "handleLayers",
  30944. value: function handleLayers(len, layers) {
  30945. var me = this,
  30946. tempLayer;
  30947. if (len) {
  30948. for (var i = 0; i < len; i++) {
  30949. if (layers[i].subLayers && layers[i].subLayers.layers && layers[i].subLayers.layers.length > 0) {
  30950. me.handleLayers(layers[i].subLayers.layers.length, layers[i].subLayers.layers);
  30951. } else {
  30952. var type = layers[i].ugcLayerType;
  30953. switch (type) {
  30954. case 'THEME':
  30955. tempLayer = new ServerTheme();
  30956. tempLayer.fromJson(layers[i]);
  30957. layers[i] = tempLayer;
  30958. break;
  30959. case 'GRID':
  30960. tempLayer = new Grid();
  30961. tempLayer.fromJson(layers[i]);
  30962. layers[i] = tempLayer;
  30963. break;
  30964. case 'IMAGE':
  30965. tempLayer = new UGCImage();
  30966. tempLayer.fromJson(layers[i]);
  30967. layers[i] = tempLayer;
  30968. break;
  30969. case 'VECTOR':
  30970. tempLayer = new Vector_Vector();
  30971. tempLayer.fromJson(layers[i]);
  30972. layers[i] = tempLayer;
  30973. break;
  30974. default:
  30975. break;
  30976. }
  30977. }
  30978. }
  30979. }
  30980. }
  30981. }]);
  30982. return GetLayersInfoService;
  30983. }(CommonServiceBase);
  30984. SuperMap.GetLayersInfoService = GetLayersInfoService;
  30985. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystParameters.js
  30986. function InterpolationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30987. 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); } }
  30988. function InterpolationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  30989. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30990. * This program are made available under the terms of the Apache License, Version 2.0
  30991. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30992. /**
  30993. * @class SuperMap.InterpolationAnalystParameters
  30994. * @category iServer SpatialAnalyst InterpolationAnalyst
  30995. * @classdesc 插值分析参数类。
  30996. * @param {Object} options - 参数。
  30997. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  30998. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  30999. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  31000. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。
  31001. * @param {string} [options.dataset] - 用于做插值分析的数据源中数据集的名称。当插值分析类型(InterpolationAnalystType)为 dataset 时,此参数为必选。
  31002. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  31003. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  31004. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  31005. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  31006. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  31007. * @param {SuperMap.PixelFormat} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  31008. * @param {string} [options.InterpolationAnalystType="dataset"] - 插值分析类型("dataset" 或 "geometry")。
  31009. */
  31010. var InterpolationAnalystParameters = /*#__PURE__*/function () {
  31011. function InterpolationAnalystParameters(options) {
  31012. InterpolationAnalystParameters_classCallCheck(this, InterpolationAnalystParameters);
  31013. if (!options) {
  31014. return;
  31015. }
  31016. /**
  31017. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.InterpolationAnalystParameters.prototype.bounds
  31018. * @description 插值分析的范围,用于确定结果栅格数据集的范围。
  31019. * 如果缺省,则默认为原数据集的范围。鉴于此插值方法为内插方法,原数据集的范围内的插值结果才相对有参考价值,
  31020. * 因此建议此参数不大于原数据集范围。
  31021. */
  31022. this.bounds = null;
  31023. /**
  31024. * @member {number} [SuperMap.InterpolationAnalystParameters.prototype.searchRadius=0]
  31025. * @description 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  31026. * 计算某个位置的Z 值时,会以该位置为圆心,以查找范围的值为半径,落在这个范围内的采样点都将参与运算。
  31027. * 该值需要根据待插值点数据的分布状况和点数据集范围进行设置。
  31028. */
  31029. this.searchRadius = 0;
  31030. /**
  31031. * @member {string} SuperMap.InterpolationAnalystParameters.prototype.zValueFieldName
  31032. * @description 数据集插值分析中,用于指定进行插值分析的目标字段名,插值分析不支持文本类型的字段。
  31033. * 含义为每个插值点在插值过程中的权重,可以将所有点此字段值设置为 1,即所有点在整体插值中权重相同。
  31034. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  31035. */
  31036. this.zValueFieldName = null;
  31037. /**
  31038. * @member {number} [SuperMap.InterpolationAnalystParameters.prototype.zValueScale=1]
  31039. * @description 用于进行插值分析值的缩放比率。
  31040. * 参加插值分析的值将乘以该参数值后再进行插值,也就是对进行插值分析的值进行统一的扩大或缩小。
  31041. */
  31042. this.zValueScale = 1;
  31043. /**
  31044. * @member {number} SuperMap.InterpolationAnalystParameters.prototype.resolution
  31045. * @description 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  31046. * 该值不能超过待分析数据集的范围边长。
  31047. * 且该值设置时,应该考虑点数据集范围大小来取值,一般为结果栅格行列值(即结果栅格数据集范围除以分辨率),在 500 以内可以较好地体现密度走势。
  31048. */
  31049. this.resolution = null;
  31050. /**
  31051. * @member {SuperMap.FilterParameter} [SuperMap.InterpolationAnalystParameters.prototype.filterQueryParameter]
  31052. * @description 过滤条件,对分析数据集中的点进行过滤,设置为 null 表示对数据集中的所有点进行分析。
  31053. */
  31054. this.filterQueryParameter = null;
  31055. /**
  31056. * @member {string} SuperMap.InterpolationAnalystParameters.prototype.outputDatasetName
  31057. * @description 插值分析结果数据集的名称。
  31058. */
  31059. this.outputDatasetName = null;
  31060. /**
  31061. * @member {string} SuperMap.InterpolationAnalystParameters.prototype.outputDatasourceName
  31062. * @description 插值分析结果数据源的名称。
  31063. */
  31064. this.outputDatasourceName = null;
  31065. /**
  31066. * @member {SuperMap.PixelFormat} [SuperMap.InterpolationAnalystParameters.prototype.pixelFormat]
  31067. * @description 指定结果栅格数据集存储的像素格式。支持存储的像素格式有 BIT16、BIT32、DOUBLE、SINGLE、UBIT1、UBIT4、UBIT8、UBIT24、UBIT32。
  31068. */
  31069. this.pixelFormat = null;
  31070. /**
  31071. * @member {string} [SuperMap.InterpolationAnalystParameters.prototype.dataset]
  31072. * @description 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。
  31073. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此参数为必选。
  31074. */
  31075. this.dataset = null;
  31076. /**
  31077. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [SuperMap.InterpolationAnalystParameters.prototype.inputPoints]
  31078. * @description 用于做插值分析的离散点(离散点包括Z值)集合。
  31079. * 当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  31080. * 通过离散点直接进行插值分析不需要指定输入数据集inputDatasourceName,inputDatasetName以及zValueFieldName。
  31081. */
  31082. this.inputPoints = null;
  31083. /**
  31084. * @member {string} [SuperMap.InterpolationAnalystParameters.prototype.InterpolationAnalystType="dataset"]
  31085. * @description 插值分析类型。差值分析包括数据集插值分析和几何插值分析两类,
  31086. * "dataset" 表示对数据集进行插值分析,"geometry" 表示对离散点数组进行插值分析。
  31087. */
  31088. this.InterpolationAnalystType = "dataset";
  31089. /**
  31090. * @member {Object} SuperMap.InterpolationAnalystParameters.prototype.clipParam
  31091. * @description 对插值分析结果进行裁剪的参数。
  31092. */
  31093. this.clipParam = null;
  31094. Util.extend(this, options);
  31095. this.CLASS_NAME = "SuperMap.InterpolationAnalystParameters";
  31096. }
  31097. /**
  31098. * @function SuperMap.InterpolationAnalystParameters.prototype.destroy
  31099. * @description 释放资源,将引用资源的属性置空。
  31100. */
  31101. InterpolationAnalystParameters_createClass(InterpolationAnalystParameters, [{
  31102. key: "destroy",
  31103. value: function destroy() {
  31104. var me = this;
  31105. me.bounds = null;
  31106. me.searchRadius = null;
  31107. me.zValueFieldName = null;
  31108. me.zValueScale = null;
  31109. me.resolution = null;
  31110. me.filterQueryParameter = null;
  31111. me.outputDatasetName = null;
  31112. me.pixelFormat = null;
  31113. }
  31114. /**
  31115. * @function SuperMap.InterpolationAnalystParameters.toObject
  31116. * @param {SuperMap.InterpolationAnalystParameters} interpolationAnalystParameters - 插值分析参数类。
  31117. * @param {SuperMap.InterpolationAnalystParameters} tempObj - 插值分析参数对象。
  31118. * @description 将插值分析参数对象转换成 JSON 对象。
  31119. * @returns JSON 对象。
  31120. */
  31121. }], [{
  31122. key: "toObject",
  31123. value: function toObject(interpolationAnalystParameters, tempObj) {
  31124. for (var name in interpolationAnalystParameters) {
  31125. if (name === "inputPoints" && interpolationAnalystParameters.InterpolationAnalystType === "geometry") {
  31126. var objs = [];
  31127. for (var i = 0; i < interpolationAnalystParameters.inputPoints.length; i++) {
  31128. var item = interpolationAnalystParameters.inputPoints[i];
  31129. var obj = {
  31130. x: item.x,
  31131. y: item.y,
  31132. z: item.tag
  31133. };
  31134. objs.push(obj);
  31135. }
  31136. tempObj[name] = objs;
  31137. } else {
  31138. tempObj[name] = interpolationAnalystParameters[name];
  31139. }
  31140. }
  31141. }
  31142. }]);
  31143. return InterpolationAnalystParameters;
  31144. }();
  31145. SuperMap.InterpolationAnalystParameters = InterpolationAnalystParameters;
  31146. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationRBFAnalystParameters.js
  31147. function InterpolationRBFAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { InterpolationRBFAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { InterpolationRBFAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return InterpolationRBFAnalystParameters_typeof(obj); }
  31148. function InterpolationRBFAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31149. 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); } }
  31150. function InterpolationRBFAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationRBFAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationRBFAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31151. function InterpolationRBFAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationRBFAnalystParameters_get = Reflect.get; } else { InterpolationRBFAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationRBFAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return InterpolationRBFAnalystParameters_get(target, property, receiver || target); }
  31152. function InterpolationRBFAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationRBFAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31153. function InterpolationRBFAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) InterpolationRBFAnalystParameters_setPrototypeOf(subClass, superClass); }
  31154. function InterpolationRBFAnalystParameters_setPrototypeOf(o, p) { InterpolationRBFAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationRBFAnalystParameters_setPrototypeOf(o, p); }
  31155. 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); }; }
  31156. function InterpolationRBFAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationRBFAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationRBFAnalystParameters_assertThisInitialized(self); }
  31157. function InterpolationRBFAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31158. function InterpolationRBFAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31159. function InterpolationRBFAnalystParameters_getPrototypeOf(o) { InterpolationRBFAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationRBFAnalystParameters_getPrototypeOf(o); }
  31160. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31161. * This program are made available under the terms of the Apache License, Version 2.0
  31162. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31163. /**
  31164. * @class SuperMap.InterpolationRBFAnalystParameters
  31165. * @category iServer SpatialAnalyst InterpolationAnalyst
  31166. * @classdesc 样条插值(径向基函数插值法)分析参数类。
  31167. * @extends {SuperMap.InterpolationAnalystParameters}
  31168. * @param {Object} options - 参数。
  31169. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  31170. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  31171. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  31172. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  31173. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  31174. * @param {number} [options.smooth=0.1] - 光滑系数,该值表示插值函数曲线与点的逼近程度,值域为0到1。
  31175. * @param {number} [options.tension=40] - 张力系数,用于调整结果栅格数据表面的特性。
  31176. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置参与差值运算的点数。
  31177. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  31178. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  31179. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  31180. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  31181. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  31182. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  31183. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  31184. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(InterpolationAnalystType)为 dataset 时。此参数为必选。
  31185. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。此参数为必选。
  31186. * @example
  31187. * var myInterpolationRBFAnalystParameters = new SuperMap.InterpolationRBFAnalystParameters({
  31188. * dataset:"SamplesP@Interpolation",
  31189. * smooth: 0.1,
  31190. * tension: 40,
  31191. * searchMode: "QUADTREE",
  31192. * maxPointCountForInterpolation: 20,
  31193. * maxPointCountInNode: 5,
  31194. * pixelFormat: "BIT16",
  31195. * zValueFieldName: "AVG_TMP",
  31196. * resolution: 3000,
  31197. * filterQueryParameter: {
  31198. * attributeFilter: ""
  31199. * },
  31200. * outputDatasetName: "myRBF"
  31201. * });
  31202. */
  31203. var InterpolationRBFAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  31204. InterpolationRBFAnalystParameters_inherits(InterpolationRBFAnalystParameters, _InterpolationAnalyst);
  31205. var _super = InterpolationRBFAnalystParameters_createSuper(InterpolationRBFAnalystParameters);
  31206. function InterpolationRBFAnalystParameters(options) {
  31207. var _this;
  31208. InterpolationRBFAnalystParameters_classCallCheck(this, InterpolationRBFAnalystParameters);
  31209. _this = _super.call(this, options);
  31210. /**
  31211. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.smooth=0.1]
  31212. * @description 光滑系数,值域为 0 到 1,常用取值如 0、0.001、0.01、0.1、和 0.5。
  31213. * 该值表示插值函数曲线与点的逼近程度,此数值越大,函数曲线与点的偏差越大,反之越小。
  31214. */
  31215. _this.smooth = 0.1;
  31216. /**
  31217. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.tension=40]
  31218. * @description 张力系数,常用取值如 0、1、5 和 10。
  31219. * 用于调整结果栅格数据表面的特性,张力越大,插值时每个点对计算结果影响越小,反之越大。
  31220. */
  31221. _this.tension = 40;
  31222. /**
  31223. * @member {SuperMap.SearchMode} SuperMap.InterpolationRBFAnalystParameters.prototype.searchMode
  31224. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
  31225. * 具体如下:
  31226. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  31227. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  31228. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  31229. */
  31230. _this.searchMode = null;
  31231. /**
  31232. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.expectedCount=12]
  31233. * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
  31234. */
  31235. _this.expectedCount = 12;
  31236. /**
  31237. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.maxPointCountForInterpolation=200]
  31238. * @description 【块查找】方式下,最多参与插值的点数。
  31239. */
  31240. _this.maxPointCountForInterpolation = 200;
  31241. /**
  31242. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.maxPointCountInNode=50]
  31243. * @description 【块查找】方式下,单个块内最多参与运算点数。
  31244. */
  31245. _this.maxPointCountInNode = 50;
  31246. if (options) {
  31247. Util.extend(InterpolationRBFAnalystParameters_assertThisInitialized(_this), options);
  31248. }
  31249. _this.CLASS_NAME = "SuperMap.InterpolationRBFAnalystParameters";
  31250. return _this;
  31251. }
  31252. /**
  31253. * @function SuperMap.InterpolationRBFAnalystParameters.prototype.destroy
  31254. * @description 释放资源,将引用资源的属性置空。
  31255. */
  31256. InterpolationRBFAnalystParameters_createClass(InterpolationRBFAnalystParameters, [{
  31257. key: "destroy",
  31258. value: function destroy() {
  31259. InterpolationRBFAnalystParameters_get(InterpolationRBFAnalystParameters_getPrototypeOf(InterpolationRBFAnalystParameters.prototype), "destroy", this).call(this);
  31260. var me = this;
  31261. me.smooth = null;
  31262. me.tension = null;
  31263. me.searchMode = null;
  31264. me.expectedCount = null;
  31265. me.maxPointCountForInterpolation = null;
  31266. me.maxPointCountInNode = null;
  31267. }
  31268. /**
  31269. * @function SuperMap.InterpolationRBFAnalystParameters.toObject
  31270. * @param {SuperMap.InterpolationRBFAnalystParameters} datasetInterpolationRBFAnalystParameters - 样条插值(径向基函数插值法)分析参数类
  31271. * @param {SuperMap.InterpolationRBFAnalystParameters} tempObj - 样条插值(径向基函数插值法)分析参数对象
  31272. * @description 将样条插值(径向基函数插值法)分析参数对象转换为 JSON 对象。
  31273. * @returns JSON 对象。
  31274. */
  31275. }], [{
  31276. key: "toObject",
  31277. value: function toObject(datasetInterpolationRBFAnalystParameters, tempObj) {
  31278. for (var name in datasetInterpolationRBFAnalystParameters) {
  31279. tempObj[name] = datasetInterpolationRBFAnalystParameters[name];
  31280. }
  31281. }
  31282. }]);
  31283. return InterpolationRBFAnalystParameters;
  31284. }(InterpolationAnalystParameters);
  31285. SuperMap.InterpolationRBFAnalystParameters = InterpolationRBFAnalystParameters;
  31286. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationDensityAnalystParameters.js
  31287. function InterpolationDensityAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { InterpolationDensityAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { InterpolationDensityAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return InterpolationDensityAnalystParameters_typeof(obj); }
  31288. function InterpolationDensityAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31289. 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); } }
  31290. function InterpolationDensityAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationDensityAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationDensityAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31291. function InterpolationDensityAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationDensityAnalystParameters_get = Reflect.get; } else { InterpolationDensityAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationDensityAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return InterpolationDensityAnalystParameters_get(target, property, receiver || target); }
  31292. function InterpolationDensityAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationDensityAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31293. function InterpolationDensityAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) InterpolationDensityAnalystParameters_setPrototypeOf(subClass, superClass); }
  31294. function InterpolationDensityAnalystParameters_setPrototypeOf(o, p) { InterpolationDensityAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationDensityAnalystParameters_setPrototypeOf(o, p); }
  31295. 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); }; }
  31296. function InterpolationDensityAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationDensityAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationDensityAnalystParameters_assertThisInitialized(self); }
  31297. function InterpolationDensityAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31298. function InterpolationDensityAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31299. function InterpolationDensityAnalystParameters_getPrototypeOf(o) { InterpolationDensityAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationDensityAnalystParameters_getPrototypeOf(o); }
  31300. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31301. * This program are made available under the terms of the Apache License, Version 2.0
  31302. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31303. /**
  31304. * @class SuperMap.InterpolationDensityAnalystParameters
  31305. * @category iServer SpatialAnalyst InterpolationAnalyst
  31306. * @classdesc 点密度差值分析参数类。
  31307. * @param {Object} options - 参数。
  31308. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  31309. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  31310. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  31311. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  31312. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型( SuperMap.InterpolationAnalystType)为 dataset 时。此为必选参数。
  31313. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  31314. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  31315. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  31316. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  31317. * @param {string} [options.dataset] - 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,必设参数。
  31318. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,必设参数。
  31319. * @extends {SuperMap.InterpolationAnalystParameters}
  31320. * @example
  31321. * var myInterpolationDensityAnalystParameters = new SuperMap.InterpolationDensityAnalystParameters({
  31322. * dataset: "SamplesP@Interpolation",
  31323. * searchRadius: "100000",
  31324. * pixelFormat: "BIT16",
  31325. * zValueFieldName: "AVG_TMP",
  31326. * resolution: 3000,
  31327. * filterQueryParameter: {
  31328. * attributeFilter: ""
  31329. * },
  31330. * outputDatasetName: "myDensity"
  31331. * });
  31332. */
  31333. var InterpolationDensityAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  31334. InterpolationDensityAnalystParameters_inherits(InterpolationDensityAnalystParameters, _InterpolationAnalyst);
  31335. var _super = InterpolationDensityAnalystParameters_createSuper(InterpolationDensityAnalystParameters);
  31336. function InterpolationDensityAnalystParameters(options) {
  31337. var _this;
  31338. InterpolationDensityAnalystParameters_classCallCheck(this, InterpolationDensityAnalystParameters);
  31339. _this = _super.call(this, options);
  31340. if (options) {
  31341. Util.extend(InterpolationDensityAnalystParameters_assertThisInitialized(_this), options);
  31342. }
  31343. _this.CLASS_NAME = "SuperMap.InterpolationDensityAnalystParameters";
  31344. return _this;
  31345. }
  31346. /**
  31347. * @function SuperMap.InterpolationDensityAnalystParameters.prototype.destroy
  31348. * @description 释放资源,将引用资源的属性置空。
  31349. */
  31350. InterpolationDensityAnalystParameters_createClass(InterpolationDensityAnalystParameters, [{
  31351. key: "destroy",
  31352. value: function destroy() {
  31353. InterpolationDensityAnalystParameters_get(InterpolationDensityAnalystParameters_getPrototypeOf(InterpolationDensityAnalystParameters.prototype), "destroy", this).call(this);
  31354. }
  31355. }]);
  31356. return InterpolationDensityAnalystParameters;
  31357. }(InterpolationAnalystParameters);
  31358. SuperMap.InterpolationDensityAnalystParameters = InterpolationDensityAnalystParameters;
  31359. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationIDWAnalystParameters.js
  31360. function InterpolationIDWAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { InterpolationIDWAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { InterpolationIDWAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return InterpolationIDWAnalystParameters_typeof(obj); }
  31361. function InterpolationIDWAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31362. 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); } }
  31363. function InterpolationIDWAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationIDWAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationIDWAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31364. function InterpolationIDWAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationIDWAnalystParameters_get = Reflect.get; } else { InterpolationIDWAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationIDWAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return InterpolationIDWAnalystParameters_get(target, property, receiver || target); }
  31365. function InterpolationIDWAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationIDWAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31366. function InterpolationIDWAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) InterpolationIDWAnalystParameters_setPrototypeOf(subClass, superClass); }
  31367. function InterpolationIDWAnalystParameters_setPrototypeOf(o, p) { InterpolationIDWAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationIDWAnalystParameters_setPrototypeOf(o, p); }
  31368. 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); }; }
  31369. function InterpolationIDWAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationIDWAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationIDWAnalystParameters_assertThisInitialized(self); }
  31370. function InterpolationIDWAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31371. function InterpolationIDWAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31372. function InterpolationIDWAnalystParameters_getPrototypeOf(o) { InterpolationIDWAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationIDWAnalystParameters_getPrototypeOf(o); }
  31373. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31374. * This program are made available under the terms of the Apache License, Version 2.0
  31375. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31376. /**
  31377. * @class SuperMap.InterpolationIDWAnalystParameters
  31378. * @category iServer SpatialAnalyst InterpolationAnalyst
  31379. * @classdesc 反距离加权插值(IDW)分析参数类。
  31380. * @param {Object} options - 参数。
  31381. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  31382. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  31383. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  31384. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  31385. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  31386. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
  31387. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置查找半径,即参与运算点的查找范围,与点数据集单位相同。
  31388. * @param {number} [options.power=2] - 距离权重计算的幂次。
  31389. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  31390. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  31391. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  31392. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  31393. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,必设参数。
  31394. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,必设参数。
  31395. * @extends {SuperMap.InterpolationAnalystParameters}
  31396. * @example 例如:
  31397. * var myInterpolationIDWAnalystParameters = new SuperMap.InterpolationIDWAnalystParameters({
  31398. * dataset:"SamplesP@Interpolation",
  31399. * power: 2,
  31400. * searchMode: "KDTREE_FIXED_COUNT",
  31401. * expectedCount: 12,
  31402. * pixelFormat: "BIT16",
  31403. * zValueFieldName: "AVG_TMP",
  31404. * resolution: 3000,
  31405. * filterQueryParameter: {
  31406. * attributeFilter: ""
  31407. * },
  31408. * outputDatasetName: "myIDW"
  31409. * });
  31410. *
  31411. */
  31412. var InterpolationIDWAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  31413. InterpolationIDWAnalystParameters_inherits(InterpolationIDWAnalystParameters, _InterpolationAnalyst);
  31414. var _super = InterpolationIDWAnalystParameters_createSuper(InterpolationIDWAnalystParameters);
  31415. function InterpolationIDWAnalystParameters(options) {
  31416. var _this;
  31417. InterpolationIDWAnalystParameters_classCallCheck(this, InterpolationIDWAnalystParameters);
  31418. _this = _super.call(this, options);
  31419. /**
  31420. * @member {number} [SuperMap.InterpolationIDWAnalystParameters.prototype.power=2]
  31421. * @description 距离权重计算的幂次。
  31422. * 该值决定了权值下降的速度,幂次越大,随距离的增大权值下降越快,距离预测点越远的点的权值也越小。
  31423. * 理论上,参数值必须大于0,但是0.5到3之间时运算结果更合理,因此推荐值为0.5~3。
  31424. */
  31425. _this.power = 2;
  31426. /**
  31427. * @member {SuperMap.SearchMode} SuperMap.InterpolationIDWAnalystParameters.prototype.searchMode
  31428. * @description 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  31429. * 具体如下:
  31430. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  31431. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  31432. */
  31433. _this.searchMode = null;
  31434. /**
  31435. * @member {number} [SuperMap.InterpolationIDWAnalystParameters.prototype.expectedCount=12]
  31436. * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
  31437. */
  31438. _this.expectedCount = 12;
  31439. if (options) {
  31440. Util.extend(InterpolationIDWAnalystParameters_assertThisInitialized(_this), options);
  31441. }
  31442. _this.CLASS_NAME = "SuperMap.InterpolationIDWAnalystParameters";
  31443. return _this;
  31444. }
  31445. /**
  31446. * @function SuperMap.InterpolationIDWAnalystParameters.prototype.destroy
  31447. * @description 释放资源,将引用资源的属性置空。
  31448. */
  31449. InterpolationIDWAnalystParameters_createClass(InterpolationIDWAnalystParameters, [{
  31450. key: "destroy",
  31451. value: function destroy() {
  31452. InterpolationIDWAnalystParameters_get(InterpolationIDWAnalystParameters_getPrototypeOf(InterpolationIDWAnalystParameters.prototype), "destroy", this).call(this);
  31453. var me = this;
  31454. me.power = null;
  31455. me.searchMode = null;
  31456. me.expectedCount = null;
  31457. }
  31458. }]);
  31459. return InterpolationIDWAnalystParameters;
  31460. }(InterpolationAnalystParameters);
  31461. SuperMap.InterpolationIDWAnalystParameters = InterpolationIDWAnalystParameters;
  31462. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationKrigingAnalystParameters.js
  31463. function InterpolationKrigingAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { InterpolationKrigingAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { InterpolationKrigingAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return InterpolationKrigingAnalystParameters_typeof(obj); }
  31464. function InterpolationKrigingAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31465. 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); } }
  31466. function InterpolationKrigingAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31467. function InterpolationKrigingAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationKrigingAnalystParameters_get = Reflect.get; } else { InterpolationKrigingAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationKrigingAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return InterpolationKrigingAnalystParameters_get(target, property, receiver || target); }
  31468. function InterpolationKrigingAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationKrigingAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31469. function InterpolationKrigingAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) InterpolationKrigingAnalystParameters_setPrototypeOf(subClass, superClass); }
  31470. function InterpolationKrigingAnalystParameters_setPrototypeOf(o, p) { InterpolationKrigingAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationKrigingAnalystParameters_setPrototypeOf(o, p); }
  31471. 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); }; }
  31472. function InterpolationKrigingAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationKrigingAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationKrigingAnalystParameters_assertThisInitialized(self); }
  31473. function InterpolationKrigingAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31474. function InterpolationKrigingAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31475. function InterpolationKrigingAnalystParameters_getPrototypeOf(o) { InterpolationKrigingAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationKrigingAnalystParameters_getPrototypeOf(o); }
  31476. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31477. * This program are made available under the terms of the Apache License, Version 2.0
  31478. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31479. /**
  31480. * @class SuperMap.InterpolationKrigingAnalystParameters
  31481. * @category iServer SpatialAnalyst InterpolationAnalyst
  31482. * @classdesc 克吕金插值分析参数类。
  31483. * @description 通过该类可以设置克吕金插值分析所需的参数。
  31484. * 克吕金(Kriging)法为地统计学上一种空间数据内插处理方法,主要的目的是利用各数据点间变异数(variance)的大小来推求某一未知点与各已知点的权重关系,
  31485. * 再由各数据点的值和其与未知点的权重关系推求未知点的值。Kriging 法最大的特色不仅是提供一个最小估计误差的预测值,并且可明确的指出误差值的大小。
  31486. * 一般而言,许多地质参数,如地形面,本身即具有连续性,故在一段距离内的任两点必有空间上的关系。反之,在一不规则面上的两点若相距甚远,
  31487. * 则在统计意义上可视为互为独立 (stastically indepedent)。这种随距离而改变的空间上连续性,可用半变异图 (semivariogram) 来表现。
  31488. * 因此,若想由已知的散乱点来推求某一未知点的值,则可利用半变异图推求各已知点与未知点的空间关系,即以下四个参数。
  31489. * 然后,由此空间参数推求半变异数,由各数据点间的半变异数可推求未知点与已知点间的权重关系,进而推求出未知点的值。<br>
  31490. *
  31491. * · 块金值(nugget):当采样点间距为0时,理论上半变异函数值为0,但时间上两采样点非常接近时半变异函数值并不为0,即产生了上图所示的块金效应,
  31492. * 对应的半变异函数值为块金值。块金值可能由于测量误差或者空间变异产生。<br>
  31493. *
  31494. * · 基台值(sill):随着采样点间距的不断增大,半变异函数的值趋向一个稳定的常数,该常数成为基台值。到达基台值后,半变异函数的值不再随采样点间距而改变,
  31495. * 即大于此间距的采样点不再具有空间相关性。<br>
  31496. *
  31497. * · 偏基台值:基台值与块金值的差值。<br>
  31498. *
  31499. * · 自相关阈值(range):也称变程,是半变异函数值达到基台值时,采样点的间距。超过自相关阈值的采样点不再具有空间相关性,将不对预测结果产生影响。<br>
  31500. *
  31501. * 由上述可知,半变异函数是克吕金插值的关键,因此选择合适的半变异函数模型非常重要,SuperMap 提供了以下三种半变异函数模型:<br>
  31502. *
  31503. * · 指数型(EXPONENTIAL):适用于空间相关关系随样本间距的增加成指数递减的情况,其空间自相关关系在样本间距的无穷远处完全消失。<br>
  31504. *
  31505. * · 球型(SPHERICAL):适用于空间自相关关系随样本间距的增加而逐渐减少,直到超出一定的距离时空间自相关关系消失的情况。<br>
  31506. *
  31507. * · 高斯型(GAUSSIAN):适用于半变异函数值渐进地逼近基台值的情况。<br>
  31508. *
  31509. * 半变异函数中,有一个关键参数即插值的字段值的期望(平均值),由于对于此参数的不同处理方法而衍生出了不同的 Kriging 方法。SuperMap的差值功能基于以下三种常用 Kriging 算法:<br>
  31510. *
  31511. * 1. 简单克吕金(Simple Kriging):该方法假定用于插值的字段值的期望(平均值)已知的某一常数。<br>
  31512. *
  31513. * 2. 普通克吕金(Kriging):该方法假定用于插值的字段值的期望(平均值)未知且恒定。它利用一定的数学函数,通过对给定的空间点进行拟合来估算单元格的值,<br>
  31514. * 生成格网数据集。它不仅可以生成一个表面,还可以给出预测结果的精度或者确定性的度量。因此,此方法计算精度较高,常用于地学领域。
  31515. *
  31516. * 3. 泛克吕金(Universal Kriging):该方法假定用于插值的字段值的期望(平均值)是未知的变量。在样点数据中存在某种主导趋势且该趋势可以通过某一个确定<br>
  31517. * 的函数或者多项式进行拟合的情况下,适用泛克吕金插值法。
  31518. *
  31519. * 克吕金法的优点是以空间统计学作为其坚实的理论基础,物理含义明确;不但能估计测定参数的空间变异分布,而且还可以估算参数的方差分布。克吕金法的缺点是计算步骤较烦琐,
  31520. * 计算量大,且变异函数有时需要根据经验人为选定。
  31521. * @param {Object} options - 参数。
  31522. * @param {string} options.type - 克吕金插值的类型。
  31523. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  31524. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  31525. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  31526. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  31527. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  31528. * @param {number} [options.mean] - 【简单克吕金】类型下,插值字段的平均值。
  31529. * @param {number} [options.angle=0] - 克吕金算法中旋转角度值。
  31530. * @param {number} [options.nugget=0] - 克吕金算法中块金效应值。
  31531. * @param {number} [options.range=0] - 克吕金算法中自相关阈值,单位与原数据集单位相同。
  31532. * @param {number} [options.sill=0] - 克吕金算法中基台值。
  31533. * @param {string} [options.variogramMode="SPHERICAL"] - 克吕金插值时的半变函数类型。
  31534. * @param {string} [options.exponent='exp1'] - 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数,可选值为 exp1、exp2。
  31535. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数;【定长查找】方式下,设置查找的最小点数。
  31536. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  31537. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  31538. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  31539. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  31540. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  31541. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  31542. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  31543. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如 ”数据集名称@数据源别名” 形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时。
  31544. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。
  31545. * @extends {SuperMap.InterpolationAnalystParameters}
  31546. * @example 例如:
  31547. * var myInterpolationKrigingAnalystParameters = new SuperMap.InterpolationKrigingAnalystParameters({
  31548. * dataset:"SamplesP@Interpolation",
  31549. * type: "KRIGING",
  31550. * angle: 0,
  31551. * mean: 5,
  31552. * nugget: 30,
  31553. * range: 50,
  31554. * sill: 300,
  31555. * variogramMode: "EXPONENTIAL",
  31556. * searchMode: "QUADTREE",
  31557. * maxPointCountForInterpolation: 20,
  31558. * maxPointCountInNode: 5,
  31559. * pixelFormat: "BIT16",
  31560. * zValueFieldName: "AVG_TMP",
  31561. * resolution: 30000,
  31562. * filterQueryParameter: {
  31563. * attributeFilter: ""
  31564. * },
  31565. * outputDatasetName: "myKriging"
  31566. * });
  31567. *
  31568. */
  31569. var InterpolationKrigingAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  31570. InterpolationKrigingAnalystParameters_inherits(InterpolationKrigingAnalystParameters, _InterpolationAnalyst);
  31571. var _super = InterpolationKrigingAnalystParameters_createSuper(InterpolationKrigingAnalystParameters);
  31572. function InterpolationKrigingAnalystParameters(options) {
  31573. var _this;
  31574. InterpolationKrigingAnalystParameters_classCallCheck(this, InterpolationKrigingAnalystParameters);
  31575. _this = _super.call(this, options);
  31576. /**
  31577. * @member {SuperMap.InterpolationAlgorithmType} SuperMap.InterpolationKrigingAnalystParameters.prototype.type
  31578. * @description 克吕金插值的类型。
  31579. * 具体如下:<br>
  31580. * {KRIGING} 普通克吕金插值法。
  31581. * {SimpleKriging} 简单克吕金插值法。
  31582. * {UniversalKriging} 泛克吕金插值法。
  31583. */
  31584. _this.type = null;
  31585. /**
  31586. * @member {number} SuperMap.InterpolationKrigingAnalystParameters.prototype.mean
  31587. * @description 【简单克吕金】方式下,插值字段的平均值。
  31588. * 即采样点插值字段值总和除以采样点数目。
  31589. */
  31590. _this.mean = null;
  31591. /**
  31592. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.angle=0]
  31593. * @description 克吕金算法中旋转角度值。
  31594. * 此角度值指示了每个查找邻域相对于水平方向逆时针旋转的角度。
  31595. */
  31596. _this.angle = 0;
  31597. /**
  31598. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.nugget=0]
  31599. * @description 克吕金算法中块金效应值。
  31600. */
  31601. _this.nugget = 0;
  31602. /**
  31603. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.range=0]
  31604. * @description 克吕金算法中自相关阈值,单位与原数据集单位相同。
  31605. */
  31606. _this.range = 0;
  31607. /**
  31608. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.sill=0]
  31609. * @description 克吕金算法中基台值。
  31610. */
  31611. _this.sill = 0;
  31612. /**
  31613. * @member {SuperMap.VariogramMode} [SuperMap.InterpolationKrigingAnalystParameters.prototype.variogramMode=SuperMap.VariogramMode.SPHERICAL]
  31614. * @description 克吕金插值时的半变函数类型。
  31615. * 用户所选择的半变函数类型会影响未知点的预测,特别是曲线在原点处的不同形状有重要意义。
  31616. * 曲线在原点处越陡,则较近领域对该预测值的影响就越大,因此输出表面就会越不光滑。
  31617. */
  31618. _this.variogramMode = VariogramMode.SPHERICAL;
  31619. /**
  31620. * @member {SuperMap.Exponent} [SuperMap.InterpolationKrigingAnalystParameters.prototype.exponent=SuperMap.Exponent.EXP1]
  31621. * @description 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数。
  31622. */
  31623. _this.exponent = Exponent.EXP1;
  31624. /**
  31625. * @member {SuperMap.SearchMode} SuperMap.InterpolationKrigingAnalystParameters.prototype.searchMode
  31626. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
  31627. * 简单克吕金和泛克吕金不支持块查找。
  31628. * 具体如下:<br>
  31629. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。<br>
  31630. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。<br>
  31631. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  31632. */
  31633. _this.searchMode = null;
  31634. /**
  31635. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.expectedCount=12]
  31636. * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数,默认值为12。
  31637. * 【定长查找】方式下,设置查找的最小点数,默认值为12。
  31638. */
  31639. _this.expectedCount = 12;
  31640. /**
  31641. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=200]
  31642. * @description 【块查找】方式下,最多参与插值的点数。
  31643. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  31644. */
  31645. _this.maxPointCountForInterpolation = 200;
  31646. /**
  31647. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=50]
  31648. * @description 【块查找】方式下,设置单个块内最多参与运算点数。
  31649. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  31650. */
  31651. _this.maxPointCountInNode = 50;
  31652. if (options) {
  31653. Util.extend(InterpolationKrigingAnalystParameters_assertThisInitialized(_this), options);
  31654. }
  31655. _this.CLASS_NAME = "SuperMap.InterpolationKrigingAnalystParameters";
  31656. return _this;
  31657. }
  31658. /**
  31659. * @function SuperMap.InterpolationKrigingAnalystParameters.prototype.destroy
  31660. * @description 释放资源,将引用资源的属性置空。
  31661. */
  31662. InterpolationKrigingAnalystParameters_createClass(InterpolationKrigingAnalystParameters, [{
  31663. key: "destroy",
  31664. value: function destroy() {
  31665. InterpolationKrigingAnalystParameters_get(InterpolationKrigingAnalystParameters_getPrototypeOf(InterpolationKrigingAnalystParameters.prototype), "destroy", this).call(this);
  31666. var me = this;
  31667. me.type = null;
  31668. me.mean = null;
  31669. me.angle = null;
  31670. me.nugget = null;
  31671. me.range = null;
  31672. me.sill = null;
  31673. me.variogramMode = null;
  31674. me.exponent = null;
  31675. me.searchMode = null;
  31676. me.expectedCount = null;
  31677. me.maxPointCountForInterpolation = null;
  31678. me.maxPointCountInNode = null;
  31679. }
  31680. }]);
  31681. return InterpolationKrigingAnalystParameters;
  31682. }(InterpolationAnalystParameters);
  31683. SuperMap.InterpolationKrigingAnalystParameters = InterpolationKrigingAnalystParameters;
  31684. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystService.js
  31685. function InterpolationAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { InterpolationAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { InterpolationAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return InterpolationAnalystService_typeof(obj); }
  31686. function InterpolationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31687. 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); } }
  31688. function InterpolationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  31689. function InterpolationAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationAnalystService_get = Reflect.get; } else { InterpolationAnalystService_get = function _get(target, property, receiver) { var base = InterpolationAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return InterpolationAnalystService_get(target, property, receiver || target); }
  31690. function InterpolationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  31691. function InterpolationAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) InterpolationAnalystService_setPrototypeOf(subClass, superClass); }
  31692. function InterpolationAnalystService_setPrototypeOf(o, p) { InterpolationAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationAnalystService_setPrototypeOf(o, p); }
  31693. 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); }; }
  31694. function InterpolationAnalystService_possibleConstructorReturn(self, call) { if (call && (InterpolationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationAnalystService_assertThisInitialized(self); }
  31695. function InterpolationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31696. function InterpolationAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31697. function InterpolationAnalystService_getPrototypeOf(o) { InterpolationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationAnalystService_getPrototypeOf(o); }
  31698. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31699. * This program are made available under the terms of the Apache License, Version 2.0
  31700. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31701. /**
  31702. * @class SuperMap.InterpolationAnalystService
  31703. * @category iServer SpatialAnalyst InterpolationAnalyst
  31704. * @classdesc 插值分析服务类。
  31705. * 插值分析可以将有限的采样点数据,通过插值算法对采样点周围的数值情况进行预测,可以掌握研究区域内数据的总体分布状况,从而使采样的离散点不仅仅反映其所在位置的数值情况,
  31706. * 还可以反映区域的数值分布。目前SuperMap iServer的插值功能提供从点数据集插值得到栅格数据集的功能,支持以下常用的内插方法,
  31707. * 包括:反距离加权插值、克吕金(Kriging)插值法、样条(径向基函数,Radial Basis Function)插值、点密度插值。
  31708. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  31709. * @param {Object} options - 参数。</br>
  31710. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31711. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31712. * @param {Object} [options.headers] - 请求头。
  31713. * @extends {SuperMap.SpatialAnalystBase}
  31714. * @example 例如:
  31715. * (start code)
  31716. * var myTInterpolationAnalystService = new SuperMap.InterpolationAnalystService(url);
  31717. * myTInterpolationAnalystService.events.on({
  31718. * "processCompleted": processCompleted,
  31719. * "processFailed": processFailed
  31720. * }
  31721. * );
  31722. * (end)
  31723. *
  31724. */
  31725. var InterpolationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  31726. InterpolationAnalystService_inherits(InterpolationAnalystService, _SpatialAnalystBase);
  31727. var _super = InterpolationAnalystService_createSuper(InterpolationAnalystService);
  31728. function InterpolationAnalystService(url, options) {
  31729. var _this;
  31730. InterpolationAnalystService_classCallCheck(this, InterpolationAnalystService);
  31731. _this = _super.call(this, url, options);
  31732. /**
  31733. * @member {string} SuperMap.InterpolationAnalystService.prototype.mode
  31734. * @description 插值分析类型。
  31735. */
  31736. _this.mode = null;
  31737. if (options) {
  31738. Util.extend(InterpolationAnalystService_assertThisInitialized(_this), options);
  31739. }
  31740. return _this;
  31741. }
  31742. /**
  31743. * @function SuperMap.InterpolationAnalystService.prototype.destroy
  31744. * @description 释放资源,将引用资源的属性置空。
  31745. */
  31746. InterpolationAnalystService_createClass(InterpolationAnalystService, [{
  31747. key: "destroy",
  31748. value: function destroy() {
  31749. InterpolationAnalystService_get(InterpolationAnalystService_getPrototypeOf(InterpolationAnalystService.prototype), "destroy", this).call(this);
  31750. this.mode = null;
  31751. this.CLASS_NAME = "SuperMap.InterpolationAnalystService";
  31752. }
  31753. /**
  31754. * @function SuperMap.InterpolationAnalystService.prototype.processAsync
  31755. * @description 负责将客户端的查询参数传递到服务端。
  31756. * @param {SuperMap.InterpolationAnalystParameters} parameter - 插值分析参数类。
  31757. */
  31758. }, {
  31759. key: "processAsync",
  31760. value: function processAsync(parameter) {
  31761. var parameterObject = {};
  31762. var me = this;
  31763. if (parameter instanceof InterpolationDensityAnalystParameters) {
  31764. me.mode = 'Density';
  31765. if (parameter.InterpolationAnalystType === 'geometry') {
  31766. me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/density');
  31767. } else {
  31768. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/density');
  31769. }
  31770. } else if (parameter instanceof InterpolationIDWAnalystParameters) {
  31771. me.mode = 'IDW';
  31772. if (parameter.InterpolationAnalystType === 'geometry') {
  31773. me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/idw');
  31774. } else {
  31775. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/idw');
  31776. }
  31777. } else if (parameter instanceof InterpolationRBFAnalystParameters) {
  31778. me.mode = 'RBF';
  31779. if (parameter.InterpolationAnalystType === 'geometry') {
  31780. me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/rbf');
  31781. } else {
  31782. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/rbf');
  31783. }
  31784. } else if (parameter instanceof InterpolationKrigingAnalystParameters) {
  31785. me.mode = 'Kriging';
  31786. if (parameter.InterpolationAnalystType === 'geometry') {
  31787. me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/kriging');
  31788. } else {
  31789. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/kriging');
  31790. }
  31791. }
  31792. InterpolationAnalystParameters.toObject(parameter, parameterObject);
  31793. var jsonParameters = Util.toJSON(parameterObject);
  31794. me.url = Util.urlAppend(me.url, 'returnContent=true');
  31795. me.request({
  31796. method: "POST",
  31797. data: jsonParameters,
  31798. scope: me,
  31799. success: me.serviceProcessCompleted,
  31800. failure: me.serviceProcessFailed
  31801. });
  31802. }
  31803. }]);
  31804. return InterpolationAnalystService;
  31805. }(SpatialAnalystBase);
  31806. SuperMap.InterpolationAnalystService = InterpolationAnalystService;
  31807. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobParameter.js
  31808. function KernelDensityJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31809. 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); } }
  31810. function KernelDensityJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  31811. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31812. * This program are made available under the terms of the Apache License, Version 2.0
  31813. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31814. /**
  31815. * @class SuperMap.KernelDensityJobParameter
  31816. * @category iServer ProcessingService DensityAnalyst
  31817. * @classdesc 密度分析任务参数类。
  31818. * @param {Object} options - 参数。
  31819. * @param {string} options.datasetName - 数据集名。
  31820. * @param {string} options.fields - 权重索引。
  31821. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  31822. * @param {number} [options.resolution=80] - 分辨率。
  31823. * @param {number} [options.method=0] - 分析方法。
  31824. * @param {number} [options.meshType=0] - 分析类型。
  31825. * @param {number} [options.radius=300] - 分析的影响半径。
  31826. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  31827. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  31828. */
  31829. var KernelDensityJobParameter = /*#__PURE__*/function () {
  31830. function KernelDensityJobParameter(options) {
  31831. KernelDensityJobParameter_classCallCheck(this, KernelDensityJobParameter);
  31832. if (!options) {
  31833. return;
  31834. }
  31835. /**
  31836. * @member {string} SuperMap.KernelDensityJobParameter.prototype.datasetName
  31837. * @description 数据集名。
  31838. */
  31839. this.datasetName = "";
  31840. /**
  31841. * @member {SuperMap.Bounds|L.Bounds|ol.extent} [SuperMap.KernelDensityJobParameter.prototype.query]
  31842. * @description 分析范围。
  31843. */
  31844. this.query = "";
  31845. /**
  31846. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.resolution=80]
  31847. * @description 网格大小。
  31848. */
  31849. this.resolution = 80;
  31850. /**
  31851. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.method=0]
  31852. * @description 分析方法。
  31853. */
  31854. this.method = 0;
  31855. /**
  31856. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.meshType=0]
  31857. * @description 分析类型。
  31858. */
  31859. this.meshType = 0;
  31860. /**
  31861. * @member {string} SuperMap.KernelDensityJobParameter.prototype.fields
  31862. * @description 权重索引。
  31863. */
  31864. this.fields = "";
  31865. /**
  31866. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.radius=300]
  31867. * @description 分析的影响半径。
  31868. */
  31869. this.radius = 300;
  31870. /**
  31871. * @member {SuperMap.AnalystSizeUnit} [SuperMap.KernelDensityJobParameter.prototype.meshSizeUnit=SuperMap.AnalystSizeUnit.METER]
  31872. * @description 网格大小单位。
  31873. */
  31874. this.meshSizeUnit = AnalystSizeUnit.METER;
  31875. /**
  31876. * @member {SuperMap.AnalystSizeUnit} [SuperMap.KernelDensityJobParameter.prototype.radiusUnit=SuperMap.AnalystSizeUnit.METER]
  31877. * @description 搜索半径单位。
  31878. */
  31879. this.radiusUnit = AnalystSizeUnit.METER;
  31880. /**
  31881. * @member {SuperMap.AnalystAreaUnit} [SuperMap.KernelDensityJobParameter.prototype.areaUnit=SuperMap.AnalystAreaUnit.SQUAREMILE]
  31882. * @description 面积单位。
  31883. */
  31884. this.areaUnit = AnalystAreaUnit.SQUAREMILE;
  31885. /**
  31886. * @member {SuperMap.OutputSetting} SuperMap.KernelDensityJobParameter.prototype.output
  31887. * @description 输出参数设置类
  31888. */
  31889. this.output = null;
  31890. /**
  31891. * @member {SuperMap.MappingParameters} [SuperMap.KernelDensityJobParameter.prototype.mappingParameters]
  31892. * @description 分析后结果可视化的参数类。
  31893. */
  31894. this.mappingParameters = null;
  31895. Util.extend(this, options);
  31896. this.CLASS_NAME = "SuperMap.KernelDensityJobParameter";
  31897. }
  31898. /**
  31899. * @function SuperMap.KernelDensityJobParameter.prototype.destroy
  31900. * @description 释放资源,将引用资源的属性置空。
  31901. */
  31902. KernelDensityJobParameter_createClass(KernelDensityJobParameter, [{
  31903. key: "destroy",
  31904. value: function destroy() {
  31905. this.datasetName = null;
  31906. this.query = null;
  31907. this.resolution = null;
  31908. this.method = null;
  31909. this.radius = null;
  31910. this.meshType = null;
  31911. this.fields = null;
  31912. this.meshSizeUnit = null;
  31913. this.radiusUnit = null;
  31914. this.areaUnit = null;
  31915. if (this.output instanceof OutputSetting) {
  31916. this.output.destroy();
  31917. this.output = null;
  31918. }
  31919. if (this.mappingParameters instanceof MappingParameters) {
  31920. this.mappingParameters.destroy();
  31921. this.mappingParameters = null;
  31922. }
  31923. }
  31924. /**
  31925. * @function SuperMap.KernelDensityJobParameter.toObject
  31926. * @param {SuperMap.KernelDensityJobParameter} kernelDensityJobParameter - 密度分析任务参数类。
  31927. * @param {SuperMap.KernelDensityJobParameter} tempObj - 密度分析任务参数对象。
  31928. * @description 将密度分析任务参数对象转换为 JSON 对象。
  31929. * @returns JSON 对象。
  31930. */
  31931. }], [{
  31932. key: "toObject",
  31933. value: function toObject(kernelDensityJobParameter, tempObj) {
  31934. for (var name in kernelDensityJobParameter) {
  31935. if (name === "datasetName") {
  31936. tempObj['input'] = tempObj['input'] || {};
  31937. tempObj['input'][name] = kernelDensityJobParameter[name];
  31938. continue;
  31939. }
  31940. if (name === "output") {
  31941. tempObj['output'] = tempObj['output'] || {};
  31942. tempObj['output'] = kernelDensityJobParameter[name];
  31943. continue;
  31944. }
  31945. tempObj['analyst'] = tempObj['analyst'] || {};
  31946. if (name === 'query' && kernelDensityJobParameter[name]) {
  31947. tempObj['analyst'][name] = kernelDensityJobParameter[name].toBBOX();
  31948. } else {
  31949. tempObj['analyst'][name] = kernelDensityJobParameter[name];
  31950. }
  31951. if (name === 'mappingParameters') {
  31952. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  31953. tempObj['analyst']['mappingParameters'] = kernelDensityJobParameter[name];
  31954. }
  31955. }
  31956. }
  31957. }]);
  31958. return KernelDensityJobParameter;
  31959. }();
  31960. SuperMap.KernelDensityJobParameter = KernelDensityJobParameter;
  31961. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobsService.js
  31962. function KernelDensityJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { KernelDensityJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { KernelDensityJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return KernelDensityJobsService_typeof(obj); }
  31963. function KernelDensityJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31964. 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); } }
  31965. function KernelDensityJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  31966. function KernelDensityJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { KernelDensityJobsService_get = Reflect.get; } else { KernelDensityJobsService_get = function _get(target, property, receiver) { var base = KernelDensityJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return KernelDensityJobsService_get(target, property, receiver || target); }
  31967. function KernelDensityJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KernelDensityJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  31968. function KernelDensityJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) KernelDensityJobsService_setPrototypeOf(subClass, superClass); }
  31969. function KernelDensityJobsService_setPrototypeOf(o, p) { KernelDensityJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return KernelDensityJobsService_setPrototypeOf(o, p); }
  31970. 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); }; }
  31971. function KernelDensityJobsService_possibleConstructorReturn(self, call) { if (call && (KernelDensityJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return KernelDensityJobsService_assertThisInitialized(self); }
  31972. function KernelDensityJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31973. function KernelDensityJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31974. function KernelDensityJobsService_getPrototypeOf(o) { KernelDensityJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KernelDensityJobsService_getPrototypeOf(o); }
  31975. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31976. * This program are made available under the terms of the Apache License, Version 2.0
  31977. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31978. /**
  31979. * @class SuperMap.KernelDensityJobsService
  31980. * @category iServer ProcessingService DensityAnalyst
  31981. * @classdesc 核密度分析服务类
  31982. * @extends {SuperMap.ProcessingServiceBase}
  31983. * @param {string} url -核密度分析服务地址。
  31984. * @param {Object} options - 交互服务时所需可选参数。
  31985. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31986. * @param {Object} [options.headers] - 请求头。
  31987. */
  31988. var KernelDensityJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  31989. KernelDensityJobsService_inherits(KernelDensityJobsService, _ProcessingServiceBas);
  31990. var _super = KernelDensityJobsService_createSuper(KernelDensityJobsService);
  31991. function KernelDensityJobsService(url, options) {
  31992. var _this;
  31993. KernelDensityJobsService_classCallCheck(this, KernelDensityJobsService);
  31994. _this = _super.call(this, url, options);
  31995. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/density');
  31996. _this.CLASS_NAME = "SuperMap.KernelDensityJobsService";
  31997. return _this;
  31998. }
  31999. /**
  32000. * @function SuperMap.KernelDensityJobsService.prototype.destroy
  32001. * @override
  32002. */
  32003. KernelDensityJobsService_createClass(KernelDensityJobsService, [{
  32004. key: "destroy",
  32005. value: function destroy() {
  32006. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "destroy", this).call(this);
  32007. }
  32008. /**
  32009. * @function SuperMap.KernelDensityJobsService.prototype.getKernelDensityJobs
  32010. * @description 获取核密度分析任务
  32011. */
  32012. }, {
  32013. key: "getKernelDensityJobs",
  32014. value: function getKernelDensityJobs() {
  32015. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, this.url);
  32016. }
  32017. /**
  32018. * @function SuperMap.KernelDensityJobsService.prototype.getKernelDensityJobs
  32019. * @description 获取指定id的核密度分析服务
  32020. * @param {string} id - 指定要获取数据的id
  32021. */
  32022. }, {
  32023. key: "getKernelDensityJob",
  32024. value: function getKernelDensityJob(id) {
  32025. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  32026. }
  32027. /**
  32028. * @function SuperMap.KernelDensityJobsService.prototype.addKernelDensityJob
  32029. * @description 新建核密度分析服务
  32030. * @param {SuperMap.KernelDensityJobParameter} params - 创建一个空间分析的请求参数。
  32031. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  32032. */
  32033. }, {
  32034. key: "addKernelDensityJob",
  32035. value: function addKernelDensityJob(params, seconds) {
  32036. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "addJob", this).call(this, this.url, params, KernelDensityJobParameter, seconds);
  32037. }
  32038. }]);
  32039. return KernelDensityJobsService;
  32040. }(ProcessingServiceBase);
  32041. SuperMap.KernelDensityJobsService = KernelDensityJobsService;
  32042. ;// CONCATENATED MODULE: ./src/common/iServer/LabelMatrixCell.js
  32043. function LabelMatrixCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32044. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32045. * This program are made available under the terms of the Apache License, Version 2.0
  32046. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32047. /**
  32048. * @class SuperMap.LabelMatrixCell
  32049. * @category iServer Map Theme
  32050. * @classdesc 矩阵标签元素抽象类。
  32051. * @description 该类可以包含 n*n 个矩阵标签元素,矩阵标签元素的类型可以是图片,符号,标签专题图等。
  32052. * 符号类型的矩阵标签元素类、图片类型的矩阵标签元素类和专题图类型的矩阵标签元素类均继承自该类。
  32053. */
  32054. var LabelMatrixCell = function LabelMatrixCell() {
  32055. LabelMatrixCell_classCallCheck(this, LabelMatrixCell);
  32056. this.CLASS_NAME = "LabelMatrixCell";
  32057. };
  32058. SuperMap.LabelMatrixCell = LabelMatrixCell;
  32059. ;// CONCATENATED MODULE: ./src/common/iServer/LabelImageCell.js
  32060. function LabelImageCell_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LabelImageCell_typeof = function _typeof(obj) { return typeof obj; }; } else { LabelImageCell_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LabelImageCell_typeof(obj); }
  32061. function LabelImageCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32062. 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); } }
  32063. function LabelImageCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelImageCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelImageCell_defineProperties(Constructor, staticProps); return Constructor; }
  32064. function LabelImageCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) LabelImageCell_setPrototypeOf(subClass, superClass); }
  32065. function LabelImageCell_setPrototypeOf(o, p) { LabelImageCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelImageCell_setPrototypeOf(o, p); }
  32066. 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); }; }
  32067. function LabelImageCell_possibleConstructorReturn(self, call) { if (call && (LabelImageCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelImageCell_assertThisInitialized(self); }
  32068. function LabelImageCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32069. function LabelImageCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32070. function LabelImageCell_getPrototypeOf(o) { LabelImageCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelImageCell_getPrototypeOf(o); }
  32071. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32072. * This program are made available under the terms of the Apache License, Version 2.0
  32073. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32074. /**
  32075. * @class SuperMap.LabelImageCell
  32076. * @category iServer Map Theme
  32077. * @classdesc 图片类型的矩阵标签元素类。
  32078. * @description 该类继承自 {@link SuperMap.LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  32079. * 矩阵标签专题图是标签专题图(ThemeLabel)的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
  32080. * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  32081. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
  32082. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 是一个二维数组,
  32083. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  32084. * @extends {SuperMap.LabelMatrixCell}
  32085. * @param {Object} options - 参数。
  32086. * @param {number} [options.height=0] - 设置图片的高度,单位为毫米。
  32087. * @param {string} [options.pathField] - 设置矩阵标签元素所使用图片的路径。
  32088. * @param {number} [options.rotation=0.0] - 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  32089. * @param {number} [options.width=0] - 设置图片的宽度,单位为毫米。
  32090. * @param {boolean} [options.sizeFixed=false] - 是否固定图片的大小。
  32091. */
  32092. var LabelImageCell = /*#__PURE__*/function (_LabelMatrixCell) {
  32093. LabelImageCell_inherits(LabelImageCell, _LabelMatrixCell);
  32094. var _super = LabelImageCell_createSuper(LabelImageCell);
  32095. function LabelImageCell(options) {
  32096. var _this;
  32097. LabelImageCell_classCallCheck(this, LabelImageCell);
  32098. _this = _super.call(this, options);
  32099. /**
  32100. * @member {number} SuperMap.LabelImageCell.prototype.height
  32101. * @description 设置图片的高度,单位为毫米。
  32102. */
  32103. _this.height = 0;
  32104. /**
  32105. * @member {string} SuperMap.LabelImageCell.prototype.pathField
  32106. * @description 设置矩阵标签元素所使用的图片路径对应的字段名。
  32107. */
  32108. _this.pathField = null;
  32109. /**
  32110. * @member {number} [SuperMap.LabelImageCell.prototype.rotation=0.0]
  32111. * @description 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  32112. */
  32113. _this.rotation = 0.0;
  32114. /**
  32115. * @member {number} SuperMap.LabelImageCell.prototype.width
  32116. * @description 设置图片的宽度,单位为毫米。
  32117. */
  32118. _this.width = 0;
  32119. /**
  32120. * @member {boolean} [SuperMap.LabelImageCell.prototype.sizeFixed=false]
  32121. * @description 是否固定图片的大小。
  32122. */
  32123. _this.sizeFixed = false;
  32124. /**
  32125. * @member {string} SuperMap.LabelImageCell.prototype.type
  32126. * @description 制作矩阵专题图时是必须的。
  32127. */
  32128. _this.type = "IMAGE";
  32129. if (options) {
  32130. Util.extend(LabelImageCell_assertThisInitialized(_this), options);
  32131. }
  32132. _this.CLASS_NAME = "SuperMap.LabelImageCell";
  32133. return _this;
  32134. }
  32135. /**
  32136. * @function SuperMap.LabelImageCell.prototype.destroy
  32137. * @description 释放资源,将引用资源的属性置空。
  32138. */
  32139. LabelImageCell_createClass(LabelImageCell, [{
  32140. key: "destroy",
  32141. value: function destroy() {
  32142. var me = this;
  32143. me.height = null;
  32144. me.pathField = null;
  32145. me.rotation = null;
  32146. me.width = null;
  32147. me.sizeFixed = null;
  32148. }
  32149. }]);
  32150. return LabelImageCell;
  32151. }(LabelMatrixCell);
  32152. SuperMap.LabelImageCell = LabelImageCell;
  32153. ;// CONCATENATED MODULE: ./src/common/iServer/LabelSymbolCell.js
  32154. function LabelSymbolCell_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LabelSymbolCell_typeof = function _typeof(obj) { return typeof obj; }; } else { LabelSymbolCell_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LabelSymbolCell_typeof(obj); }
  32155. function LabelSymbolCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32156. 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); } }
  32157. function LabelSymbolCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelSymbolCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelSymbolCell_defineProperties(Constructor, staticProps); return Constructor; }
  32158. function LabelSymbolCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) LabelSymbolCell_setPrototypeOf(subClass, superClass); }
  32159. function LabelSymbolCell_setPrototypeOf(o, p) { LabelSymbolCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelSymbolCell_setPrototypeOf(o, p); }
  32160. 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); }; }
  32161. function LabelSymbolCell_possibleConstructorReturn(self, call) { if (call && (LabelSymbolCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelSymbolCell_assertThisInitialized(self); }
  32162. function LabelSymbolCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32163. function LabelSymbolCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32164. function LabelSymbolCell_getPrototypeOf(o) { LabelSymbolCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelSymbolCell_getPrototypeOf(o); }
  32165. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32166. * This program are made available under the terms of the Apache License, Version 2.0
  32167. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32168. /**
  32169. * @class SuperMap.LabelSymbolCell
  32170. * @category iServer Map Theme
  32171. * @classdesc 符号类型的矩阵标签元素类。
  32172. * @description 该类继承自 {@link SuperMap.LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  32173. * 矩阵标签专题图是标签专题图({@link SuperMap.ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
  32174. * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  32175. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
  32176. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 属是一个二维数组,
  32177. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  32178. * @extends {SuperMap.LabelMatrixCell}
  32179. * @param {Object} options - 参数。
  32180. * @param {SuperMap.ServerStyle} options.style - 获取或设置符号样式。
  32181. * @param {string} options.symbolIDField - 符号 ID 或符号 ID 所对应的字段名称。
  32182. */
  32183. var LabelSymbolCell = /*#__PURE__*/function (_LabelMatrixCell) {
  32184. LabelSymbolCell_inherits(LabelSymbolCell, _LabelMatrixCell);
  32185. var _super = LabelSymbolCell_createSuper(LabelSymbolCell);
  32186. function LabelSymbolCell(options) {
  32187. var _this;
  32188. LabelSymbolCell_classCallCheck(this, LabelSymbolCell);
  32189. _this = _super.call(this, options);
  32190. /**
  32191. * @member {SuperMap.ServerStyle} SuperMap.LabelSymbolCell.prototype.style
  32192. * @description 获取或设置符号样式—— {@link SuperMap.ServerStyle} 对象,包括符号大小({@link SuperMap.ServerStyle.markerSize})
  32193. * 和符号旋转({@link SuperMap.ServerStyle.markerAngle})角度,其中用于设置符号 ID 的属性({@link SuperMap.ServerStyle.markerSymbolID})在此处不起作用。
  32194. */
  32195. _this.style = new ServerStyle();
  32196. /**
  32197. * @member {string} SuperMap.LabelSymbolCell.prototype.symbolIDField
  32198. * @description 获取或设置符号 ID 或符号 ID 所对应的字段名称。
  32199. */
  32200. _this.symbolIDField = null;
  32201. /**
  32202. * @member {string} SuperMap.LabelSymbolCell.prototype.type
  32203. * @description 制作矩阵专题图时是必须的。
  32204. */
  32205. _this.type = "SYMBOL";
  32206. if (options) {
  32207. Util.extend(LabelSymbolCell_assertThisInitialized(_this), options);
  32208. }
  32209. _this.CLASS_NAME = "SuperMap.LabelSymbolCell";
  32210. return _this;
  32211. }
  32212. /**
  32213. * @function SuperMap.LabelSymbolCell.prototype.destroy
  32214. * @description 释放资源,将引用资源的属性置空。
  32215. */
  32216. LabelSymbolCell_createClass(LabelSymbolCell, [{
  32217. key: "destroy",
  32218. value: function destroy() {
  32219. var me = this;
  32220. if (me.style) {
  32221. me.style.destroy();
  32222. me.style = null;
  32223. }
  32224. me.symbolIDField = null;
  32225. }
  32226. }]);
  32227. return LabelSymbolCell;
  32228. }(LabelMatrixCell);
  32229. SuperMap.LabelSymbolCell = LabelSymbolCell;
  32230. ;// CONCATENATED MODULE: ./src/common/iServer/LabelThemeCell.js
  32231. function LabelThemeCell_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LabelThemeCell_typeof = function _typeof(obj) { return typeof obj; }; } else { LabelThemeCell_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LabelThemeCell_typeof(obj); }
  32232. function LabelThemeCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32233. 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); } }
  32234. function LabelThemeCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelThemeCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelThemeCell_defineProperties(Constructor, staticProps); return Constructor; }
  32235. function LabelThemeCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) LabelThemeCell_setPrototypeOf(subClass, superClass); }
  32236. function LabelThemeCell_setPrototypeOf(o, p) { LabelThemeCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelThemeCell_setPrototypeOf(o, p); }
  32237. 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); }; }
  32238. function LabelThemeCell_possibleConstructorReturn(self, call) { if (call && (LabelThemeCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelThemeCell_assertThisInitialized(self); }
  32239. function LabelThemeCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32240. function LabelThemeCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32241. function LabelThemeCell_getPrototypeOf(o) { LabelThemeCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelThemeCell_getPrototypeOf(o); }
  32242. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32243. * This program are made available under the terms of the Apache License, Version 2.0
  32244. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32245. /**
  32246. * @class SuperMap.LabelThemeCell
  32247. * @category iServer Map Theme
  32248. * @classdesc 专题图类型的矩阵标签元素类。
  32249. * @description 该类继承自 {@link SuperMap.LabelMatrixCell} 类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  32250. * 矩阵标签专题图是标签专题图({@link SuperMap.ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
  32251. * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  32252. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
  32253. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 属是一个二维数组,
  32254. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  32255. * @extends {SuperMap.LabelMatrixCell}
  32256. * @param {Object} options -参数。
  32257. * @param {SuperMap.ThemeLabel} options.themeLabel - 使用专题图对象作为矩阵标签的一个元素。
  32258. */
  32259. var LabelThemeCell = /*#__PURE__*/function (_LabelMatrixCell) {
  32260. LabelThemeCell_inherits(LabelThemeCell, _LabelMatrixCell);
  32261. var _super = LabelThemeCell_createSuper(LabelThemeCell);
  32262. function LabelThemeCell(options) {
  32263. var _this;
  32264. LabelThemeCell_classCallCheck(this, LabelThemeCell);
  32265. _this = _super.call(this, options);
  32266. /**
  32267. * @member {SuperMap.ThemeLabel} SuperMap.LabelThemeCell.prototype.themeLabel
  32268. * @description 使用专题图对象作为矩阵标签的一个元素。
  32269. */
  32270. _this.themeLabel = new ThemeLabel();
  32271. /**
  32272. * @member {string} SuperMap.LabelThemeCell.prototype.type
  32273. * @description 制作矩阵专题图时是必须的。
  32274. */
  32275. _this.type = "THEME";
  32276. if (options) {
  32277. Util.extend(LabelThemeCell_assertThisInitialized(_this), options);
  32278. }
  32279. _this.CLASS_NAME = " SuperMap.LabelThemeCell";
  32280. return _this;
  32281. }
  32282. /**
  32283. * @function SuperMap.LabelThemeCell.prototype.destroy
  32284. * @description 释放资源,将引用资源的属性置空。
  32285. */
  32286. LabelThemeCell_createClass(LabelThemeCell, [{
  32287. key: "destroy",
  32288. value: function destroy() {
  32289. var me = this;
  32290. if (me.themeLabel) {
  32291. me.themeLabel.destroy();
  32292. me.themeLabel = null;
  32293. }
  32294. }
  32295. }]);
  32296. return LabelThemeCell;
  32297. }(LabelMatrixCell);
  32298. SuperMap.LabelThemeCell = LabelThemeCell;
  32299. ;// CONCATENATED MODULE: ./src/common/iServer/LayerStatus.js
  32300. function LayerStatus_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32301. 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); } }
  32302. function LayerStatus_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerStatus_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerStatus_defineProperties(Constructor, staticProps); return Constructor; }
  32303. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32304. * This program are made available under the terms of the Apache License, Version 2.0
  32305. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32306. /**
  32307. * @class SuperMap.LayerStatus
  32308. * @category iServer Map Theme
  32309. * @classdesc 子图层显示参数类。
  32310. * @description 该类存储了各个子图层的名字和是否可见的状态。
  32311. * @param {Object} options - 参数。
  32312. * @param {string} options.layerName - 获取或设置图层名称。
  32313. * @param {boolean} [options.isVisible=true] - 获取或设置图层是否可见,true 表示可见。
  32314. * @param {string} [options.displayFilter] - 图层显示 SQL 过滤条件。
  32315. */
  32316. var LayerStatus = /*#__PURE__*/function () {
  32317. function LayerStatus(options) {
  32318. LayerStatus_classCallCheck(this, LayerStatus);
  32319. /**
  32320. * @member {string} SuperMap.LayerStatus.prototype.layerName
  32321. * @description 获取或设置图层名称。
  32322. */
  32323. this.layerName = null;
  32324. /**
  32325. * @member {boolean} SuperMap.LayerStatus.prototype.isVisible
  32326. * @description 获取或设置图层是否可见,true 表示可见。
  32327. */
  32328. this.isVisible = null;
  32329. /**
  32330. * @member {string} [SuperMap.LayerStatus.prototype.displayFilter]
  32331. * @description 图层显示 SQL 过滤条件,如 layerStatus.displayFilter = "smid < 10",表示仅显示 smid 值小于 10 的对象。
  32332. */
  32333. this.displayFilter = null;
  32334. /**
  32335. * @member {Object} [SuperMap.LayerStatus.prototype.fieldValuesDisplayFilter]
  32336. * @property {Array.<number>} values - 要过滤的值。
  32337. * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
  32338. * @property {string} fieldValuesDisplayMode - 目前有两个 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  32339. */
  32340. this.fieldValuesDisplayFilter = null;
  32341. if (options) {
  32342. Util.extend(this, options);
  32343. }
  32344. this.CLASS_NAME = "SuperMap.LayerStatus";
  32345. }
  32346. /**
  32347. * @function SuperMap.LayerStatus.prototype.destroy
  32348. * @description 释放资源,将引用资源的属性置空。
  32349. */
  32350. LayerStatus_createClass(LayerStatus, [{
  32351. key: "destroy",
  32352. value: function destroy() {
  32353. var me = this;
  32354. me.layerName = null;
  32355. me.isVisible = null;
  32356. me.displayFilter = null;
  32357. }
  32358. /**
  32359. * @function SuperMap.LayerStatus.prototype.toJSON
  32360. * @description 生成对应的 JSON。
  32361. * @returns {Object} 对应的 JSON。
  32362. */
  32363. }, {
  32364. key: "toJSON",
  32365. value: function toJSON() {
  32366. var json = '{';
  32367. json += '"type":"UGC",';
  32368. var v = [];
  32369. if (this.layerName) {
  32370. v.push('"name":"' + this.layerName + '"');
  32371. v.push('"visible":' + this.isVisible);
  32372. }
  32373. if (this.displayFilter) {
  32374. v.push('"displayFilter":"' + this.displayFilter + '"');
  32375. }
  32376. if (this.minScale || this.minScale == 0) {
  32377. v.push('"minScale":' + this.minScale);
  32378. }
  32379. if (this.maxScale || this.maxScale == 0) {
  32380. v.push('"maxScale":' + this.maxScale);
  32381. }
  32382. if (this.fieldValuesDisplayFilter) {
  32383. v.push('"fieldValuesDisplayFilter":' + Util.toJSON(this.fieldValuesDisplayFilter));
  32384. }
  32385. json += v;
  32386. json += '}';
  32387. return json;
  32388. }
  32389. }]);
  32390. return LayerStatus;
  32391. }();
  32392. SuperMap.LayerStatus = LayerStatus;
  32393. ;// CONCATENATED MODULE: ./src/common/iServer/MapService.js
  32394. function MapService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MapService_typeof = function _typeof(obj) { return typeof obj; }; } else { MapService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MapService_typeof(obj); }
  32395. function MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32396. 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); } }
  32397. function MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapService_defineProperties(Constructor, staticProps); return Constructor; }
  32398. function MapService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { MapService_get = Reflect.get; } else { MapService_get = function _get(target, property, receiver) { var base = MapService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return MapService_get(target, property, receiver || target); }
  32399. function MapService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapService_getPrototypeOf(object); if (object === null) break; } return object; }
  32400. function MapService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MapService_setPrototypeOf(subClass, superClass); }
  32401. function MapService_setPrototypeOf(o, p) { MapService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapService_setPrototypeOf(o, p); }
  32402. 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); }; }
  32403. function MapService_possibleConstructorReturn(self, call) { if (call && (MapService_typeof(call) === "object" || typeof call === "function")) { return call; } return MapService_assertThisInitialized(self); }
  32404. function MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32405. function MapService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32406. function MapService_getPrototypeOf(o) { MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapService_getPrototypeOf(o); }
  32407. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32408. * This program are made available under the terms of the Apache License, Version 2.0
  32409. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32410. /**
  32411. * @class SuperMap.MapService
  32412. * @category iServer Map
  32413. * @classdesc 地图信息服务类。
  32414. * @extends {SuperMap.CommonServiceBase}
  32415. * @example
  32416. * var myMapService = new SuperMap.MapService(url, {
  32417. * eventListeners:{
  32418. * "processCompleted": MapServiceCompleted,
  32419. * "processFailed": MapServiceFailed
  32420. * }
  32421. * });
  32422. *
  32423. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  32424. * @param {Object} options - 参数。
  32425. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  32426. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  32427. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  32428. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32429. * @param {Object} [options.headers] - 请求头。
  32430. */
  32431. var MapService_MapService = /*#__PURE__*/function (_CommonServiceBase) {
  32432. MapService_inherits(MapService, _CommonServiceBase);
  32433. var _super = MapService_createSuper(MapService);
  32434. function MapService(url, options) {
  32435. var _this;
  32436. MapService_classCallCheck(this, MapService);
  32437. _this = _super.call(this, url, options);
  32438. /**
  32439. * @member {string} SuperMap.MapService.prototype.projection
  32440. * @description 根据投影参数获取地图状态信息。如"EPSG:4326"
  32441. */
  32442. _this.projection = null;
  32443. _this.CLASS_NAME = "SuperMap.MapService";
  32444. if (options) {
  32445. Util.extend(MapService_assertThisInitialized(_this), options);
  32446. }
  32447. var me = MapService_assertThisInitialized(_this);
  32448. if (me.projection) {
  32449. var arr = me.projection.split(":");
  32450. if (arr instanceof Array) {
  32451. if (arr.length === 2) {
  32452. me.url = Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[1], "\"}"))));
  32453. }
  32454. if (arr.length === 1) {
  32455. me.url = Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[0], "\"}"))));
  32456. }
  32457. }
  32458. }
  32459. return _this;
  32460. }
  32461. /**
  32462. * @function destroy
  32463. * @description 释放资源,将引用的资源属性置空。
  32464. */
  32465. MapService_createClass(MapService, [{
  32466. key: "destroy",
  32467. value: function destroy() {
  32468. MapService_get(MapService_getPrototypeOf(MapService.prototype), "destroy", this).call(this);
  32469. var me = this;
  32470. if (me.events) {
  32471. me.events.un(me.eventListeners);
  32472. me.events.listeners = null;
  32473. me.events.destroy();
  32474. me.events = null;
  32475. me.eventListeners = null;
  32476. }
  32477. }
  32478. /**
  32479. * @function SuperMap.MapService.prototype.processAsync
  32480. * @description 负责将客户端的设置的参数传递到服务端,与服务端完成异步通讯。
  32481. */
  32482. }, {
  32483. key: "processAsync",
  32484. value: function processAsync() {
  32485. var me = this;
  32486. me.request({
  32487. method: "GET",
  32488. scope: me,
  32489. success: me.serviceProcessCompleted,
  32490. failure: me.serviceProcessFailed
  32491. });
  32492. }
  32493. /*
  32494. * Method: getMapStatusCompleted
  32495. * 获取地图状态完成,执行此方法。
  32496. *
  32497. * Parameters:
  32498. * {Object} result - 服务器返回的结果对象。
  32499. */
  32500. }, {
  32501. key: "serviceProcessCompleted",
  32502. value: function serviceProcessCompleted(result) {
  32503. var me = this;
  32504. result = Util.transformResult(result);
  32505. var codeStatus = result.code >= 200 && result.code < 300 || result.code == 0 || result.code === 304;
  32506. var isCodeValid = result.code && codeStatus;
  32507. if (!result.code || isCodeValid) {
  32508. me.events && me.events.triggerEvent("processCompleted", {
  32509. result: result
  32510. });
  32511. } else {
  32512. ////在没有token是返回的是200,但是其实是没有权限,所以这里也应该是触发失败事件
  32513. me.events.triggerEvent("processFailed", {
  32514. error: result
  32515. });
  32516. }
  32517. }
  32518. }]);
  32519. return MapService;
  32520. }(CommonServiceBase);
  32521. SuperMap.MapService = MapService_MapService;
  32522. ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisParameters.js
  32523. function MathExpressionAnalysisParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32524. 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); } }
  32525. function MathExpressionAnalysisParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisParameters_defineProperties(Constructor, staticProps); return Constructor; }
  32526. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32527. * This program are made available under the terms of the Apache License, Version 2.0
  32528. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32529. /**
  32530. * @class SuperMap.MathExpressionAnalysisParameters
  32531. * @category iServer SpatialAnalyst GridMathAnalyst
  32532. * @classdesc 栅格代数运算参数类。
  32533. * @param {Object} options - 参数。
  32534. * @param {string} options.dataset - 要用来做栅格代数运算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:BaseMap_P@Jingjin。
  32535. * @param {string} options.resultGridName - 指定结果数据集名称。
  32536. * @param {string} options.expression - 指定的栅格运算表达式。如:[DatasourceAlias1.Raster1]*2-10。
  32537. * @param {string} options.targetDatasource - 指定存储结果数据集的数据源。
  32538. * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.extractRegion] - 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  32539. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  32540. * @param {boolean} [options.isZip=false] - 是否对结果数据集进行压缩处理。
  32541. * @param {boolean} [options.ignoreNoValue=false] - 是否忽略无值栅格数据。true 表示忽略无值数据,即无值栅格不参与运算。
  32542. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  32543. */
  32544. var MathExpressionAnalysisParameters = /*#__PURE__*/function () {
  32545. function MathExpressionAnalysisParameters(options) {
  32546. MathExpressionAnalysisParameters_classCallCheck(this, MathExpressionAnalysisParameters);
  32547. if (!options) {
  32548. return;
  32549. }
  32550. /**
  32551. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.dataset
  32552. * @description 要用来做栅格代数运算数据源中数据集的名称。
  32553. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  32554. *
  32555. */
  32556. this.dataset = null;
  32557. /**
  32558. * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.MathExpressionAnalysisParameters.prototype.extractRegion]
  32559. * @description 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  32560. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  32561. */
  32562. this.extractRegion = null;
  32563. /**
  32564. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.expression
  32565. * @description 指定的栅格运算表达式。如:"[DatasourceAlias1.Raster1]*2-10"。
  32566. */
  32567. this.expression = null;
  32568. /**
  32569. * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.isZip=false]
  32570. * @description 是否对结果数据集进行压缩处理。
  32571. */
  32572. this.isZip = false;
  32573. /**
  32574. * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.ignoreNoValue=false]
  32575. * @description 是否忽略无值栅格数据。
  32576. */
  32577. this.ignoreNoValue = false;
  32578. /**
  32579. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.targetDatasource
  32580. * @description 指定存储结果数据集的数据源。
  32581. */
  32582. this.targetDatasource = null;
  32583. /**
  32584. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.resultGridName
  32585. * @description 指定结果数据集名称。
  32586. */
  32587. this.resultGridName = null;
  32588. /**
  32589. * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.deleteExistResultDataset=false]
  32590. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  32591. */
  32592. this.deleteExistResultDataset = false;
  32593. Util.extend(this, options);
  32594. this.CLASS_NAME = "SuperMap.MathExpressionAnalysisParameters";
  32595. }
  32596. /**
  32597. * @function SuperMap.MathExpressionAnalysisParameters.prototype.destroy
  32598. * @description 释放资源,将引用资源的属性置空。
  32599. */
  32600. MathExpressionAnalysisParameters_createClass(MathExpressionAnalysisParameters, [{
  32601. key: "destroy",
  32602. value: function destroy() {
  32603. var me = this;
  32604. me.dataset = null;
  32605. me.bounds = null;
  32606. me.expression = null;
  32607. me.isZip = true;
  32608. me.ignoreNoValue = true;
  32609. me.targetDatasource = null;
  32610. me.resultGridName = null;
  32611. me.deleteExistResultDataset = null;
  32612. }
  32613. /**
  32614. * @function SuperMap.MathExpressionAnalysisParameters.toObject
  32615. * @param {Object} mathExpressionAnalysisParameters - 栅格代数运算参数。
  32616. * @param {Object} tempObj - 目标对象。
  32617. * @description 生成栅格代数运算对象。
  32618. */
  32619. }], [{
  32620. key: "toObject",
  32621. value: function toObject(mathExpressionAnalysisParameters, tempObj) {
  32622. for (var name in mathExpressionAnalysisParameters) {
  32623. if (name !== "dataset") {
  32624. tempObj[name] = mathExpressionAnalysisParameters[name];
  32625. }
  32626. if (name === "extractRegion") {
  32627. if (mathExpressionAnalysisParameters[name]) {
  32628. var bs = mathExpressionAnalysisParameters[name].components[0].components;
  32629. var region = {},
  32630. points = [],
  32631. type = "REGION";
  32632. var len = bs.length;
  32633. for (var i = 0; i < len - 1; i++) {
  32634. var poi = {};
  32635. poi["x"] = bs[i].x;
  32636. poi["y"] = bs[i].y;
  32637. points.push(poi);
  32638. }
  32639. region["points"] = points;
  32640. region["type"] = type;
  32641. tempObj[name] = region;
  32642. }
  32643. }
  32644. }
  32645. }
  32646. }]);
  32647. return MathExpressionAnalysisParameters;
  32648. }();
  32649. SuperMap.MathExpressionAnalysisParameters = MathExpressionAnalysisParameters;
  32650. ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisService.js
  32651. function MathExpressionAnalysisService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MathExpressionAnalysisService_typeof = function _typeof(obj) { return typeof obj; }; } else { MathExpressionAnalysisService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MathExpressionAnalysisService_typeof(obj); }
  32652. function MathExpressionAnalysisService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32653. 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); } }
  32654. function MathExpressionAnalysisService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisService_defineProperties(Constructor, staticProps); return Constructor; }
  32655. function MathExpressionAnalysisService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { MathExpressionAnalysisService_get = Reflect.get; } else { MathExpressionAnalysisService_get = function _get(target, property, receiver) { var base = MathExpressionAnalysisService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return MathExpressionAnalysisService_get(target, property, receiver || target); }
  32656. function MathExpressionAnalysisService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MathExpressionAnalysisService_getPrototypeOf(object); if (object === null) break; } return object; }
  32657. function MathExpressionAnalysisService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MathExpressionAnalysisService_setPrototypeOf(subClass, superClass); }
  32658. function MathExpressionAnalysisService_setPrototypeOf(o, p) { MathExpressionAnalysisService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MathExpressionAnalysisService_setPrototypeOf(o, p); }
  32659. 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); }; }
  32660. function MathExpressionAnalysisService_possibleConstructorReturn(self, call) { if (call && (MathExpressionAnalysisService_typeof(call) === "object" || typeof call === "function")) { return call; } return MathExpressionAnalysisService_assertThisInitialized(self); }
  32661. function MathExpressionAnalysisService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32662. function MathExpressionAnalysisService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32663. function MathExpressionAnalysisService_getPrototypeOf(o) { MathExpressionAnalysisService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MathExpressionAnalysisService_getPrototypeOf(o); }
  32664. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32665. * This program are made available under the terms of the Apache License, Version 2.0
  32666. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32667. /**
  32668. * @class SuperMap.MathExpressionAnalysisService
  32669. * @category iServer SpatialAnalyst GridMathAnalyst
  32670. * @classdesc 栅格代数运算服务类。
  32671. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  32672. * @param {Object} options - 参数。</br>
  32673. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32674. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32675. * @param {Object} [options.headers] - 请求头。
  32676. * @extends {SuperMap.SpatialAnalystBase}
  32677. * @example 例如:
  32678. * (start code)
  32679. * var myMathExpressionAnalysisService = new SuperMap.MathExpressionAnalysisService(url);
  32680. * myMathExpressionAnalysisService.on({
  32681. * "processCompleted": processCompleted,
  32682. * "processFailed": processFailed
  32683. * }
  32684. * );
  32685. * (end)
  32686. *
  32687. */
  32688. var MathExpressionAnalysisService = /*#__PURE__*/function (_SpatialAnalystBase) {
  32689. MathExpressionAnalysisService_inherits(MathExpressionAnalysisService, _SpatialAnalystBase);
  32690. var _super = MathExpressionAnalysisService_createSuper(MathExpressionAnalysisService);
  32691. function MathExpressionAnalysisService(url, options) {
  32692. var _this;
  32693. MathExpressionAnalysisService_classCallCheck(this, MathExpressionAnalysisService);
  32694. _this = _super.call(this, url, options);
  32695. _this.CLASS_NAME = "SuperMap.MathExpressionAnalysisService";
  32696. return _this;
  32697. }
  32698. /**
  32699. * @override
  32700. */
  32701. MathExpressionAnalysisService_createClass(MathExpressionAnalysisService, [{
  32702. key: "destroy",
  32703. value: function destroy() {
  32704. MathExpressionAnalysisService_get(MathExpressionAnalysisService_getPrototypeOf(MathExpressionAnalysisService.prototype), "destroy", this).call(this);
  32705. }
  32706. /**
  32707. * @function SuperMap.MathExpressionAnalysisService.prototype.processAsync
  32708. * @description 负责将客户端的查询参数传递到服务端。
  32709. * @param {SuperMap.MathExpressionAnalysisParameters} parameter - 栅格代数运算参数类。
  32710. */
  32711. }, {
  32712. key: "processAsync",
  32713. value: function processAsync(parameter) {
  32714. var me = this;
  32715. var parameterObject = {};
  32716. if (parameter instanceof MathExpressionAnalysisParameters) {
  32717. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/mathanalyst');
  32718. }
  32719. MathExpressionAnalysisParameters.toObject(parameter, parameterObject);
  32720. var jsonParameters = Util.toJSON(parameterObject);
  32721. me.url = Util.urlAppend(me.url, 'returnContent=true');
  32722. me.request({
  32723. method: "POST",
  32724. data: jsonParameters,
  32725. scope: me,
  32726. success: me.serviceProcessCompleted,
  32727. failure: me.serviceProcessFailed
  32728. });
  32729. }
  32730. }]);
  32731. return MathExpressionAnalysisService;
  32732. }(SpatialAnalystBase);
  32733. SuperMap.MathExpressionAnalysisService = MathExpressionAnalysisService;
  32734. ;// CONCATENATED MODULE: ./src/common/iServer/MeasureParameters.js
  32735. function MeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32736. 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); } }
  32737. function MeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureParameters_defineProperties(Constructor, staticProps); return Constructor; }
  32738. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32739. * This program are made available under the terms of the Apache License, Version 2.0
  32740. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32741. /**
  32742. * @class SuperMap.MeasureParameters
  32743. * @category iServer Map Measure
  32744. * @classdesc 量算参数类。
  32745. * @param {Object} geometry - 要量算的几何对象。
  32746. * @param {Object} options - 参数。
  32747. * @param {SuperMap.Unit} [options.unit=SuperMap.Unit.METER] - 量算单位。
  32748. * @param {string} [options.prjCoordSys] - 用来指定该量算操作所使用的投影。
  32749. * @param {string} [options.distanceMode="Geodesic"] - 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  32750. */
  32751. var MeasureParameters = /*#__PURE__*/function () {
  32752. function MeasureParameters(geometry, options) {
  32753. MeasureParameters_classCallCheck(this, MeasureParameters);
  32754. if (!geometry) {
  32755. return;
  32756. }
  32757. /**
  32758. * @member {Object} SuperMap.MeasureParameters.prototype.geometry
  32759. * @description 要量算的几何对象。<br>
  32760. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。<br>
  32761. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
  32762. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  32763. */
  32764. this.geometry = geometry;
  32765. /**
  32766. * @member {SuperMap.Unit} [SuperMap.MeasureParameters.prototype.unit=SuperMap.Unit.METER]
  32767. * @description 量算单位。即量算结果以米为单位。
  32768. */
  32769. this.unit = REST_Unit.METER;
  32770. /**
  32771. * @member {string} [SuperMap.MeasureParameters.prototype.prjCoordSys]
  32772. * @description 用来指定该量算操作所使用的投影。
  32773. */
  32774. this.prjCoordSys = null;
  32775. /**
  32776. * @member {string} [SuperMap.MeasureParameters.prototype.distanceMode="Geodesic"]
  32777. * @description 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  32778. * @example
  32779. * var param = new SuperMap.MeasureParameters(getmetry,{distanceMode:'Planar'});
  32780. */
  32781. this.distanceMode = null;
  32782. if (options) {
  32783. Util.extend(this, options);
  32784. }
  32785. this.CLASS_NAME = "SuperMap.MeasureParameters";
  32786. }
  32787. /**
  32788. * @function SuperMap.MeasureParameters.prototype.destroy
  32789. * @description 释放资源,将引用资源的属性置空。
  32790. */
  32791. MeasureParameters_createClass(MeasureParameters, [{
  32792. key: "destroy",
  32793. value: function destroy() {
  32794. var me = this;
  32795. me.geometry = null;
  32796. me.unit = null;
  32797. me.prjCoordSys = null;
  32798. }
  32799. }]);
  32800. return MeasureParameters;
  32801. }();
  32802. SuperMap.MeasureParameters = MeasureParameters;
  32803. ;// CONCATENATED MODULE: ./src/common/iServer/MeasureService.js
  32804. function MeasureService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MeasureService_typeof = function _typeof(obj) { return typeof obj; }; } else { MeasureService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MeasureService_typeof(obj); }
  32805. function MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32806. 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); } }
  32807. function MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureService_defineProperties(Constructor, staticProps); return Constructor; }
  32808. function MeasureService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { MeasureService_get = Reflect.get; } else { MeasureService_get = function _get(target, property, receiver) { var base = MeasureService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return MeasureService_get(target, property, receiver || target); }
  32809. function MeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  32810. function MeasureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MeasureService_setPrototypeOf(subClass, superClass); }
  32811. function MeasureService_setPrototypeOf(o, p) { MeasureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MeasureService_setPrototypeOf(o, p); }
  32812. 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); }; }
  32813. function MeasureService_possibleConstructorReturn(self, call) { if (call && (MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return MeasureService_assertThisInitialized(self); }
  32814. function MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32815. function MeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32816. function MeasureService_getPrototypeOf(o) { MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MeasureService_getPrototypeOf(o); }
  32817. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32818. * This program are made available under the terms of the Apache License, Version 2.0
  32819. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32820. /**
  32821. * @class SuperMap.MeasureService
  32822. * @category iServer Map Measure
  32823. * @classdesc 量算服务类。
  32824. * 该类负责将量算参数传递到服务端,并获取服务端返回的量算结果。
  32825. * @extends {SuperMap.CommonServiceBase}
  32826. * @example
  32827. * var myMeasuerService = new SuperMap.MeasureService(url, {
  32828. * measureMode: SuperMap.MeasureMode.DISTANCE,
  32829. * eventListeners:{
  32830. * "processCompleted": measureCompleted
  32831. * }
  32832. * });
  32833. * @param {string} url - 服务访问的地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  32834. * @param {Object} options - 参数。
  32835. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  32836. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  32837. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  32838. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32839. * @param {Object} [options.headers] - 请求头。
  32840. * @param {MeasureMode} options.measureMode - 量算模式,包括距离量算模式和面积量算模式。
  32841. */
  32842. var MeasureService_MeasureService = /*#__PURE__*/function (_CommonServiceBase) {
  32843. MeasureService_inherits(MeasureService, _CommonServiceBase);
  32844. var _super = MeasureService_createSuper(MeasureService);
  32845. function MeasureService(url, options) {
  32846. var _this;
  32847. MeasureService_classCallCheck(this, MeasureService);
  32848. _this = _super.call(this, url, options);
  32849. /**
  32850. * @member {SuperMap.MeasureMode} [SuperMap.MeasureService.prototype.measureMode=MeasureMode.DISTANCE]
  32851. * @description 量算模式,包括距离量算模式和面积量算模式。
  32852. */
  32853. _this.measureMode = MeasureMode.DISTANCE;
  32854. if (options) {
  32855. Util.extend(MeasureService_assertThisInitialized(_this), options);
  32856. }
  32857. _this.CLASS_NAME = "SuperMap.MeasureService";
  32858. return _this;
  32859. }
  32860. /**
  32861. * @override
  32862. */
  32863. MeasureService_createClass(MeasureService, [{
  32864. key: "destroy",
  32865. value: function destroy() {
  32866. MeasureService_get(MeasureService_getPrototypeOf(MeasureService.prototype), "destroy", this).call(this);
  32867. var me = this;
  32868. me.measureMode = null;
  32869. }
  32870. /**
  32871. * @function SuperMap.MeasureService.prototype.processAsync
  32872. * @description 负责将客户端的量算参数传递到服务端。
  32873. * @param {SuperMap.MeasureParameters} params - 量算参数。
  32874. */
  32875. }, {
  32876. key: "processAsync",
  32877. value: function processAsync(params) {
  32878. if (!(params instanceof MeasureParameters)) {
  32879. return;
  32880. }
  32881. var me = this,
  32882. geometry = params.geometry,
  32883. pointsCount = 0,
  32884. point2ds = null;
  32885. if (!geometry) {
  32886. return;
  32887. }
  32888. me.url = Util.urlPathAppend(me.url, me.measureMode === MeasureMode.AREA ? 'area' : 'distance');
  32889. var serverGeometry = ServerGeometry.fromGeometry(geometry);
  32890. if (!serverGeometry) {
  32891. return;
  32892. }
  32893. pointsCount = serverGeometry.parts[0];
  32894. point2ds = serverGeometry.points.splice(0, pointsCount);
  32895. var prjCoordSysTemp, prjCodeTemp, paramsTemp;
  32896. if (params.prjCoordSys) {
  32897. if (MeasureService_typeof(params.prjCoordSys) === "object") {
  32898. prjCodeTemp = params.prjCoordSys.projCode;
  32899. prjCoordSysTemp = '{"epsgCode"' + prjCodeTemp.substring(prjCodeTemp.indexOf(":"), prjCodeTemp.length) + "}";
  32900. } else if (typeof params.prjCoordSys === "string") {
  32901. prjCoordSysTemp = '{"epsgCode"' + params.prjCoordSys.substring(params.prjCoordSys.indexOf(":"), params.prjCoordSys.length) + "}";
  32902. }
  32903. paramsTemp = {
  32904. "point2Ds": Util.toJSON(point2ds),
  32905. "unit": params.unit,
  32906. "prjCoordSys": prjCoordSysTemp
  32907. };
  32908. } else {
  32909. paramsTemp = {
  32910. "point2Ds": Util.toJSON(point2ds),
  32911. "unit": params.unit
  32912. };
  32913. }
  32914. me.request({
  32915. method: "GET",
  32916. params: paramsTemp,
  32917. scope: me,
  32918. success: me.serviceProcessCompleted,
  32919. failure: me.serviceProcessFailed
  32920. });
  32921. }
  32922. }]);
  32923. return MeasureService;
  32924. }(CommonServiceBase);
  32925. SuperMap.MeasureService = MeasureService_MeasureService;
  32926. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystService.js
  32927. function OverlayAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { OverlayAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { OverlayAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return OverlayAnalystService_typeof(obj); }
  32928. function OverlayAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32929. 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); } }
  32930. function OverlayAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  32931. function OverlayAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { OverlayAnalystService_get = Reflect.get; } else { OverlayAnalystService_get = function _get(target, property, receiver) { var base = OverlayAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return OverlayAnalystService_get(target, property, receiver || target); }
  32932. function OverlayAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  32933. function OverlayAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) OverlayAnalystService_setPrototypeOf(subClass, superClass); }
  32934. function OverlayAnalystService_setPrototypeOf(o, p) { OverlayAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayAnalystService_setPrototypeOf(o, p); }
  32935. 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); }; }
  32936. function OverlayAnalystService_possibleConstructorReturn(self, call) { if (call && (OverlayAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return OverlayAnalystService_assertThisInitialized(self); }
  32937. function OverlayAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32938. function OverlayAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32939. function OverlayAnalystService_getPrototypeOf(o) { OverlayAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayAnalystService_getPrototypeOf(o); }
  32940. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32941. * This program are made available under the terms of the Apache License, Version 2.0
  32942. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32943. /**
  32944. * @class SuperMap.OverlayAnalystService
  32945. * @category iServer SpatialAnalyst OverlayAnalyst
  32946. * @classdesc 叠加分析服务类。
  32947. * 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  32948. * 叠加分析结果通过该类支持的事件的监听函数参数获取
  32949. * @param {string} url - 服务的访问地址。如http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  32950. * @param {Object} options - 参数。</br>
  32951. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32952. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32953. * @param {Object} [options.headers] - 请求头。
  32954. * @extends {SuperMap.CommonServiceBase}
  32955. * @example 例如:
  32956. * (start code)
  32957. * var myOverlayAnalystService = new SuperMap.OverlayAnalystService(url, {
  32958. * eventListeners: {
  32959. * "processCompleted": OverlayCompleted,
  32960. * "processFailed": OverlayFailed
  32961. * }
  32962. * });
  32963. * (end)
  32964. */
  32965. var OverlayAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  32966. OverlayAnalystService_inherits(OverlayAnalystService, _SpatialAnalystBase);
  32967. var _super = OverlayAnalystService_createSuper(OverlayAnalystService);
  32968. function OverlayAnalystService(url, options) {
  32969. var _this;
  32970. OverlayAnalystService_classCallCheck(this, OverlayAnalystService);
  32971. _this = _super.call(this, url, options);
  32972. /**
  32973. * @member {string} SuperMap.OverlayAnalystService.prototype.mode
  32974. * @description 叠加分析类型
  32975. */
  32976. _this.mode = null;
  32977. if (options) {
  32978. Util.extend(OverlayAnalystService_assertThisInitialized(_this), options);
  32979. }
  32980. _this.CLASS_NAME = "SuperMap.OverlayAnalystService";
  32981. return _this;
  32982. }
  32983. /**
  32984. * @override
  32985. */
  32986. OverlayAnalystService_createClass(OverlayAnalystService, [{
  32987. key: "destroy",
  32988. value: function destroy() {
  32989. OverlayAnalystService_get(OverlayAnalystService_getPrototypeOf(OverlayAnalystService.prototype), "destroy", this).call(this);
  32990. this.mode = null;
  32991. }
  32992. /**
  32993. * @function SuperMap.OverlayAnalystService.prototype.processAsync
  32994. * @description 负责将客户端的查询参数传递到服务端。
  32995. * @param {SuperMap.OverlayAnalystParameters} parameter - 叠加分析参数类。
  32996. */
  32997. }, {
  32998. key: "processAsync",
  32999. value: function processAsync(parameter) {
  33000. var parameterObject = {};
  33001. var me = this;
  33002. if (parameter instanceof DatasetOverlayAnalystParameters) {
  33003. me.mode = "datasets";
  33004. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.sourceDataset + '/overlay');
  33005. DatasetOverlayAnalystParameters.toObject(parameter, parameterObject);
  33006. } else if (parameter instanceof GeometryOverlayAnalystParameters) {
  33007. me.mode = "geometry"; //支持传入多个几何要素进行叠加分析
  33008. if (parameter.operateGeometries && parameter.sourceGeometries) {
  33009. me.url = Util.urlPathAppend(me.url, 'geometry/overlay/batch');
  33010. me.url = Util.urlAppend(me.url, 'ignoreAnalystParam=true');
  33011. } else {
  33012. me.url = Util.urlPathAppend(me.url, 'geometry/overlay');
  33013. }
  33014. GeometryOverlayAnalystParameters.toObject(parameter, parameterObject);
  33015. }
  33016. me.url = Util.urlAppend(me.url, 'returnContent=true');
  33017. var jsonParameters = Util.toJSON(parameterObject);
  33018. me.request({
  33019. method: "POST",
  33020. data: jsonParameters,
  33021. scope: me,
  33022. success: me.serviceProcessCompleted,
  33023. failure: me.serviceProcessFailed
  33024. });
  33025. }
  33026. }]);
  33027. return OverlayAnalystService;
  33028. }(SpatialAnalystBase);
  33029. SuperMap.OverlayAnalystService = OverlayAnalystService;
  33030. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobParameter.js
  33031. function OverlayGeoJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33032. 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); } }
  33033. function OverlayGeoJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  33034. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33035. * This program are made available under the terms of the Apache License, Version 2.0
  33036. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33037. /**
  33038. * @class SuperMap.OverlayGeoJobParameter
  33039. * @category iServer ProcessingService OverlayAnalyst
  33040. * @classdesc 叠加分析任务参数类。
  33041. * @param {Object} options - 参数。
  33042. * @param {string} options.datasetName - 数据集名。
  33043. * @param {string} options.datasetOverlay - 叠加对象所在的数据集名称。
  33044. * @param {string} options.srcFields - 输入数据需要保留的字段。
  33045. * @param {string} [options.overlayFields] - 叠加数据需要保留的字段。对分析模式为 clip、update、erase 时,此参数无效。
  33046. * @param {string} [options.mode] - 叠加分析模式。
  33047. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  33048. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  33049. */
  33050. var OverlayGeoJobParameter = /*#__PURE__*/function () {
  33051. function OverlayGeoJobParameter(options) {
  33052. OverlayGeoJobParameter_classCallCheck(this, OverlayGeoJobParameter);
  33053. if (!options) {
  33054. return;
  33055. }
  33056. /**
  33057. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.datasetName
  33058. * @description 数据集名。
  33059. */
  33060. this.datasetName = "";
  33061. /**
  33062. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.datasetOverlay
  33063. * @description 叠加对象所在的数据集名称。
  33064. */
  33065. this.datasetOverlay = "";
  33066. /**
  33067. * @member {string} [SuperMap.OverlayGeoJobParameter.prototype.mode]
  33068. * @description 叠加分析模式。
  33069. */
  33070. this.mode = "";
  33071. /**
  33072. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.srcFields
  33073. * @description 输入数据需要保留的字段。
  33074. */
  33075. this.srcFields = "";
  33076. /**
  33077. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.overlayFields
  33078. * @description 叠加数据需要保留的字段,对分析模式为 clip、update、erase 时,此参数无效。
  33079. */
  33080. this.overlayFields = "";
  33081. /**
  33082. * @member {SuperMap.OutputSetting} [SuperMap.OverlayGeoJobParameter.prototype.output]
  33083. * @description 输出参数设置类。
  33084. */
  33085. this.output = null;
  33086. /**
  33087. * @member {SuperMap.MappingParameters} [SuperMap.OverlayGeoJobParameter.prototype.mappingParameters]
  33088. * @description 分析后结果可视化的参数类。
  33089. */
  33090. this.mappingParameters = null;
  33091. Util.extend(this, options);
  33092. this.CLASS_NAME = "SuperMap.OverlayGeoJobParameter";
  33093. }
  33094. /**
  33095. * @function SuperMap.OverlayGeoJobParameter.destroy
  33096. * @override
  33097. */
  33098. OverlayGeoJobParameter_createClass(OverlayGeoJobParameter, [{
  33099. key: "destroy",
  33100. value: function destroy() {
  33101. this.datasetName = null;
  33102. this.datasetOverlay = null;
  33103. this.mode = null;
  33104. this.srcFields = null;
  33105. this.overlayFields = null;
  33106. if (this.output instanceof OutputSetting) {
  33107. this.output.destroy();
  33108. this.output = null;
  33109. }
  33110. if (this.mappingParameters instanceof MappingParameters) {
  33111. this.mappingParameters.destroy();
  33112. this.mappingParameters = null;
  33113. }
  33114. }
  33115. /**
  33116. * @function SuperMap.OverlayGeoJobParameter.toObject
  33117. * @param {Object} OverlayGeoJobParameter - 点聚合分析任务参数。
  33118. * @param {Object} tempObj - 目标对象。
  33119. * @description 生成点聚合分析任务对象。
  33120. */
  33121. }], [{
  33122. key: "toObject",
  33123. value: function toObject(OverlayGeoJobParameter, tempObj) {
  33124. for (var name in OverlayGeoJobParameter) {
  33125. if (name == "datasetName") {
  33126. tempObj['input'] = tempObj['input'] || {};
  33127. tempObj['input'][name] = OverlayGeoJobParameter[name];
  33128. continue;
  33129. }
  33130. if (name === "output") {
  33131. tempObj['output'] = tempObj['output'] || {};
  33132. tempObj['output'] = OverlayGeoJobParameter[name];
  33133. continue;
  33134. }
  33135. tempObj['analyst'] = tempObj['analyst'] || {};
  33136. tempObj['analyst'][name] = OverlayGeoJobParameter[name];
  33137. if (name === 'mappingParameters') {
  33138. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  33139. tempObj['analyst']['mappingParameters'] = OverlayGeoJobParameter[name];
  33140. }
  33141. }
  33142. }
  33143. }]);
  33144. return OverlayGeoJobParameter;
  33145. }();
  33146. SuperMap.OverlayGeoJobParameter = OverlayGeoJobParameter;
  33147. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobsService.js
  33148. function OverlayGeoJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { OverlayGeoJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { OverlayGeoJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return OverlayGeoJobsService_typeof(obj); }
  33149. function OverlayGeoJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33150. 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); } }
  33151. function OverlayGeoJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  33152. function OverlayGeoJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { OverlayGeoJobsService_get = Reflect.get; } else { OverlayGeoJobsService_get = function _get(target, property, receiver) { var base = OverlayGeoJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return OverlayGeoJobsService_get(target, property, receiver || target); }
  33153. function OverlayGeoJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayGeoJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  33154. function OverlayGeoJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) OverlayGeoJobsService_setPrototypeOf(subClass, superClass); }
  33155. function OverlayGeoJobsService_setPrototypeOf(o, p) { OverlayGeoJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayGeoJobsService_setPrototypeOf(o, p); }
  33156. 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); }; }
  33157. function OverlayGeoJobsService_possibleConstructorReturn(self, call) { if (call && (OverlayGeoJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return OverlayGeoJobsService_assertThisInitialized(self); }
  33158. function OverlayGeoJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33159. function OverlayGeoJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33160. function OverlayGeoJobsService_getPrototypeOf(o) { OverlayGeoJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayGeoJobsService_getPrototypeOf(o); }
  33161. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33162. * This program are made available under the terms of the Apache License, Version 2.0
  33163. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33164. /**
  33165. * @class SuperMap.OverlayGeoJobsService
  33166. * @category iServer ProcessingService OverlayAnalyst
  33167. * @classdesc 叠加分析任务类。
  33168. * @param {string} url - 叠加分析任务地址。
  33169. * @param {Object} options - 参数。
  33170. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  33171. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  33172. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  33173. * @param {number} options.index - 服务访问地址在数组中的位置。
  33174. * @param {number} options.length - 服务访问地址数组长度。
  33175. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33176. * @param {Object} [options.headers] - 请求头。
  33177. */
  33178. var OverlayGeoJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  33179. OverlayGeoJobsService_inherits(OverlayGeoJobsService, _ProcessingServiceBas);
  33180. var _super = OverlayGeoJobsService_createSuper(OverlayGeoJobsService);
  33181. function OverlayGeoJobsService(url, options) {
  33182. var _this;
  33183. OverlayGeoJobsService_classCallCheck(this, OverlayGeoJobsService);
  33184. _this = _super.call(this, url, options);
  33185. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/overlay');
  33186. _this.CLASS_NAME = 'SuperMap.OverlayGeoJobsService';
  33187. return _this;
  33188. }
  33189. /**
  33190. * @override
  33191. */
  33192. OverlayGeoJobsService_createClass(OverlayGeoJobsService, [{
  33193. key: "destroy",
  33194. value: function destroy() {
  33195. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "destroy", this).call(this);
  33196. }
  33197. /**
  33198. * @function SuperMap.OverlayGeoJobsService.prototype.getOverlayGeoJobs
  33199. * @description 获取叠加分析任务
  33200. */
  33201. }, {
  33202. key: "getOverlayGeoJobs",
  33203. value: function getOverlayGeoJobs() {
  33204. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, this.url);
  33205. }
  33206. /**
  33207. * @function SuperMap.OverlayGeoJobsService.prototype.getOverlayGeoJob
  33208. * @description 获取指定id的叠加分析任务
  33209. * @param {string} id - 指定要获取数据的id
  33210. */
  33211. }, {
  33212. key: "getOverlayGeoJob",
  33213. value: function getOverlayGeoJob(id) {
  33214. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  33215. }
  33216. /**
  33217. * @function SuperMap.OverlayGeoJobsService.prototype.addOverlayGeoJob
  33218. * @description 新建点叠加析服务
  33219. * @param {SuperMap.OverlayGeoJobParameter} params - 创建一个叠加分析的请求参数。
  33220. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  33221. */
  33222. }, {
  33223. key: "addOverlayGeoJob",
  33224. value: function addOverlayGeoJob(params, seconds) {
  33225. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "addJob", this).call(this, this.url, params, OverlayGeoJobParameter, seconds);
  33226. }
  33227. }]);
  33228. return OverlayGeoJobsService;
  33229. }(ProcessingServiceBase);
  33230. SuperMap.OverlayGeoJobsService = OverlayGeoJobsService;
  33231. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsParameters.js
  33232. function QueryByBoundsParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByBoundsParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByBoundsParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByBoundsParameters_typeof(obj); }
  33233. function QueryByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33234. 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); } }
  33235. function QueryByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  33236. function QueryByBoundsParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByBoundsParameters_get = Reflect.get; } else { QueryByBoundsParameters_get = function _get(target, property, receiver) { var base = QueryByBoundsParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return QueryByBoundsParameters_get(target, property, receiver || target); }
  33237. function QueryByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  33238. function QueryByBoundsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) QueryByBoundsParameters_setPrototypeOf(subClass, superClass); }
  33239. function QueryByBoundsParameters_setPrototypeOf(o, p) { QueryByBoundsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsParameters_setPrototypeOf(o, p); }
  33240. 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); }; }
  33241. function QueryByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByBoundsParameters_assertThisInitialized(self); }
  33242. function QueryByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33243. function QueryByBoundsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33244. function QueryByBoundsParameters_getPrototypeOf(o) { QueryByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsParameters_getPrototypeOf(o); }
  33245. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33246. * This program are made available under the terms of the Apache License, Version 2.0
  33247. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33248. /**
  33249. * @class SuperMap.QueryByBoundsParameters
  33250. * @category iServer Map QueryResults
  33251. * @classdesc Bounds 查询参数类。该类用于设置 Bounds 查询的相关参数。
  33252. * @extends {SuperMap.QueryParameters}
  33253. * @param {Object} options - 参数。
  33254. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 指定的查询范围。
  33255. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  33256. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  33257. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  33258. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  33259. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  33260. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  33261. * @param {number} [options.startRecord=0] - 查询起始记录号。
  33262. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  33263. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  33264. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  33265. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  33266. */
  33267. var QueryByBoundsParameters = /*#__PURE__*/function (_QueryParameters) {
  33268. QueryByBoundsParameters_inherits(QueryByBoundsParameters, _QueryParameters);
  33269. var _super = QueryByBoundsParameters_createSuper(QueryByBoundsParameters);
  33270. function QueryByBoundsParameters(options) {
  33271. var _this;
  33272. QueryByBoundsParameters_classCallCheck(this, QueryByBoundsParameters);
  33273. if (!options) {
  33274. return QueryByBoundsParameters_possibleConstructorReturn(_this);
  33275. }
  33276. _this = _super.call(this, options);
  33277. /**
  33278. * @member {boolean} [SuperMap.QueryByBoundsParameters.prototype.returnContent=true]
  33279. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  33280. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  33281. * 为 false,则返回的是查询结果资源的 URI。
  33282. */
  33283. _this.returnContent = true;
  33284. /**
  33285. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.QueryByBoundsParameters.prototype.bounds
  33286. * @description 指定的查询范围。
  33287. */
  33288. _this.bounds = null;
  33289. Util.extend(QueryByBoundsParameters_assertThisInitialized(_this), options);
  33290. _this.CLASS_NAME = "SuperMap.QueryByBoundsParameters";
  33291. return _this;
  33292. }
  33293. /**
  33294. * @function SuperMap.QueryByBoundsParameters.prototype.destroy
  33295. * @description 释放资源,将引用资源的属性置空。
  33296. */
  33297. QueryByBoundsParameters_createClass(QueryByBoundsParameters, [{
  33298. key: "destroy",
  33299. value: function destroy() {
  33300. QueryByBoundsParameters_get(QueryByBoundsParameters_getPrototypeOf(QueryByBoundsParameters.prototype), "destroy", this).call(this);
  33301. var me = this;
  33302. me.returnContent = null;
  33303. if (me.bounds) {
  33304. me.bounds = null;
  33305. }
  33306. }
  33307. }]);
  33308. return QueryByBoundsParameters;
  33309. }(QueryParameters);
  33310. SuperMap.QueryByBoundsParameters = QueryByBoundsParameters;
  33311. ;// CONCATENATED MODULE: ./src/common/iServer/QueryService.js
  33312. function QueryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryService_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryService_typeof(obj); }
  33313. function QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33314. 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); } }
  33315. function QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryService_defineProperties(Constructor, staticProps); return Constructor; }
  33316. function QueryService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryService_get = Reflect.get; } else { QueryService_get = function _get(target, property, receiver) { var base = QueryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return QueryService_get(target, property, receiver || target); }
  33317. function QueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryService_getPrototypeOf(object); if (object === null) break; } return object; }
  33318. function QueryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) QueryService_setPrototypeOf(subClass, superClass); }
  33319. function QueryService_setPrototypeOf(o, p) { QueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryService_setPrototypeOf(o, p); }
  33320. function QueryService_createSuper(Derived) { var hasNativeReflectConstruct = QueryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryService_possibleConstructorReturn(this, result); }; }
  33321. function QueryService_possibleConstructorReturn(self, call) { if (call && (QueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryService_assertThisInitialized(self); }
  33322. function QueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33323. function QueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33324. function QueryService_getPrototypeOf(o) { QueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryService_getPrototypeOf(o); }
  33325. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33326. * This program are made available under the terms of the Apache License, Version 2.0
  33327. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33328. /**
  33329. * @class SuperMap.QueryService
  33330. * @category iServer Map QueryResults
  33331. * @classdesc 查询服务基类。
  33332. * @extends {SuperMap.CommonServiceBase}
  33333. * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  33334. * @param {Object} options - 参数。
  33335. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  33336. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  33337. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  33338. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33339. * @param {Object} [options.headers] - 请求头。
  33340. * @example
  33341. * var myService = new SuperMap.QueryService(url, {
  33342. * eventListeners: {
  33343. * "processCompleted": queryCompleted,
  33344. * "processFailed": queryError
  33345. * }
  33346. * };
  33347. */
  33348. var QueryService = /*#__PURE__*/function (_CommonServiceBase) {
  33349. QueryService_inherits(QueryService, _CommonServiceBase);
  33350. var _super = QueryService_createSuper(QueryService);
  33351. /**
  33352. * @function SuperMap.QueryService.prototype.constructor
  33353. * @description 查询服务基类构造函数。
  33354. * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  33355. * @param {Object} options -参数。
  33356. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  33357. */
  33358. function QueryService(url, options) {
  33359. var _this;
  33360. QueryService_classCallCheck(this, QueryService);
  33361. _this = _super.call(this, url, options);
  33362. /**
  33363. * @member {boolean} SuperMap.QueryService.prototype.returnContent
  33364. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  33365. */
  33366. _this.returnContent = false;
  33367. /**
  33368. * @member {string} SuperMap.QueryService.prototype.format
  33369. * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
  33370. */
  33371. _this.format = DataFormat.GEOJSON;
  33372. _this.returnFeatureWithFieldCaption = false;
  33373. if (options) {
  33374. Util.extend(QueryService_assertThisInitialized(_this), options);
  33375. }
  33376. _this.CLASS_NAME = "SuperMap.QueryService";
  33377. if (!_this.url) {
  33378. return QueryService_possibleConstructorReturn(_this);
  33379. }
  33380. if (options && options.format) {
  33381. _this.format = options.format.toUpperCase();
  33382. }
  33383. _this.url = Util.urlPathAppend(_this.url, 'queryResults');
  33384. return _this;
  33385. }
  33386. /**
  33387. * @function SuperMap.QueryService.prototype.destroy
  33388. * @description 释放资源,将引用资源的属性置空。
  33389. */
  33390. QueryService_createClass(QueryService, [{
  33391. key: "destroy",
  33392. value: function destroy() {
  33393. QueryService_get(QueryService_getPrototypeOf(QueryService.prototype), "destroy", this).call(this);
  33394. var me = this;
  33395. me.returnContent = null;
  33396. me.format = null;
  33397. }
  33398. /**
  33399. * @function SuperMap.QueryService.prototype.processAsync
  33400. * @description 负责将客户端的查询参数传递到服务端。
  33401. * @param {SuperMap.QueryParameters} params - 查询参数。
  33402. */
  33403. }, {
  33404. key: "processAsync",
  33405. value: function processAsync(params) {
  33406. if (!(params instanceof QueryParameters)) {
  33407. return;
  33408. }
  33409. var me = this,
  33410. returnCustomResult = null,
  33411. jsonParameters = null;
  33412. me.returnContent = params.returnContent;
  33413. jsonParameters = me.getJsonParameters(params);
  33414. if (me.returnContent) {
  33415. me.url = Util.urlAppend(me.url, 'returnContent=' + me.returnContent);
  33416. } else {
  33417. //仅供三维使用 获取高亮图片的bounds
  33418. returnCustomResult = params.returnCustomResult;
  33419. if (returnCustomResult) {
  33420. me.url = Util.urlAppend(me.url, 'returnCustomResult=' + returnCustomResult);
  33421. }
  33422. }
  33423. me.returnFeatureWithFieldCaption = params.returnFeatureWithFieldCaption;
  33424. me.request({
  33425. method: "POST",
  33426. data: jsonParameters,
  33427. scope: me,
  33428. success: me.serviceProcessCompleted,
  33429. failure: me.serviceProcessFailed
  33430. });
  33431. }
  33432. /**
  33433. * @function SuperMap.QueryService.prototype.serviceProcessCompleted
  33434. * @description 查询完成,执行此方法。
  33435. * @param {Object} result - 服务器返回的结果对象。
  33436. */
  33437. }, {
  33438. key: "serviceProcessCompleted",
  33439. value: function serviceProcessCompleted(result) {
  33440. var me = this;
  33441. result = Util.transformResult(result);
  33442. var geoJSONFormat = new GeoJSON();
  33443. if (result && result.recordsets) {
  33444. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  33445. if (recordsets[i].features) {
  33446. if (me.returnFeatureWithFieldCaption === true) {
  33447. recordsets[i].features.map(function (feature) {
  33448. feature.fieldNames = recordsets[i].fieldCaptions;
  33449. return feature;
  33450. });
  33451. }
  33452. if (me.format === DataFormat.GEOJSON) {
  33453. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  33454. }
  33455. }
  33456. }
  33457. }
  33458. me.events.triggerEvent("processCompleted", {
  33459. result: result
  33460. });
  33461. }
  33462. /**
  33463. * @function SuperMap.QueryService.prototype.getQueryParameters
  33464. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  33465. * @param {Object} params - JSON 字符串表示的查询参数。
  33466. * @returns {SuperMap.QueryParameters} 返回转化后的 QueryParameters 对象。
  33467. */
  33468. }, {
  33469. key: "getQueryParameters",
  33470. value: function getQueryParameters(params) {
  33471. return new QueryParameters({
  33472. customParams: params.customParams,
  33473. expectCount: params.expectCount,
  33474. networkType: params.networkType,
  33475. queryOption: params.queryOption,
  33476. queryParams: params.queryParams,
  33477. startRecord: params.startRecord,
  33478. prjCoordSys: params.prjCoordSys,
  33479. holdTime: params.holdTime
  33480. });
  33481. }
  33482. }]);
  33483. return QueryService;
  33484. }(CommonServiceBase);
  33485. SuperMap.QueryService = QueryService;
  33486. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsService.js
  33487. function QueryByBoundsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByBoundsService_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByBoundsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByBoundsService_typeof(obj); }
  33488. function QueryByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33489. 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); } }
  33490. function QueryByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsService_defineProperties(Constructor, staticProps); return Constructor; }
  33491. function QueryByBoundsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByBoundsService_get = Reflect.get; } else { QueryByBoundsService_get = function _get(target, property, receiver) { var base = QueryByBoundsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return QueryByBoundsService_get(target, property, receiver || target); }
  33492. function QueryByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  33493. function QueryByBoundsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) QueryByBoundsService_setPrototypeOf(subClass, superClass); }
  33494. function QueryByBoundsService_setPrototypeOf(o, p) { QueryByBoundsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsService_setPrototypeOf(o, p); }
  33495. 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); }; }
  33496. function QueryByBoundsService_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByBoundsService_assertThisInitialized(self); }
  33497. function QueryByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33498. function QueryByBoundsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33499. function QueryByBoundsService_getPrototypeOf(o) { QueryByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsService_getPrototypeOf(o); }
  33500. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33501. * This program are made available under the terms of the Apache License, Version 2.0
  33502. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33503. /**
  33504. * @class SuperMap.QueryByBoundsService
  33505. * @category iServer Map QueryResults
  33506. * @classdesc Bounds 查询服务类。
  33507. * @augments {SuperMap.QueryService}
  33508. * @example
  33509. * (start end)
  33510. * var myQueryByBoundsService = new SuperMap.QueryByBoundsService(url, {
  33511. * eventListeners: {
  33512. * "processCompleted": queryCompleted,
  33513. * "processFailed": queryError
  33514. * }
  33515. * });
  33516. * function queryCompleted(object){//todo};
  33517. * function queryError(object){//todo};
  33518. * (end)
  33519. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  33520. * @param {Object} options - 参数。<br>
  33521. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  33522. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  33523. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  33524. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33525. * @param {Object} [options.headers] - 请求头。
  33526. */
  33527. var QueryByBoundsService = /*#__PURE__*/function (_QueryService) {
  33528. QueryByBoundsService_inherits(QueryByBoundsService, _QueryService);
  33529. var _super = QueryByBoundsService_createSuper(QueryByBoundsService);
  33530. function QueryByBoundsService(url, options) {
  33531. var _this;
  33532. QueryByBoundsService_classCallCheck(this, QueryByBoundsService);
  33533. _this = _super.call(this, url, options);
  33534. _this.CLASS_NAME = "SuperMap.QueryByBoundsService";
  33535. return _this;
  33536. }
  33537. /**
  33538. * @override
  33539. */
  33540. QueryByBoundsService_createClass(QueryByBoundsService, [{
  33541. key: "destroy",
  33542. value: function destroy() {
  33543. QueryByBoundsService_get(QueryByBoundsService_getPrototypeOf(QueryByBoundsService.prototype), "destroy", this).call(this);
  33544. }
  33545. /**
  33546. * @function SuperMap.QueryByBoundsService.prototype.getJsonParameters
  33547. * @description 将查询参数转化为 JSON 字符串。
  33548. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds 等)。
  33549. * @param {SuperMap.QueryByBoundsParameters} params - Bounds 查询参数。
  33550. * @returns {Object} 转化后的 JSON 字符串。
  33551. */
  33552. }, {
  33553. key: "getJsonParameters",
  33554. value: function getJsonParameters(params) {
  33555. if (!(params instanceof QueryByBoundsParameters)) {
  33556. return null;
  33557. }
  33558. var me = this,
  33559. jsonParameters = "",
  33560. qp = null,
  33561. bounds = params.bounds;
  33562. qp = me.getQueryParameters(params);
  33563. jsonParameters += "'queryMode':'BoundsQuery','queryParameters':";
  33564. jsonParameters += Util.toJSON(qp);
  33565. jsonParameters += ",'bounds': {'rightTop':{'y':" + bounds.top + ",'x':" + bounds.right + "},'leftBottom':{'y':" + bounds.bottom + ",'x':" + bounds.left + "}}";
  33566. jsonParameters = "{" + jsonParameters + "}";
  33567. return jsonParameters;
  33568. }
  33569. }]);
  33570. return QueryByBoundsService;
  33571. }(QueryService);
  33572. SuperMap.QueryByBoundsService = QueryByBoundsService;
  33573. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceParameters.js
  33574. function QueryByDistanceParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByDistanceParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByDistanceParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByDistanceParameters_typeof(obj); }
  33575. function QueryByDistanceParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33576. 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); } }
  33577. function QueryByDistanceParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceParameters_defineProperties(Constructor, staticProps); return Constructor; }
  33578. function QueryByDistanceParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByDistanceParameters_get = Reflect.get; } else { QueryByDistanceParameters_get = function _get(target, property, receiver) { var base = QueryByDistanceParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return QueryByDistanceParameters_get(target, property, receiver || target); }
  33579. function QueryByDistanceParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  33580. function QueryByDistanceParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) QueryByDistanceParameters_setPrototypeOf(subClass, superClass); }
  33581. function QueryByDistanceParameters_setPrototypeOf(o, p) { QueryByDistanceParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceParameters_setPrototypeOf(o, p); }
  33582. 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); }; }
  33583. function QueryByDistanceParameters_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByDistanceParameters_assertThisInitialized(self); }
  33584. function QueryByDistanceParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33585. function QueryByDistanceParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33586. function QueryByDistanceParameters_getPrototypeOf(o) { QueryByDistanceParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceParameters_getPrototypeOf(o); }
  33587. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33588. * This program are made available under the terms of the Apache License, Version 2.0
  33589. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33590. /**
  33591. * @class SuperMap.QueryByDistanceParameters
  33592. * @category iServer Map QueryResults
  33593. * @classdesc Distance 查询参数类。
  33594. * 该类用于设置 Distance 查询的相关参数。
  33595. * @extends {SuperMap.QueryParameters}
  33596. * @param {Object} options - 参数。
  33597. * @param {Object} options.geometry - 用于查询的几何对象。
  33598. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  33599. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  33600. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  33601. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  33602. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  33603. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  33604. * @param {number} [options.startRecord=0] - 查询起始记录号。
  33605. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  33606. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  33607. * @param {number} [options.distance=0] - 查询距离。
  33608. * @param {boolean} [options.isNearest=false] - 是否为最近距离查询。
  33609. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  33610. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  33611. */
  33612. var QueryByDistanceParameters = /*#__PURE__*/function (_QueryParameters) {
  33613. QueryByDistanceParameters_inherits(QueryByDistanceParameters, _QueryParameters);
  33614. var _super = QueryByDistanceParameters_createSuper(QueryByDistanceParameters);
  33615. function QueryByDistanceParameters(options) {
  33616. var _this;
  33617. QueryByDistanceParameters_classCallCheck(this, QueryByDistanceParameters);
  33618. if (!options) {
  33619. return QueryByDistanceParameters_possibleConstructorReturn(_this);
  33620. }
  33621. _this = _super.call(this, options);
  33622. /**
  33623. * @member {number} [SuperMap.QueryByDistanceParameters.prototype.distance=0]
  33624. * @description 查询距离,单位与所查询图层对应的数据集单位相同。
  33625. * 当查找最近地物时,该属性无效。
  33626. */
  33627. _this.distance = 0;
  33628. /**
  33629. * @member SuperMap.QueryByDistanceParameters.prototype.geometry
  33630. * @description 用于查询的地理对象。<br>
  33631. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。<br>
  33632. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
  33633. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  33634. */
  33635. _this.geometry = null;
  33636. /**
  33637. * @member {boolean} [SuperMap.QueryByDistanceParameters.prototype.isNearest=false]
  33638. * @description 是否为最近距离查询。<br>
  33639. * 建议该属性与 expectCount(继承自 {@link SuperMap.QueryParameters})属性联合使用。
  33640. * 当该属性为 true 时,即表示查找最近地物,如果查询结果数大于期望返回的结果记录数(expectCount),
  33641. * 则查找结果为查询总记录中距离中心最近的 expectCount 个地物。
  33642. * 当该属性为不为 true 时,如果查询结果数大于期望返回的结果记录数(expectCount),
  33643. * 则查找结果为从查询总记录中随机抽取的 expectCount 个地物。
  33644. * 目前查询结果不支持按远近距离排序。
  33645. */
  33646. _this.isNearest = null;
  33647. /**
  33648. * @member {boolean} [SuperMap.QueryByDistanceParameters.prototype.returnContent=true]
  33649. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  33650. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  33651. * 为 false,则返回的是查询结果资源的 URI。
  33652. */
  33653. _this.returnContent = true;
  33654. Util.extend(QueryByDistanceParameters_assertThisInitialized(_this), options);
  33655. _this.CLASS_NAME = "SuperMap.QueryByDistanceParameters";
  33656. return _this;
  33657. }
  33658. /**
  33659. * @function SuperMap.QueryByDistanceParameters.prototype.destroy
  33660. * @description 释放资源,将引用资源的属性置空。
  33661. */
  33662. QueryByDistanceParameters_createClass(QueryByDistanceParameters, [{
  33663. key: "destroy",
  33664. value: function destroy() {
  33665. QueryByDistanceParameters_get(QueryByDistanceParameters_getPrototypeOf(QueryByDistanceParameters.prototype), "destroy", this).call(this);
  33666. var me = this;
  33667. me.returnContent = null;
  33668. me.distance = null;
  33669. me.isNearest = null;
  33670. if (me.geometry) {
  33671. me.geometry.destroy();
  33672. me.geometry = null;
  33673. }
  33674. }
  33675. }]);
  33676. return QueryByDistanceParameters;
  33677. }(QueryParameters);
  33678. SuperMap.QueryByDistanceParameters = QueryByDistanceParameters;
  33679. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceService.js
  33680. function QueryByDistanceService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByDistanceService_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByDistanceService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByDistanceService_typeof(obj); }
  33681. function QueryByDistanceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33682. 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); } }
  33683. function QueryByDistanceService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceService_defineProperties(Constructor, staticProps); return Constructor; }
  33684. function QueryByDistanceService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByDistanceService_get = Reflect.get; } else { QueryByDistanceService_get = function _get(target, property, receiver) { var base = QueryByDistanceService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return QueryByDistanceService_get(target, property, receiver || target); }
  33685. function QueryByDistanceService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceService_getPrototypeOf(object); if (object === null) break; } return object; }
  33686. function QueryByDistanceService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) QueryByDistanceService_setPrototypeOf(subClass, superClass); }
  33687. function QueryByDistanceService_setPrototypeOf(o, p) { QueryByDistanceService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceService_setPrototypeOf(o, p); }
  33688. 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); }; }
  33689. function QueryByDistanceService_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByDistanceService_assertThisInitialized(self); }
  33690. function QueryByDistanceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33691. function QueryByDistanceService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33692. function QueryByDistanceService_getPrototypeOf(o) { QueryByDistanceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceService_getPrototypeOf(o); }
  33693. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33694. * This program are made available under the terms of the Apache License, Version 2.0
  33695. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33696. /**
  33697. * @class SuperMap.QueryByDistanceService
  33698. * @category iServer Map QueryResults
  33699. * @classdesc Distance查询服务类。
  33700. * @extends {SuperMap.QueryService}
  33701. * @example
  33702. * var myQueryByDistService = new SuperMap.QueryByDistanceService(url, {
  33703. * eventListeners: {
  33704. * "processCompleted": queryCompleted,
  33705. * "processFailed": queryError
  33706. * }
  33707. * });
  33708. * function queryCompleted(object){//todo};
  33709. * function queryError(object){//todo};
  33710. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  33711. * @param {Object} options - 参数。
  33712. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  33713. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  33714. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  33715. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33716. * @param {Object} [options.headers] - 请求头。
  33717. */
  33718. var QueryByDistanceService = /*#__PURE__*/function (_QueryService) {
  33719. QueryByDistanceService_inherits(QueryByDistanceService, _QueryService);
  33720. var _super = QueryByDistanceService_createSuper(QueryByDistanceService);
  33721. function QueryByDistanceService(url, options) {
  33722. var _this;
  33723. QueryByDistanceService_classCallCheck(this, QueryByDistanceService);
  33724. _this = _super.call(this, url, options);
  33725. _this.CLASS_NAME = "SuperMap.QueryByDistanceService";
  33726. return _this;
  33727. }
  33728. /**
  33729. * @override
  33730. */
  33731. QueryByDistanceService_createClass(QueryByDistanceService, [{
  33732. key: "destroy",
  33733. value: function destroy() {
  33734. QueryByDistanceService_get(QueryByDistanceService_getPrototypeOf(QueryByDistanceService.prototype), "destroy", this).call(this);
  33735. }
  33736. /**
  33737. * @function SuperMap.QueryByDistanceService.prototype.getJsonParameters
  33738. * @description 将查询参数转化为 JSON 字符串。
  33739. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  33740. * @param {SuperMap.QueryByDistanceParameters} params - Distance 查询参数类。
  33741. * @returns {Object} 转化后的 JSON 字符串。
  33742. */
  33743. }, {
  33744. key: "getJsonParameters",
  33745. value: function getJsonParameters(params) {
  33746. if (!(params instanceof QueryByDistanceParameters)) {
  33747. return;
  33748. }
  33749. var me = this,
  33750. jsonParameters = "",
  33751. qp = me.getQueryParameters(params);
  33752. var sg = ServerGeometry.fromGeometry(params.geometry);
  33753. jsonParameters += params.isNearest ? "'queryMode':'FindNearest','queryParameters':" : "'queryMode':'DistanceQuery','queryParameters':";
  33754. jsonParameters += Util.toJSON(qp);
  33755. jsonParameters += ",'geometry':" + Util.toJSON(sg) + ",'distance':" + params.distance;
  33756. jsonParameters = "{" + jsonParameters + "}";
  33757. return jsonParameters;
  33758. }
  33759. }]);
  33760. return QueryByDistanceService;
  33761. }(QueryService);
  33762. SuperMap.QueryByDistanceService = QueryByDistanceService;
  33763. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryParameters.js
  33764. function QueryByGeometryParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByGeometryParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByGeometryParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByGeometryParameters_typeof(obj); }
  33765. function QueryByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33766. 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); } }
  33767. function QueryByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  33768. function QueryByGeometryParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByGeometryParameters_get = Reflect.get; } else { QueryByGeometryParameters_get = function _get(target, property, receiver) { var base = QueryByGeometryParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return QueryByGeometryParameters_get(target, property, receiver || target); }
  33769. function QueryByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  33770. function QueryByGeometryParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) QueryByGeometryParameters_setPrototypeOf(subClass, superClass); }
  33771. function QueryByGeometryParameters_setPrototypeOf(o, p) { QueryByGeometryParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryParameters_setPrototypeOf(o, p); }
  33772. 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); }; }
  33773. function QueryByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByGeometryParameters_assertThisInitialized(self); }
  33774. function QueryByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33775. function QueryByGeometryParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33776. function QueryByGeometryParameters_getPrototypeOf(o) { QueryByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryParameters_getPrototypeOf(o); }
  33777. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33778. * This program are made available under the terms of the Apache License, Version 2.0
  33779. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33780. /**
  33781. * @class SuperMap.QueryByGeometryParameters
  33782. * @category iServer Map QueryResults
  33783. * @classdesc Geometry 查询参数类。
  33784. * 该类用于设置 Geometry查询的相关参数。
  33785. * @extends {SuperMap.QueryParameters}
  33786. * @param {Object} options - 参数。
  33787. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  33788. * @param {Object} options.geometry - 用于查询的几何对象。
  33789. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  33790. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  33791. * @param {Object} [options.prjCoordSys] -自定义参数,供SuperMap Online提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  33792. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  33793. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  33794. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  33795. * @param {number} [options.startRecord=0] - 查询起始记录号。
  33796. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  33797. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  33798. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  33799. * @param {SuperMap.SpatialQueryMode} [spatialQueryMode=SuperMap.SpatialQueryMode.INTERSECT] - 空间查询模式。
  33800. */
  33801. var QueryByGeometryParameters = /*#__PURE__*/function (_QueryParameters) {
  33802. QueryByGeometryParameters_inherits(QueryByGeometryParameters, _QueryParameters);
  33803. var _super = QueryByGeometryParameters_createSuper(QueryByGeometryParameters);
  33804. function QueryByGeometryParameters(options) {
  33805. var _this;
  33806. QueryByGeometryParameters_classCallCheck(this, QueryByGeometryParameters);
  33807. if (!options) {
  33808. return QueryByGeometryParameters_possibleConstructorReturn(_this);
  33809. }
  33810. _this = _super.call(this, options);
  33811. /**
  33812. * @member {boolean} [SuperMap.QueryByGeometryParameters.prototype.returnContent=true]
  33813. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。<br>
  33814. * 如果为 true,则直接返回新创建资源,即查询结果的表述。<br>
  33815. * 为 false,则返回的是查询结果资源的 URI。
  33816. */
  33817. _this.returnContent = true;
  33818. /**
  33819. * @member {Object} SuperMap.QueryByGeometryParameters.prototype.geometry
  33820. * @description 用于查询的几何对象。<br>
  33821. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。<br>
  33822. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
  33823. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  33824. */
  33825. _this.geometry = null;
  33826. /**
  33827. * @member {SuperMap.SpatialQueryMode} [SuperMap.QueryByGeometryParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.INTERSECT]
  33828. * @description 空间查询模式。
  33829. */
  33830. _this.spatialQueryMode = SpatialQueryMode.INTERSECT;
  33831. Util.extend(QueryByGeometryParameters_assertThisInitialized(_this), options);
  33832. _this.CLASS_NAME = "SuperMap.QueryByGeometryParameters";
  33833. return _this;
  33834. }
  33835. /**
  33836. * @function SuperMap.QueryByGeometryParameters.prototype.destroy
  33837. * @description 释放资源,将引用资源的属性置空。
  33838. */
  33839. QueryByGeometryParameters_createClass(QueryByGeometryParameters, [{
  33840. key: "destroy",
  33841. value: function destroy() {
  33842. QueryByGeometryParameters_get(QueryByGeometryParameters_getPrototypeOf(QueryByGeometryParameters.prototype), "destroy", this).call(this);
  33843. var me = this;
  33844. me.returnContent = null;
  33845. me.geometry = null;
  33846. me.spatialQueryMode = null;
  33847. }
  33848. }]);
  33849. return QueryByGeometryParameters;
  33850. }(QueryParameters);
  33851. SuperMap.QueryByGeometryParameters = QueryByGeometryParameters;
  33852. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryService.js
  33853. function QueryByGeometryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByGeometryService_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByGeometryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByGeometryService_typeof(obj); }
  33854. function QueryByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33855. 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); } }
  33856. function QueryByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryService_defineProperties(Constructor, staticProps); return Constructor; }
  33857. function QueryByGeometryService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByGeometryService_get = Reflect.get; } else { QueryByGeometryService_get = function _get(target, property, receiver) { var base = QueryByGeometryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return QueryByGeometryService_get(target, property, receiver || target); }
  33858. function QueryByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  33859. function QueryByGeometryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) QueryByGeometryService_setPrototypeOf(subClass, superClass); }
  33860. function QueryByGeometryService_setPrototypeOf(o, p) { QueryByGeometryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryService_setPrototypeOf(o, p); }
  33861. 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); }; }
  33862. function QueryByGeometryService_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByGeometryService_assertThisInitialized(self); }
  33863. function QueryByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33864. function QueryByGeometryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33865. function QueryByGeometryService_getPrototypeOf(o) { QueryByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryService_getPrototypeOf(o); }
  33866. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33867. * This program are made available under the terms of the Apache License, Version 2.0
  33868. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33869. /**
  33870. * @class SuperMap.QueryByGeometryService
  33871. * @category iServer Map QueryResults
  33872. * @classdesc Geometry查询服务类。
  33873. * @extends {SuperMap.QueryService}
  33874. * @example
  33875. * var myQueryByGeometryService = new SuperMap.QueryByGeometryService(url, {
  33876. * eventListeners: {
  33877. * "processCompleted": queryCompleted,
  33878. * "processFailed": queryError
  33879. * }
  33880. * });
  33881. * function queryCompleted(object){//todo};
  33882. * function queryError(object){//todo};
  33883. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  33884. * @param {Object} options - 参数。
  33885. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  33886. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  33887. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  33888. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33889. * @param {Object} [options.headers] - 请求头。
  33890. */
  33891. var QueryByGeometryService = /*#__PURE__*/function (_QueryService) {
  33892. QueryByGeometryService_inherits(QueryByGeometryService, _QueryService);
  33893. var _super = QueryByGeometryService_createSuper(QueryByGeometryService);
  33894. /**
  33895. * @function SuperMap.QueryByGeometryService.prototype.constructor
  33896. * @description Geometry 查询服务类构造函数。
  33897. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  33898. * @param {Object} options - 参数。
  33899. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  33900. */
  33901. function QueryByGeometryService(url, options) {
  33902. var _this;
  33903. QueryByGeometryService_classCallCheck(this, QueryByGeometryService);
  33904. _this = _super.call(this, url, options);
  33905. _this.CLASS_NAME = "SuperMap.QueryByGeometryService";
  33906. return _this;
  33907. }
  33908. /**
  33909. * @override
  33910. */
  33911. QueryByGeometryService_createClass(QueryByGeometryService, [{
  33912. key: "destroy",
  33913. value: function destroy() {
  33914. QueryByGeometryService_get(QueryByGeometryService_getPrototypeOf(QueryByGeometryService.prototype), "destroy", this).call(this);
  33915. }
  33916. /**
  33917. * @function SuperMap.QueryByGeometryService.prototype.getJsonParameters
  33918. * @description 将查询参数转化为 JSON 字符串。
  33919. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  33920. * @param {SuperMap.QueryByGeometryParameters} params - Geometry 查询参数类。
  33921. * @returns {Object} 转化后的 JSON 字符串。
  33922. */
  33923. }, {
  33924. key: "getJsonParameters",
  33925. value: function getJsonParameters(params) {
  33926. if (!(params instanceof QueryByGeometryParameters)) {
  33927. return;
  33928. }
  33929. var me = this,
  33930. jsonParameters = "",
  33931. qp = null,
  33932. geometry = params.geometry,
  33933. sg = ServerGeometry.fromGeometry(geometry);
  33934. qp = me.getQueryParameters(params);
  33935. jsonParameters += "'queryMode':'SpatialQuery','queryParameters':";
  33936. jsonParameters += Util.toJSON(qp) + ",'geometry':" + Util.toJSON(sg) + ",'spatialQueryMode':" + Util.toJSON(params.spatialQueryMode);
  33937. jsonParameters = "{" + jsonParameters + "}";
  33938. return jsonParameters;
  33939. }
  33940. }]);
  33941. return QueryByGeometryService;
  33942. }(QueryService);
  33943. SuperMap.QueryByGeometryService = QueryByGeometryService;
  33944. ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLParameters.js
  33945. function QueryBySQLParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryBySQLParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryBySQLParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryBySQLParameters_typeof(obj); }
  33946. function QueryBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33947. 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); } }
  33948. function QueryBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLParameters_defineProperties(Constructor, staticProps); return Constructor; }
  33949. function QueryBySQLParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryBySQLParameters_get = Reflect.get; } else { QueryBySQLParameters_get = function _get(target, property, receiver) { var base = QueryBySQLParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return QueryBySQLParameters_get(target, property, receiver || target); }
  33950. function QueryBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  33951. function QueryBySQLParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) QueryBySQLParameters_setPrototypeOf(subClass, superClass); }
  33952. function QueryBySQLParameters_setPrototypeOf(o, p) { QueryBySQLParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLParameters_setPrototypeOf(o, p); }
  33953. 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); }; }
  33954. function QueryBySQLParameters_possibleConstructorReturn(self, call) { if (call && (QueryBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryBySQLParameters_assertThisInitialized(self); }
  33955. function QueryBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33956. function QueryBySQLParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33957. function QueryBySQLParameters_getPrototypeOf(o) { QueryBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLParameters_getPrototypeOf(o); }
  33958. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33959. * This program are made available under the terms of the Apache License, Version 2.0
  33960. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33961. /**
  33962. * @class SuperMap.QueryBySQLParameters
  33963. * @category iServer Map QueryResults
  33964. * @classdesc SQL 查询参数类。
  33965. * 该类用于设置 SQL 查询的相关参数。
  33966. * @extends {SuperMap.QueryParameters}
  33967. * @param {Object} options - 参数。
  33968. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  33969. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  33970. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  33971. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  33972. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  33973. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  33974. * @param {number} [options.startRecord=0] - 查询起始记录号。
  33975. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  33976. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  33977. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  33978. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  33979. */
  33980. var QueryBySQLParameters = /*#__PURE__*/function (_QueryParameters) {
  33981. QueryBySQLParameters_inherits(QueryBySQLParameters, _QueryParameters);
  33982. var _super = QueryBySQLParameters_createSuper(QueryBySQLParameters);
  33983. function QueryBySQLParameters(options) {
  33984. var _this;
  33985. QueryBySQLParameters_classCallCheck(this, QueryBySQLParameters);
  33986. if (!options) {
  33987. return QueryBySQLParameters_possibleConstructorReturn(_this);
  33988. }
  33989. _this = _super.call(this, options);
  33990. /**
  33991. * @member {boolean} [SuperMap.QueryBySQLParameters.prototype.returnContent=true]
  33992. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  33993. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  33994. * 为 false,则返回的是查询结果资源的 URI。
  33995. */
  33996. _this.returnContent = true;
  33997. Util.extend(QueryBySQLParameters_assertThisInitialized(_this), options);
  33998. _this.CLASS_NAME = "SuperMap.QueryBySQLParameters";
  33999. return _this;
  34000. }
  34001. /**
  34002. * @function SuperMap.QueryBySQLParameters.prototype.destroy
  34003. * @description 释放资源,将引用资源的属性置空。
  34004. */
  34005. QueryBySQLParameters_createClass(QueryBySQLParameters, [{
  34006. key: "destroy",
  34007. value: function destroy() {
  34008. QueryBySQLParameters_get(QueryBySQLParameters_getPrototypeOf(QueryBySQLParameters.prototype), "destroy", this).call(this);
  34009. var me = this;
  34010. me.returnContent = null;
  34011. }
  34012. }]);
  34013. return QueryBySQLParameters;
  34014. }(QueryParameters);
  34015. SuperMap.QueryBySQLParameters = QueryBySQLParameters;
  34016. ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLService.js
  34017. function QueryBySQLService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryBySQLService_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryBySQLService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryBySQLService_typeof(obj); }
  34018. function QueryBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34019. 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); } }
  34020. function QueryBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLService_defineProperties(Constructor, staticProps); return Constructor; }
  34021. function QueryBySQLService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryBySQLService_get = Reflect.get; } else { QueryBySQLService_get = function _get(target, property, receiver) { var base = QueryBySQLService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return QueryBySQLService_get(target, property, receiver || target); }
  34022. function QueryBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  34023. function QueryBySQLService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) QueryBySQLService_setPrototypeOf(subClass, superClass); }
  34024. function QueryBySQLService_setPrototypeOf(o, p) { QueryBySQLService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLService_setPrototypeOf(o, p); }
  34025. 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); }; }
  34026. function QueryBySQLService_possibleConstructorReturn(self, call) { if (call && (QueryBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryBySQLService_assertThisInitialized(self); }
  34027. function QueryBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34028. function QueryBySQLService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34029. function QueryBySQLService_getPrototypeOf(o) { QueryBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLService_getPrototypeOf(o); }
  34030. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34031. * This program are made available under the terms of the Apache License, Version 2.0
  34032. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34033. /**
  34034. * @class SuperMap.QueryBySQLService
  34035. * @category iServer Map QueryResults
  34036. * @classdesc SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  34037. * @extends {SuperMap.QueryService}
  34038. * @example
  34039. * var queryParam = new SuperMap.FilterParameter({
  34040. * name: "Countries@World.1",
  34041. * attributeFilter: "Pop_1994>1000000000 and SmArea>900"
  34042. * });
  34043. * var queryBySQLParams = new SuperMap.QueryBySQLParameters({
  34044. * queryParams: [queryParam]
  34045. * });
  34046. * var myQueryBySQLService = new SuperMap.QueryBySQLService(url, {eventListeners: {
  34047. * "processCompleted": queryCompleted,
  34048. * "processFailed": queryError
  34049. * }
  34050. * });
  34051. * queryBySQLService.processAsync(queryBySQLParams);
  34052. * function queryCompleted(object){//todo};
  34053. * function queryError(object){//todo};
  34054. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  34055. * @param {Object} options - 参数。
  34056. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  34057. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  34058. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  34059. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34060. * @param {Object} [options.headers] - 请求头。
  34061. */
  34062. var QueryBySQLService = /*#__PURE__*/function (_QueryService) {
  34063. QueryBySQLService_inherits(QueryBySQLService, _QueryService);
  34064. var _super = QueryBySQLService_createSuper(QueryBySQLService);
  34065. /**
  34066. * @function SuperMap.QueryBySQLService.prototype.constructor
  34067. * @description SQL 查询服务类构造函数。
  34068. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  34069. * @param {Object} options - 参数。
  34070. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34071. */
  34072. function QueryBySQLService(url, options) {
  34073. var _this;
  34074. QueryBySQLService_classCallCheck(this, QueryBySQLService);
  34075. _this = _super.call(this, url, options);
  34076. _this.CLASS_NAME = "SuperMap.QueryBySQLService";
  34077. return _this;
  34078. }
  34079. /**
  34080. * @override
  34081. */
  34082. QueryBySQLService_createClass(QueryBySQLService, [{
  34083. key: "destroy",
  34084. value: function destroy() {
  34085. QueryBySQLService_get(QueryBySQLService_getPrototypeOf(QueryBySQLService.prototype), "destroy", this).call(this);
  34086. }
  34087. /**
  34088. * @function SuperMap.QueryBySQLService.prototype.getJsonParameters
  34089. * @description 将查询参数转化为 JSON 字符串。
  34090. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  34091. * @param {SuperMap.QueryBySQLParameters} params - SQL 查询参数类。
  34092. * @returns {Object} 转化后的 JSON 字符串。
  34093. */
  34094. }, {
  34095. key: "getJsonParameters",
  34096. value: function getJsonParameters(params) {
  34097. if (!(params instanceof QueryBySQLParameters)) {
  34098. return;
  34099. }
  34100. var me = this,
  34101. jsonParameters = "",
  34102. qp = null;
  34103. qp = me.getQueryParameters(params);
  34104. jsonParameters += "'queryMode':'SqlQuery','queryParameters':";
  34105. jsonParameters += Util.toJSON(qp);
  34106. jsonParameters = "{" + jsonParameters + "}";
  34107. return jsonParameters;
  34108. }
  34109. }]);
  34110. return QueryBySQLService;
  34111. }(QueryService);
  34112. SuperMap.QueryBySQLService = QueryBySQLService;
  34113. ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureParameters.js
  34114. function RouteCalculateMeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34115. 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); } }
  34116. function RouteCalculateMeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureParameters_defineProperties(Constructor, staticProps); return Constructor; }
  34117. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34118. * This program are made available under the terms of the Apache License, Version 2.0
  34119. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34120. /**
  34121. * @class SuperMap.RouteCalculateMeasureParameters
  34122. * @category iServer SpatialAnalyst RouteCalculateMeasure
  34123. * @classdesc 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  34124. * @param {Object} options - 参数。
  34125. * @param {(SuperMap.Route|L.Polyline|ol.geom.LineString)} options.sourceRoute - 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  34126. * @param {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point)} options.point - 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  34127. * @param {float} [options.tolerance] - 容限值。
  34128. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。
  34129. */
  34130. var RouteCalculateMeasureParameters = /*#__PURE__*/function () {
  34131. function RouteCalculateMeasureParameters(options) {
  34132. RouteCalculateMeasureParameters_classCallCheck(this, RouteCalculateMeasureParameters);
  34133. if (!options) {
  34134. return this;
  34135. }
  34136. /**
  34137. * @member {(SuperMap.Route|L.Polyline|ol.geom.LineString)} SuperMap.RouteCalculateMeasureParameters.prototype.sourceRoute
  34138. * @description 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  34139. */
  34140. this.sourceRoute = null;
  34141. /**
  34142. * @member {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point)} SuperMap.RouteCalculateMeasureParameters.prototype.point
  34143. * @description 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  34144. */
  34145. this.point = null;
  34146. /**
  34147. * @member {float} [SuperMap.RouteCalculateMeasureParameters.prototype.tolerance]
  34148. * @description 容限值。
  34149. */
  34150. this.tolerance = null;
  34151. /**
  34152. * @member {boolean} [SuperMap.RouteCalculateMeasureParameters.prototype.isIgnoreGap=false]
  34153. * @description 是否忽略子对象之间的距离。
  34154. */
  34155. this.isIgnoreGap = false;
  34156. Util.extend(this, options);
  34157. this.CLASS_NAME = "SuperMap.RouteCalculateMeasureParameters";
  34158. }
  34159. /**
  34160. * @function SuperMap.RouteCalculateMeasureParameters.prototype.destroy
  34161. * @description 释放资源,将引用资源的属性置空。
  34162. */
  34163. RouteCalculateMeasureParameters_createClass(RouteCalculateMeasureParameters, [{
  34164. key: "destroy",
  34165. value: function destroy() {
  34166. var me = this;
  34167. me.sourceRoute = null;
  34168. me.point = null;
  34169. if (me.tolerance) {
  34170. me.tolerance = null;
  34171. }
  34172. if (me.isIgnoreGap) {
  34173. me.isIgnoreGap = false;
  34174. }
  34175. }
  34176. }]);
  34177. return RouteCalculateMeasureParameters;
  34178. }();
  34179. SuperMap.RouteCalculateMeasureParameters = RouteCalculateMeasureParameters;
  34180. ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureService.js
  34181. function RouteCalculateMeasureService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RouteCalculateMeasureService_typeof = function _typeof(obj) { return typeof obj; }; } else { RouteCalculateMeasureService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RouteCalculateMeasureService_typeof(obj); }
  34182. function RouteCalculateMeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34183. 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); } }
  34184. function RouteCalculateMeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureService_defineProperties(Constructor, staticProps); return Constructor; }
  34185. function RouteCalculateMeasureService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { RouteCalculateMeasureService_get = Reflect.get; } else { RouteCalculateMeasureService_get = function _get(target, property, receiver) { var base = RouteCalculateMeasureService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return RouteCalculateMeasureService_get(target, property, receiver || target); }
  34186. function RouteCalculateMeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteCalculateMeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  34187. function RouteCalculateMeasureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) RouteCalculateMeasureService_setPrototypeOf(subClass, superClass); }
  34188. function RouteCalculateMeasureService_setPrototypeOf(o, p) { RouteCalculateMeasureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteCalculateMeasureService_setPrototypeOf(o, p); }
  34189. 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); }; }
  34190. function RouteCalculateMeasureService_possibleConstructorReturn(self, call) { if (call && (RouteCalculateMeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return RouteCalculateMeasureService_assertThisInitialized(self); }
  34191. function RouteCalculateMeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34192. function RouteCalculateMeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34193. function RouteCalculateMeasureService_getPrototypeOf(o) { RouteCalculateMeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteCalculateMeasureService_getPrototypeOf(o); }
  34194. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34195. * This program are made available under the terms of the Apache License, Version 2.0
  34196. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34197. /**
  34198. * @class SuperMap.RouteCalculateMeasureService
  34199. * @category iServer SpatialAnalyst RouteCalculateMeasure
  34200. * @classdesc 基于路由对象计算指定点 M 值操作的服务类。
  34201. * 该类负责将客户设置的计算指定点的 M 值参数传递给服务端,并接收服务端返回的
  34202. * 指定点的 M 值。通过该类支持的事件的监听函数参数获取。
  34203. * @extends {SuperMap.SpatialAnalystBase}
  34204. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  34205. * @param {Object} options - 参数。
  34206. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34207. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34208. * @param {Object} [options.headers] - 请求头。
  34209. * @example 实例化该类如下例所示:
  34210. * (start code)
  34211. * var parameters = new SuperMap.RouteCalculateMeasureParameters({
  34212. * "sourceRoute":{
  34213. * "type":"LINEM",
  34214. * "parts":[4],
  34215. * "points":[
  34216. * {
  34217. * "measure":0,
  34218. * "y":-6674.466867067764,
  34219. * "x":3817.3527876130133
  34220. * },
  34221. * {
  34222. * "measure":199.57954019411724,
  34223. * "y":-6670.830929417594,
  34224. * "x":3617.806369901496
  34225. * },
  34226. * {
  34227. * "measure":609.3656478634477,
  34228. * "y":-6877.837541432356,
  34229. * "x":3264.1498746678444
  34230. * },
  34231. * {
  34232. * "measure":936.0174126282958,
  34233. * "y":-7038.687780615184,
  34234. * "x":2979.846206068903
  34235. * }
  34236. * ]
  34237. * },
  34238. * "tolerance":1,
  34239. * "point":{
  34240. * "x":3330.7754269417,
  34241. * "y":-6838.8394457216
  34242. * },
  34243. * "isIgnoreGap":false
  34244. * });
  34245. *
  34246. * var routeCalculateMeasureService = new SuperMap.RouteCalculateMeasureService(spatialAnalystURL, {
  34247. * eventListeners:{
  34248. * processCompleted:calculateCompleted,
  34249. * processFailed:calculateFailded
  34250. * }
  34251. * );
  34252. * routeCalculateMeasureService.processAsync(parameters);
  34253. *
  34254. * //执行
  34255. * function calculateCompleted(){todo}
  34256. * function calculateFailded(){todo}
  34257. * (end)
  34258. *
  34259. */
  34260. var RouteCalculateMeasureService = /*#__PURE__*/function (_SpatialAnalystBase) {
  34261. RouteCalculateMeasureService_inherits(RouteCalculateMeasureService, _SpatialAnalystBase);
  34262. var _super = RouteCalculateMeasureService_createSuper(RouteCalculateMeasureService);
  34263. function RouteCalculateMeasureService(url, options) {
  34264. var _this;
  34265. RouteCalculateMeasureService_classCallCheck(this, RouteCalculateMeasureService);
  34266. _this = _super.call(this, url, options);
  34267. _this.CLASS_NAME = "SuperMap.RouteCalculateMeasureService";
  34268. return _this;
  34269. }
  34270. /**
  34271. * @override
  34272. */
  34273. RouteCalculateMeasureService_createClass(RouteCalculateMeasureService, [{
  34274. key: "destroy",
  34275. value: function destroy() {
  34276. RouteCalculateMeasureService_get(RouteCalculateMeasureService_getPrototypeOf(RouteCalculateMeasureService.prototype), "destroy", this).call(this);
  34277. }
  34278. /**
  34279. * @function SuperMap.RouteCalculateMeasureService.prototype.processAsync
  34280. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  34281. * @param {SuperMap.RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  34282. */
  34283. }, {
  34284. key: "processAsync",
  34285. value: function processAsync(params) {
  34286. if (!(params instanceof RouteCalculateMeasureParameters)) {
  34287. return;
  34288. }
  34289. var me = this,
  34290. jsonParameters;
  34291. jsonParameters = me.getJsonParameters(params);
  34292. me.request({
  34293. method: "POST",
  34294. data: jsonParameters,
  34295. scope: me,
  34296. success: me.serviceProcessCompleted,
  34297. failure: me.serviceProcessFailed
  34298. });
  34299. }
  34300. /**
  34301. * @function SuperMap.RouteCalculateMeasureService.prototype.getJsonParameters
  34302. * @description 将参数转化为 JSON 字符串。
  34303. * @param {SuperMap.RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  34304. * @returns {Object} 转化后的 JSON 字符串。
  34305. */
  34306. }, {
  34307. key: "getJsonParameters",
  34308. value: function getJsonParameters(params) {
  34309. var jsonParameters,
  34310. jsonStr = "geometry/calculatemeasure",
  34311. me = this;
  34312. me.url = Util.urlPathAppend(me.url, jsonStr);
  34313. me.url = Util.urlAppend(me.url, 'returnContent=true');
  34314. jsonParameters = Util.toJSON(params);
  34315. return jsonParameters;
  34316. }
  34317. }]);
  34318. return RouteCalculateMeasureService;
  34319. }(SpatialAnalystBase);
  34320. SuperMap.RouteCalculateMeasureService = RouteCalculateMeasureService;
  34321. ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorParameters.js
  34322. function RouteLocatorParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34323. 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); } }
  34324. function RouteLocatorParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorParameters_defineProperties(Constructor, staticProps); return Constructor; }
  34325. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34326. * This program are made available under the terms of the Apache License, Version 2.0
  34327. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34328. /**
  34329. * @class SuperMap.RouteLocatorParameters
  34330. * @category iServer SpatialAnalyst RouteLocator
  34331. * @classdesc 路由对象定位空间对象的参数类。
  34332. * 参数有两种方式,分别为 Geometry 和 Dataset 两种,前者需要指定 sourceRoute 对象作为参数,后者需要 dataset,routeIDField,routeID 三个参数
  34333. * 如果用户两种参数均设置,优先选择 Dataset 方式。
  34334. * @param {Object} options - 参数。
  34335. * @param {(SuperMap.Route|L.Polyline|ol.geom.LineString)} options.sourceRoute - 路由对象。
  34336. * @param {float} options.measure - 定位点的 M 值。只当路由对象定位点时有意义。
  34337. * @param {string} [options.type] - 类型:点 or 线。
  34338. * @param {float} [options.offset=0] - 定位点偏移量。只当路由对象定位点时有意义。
  34339. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。即不忽略子对象之间的距离。
  34340. * @param {float} [options.startMeasure] - 定位线的起始 M 值。只当路由对象定位线时有意义。
  34341. * @param {float} [options.endMeasure] - 定位线的终止 M 值。只当路由对象定位线时有意义。
  34342. */
  34343. var RouteLocatorParameters = /*#__PURE__*/function () {
  34344. function RouteLocatorParameters(options) {
  34345. RouteLocatorParameters_classCallCheck(this, RouteLocatorParameters);
  34346. if (!options) {
  34347. return this;
  34348. }
  34349. /**
  34350. * @member {(SuperMap.Route|L.Polyline|ol.geom.LineString)} SuperMap.RouteLocatorParameters.prototype.sourceRoute
  34351. * @description 路由对象。
  34352. */
  34353. this.sourceRoute = null;
  34354. /**
  34355. * @member {string} SuperMap.RouteLocatorParameters.prototype.dataset
  34356. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  34357. */
  34358. this.dataset = null;
  34359. /**
  34360. * @member {string} SuperMap.RouteLocatorParameters.prototype.routeIDField
  34361. * @description 路由对象所在的字段名称。
  34362. *
  34363. */
  34364. this.routeIDField = null;
  34365. /**
  34366. * @member {number} SuperMap.RouteLocatorParameters.prototype.routeID
  34367. * @description 路由对象标识。
  34368. *
  34369. */
  34370. this.routeID = null;
  34371. /**
  34372. * @member {string} [SuperMap.RouteLocatorParameters.prototype.type]
  34373. * @description 类型:点 or 线。
  34374. * 可选值为:
  34375. * LINE :根据起始 M 值及终止 M 值定位线对象。
  34376. * POINT : 根据 M 值定位点对象。
  34377. */
  34378. this.type = null;
  34379. /**
  34380. * @member {float} SuperMap.RouteLocatorParameters.prototype.measure
  34381. * @description 定位点的 M 值。只当路由对象定位点时有意义。
  34382. */
  34383. this.measure = null;
  34384. /**
  34385. * @member {float} [SuperMap.RouteLocatorParameters.prototype.offset=0]
  34386. * @description 定位点偏移量。只当路由对象定位点时有意义。
  34387. */
  34388. this.offset = 0;
  34389. /**
  34390. * @member {boolean} [SuperMap.RouteLocatorParameters.prototype.isIgnoreGap=false]
  34391. * @description 是否忽略子对象之间的距离。
  34392. */
  34393. this.isIgnoreGap = false;
  34394. /**
  34395. * @member {float} [SuperMap.RouteLocatorParameters.prototype.startMeasure]
  34396. * @description 定位线的起始 M 值。只当路由对象定位线时有意义。
  34397. */
  34398. this.startMeasure = null;
  34399. /**
  34400. * @member {float} [SuperMap.RouteLocatorParameters.prototype.endMeasure]
  34401. * @description 定位线的终止 M 值。只当路由对象定位线时有意义。
  34402. */
  34403. this.endMeasure = null;
  34404. var routeFromClient = options.sourceRoute;
  34405. var routeHandle = {};
  34406. if (routeFromClient && routeFromClient instanceof Geometry && routeFromClient.components) {
  34407. routeHandle.type = routeFromClient.type;
  34408. routeHandle.parts = routeFromClient.parts;
  34409. var parts = [];
  34410. for (var i = 0, len = routeFromClient.components.length; i < len; i++) {
  34411. parts = parts.concat(routeFromClient.components[i].components);
  34412. }
  34413. routeHandle.points = parts;
  34414. options.sourceRoute = routeHandle;
  34415. }
  34416. Util.extend(this, options);
  34417. this.CLASS_NAME = "SuperMap.RouteLocatorParameters";
  34418. }
  34419. /**
  34420. * @function SuperMap.RouteLocatorParameters.prototype.destroy
  34421. * @description 释放资源,将引用资源的属性置空。
  34422. */
  34423. RouteLocatorParameters_createClass(RouteLocatorParameters, [{
  34424. key: "destroy",
  34425. value: function destroy() {
  34426. var me = this;
  34427. me.sourceRoute = null;
  34428. me.type = null;
  34429. me.measure = null;
  34430. me.offset = 0;
  34431. me.isIgnoreGap = false;
  34432. me.startMeasure = null;
  34433. me.endMeasure = null;
  34434. me.dataset = null;
  34435. me.routeID = null;
  34436. me.routeIDField = null;
  34437. }
  34438. }]);
  34439. return RouteLocatorParameters;
  34440. }();
  34441. SuperMap.RouteLocatorParameters = RouteLocatorParameters;
  34442. ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorService.js
  34443. function RouteLocatorService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RouteLocatorService_typeof = function _typeof(obj) { return typeof obj; }; } else { RouteLocatorService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RouteLocatorService_typeof(obj); }
  34444. function RouteLocatorService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34445. 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); } }
  34446. function RouteLocatorService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorService_defineProperties(Constructor, staticProps); return Constructor; }
  34447. function RouteLocatorService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { RouteLocatorService_get = Reflect.get; } else { RouteLocatorService_get = function _get(target, property, receiver) { var base = RouteLocatorService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return RouteLocatorService_get(target, property, receiver || target); }
  34448. function RouteLocatorService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteLocatorService_getPrototypeOf(object); if (object === null) break; } return object; }
  34449. function RouteLocatorService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) RouteLocatorService_setPrototypeOf(subClass, superClass); }
  34450. function RouteLocatorService_setPrototypeOf(o, p) { RouteLocatorService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteLocatorService_setPrototypeOf(o, p); }
  34451. 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); }; }
  34452. function RouteLocatorService_possibleConstructorReturn(self, call) { if (call && (RouteLocatorService_typeof(call) === "object" || typeof call === "function")) { return call; } return RouteLocatorService_assertThisInitialized(self); }
  34453. function RouteLocatorService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34454. function RouteLocatorService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34455. function RouteLocatorService_getPrototypeOf(o) { RouteLocatorService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteLocatorService_getPrototypeOf(o); }
  34456. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34457. * This program are made available under the terms of the Apache License, Version 2.0
  34458. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34459. /**
  34460. * @class SuperMap.RouteLocatorService
  34461. * @category iServer SpatialAnalyst RouteLocator
  34462. * @classdesc 路由对象定位空间对象的服务类。
  34463. * @extends {SuperMap.SpatialAnalystBase}
  34464. * @param {string} url -服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  34465. * @param {Object} options - 参数。</br>
  34466. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34467. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34468. * @param {Object} [options.headers] - 请求头。
  34469. * @example 实例化该类如下例所示:
  34470. * (start code)
  34471. * var routeLocatorParameters_point = new SuperMap.RouteLocatorParameters({
  34472. * "sourceRoute":{
  34473. * "type":"LINEM",
  34474. * "parts":[4],
  34475. * "points":[
  34476. * {
  34477. * "measure":0,
  34478. * "y":-6674.466867067764,
  34479. * "x":3817.3527876130133
  34480. * },
  34481. * {
  34482. * "measure":199.57954019411724,
  34483. * "y":-6670.830929417594,
  34484. * "x":3617.806369901496
  34485. * },
  34486. * {
  34487. * "measure":609.3656478634477,
  34488. * "y":-6877.837541432356,
  34489. * "x":3264.1498746678444
  34490. * },
  34491. * {
  34492. * "measure":936.0174126282958,
  34493. * "y":-7038.687780615184,
  34494. * "x":2979.846206068903
  34495. * }
  34496. * ]
  34497. * },
  34498. * "type":"POINT",
  34499. * "measure":10,
  34500. * "offset":3,
  34501. * "isIgnoreGap":true
  34502. * });
  34503. * var routeLocatorService = new SuperMap.RouteLocatorService(spatialAnalystURL, {
  34504. * eventListeners:{
  34505. * processCompleted:routeLocatorCompleted,
  34506. * processFailed:routeLocatorFailded
  34507. * }
  34508. * );
  34509. * routeLocatorService.processAsync(routeLocatorParameters_point);
  34510. *
  34511. * //执行
  34512. * function routeLocatorCompleted(){todo}
  34513. * function routeLocatorFailded(){todo}
  34514. * (end)
  34515. *
  34516. */
  34517. var RouteLocatorService = /*#__PURE__*/function (_SpatialAnalystBase) {
  34518. RouteLocatorService_inherits(RouteLocatorService, _SpatialAnalystBase);
  34519. var _super = RouteLocatorService_createSuper(RouteLocatorService);
  34520. function RouteLocatorService(url, options) {
  34521. var _this;
  34522. RouteLocatorService_classCallCheck(this, RouteLocatorService);
  34523. _this = _super.call(this, url, options);
  34524. _this.CLASS_NAME = "SuperMap.RouteLocatorService";
  34525. return _this;
  34526. }
  34527. /**
  34528. * @override
  34529. */
  34530. RouteLocatorService_createClass(RouteLocatorService, [{
  34531. key: "destroy",
  34532. value: function destroy() {
  34533. RouteLocatorService_get(RouteLocatorService_getPrototypeOf(RouteLocatorService.prototype), "destroy", this).call(this);
  34534. }
  34535. /**
  34536. * @function SuperMap.RouteLocatorService.prototype.processAsync
  34537. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  34538. * @param {SuperMap.RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  34539. */
  34540. }, {
  34541. key: "processAsync",
  34542. value: function processAsync(params) {
  34543. if (!(params instanceof RouteLocatorParameters)) {
  34544. return;
  34545. }
  34546. var me = this,
  34547. jsonParameters;
  34548. jsonParameters = me.getJsonParameters(params);
  34549. me.request({
  34550. method: "POST",
  34551. data: jsonParameters,
  34552. scope: me,
  34553. success: me.serviceProcessCompleted,
  34554. failure: me.serviceProcessFailed
  34555. });
  34556. }
  34557. /**
  34558. * @function SuperMap.RouteLocatorService.prototype.processAsync
  34559. * @description 将参数转化为 JSON 字符串。
  34560. * @param {SuperMap.RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  34561. * @returns {Object} 转化后的JSON字符串。
  34562. */
  34563. }, {
  34564. key: "getJsonParameters",
  34565. value: function getJsonParameters(params) {
  34566. var jsonParameters,
  34567. jsonStr = "geometry/routelocator",
  34568. me = this;
  34569. if (params.dataset) {
  34570. jsonStr = "datasets/" + params.dataset + "/linearreferencing/routelocator";
  34571. params.sourceRoute = null;
  34572. }
  34573. me.url = Util.urlPathAppend(me.url, jsonStr);
  34574. me.url = Util.urlAppend(me.url, 'returnContent=true');
  34575. jsonParameters = Util.toJSON(params);
  34576. return jsonParameters;
  34577. }
  34578. }]);
  34579. return RouteLocatorService;
  34580. }(SpatialAnalystBase);
  34581. SuperMap.RouteLocatorService = RouteLocatorService;
  34582. ;// CONCATENATED MODULE: ./src/common/iServer/ServerFeature.js
  34583. function ServerFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34584. 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); } }
  34585. function ServerFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerFeature_defineProperties(Constructor, staticProps); return Constructor; }
  34586. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34587. * This program are made available under the terms of the Apache License, Version 2.0
  34588. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34589. /**
  34590. * @class SuperMap.ServerFeature
  34591. * @category iServer
  34592. * @classdesc 服务端矢量要素类。该类描述了服务端返回的矢量要素的相关信息,包括字段和几何信息。
  34593. * @param {Object} options - 参数。
  34594. * @param {SuperMap.ServerGeometry} geometry - 矢量要素的几何信息。
  34595. * @param {Array.<string>} [options.fieldNames] - 矢量要素的属性字段名集合。
  34596. * @param {Array.<string>} [options.fieldValues] - 矢量要素的属性字段值集合。
  34597. */
  34598. var ServerFeature = /*#__PURE__*/function () {
  34599. function ServerFeature(options) {
  34600. ServerFeature_classCallCheck(this, ServerFeature);
  34601. /**
  34602. * @member {Array.<string>} [SuperMap.ServerFeature.prototype.fieldNames]
  34603. * @description 矢量要素的属性字段名集合。
  34604. */
  34605. this.fieldNames = null;
  34606. /**
  34607. * @member {Array.<string>} [SuperMap.ServerFeature.prototype.fieldValues]
  34608. * @description 矢量要素的属性字段值集合。
  34609. */
  34610. this.fieldValues = null;
  34611. /**
  34612. * @member {SuperMap.ServerGeometry} SuperMap.ServerFeature.prototype.geometry
  34613. * @description 矢量要素的几何信息。
  34614. */
  34615. this.geometry = null;
  34616. if (options) {
  34617. Util.extend(this, options);
  34618. }
  34619. this.CLASS_NAME = "SuperMap.ServerFeature";
  34620. }
  34621. /**
  34622. * @function SuperMap.ServerFeature.prototype.destroy
  34623. * @description 释放资源,将引用资源的属性置空。
  34624. */
  34625. ServerFeature_createClass(ServerFeature, [{
  34626. key: "destroy",
  34627. value: function destroy() {
  34628. var me = this;
  34629. me.fieldNames = null;
  34630. me.fieldValues = null;
  34631. if (me.geometry) {
  34632. me.geometry.destroy();
  34633. me.geometry = null;
  34634. }
  34635. }
  34636. /**
  34637. * @function SuperMap.ServerFeature.prototype.toFeature
  34638. * @description 将服务端矢量要素 ServerFeature 转换为客户端矢量要素 Feature。
  34639. * @returns {SuperMap.Vector} 转换后的客户端矢量要素。
  34640. */
  34641. }, {
  34642. key: "toFeature",
  34643. value: function toFeature() {
  34644. var names,
  34645. values,
  34646. geo,
  34647. attr = {},
  34648. me = this,
  34649. feature;
  34650. names = me.fieldNames;
  34651. values = me.fieldValues;
  34652. for (var i in names) {
  34653. attr[names[i]] = values[i];
  34654. }
  34655. if (me.geometry) {
  34656. geo = me.geometry.toGeometry();
  34657. }
  34658. feature = new Vector(geo, attr);
  34659. if (me.geometry && me.geometry.id) {
  34660. feature.fid = me.geometry.id;
  34661. }
  34662. return feature;
  34663. }
  34664. /**
  34665. * @function SuperMap.ServerFeature.prototype.fromJson
  34666. * @description 将 JSON 对象表示服务端矢量要素转换为 ServerFeature。
  34667. * @param {Object} jsonObject - 要转换的 JSON 对象。
  34668. * @returns {SuperMap.ServerFeature} 转化后的 ServerFeature 对象。
  34669. */
  34670. }], [{
  34671. key: "fromJson",
  34672. value: function fromJson(jsonObject) {
  34673. var geo = null;
  34674. if (!jsonObject) {
  34675. return;
  34676. }
  34677. geo = jsonObject.geometry;
  34678. if (geo) {
  34679. geo = ServerGeometry.fromJson(geo);
  34680. }
  34681. return new ServerFeature({
  34682. fieldNames: jsonObject.fieldNames,
  34683. fieldValues: jsonObject.fieldValues,
  34684. geometry: geo
  34685. });
  34686. }
  34687. }]);
  34688. return ServerFeature;
  34689. }();
  34690. SuperMap.ServerFeature = ServerFeature;
  34691. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoParameters.js
  34692. function SetLayerInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34693. 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); } }
  34694. function SetLayerInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoParameters_defineProperties(Constructor, staticProps); return Constructor; }
  34695. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34696. * This program are made available under the terms of the Apache License, Version 2.0
  34697. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34698. /**
  34699. * @class SuperMap.SetLayerInfoParameters
  34700. * @category iServer Map TempLayersSet
  34701. * @classdesc 设置图层信息参数类.
  34702. * @param {Object} options - 参数。
  34703. * @param {string} options.resourceID - 临时图层的资源 ID。
  34704. * @param {string} options.tempLayerName - 临时图层下的子图层名。
  34705. * @param {string} options.layerInfo - 要更新的图层信息。
  34706. */
  34707. var SetLayerInfoParameters = /*#__PURE__*/function () {
  34708. function SetLayerInfoParameters(options) {
  34709. SetLayerInfoParameters_classCallCheck(this, SetLayerInfoParameters);
  34710. options = options || {};
  34711. /**
  34712. * @member {string} SuperMap.SetLayerInfoParameters.prototype.resourceID
  34713. * @description 临时图层的资源 ID。
  34714. */
  34715. this.resourceID = null;
  34716. /**
  34717. * @member {string} SuperMap.SetLayerInfoParameters.prototype.tempLayerName
  34718. * @description 临时图层下子图层(或者其子图层)名,如:Countries@World.3@@World。
  34719. */
  34720. this.tempLayerName = null;
  34721. /**
  34722. * @member {Object} SuperMap.SetLayerInfoParameters.prototype.layerInfo
  34723. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  34724. */
  34725. this.layerInfo = null;
  34726. Util.extend(this, options);
  34727. this.CLASS_NAME = "SuperMap.SetLayerInfoParameters";
  34728. }
  34729. /**
  34730. * @function SuperMap.SetLayerInfoParameters.prototype.destroy
  34731. * @description 释放资源,将引用资源的属性置空。
  34732. */
  34733. SetLayerInfoParameters_createClass(SetLayerInfoParameters, [{
  34734. key: "destroy",
  34735. value: function destroy() {
  34736. var me = this;
  34737. me.resourceID = null;
  34738. me.tempLayerName = null;
  34739. me.layerInfo = null;
  34740. }
  34741. }]);
  34742. return SetLayerInfoParameters;
  34743. }();
  34744. SuperMap.SetLayerInfoParameters = SetLayerInfoParameters;
  34745. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoService.js
  34746. function SetLayerInfoService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SetLayerInfoService_typeof = function _typeof(obj) { return typeof obj; }; } else { SetLayerInfoService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SetLayerInfoService_typeof(obj); }
  34747. function SetLayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34748. 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); } }
  34749. function SetLayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  34750. function SetLayerInfoService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayerInfoService_get = Reflect.get; } else { SetLayerInfoService_get = function _get(target, property, receiver) { var base = SetLayerInfoService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SetLayerInfoService_get(target, property, receiver || target); }
  34751. function SetLayerInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  34752. function SetLayerInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SetLayerInfoService_setPrototypeOf(subClass, superClass); }
  34753. function SetLayerInfoService_setPrototypeOf(o, p) { SetLayerInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerInfoService_setPrototypeOf(o, p); }
  34754. 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); }; }
  34755. function SetLayerInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayerInfoService_assertThisInitialized(self); }
  34756. function SetLayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34757. function SetLayerInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34758. function SetLayerInfoService_getPrototypeOf(o) { SetLayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerInfoService_getPrototypeOf(o); }
  34759. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34760. * This program are made available under the terms of the Apache License, Version 2.0
  34761. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34762. /**
  34763. * @class SuperMap.SetLayerInfoService
  34764. * @category iServer Map TempLayersSet
  34765. * @classdesc 设置图层信息服务类。可以实现临时图层中子图层的修改
  34766. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  34767. * @extends {SuperMap.CommonServiceBase}
  34768. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  34769. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World";
  34770. * @param {Object} options - 参数。
  34771. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  34772. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  34773. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  34774. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34775. * @param {Object} [options.headers] - 请求头。
  34776. */
  34777. var SetLayerInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  34778. SetLayerInfoService_inherits(SetLayerInfoService, _CommonServiceBase);
  34779. var _super = SetLayerInfoService_createSuper(SetLayerInfoService);
  34780. function SetLayerInfoService(url, options) {
  34781. var _this;
  34782. SetLayerInfoService_classCallCheck(this, SetLayerInfoService);
  34783. _this = _super.call(this, url, options);
  34784. if (options) {
  34785. Util.extend(SetLayerInfoService_assertThisInitialized(_this), options);
  34786. }
  34787. _this.CLASS_NAME = "SuperMap.SetLayerInfoService";
  34788. return _this;
  34789. }
  34790. /**
  34791. * @override
  34792. */
  34793. SetLayerInfoService_createClass(SetLayerInfoService, [{
  34794. key: "destroy",
  34795. value: function destroy() {
  34796. SetLayerInfoService_get(SetLayerInfoService_getPrototypeOf(SetLayerInfoService.prototype), "destroy", this).call(this);
  34797. Util.reset(this);
  34798. }
  34799. /**
  34800. * @function SuperMap.SetLayerInfoService.prototype.processAsync
  34801. * @description 负责将客户端的更新参数传递到服务端。
  34802. * @param {Object} params - 修改后的图层资源信息。
  34803. * 该参数可以使用获取图层信息服务<{@link SuperMap.GetLayersInfoService}>返回图层信息,解析结果result.subLayers.layers[i],然后对其属性进行修改来获取。
  34804. */
  34805. }, {
  34806. key: "processAsync",
  34807. value: function processAsync(params) {
  34808. if (!params) {
  34809. return;
  34810. }
  34811. var me = this;
  34812. var jsonParamsStr = Util.toJSON(params);
  34813. me.request({
  34814. method: "PUT",
  34815. data: jsonParamsStr,
  34816. scope: me,
  34817. success: me.serviceProcessCompleted,
  34818. failure: me.serviceProcessFailed
  34819. });
  34820. }
  34821. }]);
  34822. return SetLayerInfoService;
  34823. }(CommonServiceBase);
  34824. SuperMap.SetLayerInfoService = SetLayerInfoService;
  34825. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoParameters.js
  34826. function SetLayersInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34827. 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); } }
  34828. function SetLayersInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoParameters_defineProperties(Constructor, staticProps); return Constructor; }
  34829. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34830. * This program are made available under the terms of the Apache License, Version 2.0
  34831. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34832. /**
  34833. * @class SuperMap.SetLayersInfoParameters
  34834. * @category iServer Map TempLayersSet
  34835. * @classdesc 设置图层信息参数类。
  34836. * @param {Object} options - 参数。
  34837. * @param {boolean} [options.isTempLayers=false] - 是否是临时图层。
  34838. * @param {string} options.resourceID - 临时图层资源 ID。
  34839. * @param {string} options.layersInfo - 要更新的图层信息。
  34840. */
  34841. var SetLayersInfoParameters = /*#__PURE__*/function () {
  34842. function SetLayersInfoParameters(options) {
  34843. SetLayersInfoParameters_classCallCheck(this, SetLayersInfoParameters);
  34844. options = options || {};
  34845. /**
  34846. * @member {boolean} [SuperMap.SetLayersInfoParameters.prototype.isTempLayers=false]
  34847. * @description 是否是临时图层。
  34848. */
  34849. this.isTempLayers = null;
  34850. /**
  34851. * @member {string} SuperMap.SetLayersInfoParameters.prototype.resourceID
  34852. * @description 临时图层资源 ID,
  34853. */
  34854. this.resourceID = null;
  34855. /**
  34856. * @member {Object} SuperMap.SetLayersInfoParameters.prototype.layersInfo
  34857. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  34858. */
  34859. this.layersInfo = null;
  34860. Util.extend(this, options);
  34861. this.CLASS_NAME = "SuperMap.SetLayersInfoParameters";
  34862. }
  34863. /**
  34864. * @function SuperMap.SetLayersInfoParameters.prototype.destroy
  34865. * @description 释放资源,将引用资源的属性置空。
  34866. */
  34867. SetLayersInfoParameters_createClass(SetLayersInfoParameters, [{
  34868. key: "destroy",
  34869. value: function destroy() {
  34870. var me = this;
  34871. me.isTempLayers = null;
  34872. me.resourceID = null;
  34873. me.layersInfo = null;
  34874. }
  34875. }]);
  34876. return SetLayersInfoParameters;
  34877. }();
  34878. SuperMap.SetLayersInfoParameters = SetLayersInfoParameters;
  34879. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoService.js
  34880. function SetLayersInfoService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SetLayersInfoService_typeof = function _typeof(obj) { return typeof obj; }; } else { SetLayersInfoService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SetLayersInfoService_typeof(obj); }
  34881. function SetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34882. 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); } }
  34883. function SetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  34884. function SetLayersInfoService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayersInfoService_get = Reflect.get; } else { SetLayersInfoService_get = function _get(target, property, receiver) { var base = SetLayersInfoService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SetLayersInfoService_get(target, property, receiver || target); }
  34885. function SetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  34886. function SetLayersInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SetLayersInfoService_setPrototypeOf(subClass, superClass); }
  34887. function SetLayersInfoService_setPrototypeOf(o, p) { SetLayersInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayersInfoService_setPrototypeOf(o, p); }
  34888. 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); }; }
  34889. function SetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayersInfoService_assertThisInitialized(self); }
  34890. function SetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34891. function SetLayersInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34892. function SetLayersInfoService_getPrototypeOf(o) { SetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayersInfoService_getPrototypeOf(o); }
  34893. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34894. * This program are made available under the terms of the Apache License, Version 2.0
  34895. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34896. /**
  34897. * @class SuperMap.SetLayersInfoService
  34898. * @category iServer Map TempLayersSet
  34899. * @classdesc 设置图层信息服务类。可以实现创建新的临时图层和对现有临时图层的修改,
  34900. * 当 isTempLayers 为 false的时候执行创建临时图层。当 isTempLayers 为 ture 并且临时图层资源 resourceID 被设置有效时执行对临时图层的编辑。
  34901. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  34902. * @extends {SuperMap.CommonServiceBase}
  34903. * @param url - {string} 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  34904. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  34905. * @param {Object} options - 参数。
  34906. * @param {string} options.resourceID - 图层资源ID,临时图层的资源ID标记。
  34907. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  34908. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  34909. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  34910. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  34911. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34912. * @param {Object} [options.headers] - 请求头。
  34913. */
  34914. var SetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  34915. SetLayersInfoService_inherits(SetLayersInfoService, _CommonServiceBase);
  34916. var _super = SetLayersInfoService_createSuper(SetLayersInfoService);
  34917. function SetLayersInfoService(url, options) {
  34918. var _this;
  34919. SetLayersInfoService_classCallCheck(this, SetLayersInfoService);
  34920. _this = _super.call(this, url, options);
  34921. /**
  34922. * @member {string} SuperMap.SetLayersInfoService.prototype.resourceID
  34923. * @description 图层资源ID,临时图层的资源ID标记。
  34924. */
  34925. _this.resourceID = null;
  34926. /**
  34927. * @function {boolean} SuperMap.SetLayersInfoService.prototype.isTempLayers
  34928. * @description 当前url对应的图层是否是临时图层。
  34929. */
  34930. _this.isTempLayers = false;
  34931. if (options) {
  34932. SuperMap.Util.extend(SetLayersInfoService_assertThisInitialized(_this), options);
  34933. }
  34934. _this.CLASS_NAME = "SuperMap.SetLayersInfoService";
  34935. return _this;
  34936. }
  34937. /**
  34938. * @override
  34939. */
  34940. SetLayersInfoService_createClass(SetLayersInfoService, [{
  34941. key: "destroy",
  34942. value: function destroy() {
  34943. SetLayersInfoService_get(SetLayersInfoService_getPrototypeOf(SetLayersInfoService.prototype), "destroy", this).call(this);
  34944. Util.reset(this);
  34945. }
  34946. /**
  34947. * @function SuperMap.SetLayersInfoService.prototype.processAsync
  34948. * @description 负责将客户端的更新参数传递到服务端。
  34949. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务 <{@link SuperMap.GetLayersInfoService}>返回图层信息,然后对其属性进行修改来获取。
  34950. */
  34951. }, {
  34952. key: "processAsync",
  34953. value: function processAsync(params) {
  34954. if (!params) {
  34955. return;
  34956. }
  34957. var jsonParams,
  34958. subLayers = [],
  34959. me = this,
  34960. method = ""; //创建临时图层和设置修改临时图层信息对应不同的资源URL
  34961. if (me.isTempLayers) {
  34962. me.url = Util.urlPathAppend(me.url, "tempLayersSet/" + me.resourceID);
  34963. method = "PUT";
  34964. } else {
  34965. me.url = Util.urlPathAppend(me.url, "tempLayersSet");
  34966. method = "POST";
  34967. }
  34968. if (!params.subLayers) {
  34969. params.subLayers = {
  34970. layers: []
  34971. };
  34972. }
  34973. if (!params.subLayers.layers) {
  34974. params.subLayers.layers = [];
  34975. }
  34976. var layers = params.subLayers.layers,
  34977. len = layers.length;
  34978. for (var i in layers) {
  34979. if (layers[i].ugcLayerType === "GRID") {
  34980. var colorDictionary = {};
  34981. var colorDics = layers[i].colorDictionarys;
  34982. for (var j in colorDics) {
  34983. var key = colorDics[j].elevation;
  34984. colorDictionary[key] = colorDics[j].color;
  34985. }
  34986. }
  34987. layers[i].colorDictionary = colorDictionary;
  34988. delete layers[i].colorDictionarys;
  34989. }
  34990. for (var _i = 0; _i < len; _i++) {
  34991. if (layers[_i].toJsonObject) {
  34992. //将图层信息转换成服务端能识别的简单json对象
  34993. subLayers.push(layers[_i].toJsonObject());
  34994. } else {
  34995. subLayers.push(layers[_i]);
  34996. }
  34997. }
  34998. jsonParams = Util.extend(jsonParams, params);
  34999. jsonParams.subLayers = {
  35000. "layers": subLayers
  35001. };
  35002. jsonParams.object = null;
  35003. var jsonParamsStr = Util.toJSON([jsonParams]);
  35004. me.request({
  35005. method: method,
  35006. data: jsonParamsStr,
  35007. scope: me,
  35008. success: me.serviceProcessCompleted,
  35009. failure: me.serviceProcessFailed
  35010. });
  35011. }
  35012. }]);
  35013. return SetLayersInfoService;
  35014. }(CommonServiceBase);
  35015. SuperMap.SetLayersInfoService = SetLayersInfoService;
  35016. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusParameters.js
  35017. function SetLayerStatusParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35018. 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); } }
  35019. function SetLayerStatusParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusParameters_defineProperties(Constructor, staticProps); return Constructor; }
  35020. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35021. * This program are made available under the terms of the Apache License, Version 2.0
  35022. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35023. /**
  35024. * @class SuperMap.SetLayerStatusParameters
  35025. * @category iServer Map TempLayersSet
  35026. * @classdesc 子图层显示控制参数类,该类存储了各子图层是否可见的状态。
  35027. * 注意在 SuperMap iClient 系列产品中所说的图层与 SuperMap Deskpro 的地图对应,子图层与 SuperMap Deskpro 的图层对应。
  35028. * @param {Object} options - 参数。
  35029. * @param {Array.<SuperMap.LayerStatus>} options.layerStatusList - 获取或设置图层可见状态({@link SuperMap.LayerStatus})集合,
  35030. * 集合中的每个 {@link SuperMap.LayerStatus} 对象代表一个子图层的可视状态。
  35031. * @param {number} [options.holdTime=15] - 获取或设置资源在服务端保存的时间。
  35032. * @param {string} [options.resourceID] - 获取或设置资源服务 ID。
  35033. */
  35034. var SetLayerStatusParameters = /*#__PURE__*/function () {
  35035. function SetLayerStatusParameters(options) {
  35036. SetLayerStatusParameters_classCallCheck(this, SetLayerStatusParameters);
  35037. /**
  35038. * @member {Array.<SuperMap.LayerStatus>} SuperMap.SetLayerStatusParameters.prototype.layerStatusList
  35039. * @description 获取或设置图层可见状态({@link SuperMap.LayerStatus})集合,集合中的每个 {@link SuperMap.LayerStatus} 对象代表一个子图层的可视状态。
  35040. */
  35041. this.layerStatusList = [];
  35042. /**
  35043. * @member {number} [SuperMap.SetLayerStatusParameters.prototype.holdTime=15]
  35044. * @description 获取或设置资源在服务端保存的时间。单位为分钟。
  35045. */
  35046. this.holdTime = 15;
  35047. /**
  35048. * @member {string} SuperMap.SetLayerStatusParameters.prototype.resourceID
  35049. * @description 获取或设置资源服务ID。如果设置该参数则会在指定的 TempLayer 进行图层的显示控制;
  35050. * 如果不设置该参数,则会首先创建一个 TempLayer ,然后在新创建的 TempLayer 进行图层的显示控制。
  35051. */
  35052. this.resourceID = null;
  35053. if (options) {
  35054. Util.extend(this, options);
  35055. }
  35056. }
  35057. /**
  35058. * @function SuperMap.SetLayerStatusParameters.prototype.destroy
  35059. * @description 释放资源,将引用资源的属性置空。
  35060. */
  35061. SetLayerStatusParameters_createClass(SetLayerStatusParameters, [{
  35062. key: "destroy",
  35063. value: function destroy() {
  35064. var me = this;
  35065. me.layerStatusList = null;
  35066. me.holdTime = null;
  35067. me.resourceID = null;
  35068. }
  35069. /**
  35070. * @function SuperMap.SetLayerStatusParameters.prototype.toJSON
  35071. * @description 生成 JSON。
  35072. * @returns {Object} 对应的 JSON 对象。
  35073. */
  35074. }, {
  35075. key: "toJSON",
  35076. value: function toJSON() {
  35077. var json = '{';
  35078. json += '"layers":[';
  35079. var v = [];
  35080. for (var i = 0, len = this.layerStatusList.length; i < len; i++) {
  35081. v.push(this.layerStatusList[i].toJSON());
  35082. }
  35083. json += v;
  35084. json += ']';
  35085. json += '}';
  35086. return json;
  35087. }
  35088. }]);
  35089. return SetLayerStatusParameters;
  35090. }();
  35091. SuperMap.SetLayerStatusParameters = SetLayerStatusParameters;
  35092. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusService.js
  35093. function SetLayerStatusService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SetLayerStatusService_typeof = function _typeof(obj) { return typeof obj; }; } else { SetLayerStatusService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SetLayerStatusService_typeof(obj); }
  35094. function SetLayerStatusService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35095. 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); } }
  35096. function SetLayerStatusService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusService_defineProperties(Constructor, staticProps); return Constructor; }
  35097. function SetLayerStatusService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayerStatusService_get = Reflect.get; } else { SetLayerStatusService_get = function _get(target, property, receiver) { var base = SetLayerStatusService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SetLayerStatusService_get(target, property, receiver || target); }
  35098. function SetLayerStatusService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerStatusService_getPrototypeOf(object); if (object === null) break; } return object; }
  35099. function SetLayerStatusService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SetLayerStatusService_setPrototypeOf(subClass, superClass); }
  35100. function SetLayerStatusService_setPrototypeOf(o, p) { SetLayerStatusService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerStatusService_setPrototypeOf(o, p); }
  35101. 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); }; }
  35102. function SetLayerStatusService_possibleConstructorReturn(self, call) { if (call && (SetLayerStatusService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayerStatusService_assertThisInitialized(self); }
  35103. function SetLayerStatusService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35104. function SetLayerStatusService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  35105. function SetLayerStatusService_getPrototypeOf(o) { SetLayerStatusService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerStatusService_getPrototypeOf(o); }
  35106. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35107. * This program are made available under the terms of the Apache License, Version 2.0
  35108. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35109. /**
  35110. * @class SuperMap.SetLayerStatusService
  35111. * @category iServer Map TempLayersSet
  35112. * @classdesc 子图层显示控制服务类。该类负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  35113. * 用户获取服务端返回的各子图层显示状态有两种方式:
  35114. * 一种是通过监听 SetLayerEvent.PROCESS_COMPLETE 事件;
  35115. * 一种是使用 AsyncResponder 类实现异步处理。
  35116. * @extends {SuperMap.CommonServiceBase}
  35117. * @param {string} url - 地图服务访问地址。请求地图服务,URL 应为:
  35118. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  35119. * @param {Object} options - 参数。
  35120. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  35121. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  35122. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  35123. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35124. * @param {Object} [options.headers] - 请求头。
  35125. */
  35126. var SetLayerStatusService = /*#__PURE__*/function (_CommonServiceBase) {
  35127. SetLayerStatusService_inherits(SetLayerStatusService, _CommonServiceBase);
  35128. var _super = SetLayerStatusService_createSuper(SetLayerStatusService);
  35129. function SetLayerStatusService(url, options) {
  35130. var _this;
  35131. SetLayerStatusService_classCallCheck(this, SetLayerStatusService);
  35132. _this = _super.call(this, url, options);
  35133. _this.lastparams = null;
  35134. _this.mapUrl = url;
  35135. if (options) {
  35136. Util.extend(SetLayerStatusService_assertThisInitialized(_this), options);
  35137. }
  35138. _this.CLASS_NAME = "SuperMap.SetLayerStatusService";
  35139. return _this;
  35140. }
  35141. /**
  35142. * @override
  35143. */
  35144. SetLayerStatusService_createClass(SetLayerStatusService, [{
  35145. key: "destroy",
  35146. value: function destroy() {
  35147. SetLayerStatusService_get(SetLayerStatusService_getPrototypeOf(SetLayerStatusService.prototype), "destroy", this).call(this);
  35148. Util.reset(this);
  35149. }
  35150. /**
  35151. * @function SuperMap.SetLayerStatusService.prototype.processAsync
  35152. * @description 负责将客户端的更新参数传递到服务端。
  35153. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务{@link SuperMap.SetLayerStatusParameters}
  35154. * 返回图层信息,然后对其属性进行修改来获取。
  35155. */
  35156. }, {
  35157. key: "processAsync",
  35158. value: function processAsync(params) {
  35159. if (!(params instanceof SetLayerStatusParameters)) {
  35160. return;
  35161. }
  35162. var me = this,
  35163. method = "POST";
  35164. me.url = me.mapUrl;
  35165. if (params.resourceID == null) {
  35166. me.url = Util.urlPathAppend(me.url, 'tempLayersSet');
  35167. me.lastparams = params;
  35168. me.request({
  35169. method: method,
  35170. scope: me,
  35171. success: me.createTempLayerComplete,
  35172. failure: me.serviceProcessFailed
  35173. });
  35174. } else {
  35175. me.url = Util.urlPathAppend(me.url, "tempLayersSet/" + params.resourceID);
  35176. me.url = Util.urlAppend(me.url, "elementRemain=true&reference=" + params.resourceID + "&holdTime=" + params.holdTime.toString());
  35177. var jsonParameters = '[{';
  35178. jsonParameters += '"type":"UGC",';
  35179. if (params.layerStatusList != null && params.layerStatusList.length > 0) {
  35180. jsonParameters += '"subLayers":' + params.toJSON();
  35181. }
  35182. jsonParameters += ',"visible":' + true + ',';
  35183. jsonParameters += '"name":"' + this.getMapName(this.mapUrl) + '"';
  35184. jsonParameters += '}]';
  35185. me.request({
  35186. method: "PUT",
  35187. data: jsonParameters,
  35188. scope: me,
  35189. success: me.serviceProcessCompleted,
  35190. failure: me.serviceProcessFailed
  35191. });
  35192. }
  35193. }
  35194. /**
  35195. * @function SuperMap.SetLayerStatusService.prototype.createTempLayerComplete
  35196. * @description 设置完成,执行此方法。
  35197. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  35198. */
  35199. }, {
  35200. key: "createTempLayerComplete",
  35201. value: function createTempLayerComplete(result) {
  35202. var me = this;
  35203. result = Util.transformResult(result);
  35204. if (result.succeed) {
  35205. me.lastparams.resourceID = result.newResourceID;
  35206. }
  35207. me.processAsync(me.lastparams);
  35208. }
  35209. /**
  35210. * @function SuperMap.SetLayerStatusService.prototype.getMapName
  35211. * @description 获取地图名称。
  35212. * @param {Object} url - 服务地址。
  35213. */
  35214. }, {
  35215. key: "getMapName",
  35216. value: function getMapName(url) {
  35217. var mapUrl = url;
  35218. if (mapUrl.charAt(mapUrl.length - 1) === "/") {
  35219. mapUrl = mapUrl.substr(0, mapUrl.length - 1);
  35220. }
  35221. var index = mapUrl.lastIndexOf("/");
  35222. var mapName = mapUrl.substring(index + 1, mapUrl.length);
  35223. return mapName;
  35224. }
  35225. /**
  35226. * @function SuperMap.SetLayerStatusService.prototype.setLayerCompleted
  35227. * @description 设置完成,执行此方法。
  35228. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  35229. */
  35230. }, {
  35231. key: "serviceProcessCompleted",
  35232. value: function serviceProcessCompleted(result) {
  35233. var me = this;
  35234. result = Util.transformResult(result);
  35235. if (result != null && me.lastparams != null) {
  35236. result.newResourceID = me.lastparams.resourceID;
  35237. }
  35238. me.events.triggerEvent("processCompleted", {
  35239. result: result
  35240. });
  35241. }
  35242. }]);
  35243. return SetLayerStatusService;
  35244. }(CommonServiceBase);
  35245. SuperMap.SetLayerStatusService = SetLayerStatusService;
  35246. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsParameter.js
  35247. function SingleObjectQueryJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35248. 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); } }
  35249. function SingleObjectQueryJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  35250. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35251. * This program are made available under the terms of the Apache License, Version 2.0
  35252. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35253. /**
  35254. * @class SuperMap.SingleObjectQueryJobsParameter
  35255. * @category iServer ProcessingService Query
  35256. * @classdesc 单对象空间查询分析任务参数类。
  35257. * @param {Object} options - 参数。
  35258. * @param {string} options.datasetName - 数据集名。
  35259. * @param {string} options.datasetQuery - 查询对象所在的数据集名称。
  35260. * @param {SuperMap.SpatialQueryMode} [options.mode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式。
  35261. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  35262. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  35263. */
  35264. var SingleObjectQueryJobsParameter = /*#__PURE__*/function () {
  35265. function SingleObjectQueryJobsParameter(options) {
  35266. SingleObjectQueryJobsParameter_classCallCheck(this, SingleObjectQueryJobsParameter);
  35267. if (!options) {
  35268. return;
  35269. }
  35270. /**
  35271. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.datasetName
  35272. * @description 数据集名。
  35273. */
  35274. this.datasetName = "";
  35275. /**
  35276. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.datasetQuery
  35277. * @description 查询对象所在的数据集名称。
  35278. */
  35279. this.datasetQuery = "";
  35280. /**
  35281. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.geometryQuery
  35282. * @description 查询对象所在的几何对象。
  35283. */
  35284. this.geometryQuery = "";
  35285. /**
  35286. * @member {SuperMap.SpatialQueryMode} [SuperMap.SingleObjectQueryJobsParameter.prototype.mode=SuperMap.SpatialQueryMode.CONTAIN]
  35287. * @description 空间查询模式 。
  35288. */
  35289. this.mode = SpatialQueryMode.CONTAIN;
  35290. /**
  35291. * @member {SuperMap.OutputSetting} [SuperMap.SingleObjectQueryJobsParameter.prototype.output]
  35292. * @description 输出参数设置类。
  35293. */
  35294. this.output = null;
  35295. /**
  35296. * @member {SuperMap.MappingParameters} [SuperMap.SingleObjectQueryJobsParameter.prototype.mappingParameters]
  35297. * @description 分析后结果可视化的参数类。
  35298. */
  35299. this.mappingParameters = null;
  35300. Util.extend(this, options);
  35301. this.CLASS_NAME = "SuperMap.SingleObjectQueryJobsParameter";
  35302. }
  35303. /**
  35304. * @function SuperMap.SingleObjectQueryJobsParameter.prototype.destroy
  35305. * @description 释放资源,将引用资源的属性置空。
  35306. */
  35307. SingleObjectQueryJobsParameter_createClass(SingleObjectQueryJobsParameter, [{
  35308. key: "destroy",
  35309. value: function destroy() {
  35310. this.datasetName = null;
  35311. this.datasetQuery = null;
  35312. this.geometryQuery = null;
  35313. this.mode = null;
  35314. if (this.output instanceof OutputSetting) {
  35315. this.output.destroy();
  35316. this.output = null;
  35317. }
  35318. if (this.mappingParameters instanceof MappingParameters) {
  35319. this.mappingParameters.destroy();
  35320. this.mappingParameters = null;
  35321. }
  35322. }
  35323. /**
  35324. * @function SuperMap.SingleObjectQueryJobsParameter.toObject
  35325. * @param {Object} singleObjectQueryJobsParameter - 单对象空间查询分析任务参数。
  35326. * @param {Object} tempObj - 目标对象。
  35327. * @description 生成单对象空间查询分析任务对象。
  35328. */
  35329. }], [{
  35330. key: "toObject",
  35331. value: function toObject(singleObjectQueryJobsParameter, tempObj) {
  35332. for (var name in singleObjectQueryJobsParameter) {
  35333. if (name === "datasetName") {
  35334. tempObj['input'] = tempObj['input'] || {};
  35335. tempObj['input'][name] = singleObjectQueryJobsParameter[name];
  35336. continue;
  35337. }
  35338. if (name === "output") {
  35339. tempObj['output'] = tempObj['output'] || {};
  35340. tempObj['output'] = singleObjectQueryJobsParameter[name];
  35341. continue;
  35342. }
  35343. tempObj['analyst'] = tempObj['analyst'] || {};
  35344. tempObj['analyst'][name] = singleObjectQueryJobsParameter[name];
  35345. if (name === 'mappingParameters') {
  35346. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  35347. tempObj['analyst']['mappingParameters'] = singleObjectQueryJobsParameter[name];
  35348. }
  35349. }
  35350. }
  35351. }]);
  35352. return SingleObjectQueryJobsParameter;
  35353. }();
  35354. SuperMap.SingleObjectQueryJobsParameter = SingleObjectQueryJobsParameter;
  35355. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsService.js
  35356. function SingleObjectQueryJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SingleObjectQueryJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SingleObjectQueryJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SingleObjectQueryJobsService_typeof(obj); }
  35357. function SingleObjectQueryJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35358. 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); } }
  35359. function SingleObjectQueryJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  35360. function SingleObjectQueryJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SingleObjectQueryJobsService_get = Reflect.get; } else { SingleObjectQueryJobsService_get = function _get(target, property, receiver) { var base = SingleObjectQueryJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SingleObjectQueryJobsService_get(target, property, receiver || target); }
  35361. function SingleObjectQueryJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SingleObjectQueryJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  35362. function SingleObjectQueryJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SingleObjectQueryJobsService_setPrototypeOf(subClass, superClass); }
  35363. function SingleObjectQueryJobsService_setPrototypeOf(o, p) { SingleObjectQueryJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SingleObjectQueryJobsService_setPrototypeOf(o, p); }
  35364. 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); }; }
  35365. function SingleObjectQueryJobsService_possibleConstructorReturn(self, call) { if (call && (SingleObjectQueryJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SingleObjectQueryJobsService_assertThisInitialized(self); }
  35366. function SingleObjectQueryJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35367. function SingleObjectQueryJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  35368. function SingleObjectQueryJobsService_getPrototypeOf(o) { SingleObjectQueryJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SingleObjectQueryJobsService_getPrototypeOf(o); }
  35369. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35370. * This program are made available under the terms of the Apache License, Version 2.0
  35371. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35372. /**
  35373. * @class SuperMap.SingleObjectQueryJobsService
  35374. * @category iServer ProcessingService Query
  35375. * @classdesc 单对象查询分析服务类
  35376. * @extends {SuperMap.ProcessingServiceBase}
  35377. * @param {string} url - 单对象空间查询分析服务地址。
  35378. * @param {Object} options - 参数。
  35379. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35380. * @param {Object} [options.headers] - 请求头。
  35381. */
  35382. var SingleObjectQueryJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  35383. SingleObjectQueryJobsService_inherits(SingleObjectQueryJobsService, _ProcessingServiceBas);
  35384. var _super = SingleObjectQueryJobsService_createSuper(SingleObjectQueryJobsService);
  35385. function SingleObjectQueryJobsService(url, options) {
  35386. var _this;
  35387. SingleObjectQueryJobsService_classCallCheck(this, SingleObjectQueryJobsService);
  35388. _this = _super.call(this, url, options);
  35389. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/query');
  35390. _this.CLASS_NAME = 'SuperMap.SingleObjectQueryJobsService';
  35391. return _this;
  35392. }
  35393. /**
  35394. *@override
  35395. */
  35396. SingleObjectQueryJobsService_createClass(SingleObjectQueryJobsService, [{
  35397. key: "destroy",
  35398. value: function destroy() {
  35399. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "destroy", this).call(this);
  35400. }
  35401. /**
  35402. * @function SuperMap.SingleObjectQueryJobsService.protitype.getQueryJobs
  35403. * @description 获取单对象空间查询分析所有任务
  35404. */
  35405. }, {
  35406. key: "getQueryJobs",
  35407. value: function getQueryJobs() {
  35408. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, this.url);
  35409. }
  35410. /**
  35411. * @function SuperMap.KernelDensityJobsService.protitype.getQueryJob
  35412. * @description 获取指定id的单对象空间查询分析服务
  35413. * @param {string} id - 指定要获取数据的id
  35414. */
  35415. }, {
  35416. key: "getQueryJob",
  35417. value: function getQueryJob(id) {
  35418. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  35419. }
  35420. /**
  35421. * @function SuperMap.SingleObjectQueryJobsService.protitype.addQueryJob
  35422. * @description 新建单对象空间查询分析服务
  35423. * @param {SuperMap.SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
  35424. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  35425. */
  35426. }, {
  35427. key: "addQueryJob",
  35428. value: function addQueryJob(params, seconds) {
  35429. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "addJob", this).call(this, this.url, params, SingleObjectQueryJobsParameter, seconds);
  35430. }
  35431. }]);
  35432. return SingleObjectQueryJobsService;
  35433. }(ProcessingServiceBase);
  35434. SuperMap.SingleObjectQueryJobsService = SingleObjectQueryJobsService;
  35435. ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryParameters.js
  35436. function StopQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35437. 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); } }
  35438. function StopQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  35439. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35440. * This program are made available under the terms of the Apache License, Version 2.0
  35441. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35442. /**
  35443. * @class SuperMap.StopQueryParameters
  35444. * @category iServer TrafficTransferAnalyst TransferStops
  35445. * @classdesc 站点查询参数类。
  35446. * @param {Object} options - 参数。
  35447. * @param {string} options.keyWord - 站点名称关键字。
  35448. * @param {boolean} [options.returnPosition=false] - 是否返回站点坐标信息。
  35449. */
  35450. var StopQueryParameters = /*#__PURE__*/function () {
  35451. function StopQueryParameters(options) {
  35452. StopQueryParameters_classCallCheck(this, StopQueryParameters);
  35453. options = options || {};
  35454. /**
  35455. * @member {string} SuperMap.StopQueryParameters.prototype.keyWord
  35456. * @description 站点名称关键字。
  35457. */
  35458. this.keyWord = null;
  35459. /**
  35460. * @member {boolean} [SuperMap.StopQueryParameters.prototype.returnPosition=false]
  35461. * @description 是否返回站点坐标信息。
  35462. */
  35463. this.returnPosition = false;
  35464. Util.extend(this, options);
  35465. this.CLASS_NAME = "SuperMap.StopQueryParameters";
  35466. }
  35467. /**
  35468. * @function SuperMap.StopQueryParameters.prototype.destroy
  35469. * @description 释放资源,将引用资源的属性置空。
  35470. */
  35471. StopQueryParameters_createClass(StopQueryParameters, [{
  35472. key: "destroy",
  35473. value: function destroy() {
  35474. Util.reset(this);
  35475. }
  35476. }]);
  35477. return StopQueryParameters;
  35478. }();
  35479. SuperMap.StopQueryParameters = StopQueryParameters;
  35480. ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryService.js
  35481. function StopQueryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { StopQueryService_typeof = function _typeof(obj) { return typeof obj; }; } else { StopQueryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return StopQueryService_typeof(obj); }
  35482. function StopQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35483. 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); } }
  35484. function StopQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryService_defineProperties(Constructor, staticProps); return Constructor; }
  35485. function StopQueryService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { StopQueryService_get = Reflect.get; } else { StopQueryService_get = function _get(target, property, receiver) { var base = StopQueryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return StopQueryService_get(target, property, receiver || target); }
  35486. function StopQueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = StopQueryService_getPrototypeOf(object); if (object === null) break; } return object; }
  35487. function StopQueryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) StopQueryService_setPrototypeOf(subClass, superClass); }
  35488. function StopQueryService_setPrototypeOf(o, p) { StopQueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return StopQueryService_setPrototypeOf(o, p); }
  35489. 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); }; }
  35490. function StopQueryService_possibleConstructorReturn(self, call) { if (call && (StopQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return StopQueryService_assertThisInitialized(self); }
  35491. function StopQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35492. function StopQueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  35493. function StopQueryService_getPrototypeOf(o) { StopQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return StopQueryService_getPrototypeOf(o); }
  35494. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35495. * This program are made available under the terms of the Apache License, Version 2.0
  35496. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35497. /**
  35498. * @class SuperMap.StopQueryService
  35499. * @category iServer TrafficTransferAnalyst TransferStops
  35500. * @classdesc 站点查询服务类。
  35501. * 返回结果通过该类支持的事件的监听函数参数获取
  35502. * @extends {SuperMap.CommonServiceBase}
  35503. * @param {string} url - 与客户端交互的站点查询服务地址。
  35504. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  35505. * @param {Object} options - 参数。</br>
  35506. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35507. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35508. * @param {Object} [options.headers] - 请求头。
  35509. * @example 例如:
  35510. * (start code)
  35511. * var myService = new SuperMap.StopQueryService(url, {eventListeners: {
  35512. * "processCompleted": StopQueryCompleted,
  35513. * "processFailed": StopQueryError
  35514. * }
  35515. * };
  35516. * (end)
  35517. *
  35518. *
  35519. */
  35520. var StopQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  35521. StopQueryService_inherits(StopQueryService, _CommonServiceBase);
  35522. var _super = StopQueryService_createSuper(StopQueryService);
  35523. function StopQueryService(url, options) {
  35524. var _this;
  35525. StopQueryService_classCallCheck(this, StopQueryService);
  35526. _this = _super.call(this, url, options);
  35527. options = options || {};
  35528. Util.extend(StopQueryService_assertThisInitialized(_this), options);
  35529. _this.CLASS_NAME = "SuperMap.StopQueryService";
  35530. return _this;
  35531. }
  35532. /**
  35533. *@override
  35534. */
  35535. StopQueryService_createClass(StopQueryService, [{
  35536. key: "destroy",
  35537. value: function destroy() {
  35538. StopQueryService_get(StopQueryService_getPrototypeOf(StopQueryService.prototype), "destroy", this).call(this);
  35539. Util.reset(this);
  35540. }
  35541. /**
  35542. * @function SuperMap.StopQueryService.prototype.processAsync
  35543. * @description 负责将客户端的更新参数传递到服务端。
  35544. * @param {SuperMap.StopQueryParameters} params - 交通换乘参数。
  35545. */
  35546. }, {
  35547. key: "processAsync",
  35548. value: function processAsync(params) {
  35549. if (!(params instanceof StopQueryParameters)) {
  35550. return;
  35551. }
  35552. var me = this;
  35553. me.url = Util.urlPathAppend(me.url, 'stops/keyword/' + params.keyWord);
  35554. me.request({
  35555. method: "GET",
  35556. params: {
  35557. returnPosition: params.returnPosition
  35558. },
  35559. scope: me,
  35560. success: me.serviceProcessCompleted,
  35561. failure: me.serviceProcessFailed
  35562. });
  35563. }
  35564. }]);
  35565. return StopQueryService;
  35566. }(CommonServiceBase);
  35567. SuperMap.StopQueryService = StopQueryService;
  35568. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsParameter.js
  35569. function SummaryAttributesJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35570. 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); } }
  35571. function SummaryAttributesJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  35572. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35573. * This program are made available under the terms of the Apache License, Version 2.0
  35574. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35575. /**
  35576. * @class SuperMap.SummaryAttributesJobsParameter
  35577. * @category iServer ProcessingService SummaryAttributes
  35578. * @classdesc 属性汇总分析任务参数类
  35579. * @param {Object} options - 参数。
  35580. * @param {string} options.datasetName - 数据集名。
  35581. * @param {string} options.groupField - 分组字段。
  35582. * @param {string} options.attributeField - 属性字段。
  35583. * @param {string} options.statisticModes - 统计模式。
  35584. * @param {SuperMap.OutputSetting} [options.output] -输出参数设置。
  35585. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  35586. */
  35587. var SummaryAttributesJobsParameter = /*#__PURE__*/function () {
  35588. function SummaryAttributesJobsParameter(options) {
  35589. SummaryAttributesJobsParameter_classCallCheck(this, SummaryAttributesJobsParameter);
  35590. if (!options) {
  35591. return;
  35592. }
  35593. /**
  35594. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.datasetName
  35595. * @description 汇总数据集名称。
  35596. */
  35597. this.datasetName = "";
  35598. /**
  35599. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.groupField
  35600. * @description 分组字段。
  35601. */
  35602. this.groupField = "";
  35603. /**
  35604. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.attributeField
  35605. * @description 属性字段。
  35606. */
  35607. this.attributeField = "";
  35608. /**
  35609. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.statisticModes
  35610. * @description 属性汇总统计模式。
  35611. */
  35612. this.statisticModes = "";
  35613. /**
  35614. * @member {SuperMap.OutputSetting} SuperMap.SummaryAttributesJobsParameter.prototype.output
  35615. * @description 输出参数设置类。
  35616. */
  35617. this.output = null;
  35618. /**
  35619. * @member {SuperMap.MappingParameters} [SuperMap.SummaryAttributesJobsParameter.prototype.mappingParameters]
  35620. * @description 分析后结果可视化的参数类。
  35621. */
  35622. this.mappingParameters = null;
  35623. Util.extend(this, options);
  35624. this.CLASS_NAME = "SuperMap.SummaryAttributesJobsParameter";
  35625. }
  35626. /**
  35627. * @function SuperMap.SummaryAttributesJobsParameter.destroy
  35628. * @override
  35629. */
  35630. SummaryAttributesJobsParameter_createClass(SummaryAttributesJobsParameter, [{
  35631. key: "destroy",
  35632. value: function destroy() {
  35633. this.datasetName = null;
  35634. this.groupField = null;
  35635. this.attributeField = null;
  35636. this.statisticModes = null;
  35637. if (this.output instanceof OutputSetting) {
  35638. this.output.destroy();
  35639. this.output = null;
  35640. }
  35641. if (this.mappingParameters instanceof MappingParameters) {
  35642. this.mappingParameters.destroy();
  35643. this.mappingParameters = null;
  35644. }
  35645. }
  35646. /**
  35647. * @function SuperMap.SummaryAttributesJobsParameter.toObject
  35648. * @param {Object} SummaryAttributesJobsParameter - 属性汇总任务参数。
  35649. * @param {Object} tempObj - 目标对象。
  35650. * @description 生成属性汇总分析任务对象。
  35651. */
  35652. }], [{
  35653. key: "toObject",
  35654. value: function toObject(SummaryAttributesJobsParameter, tempObj) {
  35655. for (var name in SummaryAttributesJobsParameter) {
  35656. if (name === "datasetName") {
  35657. tempObj['input'] = tempObj['input'] || {};
  35658. tempObj['input'][name] = SummaryAttributesJobsParameter[name];
  35659. continue;
  35660. }
  35661. if (name === "output") {
  35662. tempObj['output'] = tempObj['output'] || {};
  35663. tempObj['output'] = SummaryAttributesJobsParameter[name];
  35664. continue;
  35665. }
  35666. tempObj['analyst'] = tempObj['analyst'] || {};
  35667. tempObj['analyst'][name] = SummaryAttributesJobsParameter[name];
  35668. if (name === 'mappingParameters') {
  35669. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  35670. tempObj['analyst']['mappingParameters'] = SummaryAttributesJobsParameter[name];
  35671. }
  35672. }
  35673. }
  35674. }]);
  35675. return SummaryAttributesJobsParameter;
  35676. }();
  35677. SuperMap.SummaryAttributesJobsParameter = SummaryAttributesJobsParameter;
  35678. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsService.js
  35679. function SummaryAttributesJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SummaryAttributesJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SummaryAttributesJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SummaryAttributesJobsService_typeof(obj); }
  35680. function SummaryAttributesJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35681. 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); } }
  35682. function SummaryAttributesJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  35683. function SummaryAttributesJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryAttributesJobsService_get = Reflect.get; } else { SummaryAttributesJobsService_get = function _get(target, property, receiver) { var base = SummaryAttributesJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SummaryAttributesJobsService_get(target, property, receiver || target); }
  35684. function SummaryAttributesJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryAttributesJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  35685. function SummaryAttributesJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SummaryAttributesJobsService_setPrototypeOf(subClass, superClass); }
  35686. function SummaryAttributesJobsService_setPrototypeOf(o, p) { SummaryAttributesJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryAttributesJobsService_setPrototypeOf(o, p); }
  35687. 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); }; }
  35688. function SummaryAttributesJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryAttributesJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryAttributesJobsService_assertThisInitialized(self); }
  35689. function SummaryAttributesJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35690. function SummaryAttributesJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  35691. function SummaryAttributesJobsService_getPrototypeOf(o) { SummaryAttributesJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryAttributesJobsService_getPrototypeOf(o); }
  35692. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35693. * This program are made available under the terms of the Apache License, Version 2.0
  35694. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35695. /**
  35696. * @class SuperMap.SummaryAttributesJobsService
  35697. * @category iServer ProcessingService SummaryAttributes
  35698. * @classdesc 属性汇总分析服务类
  35699. * @extends {SuperMap.ProcessingServiceBase}
  35700. * @param {string} url - 汇总统计分析服务地址。
  35701. * @param {Object} options - 参数。
  35702. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35703. * @param {Object} [options.headers] - 请求头。
  35704. */
  35705. var SummaryAttributesJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  35706. SummaryAttributesJobsService_inherits(SummaryAttributesJobsService, _ProcessingServiceBas);
  35707. var _super = SummaryAttributesJobsService_createSuper(SummaryAttributesJobsService);
  35708. function SummaryAttributesJobsService(url, options) {
  35709. var _this;
  35710. SummaryAttributesJobsService_classCallCheck(this, SummaryAttributesJobsService);
  35711. _this = _super.call(this, url, options);
  35712. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/summaryattributes');
  35713. _this.CLASS_NAME = "SuperMap.SummaryAttributesJobsService";
  35714. return _this;
  35715. }
  35716. /**
  35717. *@override
  35718. */
  35719. SummaryAttributesJobsService_createClass(SummaryAttributesJobsService, [{
  35720. key: "destroy",
  35721. value: function destroy() {
  35722. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "destroy", this).call(this);
  35723. }
  35724. /**
  35725. * @function SuperMap.SummaryAttributesJobsService.protitype.getSummaryAttributesJobs
  35726. * @description 获取属性汇总分析所有任务
  35727. */
  35728. }, {
  35729. key: "getSummaryAttributesJobs",
  35730. value: function getSummaryAttributesJobs() {
  35731. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, this.url);
  35732. }
  35733. /**
  35734. * @function SuperMap.SummaryAttributesJobsService.protitype.getSummaryAttributesJob
  35735. * @description 获取指定id的属性汇总分析服务
  35736. * @param {string} id - 指定要获取数据的id
  35737. */
  35738. }, {
  35739. key: "getSummaryAttributesJob",
  35740. value: function getSummaryAttributesJob(id) {
  35741. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  35742. }
  35743. /**
  35744. * @function SuperMap.SummaryAttributesJobsService.protitype.addSummaryAttributesJob
  35745. * @description 新建属性汇总分析服务
  35746. * @param {SuperMap.SummaryAttributesJobsParameter} params - 创建一个空间分析的请求参数。
  35747. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  35748. */
  35749. }, {
  35750. key: "addSummaryAttributesJob",
  35751. value: function addSummaryAttributesJob(params, seconds) {
  35752. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryAttributesJobsParameter, seconds);
  35753. }
  35754. }]);
  35755. return SummaryAttributesJobsService;
  35756. }(ProcessingServiceBase);
  35757. SuperMap.SummaryAttributesJobsService = SummaryAttributesJobsService;
  35758. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobParameter.js
  35759. function SummaryMeshJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35760. 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); } }
  35761. function SummaryMeshJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  35762. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35763. * This program are made available under the terms of the Apache License, Version 2.0
  35764. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35765. /**
  35766. * @class SuperMap.SummaryMeshJobParameter
  35767. * @category iServer ProcessingService AggregatePoints
  35768. * @classdesc 点聚合分析任务参数类。
  35769. * @param {Object} options - 参数。
  35770. * @param {string} options.datasetName - 数据集名。
  35771. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  35772. * @param {number} options.fields - 权重索引。
  35773. * @param {number} [options.resolution=100] - 分辨率。
  35774. * @param {SuperMap.StatisticAnalystMode} [options.statisticModes=SuperMap.StatisticAnalystMode.AVERAGE] - 分析模式。
  35775. * @param {number} [options.meshType=0] - 分析类型。
  35776. * @param {SuperMap.SummaryType} [options.type=SuperMap.SummaryType.SUMMARYMESH] - 聚合类型。
  35777. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  35778. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  35779. */
  35780. var SummaryMeshJobParameter = /*#__PURE__*/function () {
  35781. function SummaryMeshJobParameter(options) {
  35782. SummaryMeshJobParameter_classCallCheck(this, SummaryMeshJobParameter);
  35783. if (!options) {
  35784. return;
  35785. }
  35786. /**
  35787. * @member {string} SuperMap.SummaryMeshJobParameter.prototype.datasetName
  35788. * @description 数据集名。
  35789. */
  35790. this.datasetName = "";
  35791. /**
  35792. * @member {string} SuperMap.SummaryMeshJobParameter.prototype.regionDataset
  35793. * @description 聚合面数据集(聚合类型为多边形聚合时使用的参数)。
  35794. */
  35795. this.regionDataset = "";
  35796. /**
  35797. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.SummaryMeshJobParameter.prototype.query
  35798. * @description 分析范围(聚合类型为网格面聚合时使用的参数)。
  35799. */
  35800. this.query = "";
  35801. /**
  35802. * @member {number} [SuperMap.SummaryMeshJobParameter.prototype.resolution=100]
  35803. * @description 分辨率(聚合类型为网格面聚合时使用的参数)。
  35804. */
  35805. this.resolution = 100;
  35806. /**
  35807. * @member {number} [SuperMap.SummaryMeshJobParameter.prototype.meshType=0]
  35808. * @description 网格面类型(聚合类型为网格面聚合时使用的参数),取值:0 或 1。
  35809. */
  35810. this.meshType = 0;
  35811. /**
  35812. * @member {SuperMap.StatisticAnalystMode} [SuperMap.SummaryMeshJobParameter.prototype.statisticModes=SuperMap.StatisticAnalystMode.AVERAGE]
  35813. * @description 统计模式。
  35814. */
  35815. this.statisticModes = StatisticAnalystMode.AVERAGE;
  35816. /**
  35817. * @member {number} SuperMap.SummaryMeshJobParameter.prototype.fields
  35818. * @description 权重字段。
  35819. */
  35820. this.fields = "";
  35821. /**
  35822. * @member {SuperMap.SummaryType} [SuperMap.SummaryMeshJobParameter.prototype.type=SuperMap.SummaryType.SUMMARYMESH]
  35823. * @description 聚合类型。
  35824. */
  35825. this.type = SummaryType.SUMMARYMESH;
  35826. /**
  35827. * @member {SuperMap.OutputSetting} [SuperMap.SummaryMeshJobParameter.prototype.output]
  35828. * @description 输出参数设置类。
  35829. */
  35830. this.output = null;
  35831. /**
  35832. * @member {SuperMap.MappingParameters} [SuperMap.SummaryMeshJobParameter.prototype.mappingParameters]
  35833. * @description 分析后结果可视化的参数类。
  35834. */
  35835. this.mappingParameters = null;
  35836. Util.extend(this, options);
  35837. this.CLASS_NAME = "SuperMap.SummaryMeshJobParameter";
  35838. }
  35839. /**
  35840. * @function SuperMap.SummaryMeshJobParameter.destroy
  35841. * @override
  35842. */
  35843. SummaryMeshJobParameter_createClass(SummaryMeshJobParameter, [{
  35844. key: "destroy",
  35845. value: function destroy() {
  35846. this.datasetName = null;
  35847. this.query = null;
  35848. this.resolution = null;
  35849. this.statisticModes = null;
  35850. this.meshType = null;
  35851. this.fields = null;
  35852. this.regionDataset = null;
  35853. this.type = null;
  35854. if (this.output instanceof OutputSetting) {
  35855. this.output.destroy();
  35856. this.output = null;
  35857. }
  35858. if (this.mappingParameters instanceof MappingParameters) {
  35859. this.mappingParameters.destroy();
  35860. this.mappingParameters = null;
  35861. }
  35862. }
  35863. /**
  35864. * @function SuperMap.SummaryMeshJobParameter.toObject
  35865. * @param {Object} summaryMeshJobParameter - 点聚合分析任务参数。
  35866. * @param {Object} tempObj - 目标对象。
  35867. * @description 生成点聚合分析任务对象。
  35868. */
  35869. }], [{
  35870. key: "toObject",
  35871. value: function toObject(summaryMeshJobParameter, tempObj) {
  35872. for (var name in summaryMeshJobParameter) {
  35873. if (name === "datasetName") {
  35874. tempObj['input'] = tempObj['input'] || {};
  35875. tempObj['input'][name] = summaryMeshJobParameter[name];
  35876. continue;
  35877. }
  35878. if (name === "type") {
  35879. tempObj['type'] = summaryMeshJobParameter[name];
  35880. continue;
  35881. }
  35882. if (name === "output") {
  35883. tempObj['output'] = tempObj['output'] || {};
  35884. tempObj['output'] = summaryMeshJobParameter[name];
  35885. continue;
  35886. }
  35887. if (summaryMeshJobParameter.type === 'SUMMARYMESH' && name !== 'regionDataset' || summaryMeshJobParameter.type === 'SUMMARYREGION' && !contains(['meshType', 'resolution', 'query'], name)) {
  35888. tempObj['analyst'] = tempObj['analyst'] || {};
  35889. if (name === 'query' && summaryMeshJobParameter[name]) {
  35890. tempObj['analyst'][name] = summaryMeshJobParameter[name].toBBOX();
  35891. } else {
  35892. tempObj['analyst'][name] = summaryMeshJobParameter[name];
  35893. }
  35894. if (name === 'mappingParameters') {
  35895. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  35896. tempObj['analyst']['mappingParameters'] = summaryMeshJobParameter[name];
  35897. }
  35898. }
  35899. }
  35900. function contains(arr, obj) {
  35901. var i = arr.length;
  35902. while (i--) {
  35903. if (arr[i] === obj) {
  35904. return true;
  35905. }
  35906. }
  35907. return false;
  35908. }
  35909. }
  35910. }]);
  35911. return SummaryMeshJobParameter;
  35912. }();
  35913. SuperMap.SummaryMeshJobParameter = SummaryMeshJobParameter;
  35914. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobsService.js
  35915. function SummaryMeshJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SummaryMeshJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SummaryMeshJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SummaryMeshJobsService_typeof(obj); }
  35916. function SummaryMeshJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35917. 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); } }
  35918. function SummaryMeshJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  35919. function SummaryMeshJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryMeshJobsService_get = Reflect.get; } else { SummaryMeshJobsService_get = function _get(target, property, receiver) { var base = SummaryMeshJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SummaryMeshJobsService_get(target, property, receiver || target); }
  35920. function SummaryMeshJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryMeshJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  35921. function SummaryMeshJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SummaryMeshJobsService_setPrototypeOf(subClass, superClass); }
  35922. function SummaryMeshJobsService_setPrototypeOf(o, p) { SummaryMeshJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryMeshJobsService_setPrototypeOf(o, p); }
  35923. 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); }; }
  35924. function SummaryMeshJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryMeshJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryMeshJobsService_assertThisInitialized(self); }
  35925. function SummaryMeshJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35926. function SummaryMeshJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  35927. function SummaryMeshJobsService_getPrototypeOf(o) { SummaryMeshJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryMeshJobsService_getPrototypeOf(o); }
  35928. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35929. * This program are made available under the terms of the Apache License, Version 2.0
  35930. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35931. /**
  35932. * @class SuperMap.SummaryMeshJobsService
  35933. * @category iServer ProcessingService AggregatePoints
  35934. * @classdesc 点聚合分析任务类。
  35935. * @param {string} url -点聚合分析任务地址。
  35936. * @param {Object} options - 参数。
  35937. * @param {SuperMap.Events} options.events - 处理所有事件的对象。<br>
  35938. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  35939. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  35940. * @param {number} options.index - 服务访问地址在数组中的位置。<br>
  35941. * @param {number} options.length - 服务访问地址数组长度。
  35942. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35943. * @param {Object} [options.headers] - 请求头。
  35944. */
  35945. var SummaryMeshJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  35946. SummaryMeshJobsService_inherits(SummaryMeshJobsService, _ProcessingServiceBas);
  35947. var _super = SummaryMeshJobsService_createSuper(SummaryMeshJobsService);
  35948. function SummaryMeshJobsService(url, options) {
  35949. var _this;
  35950. SummaryMeshJobsService_classCallCheck(this, SummaryMeshJobsService);
  35951. _this = _super.call(this, url, options);
  35952. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/aggregatepoints');
  35953. _this.CLASS_NAME = 'SuperMap.SummaryMeshJobsService';
  35954. return _this;
  35955. }
  35956. /**
  35957. * @override
  35958. */
  35959. SummaryMeshJobsService_createClass(SummaryMeshJobsService, [{
  35960. key: "destroy",
  35961. value: function destroy() {
  35962. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "destroy", this).call(this);
  35963. }
  35964. /**
  35965. * @function SuperMap.SummaryMeshJobsService.prototype.getSummaryMeshJobs
  35966. * @description 获取点聚合分析任务
  35967. */
  35968. }, {
  35969. key: "getSummaryMeshJobs",
  35970. value: function getSummaryMeshJobs() {
  35971. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, this.url);
  35972. }
  35973. /**
  35974. * @function SuperMap.SummaryMeshJobsService.prototype.getSummaryMeshJob
  35975. * @description 获取指定ip的点聚合分析任务
  35976. * @param {string} id - 指定要获取数据的id
  35977. */
  35978. }, {
  35979. key: "getSummaryMeshJob",
  35980. value: function getSummaryMeshJob(id) {
  35981. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  35982. }
  35983. /**
  35984. * @function SuperMap.SummaryMeshJobsService.prototype.addSummaryMeshJob
  35985. * @description 新建点聚合分析服务
  35986. * @param {SuperMap.SummaryMeshJobParameter} params - 创建一个空间分析的请求参数。
  35987. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  35988. */
  35989. }, {
  35990. key: "addSummaryMeshJob",
  35991. value: function addSummaryMeshJob(params, seconds) {
  35992. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryMeshJobParameter, seconds);
  35993. }
  35994. }]);
  35995. return SummaryMeshJobsService;
  35996. }(ProcessingServiceBase);
  35997. SuperMap.SummaryMeshJobsService = SummaryMeshJobsService;
  35998. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobParameter.js
  35999. function SummaryRegionJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36000. 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); } }
  36001. function SummaryRegionJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  36002. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36003. * This program are made available under the terms of the Apache License, Version 2.0
  36004. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36005. /**
  36006. * @class SuperMap.SummaryRegionJobParameter
  36007. * @category iServer ProcessingService SummaryRegion
  36008. * @classdesc 区域汇总分析任务参数类。
  36009. * @param {Object} options - 参数。
  36010. * @param {string} options.datasetName - 数据集名。
  36011. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  36012. * @param {string} [options.standardFields] - 标准属性字段名称。
  36013. * @param {string} [options.weightedFields] - 权重字段名称。
  36014. * @param {SuperMap.StatisticAnalystMode} [options.standardStatisticModes] - 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  36015. * @param {SuperMap.StatisticAnalystMode} [options.weightedStatisticModes] - 权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  36016. * @param {boolean} [options.sumShape=true] - 是否统计长度或面积。
  36017. * @param {boolean} [options.standardSummaryFields=false] - 是否以标准属字段统计。
  36018. * @param {boolean} [options.weightedSummaryFields=false] - 是否以权重字段统计。
  36019. * @param {number} [options.resolution=100] - 网格大小。
  36020. * @param {number} [options.meshType=0] - 网格面汇总类型。
  36021. * @param {SuperMap.AnalystSizeUnit} [options.meshSizeUnit=SuperMap.AnalystSizeUnit.METER] - 网格大小单位。
  36022. * @param {SuperMap.SummaryType} [options.type=SuperMap.SummaryType.SUMMARYMESH] - 汇总类型。
  36023. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  36024. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  36025. */
  36026. var SummaryRegionJobParameter = /*#__PURE__*/function () {
  36027. function SummaryRegionJobParameter(options) {
  36028. SummaryRegionJobParameter_classCallCheck(this, SummaryRegionJobParameter);
  36029. if (!options) {
  36030. return;
  36031. }
  36032. /**
  36033. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.datasetName
  36034. * @description 数据集名。
  36035. */
  36036. this.datasetName = "";
  36037. /**
  36038. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.regionDataset
  36039. * @description 汇总数据源(多边形汇总时用到的参数)。
  36040. */
  36041. this.regionDataset = "";
  36042. /**
  36043. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.sumShape=true]
  36044. * @description 是否统计长度或面积。
  36045. */
  36046. this.sumShape = true;
  36047. /**
  36048. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.SummaryRegionJobParameter.prototype.query
  36049. * @description 分析范围。
  36050. */
  36051. this.query = "";
  36052. /**
  36053. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.standardSummaryFields=false]
  36054. * @description 是否以标准属字段统计。
  36055. */
  36056. this.standardSummaryFields = false;
  36057. /**
  36058. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.standardFields
  36059. * @description 标准属性字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。standardSummaryFields 为 true 时必填。
  36060. */
  36061. this.standardFields = "";
  36062. /**
  36063. * @member {SuperMap.StatisticAnalystMode} SuperMap.SummaryRegionJobParameter.prototype.standardStatisticModes
  36064. * @description 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  36065. */
  36066. this.standardStatisticModes = "";
  36067. /**
  36068. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.weightedSummaryFields=false]
  36069. * @description 是否以权重字段统计。
  36070. */
  36071. this.weightedSummaryFields = false;
  36072. /**
  36073. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.weightedFields
  36074. * @description 权重字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。weightedSummaryFields 为 true 时必填。
  36075. */
  36076. this.weightedFields = "";
  36077. /**
  36078. * @member {SuperMap.StatisticAnalystMode} SuperMap.SummaryRegionJobParameter.prototype.weightedStatisticModes
  36079. * @description 以权重字段统计的统计模式。权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  36080. */
  36081. this.weightedStatisticModes = "";
  36082. /**
  36083. * @member {number} [SuperMap.SummaryRegionJobParameter.prototype.meshType=0]
  36084. * @description 网格面汇总类型。
  36085. */
  36086. this.meshType = 0;
  36087. /**
  36088. * @member {number} [SuperMap.SummaryRegionJobParameter.prototype.resolution=100]
  36089. * @description 网格大小。
  36090. */
  36091. this.resolution = 100;
  36092. /**
  36093. * @member {SuperMap.AnalystSizeUnit} [SuperMap.SummaryRegionJobParameter.prototype.meshSizeUnit=SuperMap.AnalystSizeUnit.METER]
  36094. * @description 网格大小单位。
  36095. */
  36096. this.meshSizeUnit = AnalystSizeUnit.METER;
  36097. /**
  36098. * @member {SuperMap.SummaryType} [SuperMap.SummaryRegionJobParameter.prototype.type=SuperMap.SummaryType.SUMMARYMESH]
  36099. * @description 汇总类型。
  36100. */
  36101. this.type = SummaryType.SUMMARYMESH;
  36102. /**
  36103. * @member {SuperMap.OutputSetting} SuperMap.SummaryRegionJobParameter.prototype.output
  36104. * @description 输出参数设置类
  36105. */
  36106. this.output = null;
  36107. /**
  36108. * @member {SuperMap.MappingParameters} [SuperMap.SummaryRegionJobParameter.prototype.mappingParameters]
  36109. * @description 分析后结果可视化的参数类。
  36110. */
  36111. this.mappingParameters = null;
  36112. Util.extend(this, options);
  36113. this.CLASS_NAME = "SuperMap.SummaryRegionJobParameter";
  36114. }
  36115. /**
  36116. * @function SuperMap.SummaryRegionJobParameter.prototype.destroy
  36117. * @description 释放资源,将引用资源的属性置空。
  36118. */
  36119. SummaryRegionJobParameter_createClass(SummaryRegionJobParameter, [{
  36120. key: "destroy",
  36121. value: function destroy() {
  36122. this.datasetName = null;
  36123. this.sumShape = null;
  36124. this.regionDataset = null;
  36125. this.query = null;
  36126. this.standardSummaryFields = null;
  36127. this.standardFields = null;
  36128. this.standardStatisticModes = null;
  36129. this.weightedSummaryFields = null;
  36130. this.weightedFields = null;
  36131. this.weightedStatisticModes = null;
  36132. this.meshType = null;
  36133. this.resolution = null;
  36134. this.meshSizeUnit = null;
  36135. this.type = null;
  36136. if (this.output instanceof OutputSetting) {
  36137. this.output.destroy();
  36138. this.output = null;
  36139. }
  36140. if (this.mappingParameters instanceof MappingParameters) {
  36141. this.mappingParameters.destroy();
  36142. this.mappingParameters = null;
  36143. }
  36144. }
  36145. /**
  36146. * @function SuperMap.SummaryRegionJobParameter.toObject
  36147. * @param {Object} summaryRegionJobParameter - 矢量裁剪分析任务参数。
  36148. * @param {Object} tempObj - 目标对象。
  36149. * @description 生成区域汇总分析服务对象。
  36150. */
  36151. }], [{
  36152. key: "toObject",
  36153. value: function toObject(summaryRegionJobParameter, tempObj) {
  36154. for (var name in summaryRegionJobParameter) {
  36155. if (name === "datasetName") {
  36156. tempObj['input'] = tempObj['input'] || {};
  36157. tempObj['input'][name] = summaryRegionJobParameter[name];
  36158. continue;
  36159. }
  36160. if (name === "type") {
  36161. tempObj['type'] = summaryRegionJobParameter[name];
  36162. continue;
  36163. }
  36164. if (name === "type") {
  36165. tempObj['type'] = summaryRegionJobParameter[name];
  36166. continue;
  36167. }
  36168. if (name === "output") {
  36169. tempObj['output'] = tempObj['output'] || {};
  36170. tempObj['output'] = summaryRegionJobParameter[name];
  36171. continue;
  36172. }
  36173. if (summaryRegionJobParameter.type === "SUMMARYREGION" || summaryRegionJobParameter.type === "SUMMARYMESH" && name !== "regionDataset") {
  36174. tempObj['analyst'] = tempObj['analyst'] || {};
  36175. if (name === 'query' && summaryRegionJobParameter[name]) {
  36176. tempObj['analyst'][name] = summaryRegionJobParameter[name].toBBOX();
  36177. } else {
  36178. tempObj['analyst'][name] = summaryRegionJobParameter[name];
  36179. }
  36180. if (name === 'mappingParameters') {
  36181. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  36182. tempObj['analyst']['mappingParameters'] = summaryRegionJobParameter[name];
  36183. }
  36184. }
  36185. }
  36186. }
  36187. }]);
  36188. return SummaryRegionJobParameter;
  36189. }();
  36190. SuperMap.SummaryRegionJobParameter = SummaryRegionJobParameter;
  36191. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobsService.js
  36192. function SummaryRegionJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SummaryRegionJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SummaryRegionJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SummaryRegionJobsService_typeof(obj); }
  36193. function SummaryRegionJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36194. 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); } }
  36195. function SummaryRegionJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  36196. function SummaryRegionJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryRegionJobsService_get = Reflect.get; } else { SummaryRegionJobsService_get = function _get(target, property, receiver) { var base = SummaryRegionJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SummaryRegionJobsService_get(target, property, receiver || target); }
  36197. function SummaryRegionJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryRegionJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  36198. function SummaryRegionJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SummaryRegionJobsService_setPrototypeOf(subClass, superClass); }
  36199. function SummaryRegionJobsService_setPrototypeOf(o, p) { SummaryRegionJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryRegionJobsService_setPrototypeOf(o, p); }
  36200. 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); }; }
  36201. function SummaryRegionJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryRegionJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryRegionJobsService_assertThisInitialized(self); }
  36202. function SummaryRegionJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36203. function SummaryRegionJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  36204. function SummaryRegionJobsService_getPrototypeOf(o) { SummaryRegionJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryRegionJobsService_getPrototypeOf(o); }
  36205. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36206. * This program are made available under the terms of the Apache License, Version 2.0
  36207. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36208. /**
  36209. * @class SuperMap.SummaryRegionJobsService
  36210. * @category iServer ProcessingService SummaryRegion
  36211. * @classdesc 区域汇总分析服务类
  36212. * @extends {SuperMap.ProcessingServiceBase}
  36213. * @param {string} url - 区域汇总分析服务地址。
  36214. * @param {Object} options - 参数。
  36215. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36216. * @param {Object} [options.headers] - 请求头。
  36217. */
  36218. var SummaryRegionJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  36219. SummaryRegionJobsService_inherits(SummaryRegionJobsService, _ProcessingServiceBas);
  36220. var _super = SummaryRegionJobsService_createSuper(SummaryRegionJobsService);
  36221. function SummaryRegionJobsService(url, options) {
  36222. var _this;
  36223. SummaryRegionJobsService_classCallCheck(this, SummaryRegionJobsService);
  36224. _this = _super.call(this, url, options);
  36225. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/summaryregion');
  36226. _this.CLASS_NAME = 'SuperMap.SummaryRegionJobsService';
  36227. return _this;
  36228. }
  36229. /**
  36230. *@override
  36231. */
  36232. SummaryRegionJobsService_createClass(SummaryRegionJobsService, [{
  36233. key: "destroy",
  36234. value: function destroy() {
  36235. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "destroy", this).call(this);
  36236. }
  36237. /**
  36238. * @function SuperMap.SummaryRegionJobsService.prototype.getSummaryRegionJobs
  36239. * @description 获取区域汇总分析任务集合。
  36240. */
  36241. }, {
  36242. key: "getSummaryRegionJobs",
  36243. value: function getSummaryRegionJobs() {
  36244. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, this.url);
  36245. }
  36246. /**
  36247. * @function SuperMap.SummaryRegionJobsService.prototype.getSummaryRegionJob
  36248. * @description 获取指定id的区域汇总分析任务。
  36249. * @param {string} id -要获取区域汇总分析任务的id
  36250. */
  36251. }, {
  36252. key: "getSummaryRegionJob",
  36253. value: function getSummaryRegionJob(id) {
  36254. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  36255. }
  36256. /**
  36257. * @function SuperMap.SummaryRegionJobsService.prototype.addSummaryRegionJob
  36258. * @description 新建区域汇总任务。
  36259. * @param {SuperMap.SummaryRegionJobParameter} params - 创建一个区域汇总任务的请求参数。
  36260. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  36261. */
  36262. }, {
  36263. key: "addSummaryRegionJob",
  36264. value: function addSummaryRegionJob(params, seconds) {
  36265. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryRegionJobParameter, seconds);
  36266. }
  36267. }]);
  36268. return SummaryRegionJobsService;
  36269. }(ProcessingServiceBase);
  36270. SuperMap.SummaryRegionJobsService = SummaryRegionJobsService;
  36271. ;// CONCATENATED MODULE: ./src/common/iServer/SupplyCenter.js
  36272. function SupplyCenter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36273. 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); } }
  36274. function SupplyCenter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SupplyCenter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SupplyCenter_defineProperties(Constructor, staticProps); return Constructor; }
  36275. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36276. * This program are made available under the terms of the Apache License, Version 2.0
  36277. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36278. /**
  36279. * @class SuperMap.SupplyCenter
  36280. * @category iServer NetworkAnalyst Location
  36281. * @classdesc 资源供给中心类。在资源分配和选址分区分析两个功能中使用。
  36282. * @param {Object} options - 参数。
  36283. * @param {number} options.maxWeight - 资源供给中心的最大耗费值。
  36284. * @param {number} options.nodeID - 资源供给中心点的结点 ID 号。资源供给中心必须是结点。
  36285. * @param {number} options.resourceValue - 资源供给中心能提供的最大服务量或商品数量。
  36286. * @param {SuperMap.SupplyCenterType} [options.type] - 资源供给中心点的类型常量。
  36287. */
  36288. var SupplyCenter = /*#__PURE__*/function () {
  36289. function SupplyCenter(options) {
  36290. SupplyCenter_classCallCheck(this, SupplyCenter);
  36291. /**
  36292. * @member {number} SuperMap.SupplyCenter.prototype.maxWeight
  36293. * @description 资源供给中心的最大耗费值。中心点最大阻值设置越小,表示中心点所提供的资源可影响范围越大。
  36294. * 最大阻力值是用来限制需求点到中心点的花费。
  36295. * 如果需求点(弧段或结点)到此中心的花费大于最大阻力值,则该需求点不属于该资源供给中心提供资源的范围。
  36296. */
  36297. this.maxWeight = null;
  36298. /**
  36299. * @member {number} SuperMap.SupplyCenter.prototype.nodeID
  36300. * @description 资源供给中心点的结点 ID 号,资源供给中心必须是结点。
  36301. */
  36302. this.nodeID = null;
  36303. /**
  36304. * @member {number} SuperMap.SupplyCenter.prototype.resourceValue
  36305. * @description 资源供给中心能提供的最大服务量或商品数量。例如资源中心为学校,资源中心资源量表示该学校能够接纳多少学生。
  36306. */
  36307. this.resourceValue = null;
  36308. /**
  36309. * @member {SuperMap.SupplyCenterType} [SuperMap.SupplyCenter.prototype.type]
  36310. * @description 资源供给中心点的类型常量。资源供给中心点的类型包括非中心,固定中心和可选中心。
  36311. * 固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  36312. */
  36313. this.type = null;
  36314. if (options) {
  36315. Util.extend(this, options);
  36316. }
  36317. this.CLASS_NAME = "SuperMap.SupplyCenter";
  36318. }
  36319. /**
  36320. * @function SuperMap.SupplyCenter.prototype.destroy
  36321. * @description 释放资源,将引用资源的属性置空。
  36322. */
  36323. SupplyCenter_createClass(SupplyCenter, [{
  36324. key: "destroy",
  36325. value: function destroy() {
  36326. var me = this;
  36327. me.maxWeight = null;
  36328. me.nodeID = null;
  36329. me.resourceValue = null;
  36330. me.type = null;
  36331. }
  36332. /**
  36333. * @function SuperMap.SupplyCenter.fromJson
  36334. * @description 将服务端 JSON 对象转换成当前客户端对象。
  36335. * @param {Object} jsonObject - 要转换的 JSON 对象。
  36336. * @returns {SuperMap.SupplyCenter} SupplyCenter 对象。
  36337. */
  36338. }], [{
  36339. key: "fromJson",
  36340. value: function fromJson(jsonObject) {
  36341. if (!jsonObject) {
  36342. return;
  36343. }
  36344. return new SupplyCenter({
  36345. maxWeight: jsonObject.maxWeight,
  36346. nodeID: jsonObject.nodeID,
  36347. resourceValue: jsonObject.resourceValue,
  36348. type: jsonObject.type
  36349. });
  36350. }
  36351. }]);
  36352. return SupplyCenter;
  36353. }();
  36354. SuperMap.SupplyCenter = SupplyCenter;
  36355. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystService.js
  36356. function SurfaceAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SurfaceAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { SurfaceAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SurfaceAnalystService_typeof(obj); }
  36357. function SurfaceAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36358. 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); } }
  36359. function SurfaceAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  36360. function SurfaceAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SurfaceAnalystService_get = Reflect.get; } else { SurfaceAnalystService_get = function _get(target, property, receiver) { var base = SurfaceAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SurfaceAnalystService_get(target, property, receiver || target); }
  36361. function SurfaceAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SurfaceAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  36362. function SurfaceAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SurfaceAnalystService_setPrototypeOf(subClass, superClass); }
  36363. function SurfaceAnalystService_setPrototypeOf(o, p) { SurfaceAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SurfaceAnalystService_setPrototypeOf(o, p); }
  36364. 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); }; }
  36365. function SurfaceAnalystService_possibleConstructorReturn(self, call) { if (call && (SurfaceAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return SurfaceAnalystService_assertThisInitialized(self); }
  36366. function SurfaceAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36367. function SurfaceAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  36368. function SurfaceAnalystService_getPrototypeOf(o) { SurfaceAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SurfaceAnalystService_getPrototypeOf(o); }
  36369. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36370. * This program are made available under the terms of the Apache License, Version 2.0
  36371. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36372. /**
  36373. * @class SuperMap.SurfaceAnalystService
  36374. * @category iServer SpatialAnalyst SurfaceAnalyst
  36375. * @classdesc 表面分析服务类。
  36376. * 该类负责将客户设置的表面分析服务参数传递给服务端,并接收服务端返回的表面分析服务分析结果数据。
  36377. * 表面分析结果通过该类支持的事件的监听函数参数获取
  36378. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  36379. * @param {Object} options - 参数。</br>
  36380. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36381. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36382. * @param {Object} [options.headers] - 请求头。
  36383. * @extends {SuperMap.SpatialAnalystBase}
  36384. * @example 例如:
  36385. * (start code)
  36386. * var mySurfaceAnalystService = new SuperMap.SurfaceAnalystService(url, {
  36387. * eventListeners: {
  36388. * "processCompleted": surfaceAnalysCompleted,
  36389. * "processFailed": surfaceAnalysFailed
  36390. * }
  36391. * });
  36392. * (end)
  36393. *
  36394. */
  36395. var SurfaceAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  36396. SurfaceAnalystService_inherits(SurfaceAnalystService, _SpatialAnalystBase);
  36397. var _super = SurfaceAnalystService_createSuper(SurfaceAnalystService);
  36398. function SurfaceAnalystService(url, options) {
  36399. var _this;
  36400. SurfaceAnalystService_classCallCheck(this, SurfaceAnalystService);
  36401. _this = _super.call(this, url, options);
  36402. _this.CLASS_NAME = "SuperMap.SurfaceAnalystService";
  36403. return _this;
  36404. }
  36405. /**
  36406. * @function SuperMap.SurfaceAnalystService.prototype.destroy
  36407. * @description 释放资源,将引用的资源属性置空。
  36408. */
  36409. SurfaceAnalystService_createClass(SurfaceAnalystService, [{
  36410. key: "destroy",
  36411. value: function destroy() {
  36412. SurfaceAnalystService_get(SurfaceAnalystService_getPrototypeOf(SurfaceAnalystService.prototype), "destroy", this).call(this);
  36413. }
  36414. /**
  36415. * @function SuperMap.SurfaceAnalystService.prototype.processAsync
  36416. * @description 负责将客户端的表面分析服务参数传递到服务端。
  36417. * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  36418. */
  36419. }, {
  36420. key: "processAsync",
  36421. value: function processAsync(params) {
  36422. if (!(params instanceof SurfaceAnalystParameters)) {
  36423. return;
  36424. }
  36425. var me = this,
  36426. jsonParameters;
  36427. jsonParameters = me.getJsonParameters(params);
  36428. me.request({
  36429. method: "POST",
  36430. data: jsonParameters,
  36431. scope: me,
  36432. success: me.serviceProcessCompleted,
  36433. failure: me.serviceProcessFailed
  36434. });
  36435. }
  36436. /**
  36437. * @function SuperMap.SurfaceAnalystService.prototype.getJsonParameters
  36438. * @description 将参数转化为 JSON 字符串。
  36439. * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  36440. * @returns {Object} 转化后的JSON字符串。
  36441. */
  36442. }, {
  36443. key: "getJsonParameters",
  36444. value: function getJsonParameters(params) {
  36445. var jsonParameters = '';
  36446. var parameterObject = {};
  36447. var me = this;
  36448. if (params instanceof DatasetSurfaceAnalystParameters) {
  36449. me.url = Util.urlPathAppend(me.url, 'datasets/' + params.dataset + '/' + params.surfaceAnalystMethod.toLowerCase());
  36450. DatasetSurfaceAnalystParameters.toObject(params, parameterObject);
  36451. jsonParameters = Util.toJSON(parameterObject);
  36452. } else if (params instanceof GeometrySurfaceAnalystParameters) {
  36453. me.url = Util.urlPathAppend(me.url, 'geometry/' + params.surfaceAnalystMethod.toLowerCase());
  36454. jsonParameters = Util.toJSON(params);
  36455. } else {
  36456. return;
  36457. }
  36458. me.url = Util.urlAppend(me.url, 'returnContent=true');
  36459. return jsonParameters;
  36460. }
  36461. }]);
  36462. return SurfaceAnalystService;
  36463. }(SpatialAnalystBase);
  36464. SuperMap.SurfaceAnalystService = SurfaceAnalystService;
  36465. ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationParameters.js
  36466. function TerrainCurvatureCalculationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36467. 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); } }
  36468. function TerrainCurvatureCalculationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor, staticProps); return Constructor; }
  36469. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36470. * This program are made available under the terms of the Apache License, Version 2.0
  36471. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36472. /**
  36473. * @class SuperMap.TerrainCurvatureCalculationParameters
  36474. * @category iServer SpatialAnalyst TerrainCalculation
  36475. * @classdesc 地形曲率计算参数类。
  36476. * @param {Object} options - 参数。
  36477. * @param {string} options.dataset - 要用来做地形曲率计算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  36478. * @param {string} options.averageCurvatureName - 结果数据集:平均曲率数据集的名称。
  36479. * @param {string} options.profileCurvatureName - 结果数据集:剖面曲率数据集的名称。
  36480. * @param {string} options.planCurvatureName - 结果数据集:平面曲率数据集的名称。
  36481. * @param {number} [options.zFactor=1.0] - 指定的高程缩放系数。1.0 表示不缩放。
  36482. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  36483. */
  36484. var TerrainCurvatureCalculationParameters = /*#__PURE__*/function () {
  36485. function TerrainCurvatureCalculationParameters(options) {
  36486. TerrainCurvatureCalculationParameters_classCallCheck(this, TerrainCurvatureCalculationParameters);
  36487. if (!options) {
  36488. return;
  36489. }
  36490. /**
  36491. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.dataset
  36492. * @description 要用来做地形曲率计算数据源中数据集的名称。
  36493. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  36494. * 注:地形曲率计算必须为栅格数据集。
  36495. */
  36496. this.dataset = null;
  36497. /**
  36498. * @member {number} [SuperMap.TerrainCurvatureCalculationParameters.prototype.zFactor=1.0]
  36499. * @description 指定的高程缩放系数。1.0 表示不缩放。
  36500. * 该值是指在 DEM 栅格数据中,栅格值( Z 坐标,即高程值)相对于 X 和 Y 坐标的单位变换系数。
  36501. * 通常有 X,Y,Z 都参加的计算中,需要将高程值乘以一个高程缩放系数,使得三者单位一致。
  36502. * 例如,X、Y 方向上的单位是米,而 Z 方向的单位是英尺,由于 1 英尺等于 0.3048 米,则需要指定缩放系数为 0.3048。
  36503. */
  36504. this.zFactor = 1.0;
  36505. /**
  36506. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.averageCurvatureName
  36507. * @description 结果数据集:平均曲率数据集的名称。
  36508. */
  36509. this.averageCurvatureName = null;
  36510. /**
  36511. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.profileCurvatureName
  36512. * @description 结果数据集:剖面曲率数据集的名称。
  36513. */
  36514. this.profileCurvatureName = "";
  36515. /**
  36516. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.planCurvatureName
  36517. * @description 结果数据集:平面曲率数据集的名称。
  36518. */
  36519. this.planCurvatureName = "";
  36520. /**
  36521. * @member {boolean} [SuperMap.TerrainCurvatureCalculationParameters.prototype.deleteExistResultDataset=false]
  36522. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  36523. */
  36524. this.deleteExistResultDataset = false;
  36525. Util.extend(this, options);
  36526. this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationParameters";
  36527. }
  36528. /**
  36529. * @function SuperMap.TerrainCurvatureCalculationParameters.prototype.destroy
  36530. * @description 释放资源,将引用资源的属性置空。
  36531. */
  36532. TerrainCurvatureCalculationParameters_createClass(TerrainCurvatureCalculationParameters, [{
  36533. key: "destroy",
  36534. value: function destroy() {
  36535. var me = this;
  36536. me.dataset = null;
  36537. me.zFactor = 1.0;
  36538. me.averageCurvatureName = null;
  36539. me.profileCurvatureName = null;
  36540. me.planCurvatureName = null;
  36541. me.deleteExistResultDataset = true;
  36542. }
  36543. /**
  36544. * @function SuperMap.TerrainCurvatureCalculationParameters.toObject
  36545. * @param {Object} derrainCurvatureCalculationParameters - 地形曲率计算参数。
  36546. * @param {Object} tempObj - 目标对象。
  36547. * @description 生成地形曲率计算对象。
  36548. */
  36549. }], [{
  36550. key: "toObject",
  36551. value: function toObject(derrainCurvatureCalculationParameters, tempObj) {
  36552. for (var name in derrainCurvatureCalculationParameters) {
  36553. if (name !== "dataset") {
  36554. tempObj[name] = derrainCurvatureCalculationParameters[name];
  36555. }
  36556. }
  36557. }
  36558. }]);
  36559. return TerrainCurvatureCalculationParameters;
  36560. }();
  36561. SuperMap.TerrainCurvatureCalculationParameters = TerrainCurvatureCalculationParameters;
  36562. ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationService.js
  36563. function TerrainCurvatureCalculationService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TerrainCurvatureCalculationService_typeof = function _typeof(obj) { return typeof obj; }; } else { TerrainCurvatureCalculationService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TerrainCurvatureCalculationService_typeof(obj); }
  36564. function TerrainCurvatureCalculationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36565. 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); } }
  36566. function TerrainCurvatureCalculationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationService_defineProperties(Constructor, staticProps); return Constructor; }
  36567. function TerrainCurvatureCalculationService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TerrainCurvatureCalculationService_get = Reflect.get; } else { TerrainCurvatureCalculationService_get = function _get(target, property, receiver) { var base = TerrainCurvatureCalculationService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return TerrainCurvatureCalculationService_get(target, property, receiver || target); }
  36568. function TerrainCurvatureCalculationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TerrainCurvatureCalculationService_getPrototypeOf(object); if (object === null) break; } return object; }
  36569. function TerrainCurvatureCalculationService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) TerrainCurvatureCalculationService_setPrototypeOf(subClass, superClass); }
  36570. function TerrainCurvatureCalculationService_setPrototypeOf(o, p) { TerrainCurvatureCalculationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TerrainCurvatureCalculationService_setPrototypeOf(o, p); }
  36571. 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); }; }
  36572. function TerrainCurvatureCalculationService_possibleConstructorReturn(self, call) { if (call && (TerrainCurvatureCalculationService_typeof(call) === "object" || typeof call === "function")) { return call; } return TerrainCurvatureCalculationService_assertThisInitialized(self); }
  36573. function TerrainCurvatureCalculationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36574. function TerrainCurvatureCalculationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  36575. function TerrainCurvatureCalculationService_getPrototypeOf(o) { TerrainCurvatureCalculationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TerrainCurvatureCalculationService_getPrototypeOf(o); }
  36576. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36577. * This program are made available under the terms of the Apache License, Version 2.0
  36578. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36579. /**
  36580. * @class SuperMap.TerrainCurvatureCalculationService
  36581. * @category iServer SpatialAnalyst TerrainCalculation
  36582. * @classdesc 地形曲率计算服务类。
  36583. * @extends {SuperMap.SpatialAnalystBase}
  36584. * @param {Object} options - 参数。
  36585. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36586. * @param {string} options.url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  36587. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36588. * @param {Object} [options.headers] - 请求头。
  36589. * @example 例如:
  36590. * (start code)
  36591. * var myTerrainCurvatureCalculationService = new SuperMap.TerrainCurvatureCalculationService(url);
  36592. * myTerrainCurvatureCalculationService.on({
  36593. * "processCompleted": processCompleted,
  36594. * "processFailed": processFailed
  36595. * }
  36596. * );
  36597. * (end)
  36598. *
  36599. */
  36600. var TerrainCurvatureCalculationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  36601. TerrainCurvatureCalculationService_inherits(TerrainCurvatureCalculationService, _SpatialAnalystBase);
  36602. var _super = TerrainCurvatureCalculationService_createSuper(TerrainCurvatureCalculationService);
  36603. function TerrainCurvatureCalculationService(url, options) {
  36604. var _this;
  36605. TerrainCurvatureCalculationService_classCallCheck(this, TerrainCurvatureCalculationService);
  36606. _this = _super.call(this, url, options);
  36607. _this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationService";
  36608. return _this;
  36609. }
  36610. /**
  36611. *@override
  36612. */
  36613. TerrainCurvatureCalculationService_createClass(TerrainCurvatureCalculationService, [{
  36614. key: "destroy",
  36615. value: function destroy() {
  36616. TerrainCurvatureCalculationService_get(TerrainCurvatureCalculationService_getPrototypeOf(TerrainCurvatureCalculationService.prototype), "destroy", this).call(this);
  36617. }
  36618. /**
  36619. * @function SuperMap.TerrainCurvatureCalculationService.prototype.processAsync
  36620. * @description 负责将客户端的查询参数传递到服务端。
  36621. * @param {SuperMap.TerrainCurvatureCalculationParameters} parameter - 地形曲率计算参数类。
  36622. */
  36623. }, {
  36624. key: "processAsync",
  36625. value: function processAsync(parameter) {
  36626. var me = this;
  36627. var parameterObject = {};
  36628. if (parameter instanceof TerrainCurvatureCalculationParameters) {
  36629. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/terraincalculation/curvature');
  36630. }
  36631. TerrainCurvatureCalculationParameters.toObject(parameter, parameterObject);
  36632. var jsonParameters = SuperMap.Util.toJSON(parameterObject);
  36633. me.url = Util.urlAppend(me.url, 'returnContent=true');
  36634. me.request({
  36635. method: "POST",
  36636. data: jsonParameters,
  36637. scope: me,
  36638. success: me.serviceProcessCompleted,
  36639. failure: me.serviceProcessFailed
  36640. });
  36641. }
  36642. }]);
  36643. return TerrainCurvatureCalculationService;
  36644. }(SpatialAnalystBase);
  36645. SuperMap.TerrainCurvatureCalculationService = TerrainCurvatureCalculationService;
  36646. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRangeItem.js
  36647. function ThemeGridRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36648. 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); } }
  36649. function ThemeGridRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRangeItem_defineProperties(Constructor, staticProps); return Constructor; }
  36650. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36651. * This program are made available under the terms of the Apache License, Version 2.0
  36652. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36653. /**
  36654. * @class SuperMap.ThemeGridRangeItem
  36655. * @category iServer Map Theme
  36656. * @classdesc 栅格分段专题图子项类。
  36657. * @description 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  36658. * 本类用来设置每个范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  36659. * @param {Object} options - 参数。
  36660. * @param {SuperMap.ServerColor} options.color - 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  36661. * @param {string} [options.caption] - 栅格分段专题图子项的标题。
  36662. * @param {number} [options.end=0] - 栅格分段专题图子项的终止值。
  36663. * @param {number} [options.start=0] - 栅格分段专题图子项的起始值。
  36664. * @param {boolean} [options.visible=true] - 栅格分段专题图子项是否可见。
  36665. */
  36666. var ThemeGridRangeItem = /*#__PURE__*/function () {
  36667. function ThemeGridRangeItem(options) {
  36668. ThemeGridRangeItem_classCallCheck(this, ThemeGridRangeItem);
  36669. /**
  36670. * @member {string} [SuperMap.ThemeGridRangeItem.prototype.caption]
  36671. * @description 栅格分段专题图子项的标题。
  36672. */
  36673. this.caption = null;
  36674. /**
  36675. * @member {SuperMap.ServerColor} SuperMap.ThemeGridRangeItem.prototype.color
  36676. * @description 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  36677. */
  36678. this.color = new ServerColor();
  36679. /**
  36680. * @member {number} [SuperMap.ThemeGridRangeItem.prototype.end=0]
  36681. * @description 栅格分段专题图子项的终止值,即该段专题值范围的最大值。
  36682. */
  36683. this.end = 0;
  36684. /**
  36685. * @member {number} [SuperMap.ThemeGridRangeItem.prototype.start=0]
  36686. * @description 栅格分段专题图子项的起始值,即该段专题值范围的最小值。
  36687. */
  36688. this.start = 0;
  36689. /**
  36690. * @member {boolean} [SuperMap.ThemeGridRangeItem.prototype.visible=true]
  36691. * @description 栅格分段专题图子项是否可见。
  36692. */
  36693. this.visible = true;
  36694. if (options) {
  36695. Util.extend(this, options);
  36696. }
  36697. this.CLASS_NAME = "SuperMap.ThemeGridRangeItem";
  36698. }
  36699. /**
  36700. * @function SuperMap.ThemeGridRangeItem.prototype.destroy
  36701. * @description 释放资源,将引用资源的属性置空。
  36702. */
  36703. ThemeGridRangeItem_createClass(ThemeGridRangeItem, [{
  36704. key: "destroy",
  36705. value: function destroy() {
  36706. var me = this;
  36707. me.caption = null;
  36708. me.end = null;
  36709. me.start = null; //需要验证是够存在destroy方法
  36710. if (me.color) {
  36711. me.color.destroy();
  36712. me.color = null;
  36713. }
  36714. me.visible = null;
  36715. }
  36716. /**
  36717. * @function SuperMap.ThemeGridRangeItem.prototype.toServerJSONObject
  36718. * @description 转换成对应的 JSON 格式对象。
  36719. * @returns {Object} 对应的 JSON 格式对象。
  36720. */
  36721. }, {
  36722. key: "toServerJSONObject",
  36723. value: function toServerJSONObject() {
  36724. var obj = {};
  36725. obj = Util.copyAttributes(obj, this);
  36726. if (obj.color) {
  36727. if (obj.color.toServerJSONObject) {
  36728. obj.color = obj.color.toServerJSONObject();
  36729. }
  36730. }
  36731. return obj;
  36732. }
  36733. /**
  36734. * @function SuperMap.ThemeGridRangeItem.fromObj
  36735. * @description 从传入对象获取栅格分段专题图子项类。
  36736. * @param {Object} obj - 传入对象。
  36737. * @returns {SuperMap.ThemeGridRangeItem} ThemeGridRangeItem 对象。
  36738. */
  36739. }], [{
  36740. key: "fromObj",
  36741. value: function fromObj(obj) {
  36742. if (!obj) {
  36743. return;
  36744. }
  36745. var res = new ThemeGridRangeItem();
  36746. Util.copy(res, obj);
  36747. res.color = ServerColor.fromJson(obj.color);
  36748. return res;
  36749. }
  36750. }]);
  36751. return ThemeGridRangeItem;
  36752. }();
  36753. SuperMap.ThemeGridRangeItem = ThemeGridRangeItem;
  36754. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRange.js
  36755. function ThemeGridRange_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeGridRange_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeGridRange_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeGridRange_typeof(obj); }
  36756. function ThemeGridRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36757. 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); } }
  36758. function ThemeGridRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRange_defineProperties(Constructor, staticProps); return Constructor; }
  36759. function ThemeGridRange_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGridRange_get = Reflect.get; } else { ThemeGridRange_get = function _get(target, property, receiver) { var base = ThemeGridRange_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ThemeGridRange_get(target, property, receiver || target); }
  36760. function ThemeGridRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridRange_getPrototypeOf(object); if (object === null) break; } return object; }
  36761. function ThemeGridRange_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThemeGridRange_setPrototypeOf(subClass, superClass); }
  36762. function ThemeGridRange_setPrototypeOf(o, p) { ThemeGridRange_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridRange_setPrototypeOf(o, p); }
  36763. 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); }; }
  36764. function ThemeGridRange_possibleConstructorReturn(self, call) { if (call && (ThemeGridRange_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGridRange_assertThisInitialized(self); }
  36765. function ThemeGridRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36766. function ThemeGridRange_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  36767. function ThemeGridRange_getPrototypeOf(o) { ThemeGridRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridRange_getPrototypeOf(o); }
  36768. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36769. * This program are made available under the terms of the Apache License, Version 2.0
  36770. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36771. /**
  36772. * @class SuperMap.ThemeGridRange
  36773. * @category iServer Map Theme
  36774. * @classdesc 栅格分段专题图。
  36775. * @description 栅格分段专题图,是将所有单元格的值按照某种分段方式分成多个范围段,值在同一个范围段中的单元格使用相同的颜色进行显示。
  36776. * 栅格分段专题图一般用来反映连续分布现象的数量或程度特征。比如某年的全国降水量分布图,将各气象站点的观测值经过内插之后生成的栅格数据进行分段显示。
  36777. * 该类类似于分段专题图类,不同点在于分段专题图的操作对象是矢量数据,而栅格分段专题图的操作对象是栅格数据。
  36778. * @extends {SuperMap.Theme}
  36779. * @param {Object} options - 参数。
  36780. * @param {Array.<SuperMap.ThemeGridRangeItem>} options.items - 栅格分段专题图子项数组。
  36781. * @param {boolean} [options.reverseColor=false] - 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  36782. * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
  36783. * @param {number} [options.rangeParameter=0] - 分段参数。
  36784. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  36785. */
  36786. var ThemeGridRange = /*#__PURE__*/function (_Theme) {
  36787. ThemeGridRange_inherits(ThemeGridRange, _Theme);
  36788. var _super = ThemeGridRange_createSuper(ThemeGridRange);
  36789. function ThemeGridRange(options) {
  36790. var _this;
  36791. ThemeGridRange_classCallCheck(this, ThemeGridRange);
  36792. _this = _super.call(this, "GRIDRANGE", options);
  36793. /**
  36794. * @member {Array.<SuperMap.ThemeGridRangeItem>} SuperMap.ThemeGridRange.prototype.items
  36795. * @description 栅格分段专题图子项数组。<br>
  36796. * 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  36797. * 本类用来设置每个栅格范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  36798. */
  36799. _this.items = null;
  36800. /**
  36801. * @member {SuperMap.RangeMode} [SuperMap.ThemeGridRange.prototype.rangeMode=SuperMap.RangeMode.EQUALINTERVAL]
  36802. * @description 分段专题图的分段模式。<br>
  36803. * 在栅格分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  36804. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  36805. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  36806. */
  36807. _this.rangeMode = RangeMode.EQUALINTERVAL;
  36808. /**
  36809. * @member {number} [SuperMap.ThemeGridRange.prototype.rangeParameter=0]
  36810. * @description 分段参数。<br>
  36811. * 当分段模式为等距离分段法,平方根分段,对数分段法,计数分段法其中一种模式时,该参数用于设置分段个数,必设;当分段模式为标准差分段法时,
  36812. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  36813. */
  36814. _this.rangeParameter = 0;
  36815. /**
  36816. * @member {SuperMap.ColorGradientType} [SuperMap.ThemeGridRange.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  36817. * @description 渐变颜色枚举类。
  36818. *
  36819. */
  36820. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  36821. /**
  36822. * @member {boolean} SuperMap.ThemeGridRange.prototype.reverseColor
  36823. * @description 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  36824. */
  36825. _this.reverseColor = false;
  36826. if (options) {
  36827. Util.extend(ThemeGridRange_assertThisInitialized(_this), options);
  36828. }
  36829. _this.CLASS_NAME = "SuperMap.ThemeGridRange";
  36830. return _this;
  36831. }
  36832. /**
  36833. * @function SuperMap.ThemeGridRange.prototype.destroy
  36834. * @override
  36835. */
  36836. ThemeGridRange_createClass(ThemeGridRange, [{
  36837. key: "destroy",
  36838. value: function destroy() {
  36839. ThemeGridRange_get(ThemeGridRange_getPrototypeOf(ThemeGridRange.prototype), "destroy", this).call(this);
  36840. var me = this;
  36841. if (me.items) {
  36842. if (me.items.length > 0) {
  36843. for (var item in me.items) {
  36844. me.items[item].destroy();
  36845. me.items[item] = null;
  36846. }
  36847. }
  36848. me.items = null;
  36849. }
  36850. me.reverseColor = null;
  36851. me.rangeMode = null;
  36852. me.rangeParameter = null;
  36853. me.colorGradientType = null;
  36854. }
  36855. /**
  36856. * @function SuperMap.ThemeGridRange.fromObj
  36857. * @description 从传入对象获取栅格分段专题图。
  36858. * @param {Object} obj - 传入对象。
  36859. * @returns {SuperMap.ThemeGridRange} ThemeGridRange 对象。
  36860. */
  36861. }], [{
  36862. key: "fromObj",
  36863. value: function fromObj(obj) {
  36864. if (!obj) {
  36865. return;
  36866. }
  36867. var res = new ThemeGridRange();
  36868. Util.copy(res, obj);
  36869. var itemsR = obj.items;
  36870. var len = itemsR ? itemsR.length : 0;
  36871. res.items = [];
  36872. for (var i = 0; i < len; i++) {
  36873. res.items.push(ThemeGridRangeItem.fromObj(itemsR[i]));
  36874. }
  36875. return res;
  36876. }
  36877. }]);
  36878. return ThemeGridRange;
  36879. }(Theme);
  36880. SuperMap.ThemeGridRange = ThemeGridRange;
  36881. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUniqueItem.js
  36882. function ThemeGridUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36883. 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); } }
  36884. function ThemeGridUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
  36885. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36886. * This program are made available under the terms of the Apache License, Version 2.0
  36887. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36888. /**
  36889. * @class SuperMap.ThemeGridUniqueItem
  36890. * @category iServer Map Theme
  36891. * @classdesc 栅格单值专题图子项类。
  36892. * 栅格单值专题图是将值相同的单元格归为一类,每一类是一个专题图子项。
  36893. * @param {Object} options - 参数。
  36894. * @param {string} [options.caption] - 栅格单值专题图子项的名称。
  36895. * @param {SuperMap.ServerColor} [options.color] - 栅格单值专题图子项的显示颜色。
  36896. * @param {number} options.unique - 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  36897. * @param {boolean} [options.visible=true] - 栅格单值专题图子项是否可见。
  36898. */
  36899. var ThemeGridUniqueItem = /*#__PURE__*/function () {
  36900. function ThemeGridUniqueItem(options) {
  36901. ThemeGridUniqueItem_classCallCheck(this, ThemeGridUniqueItem);
  36902. /**
  36903. * @member {string} [SuperMap.ThemeGridUniqueItem.prototype.caption]
  36904. * @description 栅格单值专题图子项的名称。
  36905. */
  36906. this.caption = null;
  36907. /**
  36908. * @member {SuperMap.ServerColor} [SuperMap.ThemeGridUniqueItem.prototype.color]
  36909. * @description 栅格单值专题图子项的显示颜色。
  36910. */
  36911. this.color = new ServerColor();
  36912. /**
  36913. * @member {number} SuperMap.ThemeGridUniqueItem.prototype.unique
  36914. * @description 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  36915. */
  36916. this.unique = null;
  36917. /**
  36918. * @member {boolean} [SuperMap.ThemeGridUniqueItem.prototype.visible=true]
  36919. * @description 栅格单值专题图子项是否可见。
  36920. */
  36921. this.visible = true;
  36922. if (options) {
  36923. Util.extend(this, options);
  36924. }
  36925. this.CLASS_NAME = "SuperMap.ThemeGridUniqueItem";
  36926. }
  36927. /**
  36928. * @function SuperMap.ThemeGridUniqueItem.prototype.destroy
  36929. * @description 释放资源,将引用资源的属性置空。
  36930. */
  36931. ThemeGridUniqueItem_createClass(ThemeGridUniqueItem, [{
  36932. key: "destroy",
  36933. value: function destroy() {
  36934. var me = this;
  36935. me.caption = null;
  36936. me.unique = null;
  36937. if (me.color) {
  36938. me.color.destroy();
  36939. me.color = null;
  36940. }
  36941. me.visible = null;
  36942. }
  36943. /**
  36944. * @function SuperMap.ThemeGridUniqueItem.prototype.toServerJSONObject
  36945. * @description 转换成对应的 JSON 格式对象。
  36946. * @returns {Object} 对应的 JSON 格式对象。
  36947. */
  36948. }, {
  36949. key: "toServerJSONObject",
  36950. value: function toServerJSONObject() {
  36951. var obj = {};
  36952. obj = Util.copyAttributes(obj, this);
  36953. if (obj.color) {
  36954. if (obj.color.toServerJSONObject) {
  36955. obj.color = obj.color.toServerJSONObject();
  36956. }
  36957. }
  36958. return obj;
  36959. }
  36960. /**
  36961. * @function SuperMap.ThemeGridUniqueItem.fromObj
  36962. * @description 从传入对象获取栅格单值专题图子项类。
  36963. * @param {Object} obj - 传入对象。
  36964. * @returns {SuperMap.ThemeGridUniqueItem} ThemeGridUniqueItem 对象。
  36965. */
  36966. }], [{
  36967. key: "fromObj",
  36968. value: function fromObj(obj) {
  36969. var res = new ThemeGridUniqueItem();
  36970. Util.copy(res, obj);
  36971. res.color = ServerColor.fromJson(obj.color);
  36972. return res;
  36973. }
  36974. }]);
  36975. return ThemeGridUniqueItem;
  36976. }();
  36977. SuperMap.ThemeGridUniqueItem = ThemeGridUniqueItem;
  36978. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUnique.js
  36979. function ThemeGridUnique_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeGridUnique_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeGridUnique_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeGridUnique_typeof(obj); }
  36980. function ThemeGridUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36981. 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); } }
  36982. function ThemeGridUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUnique_defineProperties(Constructor, staticProps); return Constructor; }
  36983. function ThemeGridUnique_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGridUnique_get = Reflect.get; } else { ThemeGridUnique_get = function _get(target, property, receiver) { var base = ThemeGridUnique_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ThemeGridUnique_get(target, property, receiver || target); }
  36984. function ThemeGridUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  36985. function ThemeGridUnique_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThemeGridUnique_setPrototypeOf(subClass, superClass); }
  36986. function ThemeGridUnique_setPrototypeOf(o, p) { ThemeGridUnique_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridUnique_setPrototypeOf(o, p); }
  36987. 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); }; }
  36988. function ThemeGridUnique_possibleConstructorReturn(self, call) { if (call && (ThemeGridUnique_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGridUnique_assertThisInitialized(self); }
  36989. function ThemeGridUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36990. function ThemeGridUnique_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  36991. function ThemeGridUnique_getPrototypeOf(o) { ThemeGridUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridUnique_getPrototypeOf(o); }
  36992. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36993. * This program are made available under the terms of the Apache License, Version 2.0
  36994. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36995. /**
  36996. * @class SuperMap.ThemeGridUnique
  36997. * @category iServer Map Theme
  36998. * @classdesc 栅格单值专题图类。
  36999. * @description 栅格单值专题图,是将单元格值相同的归为一类,为每一类设定一种颜色,从而用来区分不同的类别。<br>
  37000. * 栅格单值专题图适用于离散栅格数据和部分连续栅格数据,对于单元格值各不相同的那些连续栅格数据,使用栅格单值专题图不具有任何意义。
  37001. * @extends {SuperMap.Theme}
  37002. * @param {Object} options - 参数。
  37003. * @param {Array.<SuperMap.ThemeGridUniqueItem>} options.items - 栅格单值专题图子项数组。
  37004. * @param {SuperMap.ServerColor} [options.defaultcolor] - 栅格单值专题图的默认颜色。
  37005. */
  37006. var ThemeGridUnique = /*#__PURE__*/function (_Theme) {
  37007. ThemeGridUnique_inherits(ThemeGridUnique, _Theme);
  37008. var _super = ThemeGridUnique_createSuper(ThemeGridUnique);
  37009. function ThemeGridUnique(options) {
  37010. var _this;
  37011. ThemeGridUnique_classCallCheck(this, ThemeGridUnique);
  37012. _this = _super.call(this, "GRIDUNIQUE", options);
  37013. /**
  37014. * @member {SuperMap.ServerColor} SuperMap.ThemeGridUnique.prototype.defaultcolor
  37015. * @description 栅格单值专题图的默认颜色。
  37016. * 对于那些未在格网单值专题图子项之列的要素使用该颜色显示。
  37017. */
  37018. _this.defaultcolor = new ServerColor();
  37019. /**
  37020. * @member {Array.<SuperMap.ThemeGridUniqueItem>} SuperMap.ThemeGridUnique.prototype.items
  37021. * @description 栅格单值专题图子项数组。
  37022. * 栅格单值专题图将值相同的单元格归为一类,每一类是一个专题图子项。
  37023. */
  37024. _this.items = null;
  37025. if (options) {
  37026. Util.extend(ThemeGridUnique_assertThisInitialized(_this), options);
  37027. }
  37028. _this.CLASS_NAME = "SuperMap.ThemeGridUnique";
  37029. return _this;
  37030. }
  37031. /**
  37032. * @function SuperMap.ThemeGridUnique.prototype.destroy
  37033. * @override
  37034. */
  37035. ThemeGridUnique_createClass(ThemeGridUnique, [{
  37036. key: "destroy",
  37037. value: function destroy() {
  37038. ThemeGridUnique_get(ThemeGridUnique_getPrototypeOf(ThemeGridUnique.prototype), "destroy", this).call(this);
  37039. var me = this;
  37040. if (me.items) {
  37041. if (me.items.length > 0) {
  37042. for (var item in me.items) {
  37043. me.items[item].destroy();
  37044. me.items[item] = null;
  37045. }
  37046. }
  37047. me.items = null;
  37048. }
  37049. if (me.defaultcolor) {
  37050. me.defaultcolor.destroy();
  37051. me.defaultcolor = null;
  37052. }
  37053. }
  37054. /**
  37055. * @function SuperMap.ThemeGridUnique.prototype.toServerJSONObject
  37056. * @description 转换成对应的 JSON 格式对象。
  37057. * @returns {Object} 对应的 JSON 格式对象
  37058. */
  37059. }, {
  37060. key: "toServerJSONObject",
  37061. value: function toServerJSONObject() {
  37062. var obj = {};
  37063. obj = Util.copyAttributes(obj, this);
  37064. if (obj.defaultcolor) {
  37065. if (obj.defaultcolor.toServerJSONObject) {
  37066. obj.defaultcolor = obj.defaultcolor.toServerJSONObject();
  37067. }
  37068. }
  37069. if (obj.items) {
  37070. var items = [],
  37071. len = obj.items.length;
  37072. for (var i = 0; i < len; i++) {
  37073. items.push(obj.items[i].toServerJSONObject());
  37074. }
  37075. obj.items = items;
  37076. }
  37077. return obj;
  37078. }
  37079. /**
  37080. * @function SuperMap.ThemeGridUnique.fromObj
  37081. * @description 从传入对象获取栅格单值专题图类。
  37082. * @param {Object} obj - 传入对象
  37083. * @returns {SuperMap.ThemeGridUnique} ThemeGridUnique 对象
  37084. */
  37085. }], [{
  37086. key: "fromObj",
  37087. value: function fromObj(obj) {
  37088. var res = new ThemeGridUnique();
  37089. var uItems = obj.items;
  37090. var len = uItems ? uItems.length : 0;
  37091. Util.extend(res, obj);
  37092. res.items = [];
  37093. res.defaultcolor = ServerColor.fromJson(obj.defaultcolor);
  37094. for (var i = 0; i < len; i++) {
  37095. res.items.push(ThemeGridUniqueItem.fromObj(uItems[i]));
  37096. }
  37097. return res;
  37098. }
  37099. }]);
  37100. return ThemeGridUnique;
  37101. }(Theme);
  37102. SuperMap.ThemeGridUnique = ThemeGridUnique;
  37103. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelUniqueItem.js
  37104. function ThemeLabelUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37105. 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); } }
  37106. function ThemeLabelUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
  37107. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37108. * This program are made available under the terms of the Apache License, Version 2.0
  37109. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37110. /**
  37111. * @class SuperMap.ThemeLabelUniqueItem
  37112. * @category iServer Map Theme
  37113. * @classdesc 单值标签专题图的子项。
  37114. * @description 标签专题图用专题值对点、线、面等对象做标注,值得注意的是,单值标签专题图允许用户通过 uniqueExpression
  37115. * 字段指定用于单值的字段,同一值的标签具有相同的显示风格,其中每一个值就是一个专题图子项,
  37116. * 每一个子项都具有其名称、风格、指定的单值、X 方向偏移量和 Y 方向偏移量。
  37117. * @param {Object} options - 参数。
  37118. * @param {string} options.unique - 单值专题图子项的值,可以为数字、字符串等。
  37119. * @param {string} [options.caption] - 专题图子项的名称。
  37120. * @param {number} [options.offsetX=0] - 标签在 X 方向偏移量。
  37121. * @param {number} [options.offsetY=0] - 标签在 Y 方向偏移量。
  37122. * @param {boolean} [options.visible=true] - 标签专题图子项是否可见。
  37123. * @param {SuperMap.ServerTextStyle} [options.style] - 标签专题图子项文本的显示风格。
  37124. */
  37125. var ThemeLabelUniqueItem = /*#__PURE__*/function () {
  37126. function ThemeLabelUniqueItem(options) {
  37127. ThemeLabelUniqueItem_classCallCheck(this, ThemeLabelUniqueItem);
  37128. /**
  37129. * @member {string} [SuperMap.ThemeLabelUniqueItem.prototype.caption]
  37130. * @description 标签专题子项的标题。
  37131. */
  37132. this.caption = null;
  37133. /**
  37134. * @member {string} SuperMap.ThemeLabelUniqueItem.prototype.unique
  37135. * @description 单值专题图子项的值,可以为数字、字符串等。
  37136. */
  37137. this.unique = null;
  37138. /**
  37139. * @member {number} [SuperMap.ThemeLabelUniqueItem.prototype.offsetX=0]
  37140. * @description 标签在 X 方向偏移量。
  37141. */
  37142. this.offsetX = 0;
  37143. /**
  37144. * @member {number} [SuperMap.ThemeLabelUniqueItem.prototype.offsetY=0]
  37145. * @description 标签在 Y 方向偏移量。
  37146. */
  37147. this.offsetY = 0;
  37148. /**
  37149. * @member {boolean} [SuperMap.ThemeLabelUniqueItem.prototype.visible=true]
  37150. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  37151. */
  37152. this.visible = true;
  37153. /**
  37154. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeLabelUniqueItem.prototype.style
  37155. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  37156. * uniformMixedStyle(标签文本的复合风格),SuperMap.ThemeLabelUniqueItem.style(单值子项的文本风格),uniformStyle(统一文本风格)。
  37157. */
  37158. this.style = new ServerTextStyle();
  37159. if (options) {
  37160. Util.extend(this, options);
  37161. }
  37162. this.CLASS_NAME = "SuperMap.ThemeLabelUniqueItem";
  37163. }
  37164. /**
  37165. * @function SuperMap.ThemeLabelUniqueItem.prototype.destroy
  37166. * @description 释放资源,将引用资源的属性置空。
  37167. */
  37168. ThemeLabelUniqueItem_createClass(ThemeLabelUniqueItem, [{
  37169. key: "destroy",
  37170. value: function destroy() {
  37171. var me = this;
  37172. me.unique = null;
  37173. me.caption = null;
  37174. me.offsetX = null;
  37175. me.offsetY = null;
  37176. if (me.style) {
  37177. me.style.destroy();
  37178. me.style = null;
  37179. }
  37180. me.visible = null;
  37181. }
  37182. /**
  37183. * @function SuperMap.ThemeLabelUniqueItem.fromObj
  37184. * @description 从传入对象获取单值标签专题图的子项类。
  37185. * @param {Object} obj - 传入对象。
  37186. * @returns {SuperMap.ThemeLabelUniqueItem} ThemeLabelUniqueItem 对象。
  37187. */
  37188. }], [{
  37189. key: "fromObj",
  37190. value: function fromObj(obj) {
  37191. if (!obj) {
  37192. return;
  37193. }
  37194. var t = new ThemeLabelUniqueItem();
  37195. Util.copy(t, obj);
  37196. return t;
  37197. }
  37198. }]);
  37199. return ThemeLabelUniqueItem;
  37200. }();
  37201. SuperMap.ThemeLabelUniqueItem = ThemeLabelUniqueItem;
  37202. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeParameters.js
  37203. function ThemeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37204. 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); } }
  37205. function ThemeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeParameters_defineProperties(Constructor, staticProps); return Constructor; }
  37206. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37207. * This program are made available under the terms of the Apache License, Version 2.0
  37208. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37209. /**
  37210. * @class SuperMap.ThemeParameters
  37211. * @category iServer Map Theme
  37212. * @classdesc 专题图参数类。
  37213. * 该类存储了制作专题所需的参数,包括数据源、数据集名称和专题图对象。
  37214. * @param {Object} options - 参数。
  37215. * @param {Array.<string>} options.datasetNames - 要制作专题图的数据集数组。
  37216. * @param {Array.<string>} options.dataSourceNames - 要制作专题图的数据集所在的数据源数组。
  37217. * @param {Array.<SuperMap.JoinItem>} [options.joinItems] - 专题图外部表的连接信息 JoinItem 数组。
  37218. * @param {Array.<SuperMap.Theme>} options.themes - 专题图对象列表。
  37219. * @param {Array.<string>} [options.displayFilters] - 专题图属性过滤条件。
  37220. * @param {Array.<string>} [options.displayOrderBys] - 专题图对象生成符号叠加次序排序字段。
  37221. * @param {Object} [options.fieldValuesDisplayFilter] - 图层要素的显示和隐藏的过滤属性,其带有三个属性,分别是:values、fieldName、fieldValuesDisplayMode。
  37222. */
  37223. var ThemeParameters = /*#__PURE__*/function () {
  37224. function ThemeParameters(options) {
  37225. ThemeParameters_classCallCheck(this, ThemeParameters);
  37226. /**
  37227. * @member {Array.<string>} SuperMap.ThemeParameters.prototype.datasetNames
  37228. * @description 要制作专题图的数据集数组。
  37229. */
  37230. this.datasetNames = null;
  37231. /**
  37232. * @member {Array.<string>} SuperMap.ThemeParameters.prototype.dataSourceNames
  37233. * @description 要制作专题图的数据集所在的数据源数组。
  37234. */
  37235. this.dataSourceNames = null;
  37236. /**
  37237. * @member {Array.<SuperMap.JoinItem>} [SuperMap.ThemeParameters.prototype.joinItems]
  37238. * @description 设置与外部表的连接信息 JoinItem 数组。
  37239. * 使用此属性可以制作与外部表连接的专题图。
  37240. */
  37241. this.joinItems = null;
  37242. /**
  37243. * @member {Array.<SuperMap.Theme>} SuperMap.ThemeParameters.prototype.themes
  37244. * @description 专题图对象列表。
  37245. * 该参数为实例化的各类专题图对象的集合。
  37246. */
  37247. this.themes = null;
  37248. /**
  37249. * @member {Array.<string>} [SuperMap.ThemeParameters.prototype.displayFilters]
  37250. * @description 专题图属性过滤条件。
  37251. */
  37252. this.displayFilters = null;
  37253. /**
  37254. * @member {Array.<string>} [SuperMap.ThemeParameters.prototype.displayOrderBys]
  37255. * @description 专题图对象生成符号叠加次序排序字段。
  37256. */
  37257. this.displayOrderBys = null;
  37258. /**
  37259. * @member {Object} [SuperMap.ThemeParameters.prototype.fieldValuesDisplayFilter]
  37260. * @property {Array.<number>} values - 需要过滤的值。
  37261. * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
  37262. * @property {string} fieldValuesDisplayMode - 目前为 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  37263. */
  37264. this.fieldValuesDisplayFilter = null;
  37265. if (options) {
  37266. Util.extend(this, options);
  37267. }
  37268. this.CLASS_NAME = "SuperMap.ThemeParameters";
  37269. }
  37270. /**
  37271. * @function SuperMap.ThemeParameters.prototype.destroy
  37272. * @description 释放资源,将引用资源的属性置空。
  37273. */
  37274. ThemeParameters_createClass(ThemeParameters, [{
  37275. key: "destroy",
  37276. value: function destroy() {
  37277. var me = this;
  37278. me.datasetNames = null;
  37279. me.dataSourceNames = null;
  37280. if (me.joinItems) {
  37281. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  37282. joinItems[i].destroy();
  37283. }
  37284. me.joinItems = null;
  37285. }
  37286. if (me.themes) {
  37287. for (var _i = 0, themes = me.themes, _len = themes.length; _i < _len; _i++) {
  37288. themes[_i].destroy();
  37289. }
  37290. me.themes = null;
  37291. }
  37292. }
  37293. }]);
  37294. return ThemeParameters;
  37295. }();
  37296. SuperMap.ThemeParameters = ThemeParameters;
  37297. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeService.js
  37298. function ThemeService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeService_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeService_typeof(obj); }
  37299. function ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37300. 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); } }
  37301. function ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeService_defineProperties(Constructor, staticProps); return Constructor; }
  37302. function ThemeService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeService_get = Reflect.get; } else { ThemeService_get = function _get(target, property, receiver) { var base = ThemeService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ThemeService_get(target, property, receiver || target); }
  37303. function ThemeService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeService_getPrototypeOf(object); if (object === null) break; } return object; }
  37304. function ThemeService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThemeService_setPrototypeOf(subClass, superClass); }
  37305. function ThemeService_setPrototypeOf(o, p) { ThemeService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeService_setPrototypeOf(o, p); }
  37306. 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); }; }
  37307. function ThemeService_possibleConstructorReturn(self, call) { if (call && (ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeService_assertThisInitialized(self); }
  37308. function ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37309. function ThemeService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  37310. function ThemeService_getPrototypeOf(o) { ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeService_getPrototypeOf(o); }
  37311. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37312. * This program are made available under the terms of the Apache License, Version 2.0
  37313. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37314. /**
  37315. * @class SuperMap.ThemeService
  37316. * @category iServer Map Theme
  37317. * @classdesc 专题图服务类。
  37318. * @extends {SuperMap.CommonServiceBase}
  37319. * @example
  37320. * var myThemeService = new SuperMap.ThemeService(url, {
  37321. * eventListeners: {
  37322. * "processCompleted": themeCompleted,
  37323. * "processFailed": themeFailed
  37324. * }
  37325. * });
  37326. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  37327. * @param {Object} options - 参数。
  37328. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  37329. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37330. * @param {Object} [options.headers] - 请求头。
  37331. */
  37332. var ThemeService_ThemeService = /*#__PURE__*/function (_CommonServiceBase) {
  37333. ThemeService_inherits(ThemeService, _CommonServiceBase);
  37334. var _super = ThemeService_createSuper(ThemeService);
  37335. function ThemeService(url, options) {
  37336. var _this;
  37337. ThemeService_classCallCheck(this, ThemeService);
  37338. _this = _super.call(this, url, options);
  37339. if (options) {
  37340. SuperMap.Util.extend(ThemeService_assertThisInitialized(_this), options);
  37341. }
  37342. _this.url = Util.urlPathAppend(_this.url, 'tempLayersSet');
  37343. _this.CLASS_NAME = 'SuperMap.ThemeService';
  37344. return _this;
  37345. }
  37346. /**
  37347. * @override
  37348. */
  37349. ThemeService_createClass(ThemeService, [{
  37350. key: "destroy",
  37351. value: function destroy() {
  37352. ThemeService_get(ThemeService_getPrototypeOf(ThemeService.prototype), "destroy", this).call(this);
  37353. }
  37354. /**
  37355. * @function SuperMap.ThemeService.prototype.processAsync
  37356. * @description 负责将客户端的专题图参数传递到服务端。
  37357. * @param {SuperMap.ThemeParameters} params - 专题图参数类。
  37358. */
  37359. }, {
  37360. key: "processAsync",
  37361. value: function processAsync(params) {
  37362. if (!(params instanceof ThemeParameters)) {
  37363. return;
  37364. }
  37365. var me = this,
  37366. jsonParameters = null;
  37367. jsonParameters = me.getJsonParameters(params);
  37368. me.request({
  37369. method: "POST",
  37370. data: jsonParameters,
  37371. scope: me,
  37372. success: me.serviceProcessCompleted,
  37373. failure: me.serviceProcessFailed
  37374. });
  37375. }
  37376. /**
  37377. * @function SuperMap.ThemeService.prototype.getJsonParameters
  37378. * @description 将专题图参数参数转化为 JSON 字符串。
  37379. * @param {SuperMap.ThemeParameters} parameter - 专题图参数类。
  37380. * @returns {Object} 转化后的JSON字符串。
  37381. */
  37382. }, {
  37383. key: "getJsonParameters",
  37384. value: function getJsonParameters(parameter) {
  37385. var jsonParameters = "",
  37386. themeObj = null,
  37387. filters = null,
  37388. orderBys = null,
  37389. fieldValuesDisplayFilter;
  37390. jsonParameters += "[{'type': 'UGC','subLayers': {'layers': [";
  37391. for (var i = 0; i < parameter.themes.length; i++) {
  37392. themeObj = parameter.themes[i];
  37393. var jsonTheme = Util.toJSON(themeObj);
  37394. jsonTheme = jsonTheme.slice(0, -1);
  37395. jsonParameters += "{'theme': " + jsonTheme + "},'type': 'UGC','ugcLayerType': 'THEME',";
  37396. filters = parameter.displayFilters;
  37397. if (filters && filters.length > 0) {
  37398. if (filters.length === 1) {
  37399. jsonParameters += "'displayFilter':\"" + filters[0] + "\",";
  37400. } else {
  37401. jsonParameters += "'displayFilter':\"" + filters[i] + "\",";
  37402. }
  37403. }
  37404. orderBys = parameter.displayOrderBy;
  37405. if (orderBys && orderBys.length > 0) {
  37406. if (orderBys.length === 1) {
  37407. jsonParameters += "'displayOrderBy':'" + orderBys[0] + "',";
  37408. } else {
  37409. jsonParameters += "'displayOrderBy':'" + orderBys[i] + "',";
  37410. }
  37411. }
  37412. fieldValuesDisplayFilter = parameter.fieldValuesDisplayFilter;
  37413. if (fieldValuesDisplayFilter) {
  37414. jsonParameters += "'fieldValuesDisplayFilter':" + Util.toJSON(fieldValuesDisplayFilter) + ",";
  37415. }
  37416. if (parameter.joinItems && parameter.joinItems.length > 0 && parameter.joinItems[i]) {
  37417. jsonParameters += "'joinItems':[" + Util.toJSON(parameter.joinItems[i]) + "],";
  37418. }
  37419. if (parameter.datasetNames && parameter.dataSourceNames) {
  37420. var datasetID = parameter.datasetNames[i] ? i : parameter.datasetNames.length - 1;
  37421. var dataSourceID = parameter.dataSourceNames[i] ? i : parameter.dataSourceNames.length - 1;
  37422. jsonParameters += "'datasetInfo': {'name': '" + parameter.datasetNames[datasetID] + "','dataSourceName': '" + parameter.dataSourceNames[dataSourceID] + "'}},";
  37423. } else {
  37424. jsonParameters += "},";
  37425. }
  37426. } //去除多余的逗号
  37427. if (parameter.themes && parameter.themes.length > 0) {
  37428. jsonParameters = jsonParameters.substring(0, jsonParameters.length - 1);
  37429. }
  37430. jsonParameters += "]},";
  37431. var urlArray = this.url.split("/");
  37432. var jsonMapName = urlArray[urlArray.length - 2];
  37433. jsonParameters += "'name': '" + jsonMapName + "'}]";
  37434. return jsonParameters;
  37435. }
  37436. }]);
  37437. return ThemeService;
  37438. }(CommonServiceBase);
  37439. SuperMap.ThemeService = ThemeService_ThemeService;
  37440. ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystService.js
  37441. function ThiessenAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThiessenAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { ThiessenAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThiessenAnalystService_typeof(obj); }
  37442. function ThiessenAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37443. 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); } }
  37444. function ThiessenAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  37445. function ThiessenAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThiessenAnalystService_get = Reflect.get; } else { ThiessenAnalystService_get = function _get(target, property, receiver) { var base = ThiessenAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ThiessenAnalystService_get(target, property, receiver || target); }
  37446. function ThiessenAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThiessenAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  37447. function ThiessenAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThiessenAnalystService_setPrototypeOf(subClass, superClass); }
  37448. function ThiessenAnalystService_setPrototypeOf(o, p) { ThiessenAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThiessenAnalystService_setPrototypeOf(o, p); }
  37449. 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); }; }
  37450. function ThiessenAnalystService_possibleConstructorReturn(self, call) { if (call && (ThiessenAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return ThiessenAnalystService_assertThisInitialized(self); }
  37451. function ThiessenAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37452. function ThiessenAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  37453. function ThiessenAnalystService_getPrototypeOf(o) { ThiessenAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThiessenAnalystService_getPrototypeOf(o); }
  37454. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37455. * This program are made available under the terms of the Apache License, Version 2.0
  37456. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37457. /**
  37458. * @class SuperMap.ThiessenAnalystService
  37459. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  37460. * @classdesc
  37461. * 泰森多边形分析服务类
  37462. * 该类负责将客户设置的泰森多边形分析参数传递给服务端,并接收服务端返回的分析结果数据。
  37463. * 泰森多边形分析结果通过该类支持的事件的监听函数参数获取
  37464. * 泰森多边形分析的参数支持两种,当参数为 {SuperMap.DatasetThiessenAnalystParameters} 类型
  37465. * 时,执行数据集泰森多边形分析,当参数为 {SuperMap.GeometryThiessenAnalystParameters} 类型时,
  37466. * 执行几何对象泰森多边形分析。
  37467. * @param url - {string} 服务的访问地址。
  37468. * 如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  37469. * @param {Object} options - 参数。</br>
  37470. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  37471. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37472. * @param {Object} [options.headers] - 请求头。
  37473. * @extends {SuperMap.SpatialAnalystBase}
  37474. * @example 例如:
  37475. * (start code)
  37476. * var myThiessenAnalystService = new SuperMap.ThiessenAnalystService(url, {
  37477. * eventListeners: {
  37478. * "processCompleted": bufferCompleted,
  37479. * "processFailed": bufferFailed
  37480. * }
  37481. * });
  37482. * (end)
  37483. *
  37484. */
  37485. var ThiessenAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  37486. ThiessenAnalystService_inherits(ThiessenAnalystService, _SpatialAnalystBase);
  37487. var _super = ThiessenAnalystService_createSuper(ThiessenAnalystService);
  37488. function ThiessenAnalystService(url, options) {
  37489. var _this;
  37490. ThiessenAnalystService_classCallCheck(this, ThiessenAnalystService);
  37491. _this = _super.call(this, url, options);
  37492. /**
  37493. * @member {string} SuperMap.ThiessenAnalystService.prototype.mode
  37494. * @description 缓冲区分析类型
  37495. */
  37496. _this.mode = null;
  37497. if (options) {
  37498. Util.extend(ThiessenAnalystService_assertThisInitialized(_this), options);
  37499. }
  37500. _this.CLASS_NAME = "SuperMap.ThiessenAnalystService";
  37501. return _this;
  37502. }
  37503. /**
  37504. * @override
  37505. */
  37506. ThiessenAnalystService_createClass(ThiessenAnalystService, [{
  37507. key: "destroy",
  37508. value: function destroy() {
  37509. ThiessenAnalystService_get(ThiessenAnalystService_getPrototypeOf(ThiessenAnalystService.prototype), "destroy", this).call(this);
  37510. this.mode = null;
  37511. }
  37512. /**
  37513. * @function SuperMap.ThiessenAnalystService.prototype.processAsync
  37514. * @description 负责将客户端的查询参数传递到服务端。
  37515. * @param {(SuperMap.DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters)} parameter - 泰森多边形分析参数基类。
  37516. */
  37517. }, {
  37518. key: "processAsync",
  37519. value: function processAsync(parameter) {
  37520. var parameterObject = {};
  37521. var me = this;
  37522. if (parameter instanceof DatasetThiessenAnalystParameters) {
  37523. me.mode = "datasets";
  37524. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/thiessenpolygon');
  37525. DatasetThiessenAnalystParameters.toObject(parameter, parameterObject);
  37526. } else if (parameter instanceof GeometryThiessenAnalystParameters) {
  37527. me.mode = "geometry";
  37528. me.url = Util.urlPathAppend(me.url, 'geometry/thiessenpolygon');
  37529. GeometryThiessenAnalystParameters.toObject(parameter, parameterObject);
  37530. }
  37531. var jsonParameters = Util.toJSON(parameterObject);
  37532. me.url = Util.urlAppend(me.url, 'returnContent=true');
  37533. me.request({
  37534. method: "POST",
  37535. data: jsonParameters,
  37536. scope: me,
  37537. success: me.serviceProcessCompleted,
  37538. failure: me.serviceProcessFailed
  37539. });
  37540. }
  37541. }]);
  37542. return ThiessenAnalystService;
  37543. }(SpatialAnalystBase);
  37544. SuperMap.ThiessenAnalystService = ThiessenAnalystService;
  37545. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBatchAnalystService.js
  37546. function GeometryBatchAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeometryBatchAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { GeometryBatchAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeometryBatchAnalystService_typeof(obj); }
  37547. function GeometryBatchAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37548. 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); } }
  37549. function GeometryBatchAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBatchAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBatchAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  37550. function GeometryBatchAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryBatchAnalystService_get = Reflect.get; } else { GeometryBatchAnalystService_get = function _get(target, property, receiver) { var base = GeometryBatchAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeometryBatchAnalystService_get(target, property, receiver || target); }
  37551. function GeometryBatchAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBatchAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  37552. function GeometryBatchAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeometryBatchAnalystService_setPrototypeOf(subClass, superClass); }
  37553. function GeometryBatchAnalystService_setPrototypeOf(o, p) { GeometryBatchAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBatchAnalystService_setPrototypeOf(o, p); }
  37554. 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); }; }
  37555. function GeometryBatchAnalystService_possibleConstructorReturn(self, call) { if (call && (GeometryBatchAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryBatchAnalystService_assertThisInitialized(self); }
  37556. function GeometryBatchAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37557. function GeometryBatchAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  37558. function GeometryBatchAnalystService_getPrototypeOf(o) { GeometryBatchAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBatchAnalystService_getPrototypeOf(o); }
  37559. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37560. * This program are made available under the terms of the Apache License, Version 2.0
  37561. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37562. /**
  37563. * @class SuperMap.GeometryBatchAnalystService
  37564. * @category iServer SpatialAnalyst BatchAnalyst
  37565. * @classdesc 批量空间分析服务类
  37566. * @description 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  37567. * 叠加分析结果通过该类支持的事件的监听函数参数获取,参数类型为 {<SuperMap.REST.OverlayAnalystEventArgs>}; 获取的结果数据包括 originResult 、result 两种,
  37568. * 其中,originResult 为服务端返回的用 JSON 对象表示的量算结果数据,result 为服务端返回的量算结果数据。
  37569. * @extends {SuperMap.SpatialAnalystBase}
  37570. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  37571. * @param {Object} options - 参数。
  37572. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  37573. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37574. * @param {Object} [options.headers] - 请求头。
  37575. * @example
  37576. * var myOverlayAnalystService = new SuperMap.REST.GeometryBatchAnalystService(url, {
  37577. * eventListeners: {
  37578. * "processCompleted": OverlayCompleted,
  37579. * "processFailed": OverlayFailed
  37580. * }
  37581. * });
  37582. */
  37583. var GeometryBatchAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  37584. GeometryBatchAnalystService_inherits(GeometryBatchAnalystService, _SpatialAnalystBase);
  37585. var _super = GeometryBatchAnalystService_createSuper(GeometryBatchAnalystService);
  37586. function GeometryBatchAnalystService(url, options) {
  37587. var _this;
  37588. GeometryBatchAnalystService_classCallCheck(this, GeometryBatchAnalystService);
  37589. _this = _super.call(this, url, options);
  37590. if (options) {
  37591. Util.extend(GeometryBatchAnalystService_assertThisInitialized(_this), options);
  37592. }
  37593. _this.CLASS_NAME = "SuperMap.GeometryBatchAnalystService";
  37594. return _this;
  37595. }
  37596. /**
  37597. * @function SuperMap.GeometryBatchAnalystService.prototype.processAsync
  37598. * @description 负责将客户端的查询参数传递到服务端。
  37599. * @param {SuperMap.GeometryBatchOverlayAnalystParameters} parameter - 批量几何对象叠加分析参数类
  37600. *
  37601. */
  37602. GeometryBatchAnalystService_createClass(GeometryBatchAnalystService, [{
  37603. key: "processAsync",
  37604. value: function processAsync(parameters) {
  37605. var me = this;
  37606. me.url = Util.urlPathAppend(me.url, 'geometry/batchanalyst');
  37607. me.url = Util.urlAppend(me.url, 'returnContent=true&ignoreAnalystParam=true');
  37608. var parameterObjects = me._processParams(parameters);
  37609. var jsonParameters = Util.toJSON(parameterObjects);
  37610. me.request({
  37611. method: "POST",
  37612. data: jsonParameters,
  37613. scope: me,
  37614. success: me.serviceProcessCompleted,
  37615. failure: me.serviceProcessFailed
  37616. });
  37617. }
  37618. }, {
  37619. key: "_processParams",
  37620. value: function _processParams(parameters) {
  37621. var me = this;
  37622. if (!Util.isArray(parameters)) {
  37623. return;
  37624. }
  37625. var processParams = [];
  37626. parameters.map(function (item) {
  37627. processParams.push(me._toJSON(item));
  37628. return item;
  37629. });
  37630. return processParams;
  37631. }
  37632. }, {
  37633. key: "_toJSON",
  37634. value: function _toJSON(parameter) {
  37635. var tempObj = {};
  37636. if (parameter.analystName === "buffer") {
  37637. tempObj.analystName = "buffer";
  37638. tempObj.param = {}; //几何对象的批量空间分析,
  37639. GeometryBufferAnalystParameters.toObject(parameter.param, tempObj.param);
  37640. } else if (parameter.analystName === "overlay") {
  37641. tempObj.analystName = "overlay";
  37642. tempObj.param = {};
  37643. GeometryOverlayAnalystParameters.toObject(parameter.param, tempObj.param);
  37644. } else if (parameter.analystName === "interpolationDensity") {
  37645. tempObj.analystName = "interpolationDensity";
  37646. tempObj.param = {};
  37647. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  37648. } else if (parameter.analystName === "interpolationidw") {
  37649. tempObj.analystName = "interpolationidw";
  37650. tempObj.param = {};
  37651. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  37652. } else if (parameter.analystName === "interpolationRBF") {
  37653. tempObj.analystName = "interpolationRBF";
  37654. tempObj.param = {};
  37655. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  37656. } else if (parameter.analystName === "interpolationKriging") {
  37657. tempObj.analystName = "interpolationKriging";
  37658. tempObj.param = {};
  37659. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  37660. } else if (parameter.analystName === "thiessenpolygon") {
  37661. tempObj.analystName = "thiessenpolygon";
  37662. tempObj.param = {};
  37663. GeometryThiessenAnalystParameters.toObject(parameter.param, tempObj.param);
  37664. } else {
  37665. //isoline; isoregion; calculatemeasure; routelocator 四种分析不需要再处理参数
  37666. return parameter;
  37667. }
  37668. return tempObj;
  37669. }
  37670. /**
  37671. * @override
  37672. */
  37673. }, {
  37674. key: "destroy",
  37675. value: function destroy() {
  37676. GeometryBatchAnalystService_get(GeometryBatchAnalystService_getPrototypeOf(GeometryBatchAnalystService.prototype), "destroy", this).call(this);
  37677. }
  37678. }]);
  37679. return GeometryBatchAnalystService;
  37680. }(SpatialAnalystBase);
  37681. SuperMap.GeometryBatchAnalystService = GeometryBatchAnalystService;
  37682. ;// CONCATENATED MODULE: ./src/common/iServer/TilesetsService.js
  37683. function TilesetsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TilesetsService_typeof = function _typeof(obj) { return typeof obj; }; } else { TilesetsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TilesetsService_typeof(obj); }
  37684. function TilesetsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37685. 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); } }
  37686. function TilesetsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TilesetsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TilesetsService_defineProperties(Constructor, staticProps); return Constructor; }
  37687. function TilesetsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TilesetsService_get = Reflect.get; } else { TilesetsService_get = function _get(target, property, receiver) { var base = TilesetsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return TilesetsService_get(target, property, receiver || target); }
  37688. function TilesetsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TilesetsService_getPrototypeOf(object); if (object === null) break; } return object; }
  37689. function TilesetsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) TilesetsService_setPrototypeOf(subClass, superClass); }
  37690. function TilesetsService_setPrototypeOf(o, p) { TilesetsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TilesetsService_setPrototypeOf(o, p); }
  37691. 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); }; }
  37692. function TilesetsService_possibleConstructorReturn(self, call) { if (call && (TilesetsService_typeof(call) === "object" || typeof call === "function")) { return call; } return TilesetsService_assertThisInitialized(self); }
  37693. function TilesetsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37694. function TilesetsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  37695. function TilesetsService_getPrototypeOf(o) { TilesetsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TilesetsService_getPrototypeOf(o); }
  37696. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37697. * This program are made available under the terms of the Apache License, Version 2.0
  37698. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37699. /**
  37700. * @class SuperMap.TilesetsService
  37701. * @category iServer Map Tilesets
  37702. * @classdesc 切片列表信息查询服务类;即查询切片地图服务的切片列表,返回切片集名称、地图切片元数据信息、切片版本集信息。
  37703. * @extends {SuperMap.CommonServiceBase}
  37704. * @param {string} url - 地图服务地址。URL 应为:
  37705. * http://{服务器地址}:{服务端口号}/iserver/services/{服务名}/rest/maps/map;
  37706. * 例如: "http://localhost:8090/iserver/services/test/rest/maps/tianlocal"。
  37707. * @param {Object} options - 参数。
  37708. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  37709. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  37710. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  37711. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37712. * @param {Object} [options.headers] - 请求头。
  37713. */
  37714. var TilesetsService = /*#__PURE__*/function (_CommonServiceBase) {
  37715. TilesetsService_inherits(TilesetsService, _CommonServiceBase);
  37716. var _super = TilesetsService_createSuper(TilesetsService);
  37717. function TilesetsService(url, options) {
  37718. var _this;
  37719. TilesetsService_classCallCheck(this, TilesetsService);
  37720. _this = _super.call(this, url, options);
  37721. _this.CLASS_NAME = "SuperMap.TilesetsService";
  37722. return _this;
  37723. }
  37724. /**
  37725. * @override
  37726. */
  37727. TilesetsService_createClass(TilesetsService, [{
  37728. key: "destroy",
  37729. value: function destroy() {
  37730. TilesetsService_get(TilesetsService_getPrototypeOf(TilesetsService.prototype), "destroy", this).call(this);
  37731. }
  37732. /**
  37733. * @function SuperMap.TilesetsService.prototype.processAsync
  37734. * @description 负责将客户端的查询参数传递到服务端。
  37735. */
  37736. }, {
  37737. key: "processAsync",
  37738. value: function processAsync() {
  37739. if (!this.url) {
  37740. return;
  37741. }
  37742. var me = this;
  37743. me.url = Util.urlPathAppend(me.url, 'tilesets');
  37744. me.request({
  37745. method: "GET",
  37746. scope: me,
  37747. success: me.serviceProcessCompleted,
  37748. failure: me.serviceProcessFailed
  37749. });
  37750. }
  37751. }]);
  37752. return TilesetsService;
  37753. }(CommonServiceBase);
  37754. SuperMap.TilesetsService = TilesetsService;
  37755. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsParameter.js
  37756. function TopologyValidatorJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37757. 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); } }
  37758. function TopologyValidatorJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  37759. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37760. * This program are made available under the terms of the Apache License, Version 2.0
  37761. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37762. /**
  37763. * @class SuperMap.TopologyValidatorJobsParameter
  37764. * @category iServer ProcessingService TopologyValidator
  37765. * @classdesc 拓扑检查分析任务参数类。
  37766. * @param {Object} options - 必填参数。
  37767. * @param {string} options.datasetName - 数据集名。
  37768. * @param {string} options.datasetTopology -检查对象所在的数据集名称。
  37769. * @param {SuperMap.TopologyValidatorRule} [options.rule=SuperMap.TopologyValidatorRule.REGIONNOOVERLAP] - 拓扑检查规则。
  37770. * @param {string} [options.tolerance] - 容限。
  37771. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  37772. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  37773. */
  37774. var TopologyValidatorJobsParameter = /*#__PURE__*/function () {
  37775. function TopologyValidatorJobsParameter(options) {
  37776. TopologyValidatorJobsParameter_classCallCheck(this, TopologyValidatorJobsParameter);
  37777. if (!options) {
  37778. return;
  37779. }
  37780. /**
  37781. * @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetName
  37782. * @description 数据集名。
  37783. */
  37784. this.datasetName = "";
  37785. /**
  37786. * @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetTopology
  37787. * @description 拓扑检查对象所在的数据集名称。
  37788. */
  37789. this.datasetTopology = "";
  37790. /**
  37791. * @member {string} [SuperMap.TopologyValidatorJobsParameter.prototype.tolerance]
  37792. * @description 容限,指定的拓扑错误检查时使用的容限。
  37793. */
  37794. this.tolerance = "";
  37795. /**
  37796. * @member {SuperMap.TopologyValidatorRule} [SuperMap.TopologyValidatorJobsParameter.prototype.rule=SuperMap.TopologyValidatorRule.REGIONNOOVERLAP]
  37797. * @description 拓扑检查模式。
  37798. */
  37799. this.rule = TopologyValidatorRule.REGIONNOOVERLAP;
  37800. /**
  37801. * @member {SuperMap.OutputSetting} [SuperMap.TopologyValidatorJobsParameter.prototype.output]
  37802. * @description 输出参数设置类。
  37803. */
  37804. this.output = null;
  37805. /**
  37806. * @member {SuperMap.MappingParameters} [SuperMap.TopologyValidatorJobsParameter.prototype.mappingParameters]
  37807. * @description 分析后结果可视化的参数类。
  37808. */
  37809. this.mappingParameters = null;
  37810. Util.extend(this, options);
  37811. this.CLASS_NAME = "SuperMap.TopologyValidatorJobsParameter";
  37812. }
  37813. /**
  37814. * @function SuperMap.TopologyValidatorJobsParameter.prototype.destroy
  37815. * @description 释放资源,将引用资源的属性置空。
  37816. */
  37817. TopologyValidatorJobsParameter_createClass(TopologyValidatorJobsParameter, [{
  37818. key: "destroy",
  37819. value: function destroy() {
  37820. this.datasetName = null;
  37821. this.datasetTopology = null;
  37822. this.tolerance = null;
  37823. this.rule = null;
  37824. if (this.output instanceof OutputSetting) {
  37825. this.output.destroy();
  37826. this.output = null;
  37827. }
  37828. if (this.mappingParameters instanceof MappingParameters) {
  37829. this.mappingParameters.destroy();
  37830. this.mappingParameters = null;
  37831. }
  37832. }
  37833. /**
  37834. * @function SuperMap.TopologyValidatorJobsParameter.toObject
  37835. * @param {Object} TopologyValidatorJobsParameter -拓扑检查分析任务参数。
  37836. * @param {Object} tempObj - 目标对象。
  37837. * @description 生成拓扑检查分析任务对象。
  37838. */
  37839. }], [{
  37840. key: "toObject",
  37841. value: function toObject(TopologyValidatorJobsParameter, tempObj) {
  37842. for (var name in TopologyValidatorJobsParameter) {
  37843. if (name === "datasetName") {
  37844. tempObj['input'] = tempObj['input'] || {};
  37845. tempObj['input'][name] = TopologyValidatorJobsParameter[name];
  37846. continue;
  37847. }
  37848. if (name === "output") {
  37849. tempObj['output'] = tempObj['output'] || {};
  37850. tempObj['output'] = TopologyValidatorJobsParameter[name];
  37851. continue;
  37852. }
  37853. tempObj['analyst'] = tempObj['analyst'] || {};
  37854. tempObj['analyst'][name] = TopologyValidatorJobsParameter[name];
  37855. if (name === 'mappingParameters') {
  37856. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  37857. tempObj['analyst']['mappingParameters'] = TopologyValidatorJobsParameter[name];
  37858. }
  37859. }
  37860. }
  37861. }]);
  37862. return TopologyValidatorJobsParameter;
  37863. }();
  37864. SuperMap.TopologyValidatorJobsParameter = TopologyValidatorJobsParameter;
  37865. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsService.js
  37866. function TopologyValidatorJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TopologyValidatorJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { TopologyValidatorJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TopologyValidatorJobsService_typeof(obj); }
  37867. function TopologyValidatorJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37868. 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); } }
  37869. function TopologyValidatorJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  37870. function TopologyValidatorJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TopologyValidatorJobsService_get = Reflect.get; } else { TopologyValidatorJobsService_get = function _get(target, property, receiver) { var base = TopologyValidatorJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return TopologyValidatorJobsService_get(target, property, receiver || target); }
  37871. function TopologyValidatorJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TopologyValidatorJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  37872. function TopologyValidatorJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) TopologyValidatorJobsService_setPrototypeOf(subClass, superClass); }
  37873. function TopologyValidatorJobsService_setPrototypeOf(o, p) { TopologyValidatorJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TopologyValidatorJobsService_setPrototypeOf(o, p); }
  37874. 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); }; }
  37875. function TopologyValidatorJobsService_possibleConstructorReturn(self, call) { if (call && (TopologyValidatorJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return TopologyValidatorJobsService_assertThisInitialized(self); }
  37876. function TopologyValidatorJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37877. function TopologyValidatorJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  37878. function TopologyValidatorJobsService_getPrototypeOf(o) { TopologyValidatorJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TopologyValidatorJobsService_getPrototypeOf(o); }
  37879. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37880. * This program are made available under the terms of the Apache License, Version 2.0
  37881. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37882. /**
  37883. * @class SuperMap.TopologyValidatorJobsService
  37884. * @category iServer ProcessingService TopologyValidator
  37885. * @classdesc 拓扑检查分析服务类
  37886. * @extends {SuperMap.ProcessingServiceBase}
  37887. * @param {string} url - 拓扑检查分析服务地址。
  37888. * @param {Object} options - 参数。
  37889. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37890. * @param {Object} [options.headers] - 请求头。
  37891. */
  37892. var TopologyValidatorJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  37893. TopologyValidatorJobsService_inherits(TopologyValidatorJobsService, _ProcessingServiceBas);
  37894. var _super = TopologyValidatorJobsService_createSuper(TopologyValidatorJobsService);
  37895. function TopologyValidatorJobsService(url, options) {
  37896. var _this;
  37897. TopologyValidatorJobsService_classCallCheck(this, TopologyValidatorJobsService);
  37898. _this = _super.call(this, url, options);
  37899. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/topologyvalidator');
  37900. _this.CLASS_NAME = "SuperMap.TopologyValidatorJobsService";
  37901. return _this;
  37902. }
  37903. /**
  37904. *@override
  37905. */
  37906. TopologyValidatorJobsService_createClass(TopologyValidatorJobsService, [{
  37907. key: "destroy",
  37908. value: function destroy() {
  37909. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "destroy", this).call(this);
  37910. }
  37911. /**
  37912. * @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJobs
  37913. * @description 获取拓扑检查分析所有任务
  37914. */
  37915. }, {
  37916. key: "getTopologyValidatorJobs",
  37917. value: function getTopologyValidatorJobs() {
  37918. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, this.url);
  37919. }
  37920. /**
  37921. * @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJob
  37922. * @description 获取指定id的拓扑检查分析服务
  37923. * @param {string} id - 指定要获取数据的id
  37924. */
  37925. }, {
  37926. key: "getTopologyValidatorJob",
  37927. value: function getTopologyValidatorJob(id) {
  37928. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  37929. }
  37930. /**
  37931. * @function SuperMap.TopologyValidatorJobsService.protitype.addTopologyValidatorJob
  37932. * @description 新建拓扑检查分析服务
  37933. * @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
  37934. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  37935. */
  37936. }, {
  37937. key: "addTopologyValidatorJob",
  37938. value: function addTopologyValidatorJob(params, seconds) {
  37939. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "addJob", this).call(this, this.url, params, TopologyValidatorJobsParameter, seconds);
  37940. }
  37941. }]);
  37942. return TopologyValidatorJobsService;
  37943. }(ProcessingServiceBase);
  37944. SuperMap.TopologyValidatorJobsService = TopologyValidatorJobsService;
  37945. ;// CONCATENATED MODULE: ./src/common/iServer/TransferLine.js
  37946. function TransferLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37947. 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); } }
  37948. function TransferLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferLine_defineProperties(Constructor, staticProps); return Constructor; }
  37949. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37950. * This program are made available under the terms of the Apache License, Version 2.0
  37951. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37952. /**
  37953. * @class SuperMap.TransferLine
  37954. * @category iServer TrafficTransferAnalyst TransferPath
  37955. * @classdesc 换乘路线信息类。
  37956. * @param {Object} options - 参数。
  37957. * @param {number} options.lineID - 乘车路线 ID。
  37958. * @param {string} options.lineName - 乘车路线名称。
  37959. * @param {string} options.lineAliasName - 乘车路线别名。
  37960. * @param {number} options.startStopIndex - 上车站点在本公交路线中的索引。
  37961. * @param {string} options.startStopName - 上车站点名称。
  37962. * @param {string} options.startStopAliasName - 上车站点别名。
  37963. * @param {number} options.endStopIndex - 下车站点在本公交路线中的索引。
  37964. * @param {string} options.endStopName - 下车站点名称。
  37965. * @param {string} options.endStopAliasName - 下车站点别名。
  37966. */
  37967. var TransferLine = /*#__PURE__*/function () {
  37968. function TransferLine(options) {
  37969. TransferLine_classCallCheck(this, TransferLine);
  37970. options = options || {};
  37971. /**
  37972. * @member {number} SuperMap.TransferLine.prototype.lineID
  37973. * @description 乘车路线 ID。
  37974. */
  37975. this.lineID = null;
  37976. /**
  37977. * @member {string} SuperMap.TransferLine.prototype.lineName
  37978. * @description 乘车路线名称。
  37979. */
  37980. this.lineName = null;
  37981. /**
  37982. * @member {string} SuperMap.TransferLine.prototype.lineAliasName
  37983. * @description 乘车路线别名。
  37984. */
  37985. this.lineAliasName = null;
  37986. /**
  37987. * @member {number} SuperMap.TransferLine.prototype.startStopIndex
  37988. * @description 上车站点在本公交路线中的索引。
  37989. */
  37990. this.startStopIndex = null;
  37991. /**
  37992. * @member {string} SuperMap.TransferLine.prototype.startStopName
  37993. * @description 上车站点名称。
  37994. */
  37995. this.startStopName = null;
  37996. /**
  37997. * @member {string} SuperMap.TransferLine.prototype.startStopAliasName
  37998. * @description 上车站点别名。
  37999. */
  38000. this.startStopAliasName = null;
  38001. /**
  38002. * @member {number} SuperMap.TransferLine.prototype.endStopIndex
  38003. * @description 下车站点在本公交路线中的索引。
  38004. */
  38005. this.endStopIndex = null;
  38006. /**
  38007. * @member {string} SuperMap.TransferLine.prototype.endStopName
  38008. * @description 下车站点名称。
  38009. */
  38010. this.endStopName = null;
  38011. /**
  38012. * @member {string} SuperMap.TransferLine.prototype.endStopAliasName
  38013. * @description 下车站点别名。
  38014. */
  38015. this.endStopAliasName = null;
  38016. Util.extend(this, options);
  38017. this.CLASS_NAME = "SuperMap.TransferLine";
  38018. }
  38019. /**
  38020. * @function SuperMap.TransferLine.prototype.destroy
  38021. * @description 释放资源,将引用资源的属性置空。
  38022. */
  38023. TransferLine_createClass(TransferLine, [{
  38024. key: "destroy",
  38025. value: function destroy() {
  38026. Util.reset(this);
  38027. }
  38028. /**
  38029. * @function SuperMap.TransferLine.fromJson
  38030. * @description 将返回结果转化为 {@link SuperMap.TransferLine} 对象。
  38031. * @param {Object} jsonObject - 新的返回结果。
  38032. * @returns {SuperMap.TransferLine} 转化后的 {@link SuperMap.TransferLine} 对象。
  38033. */
  38034. }], [{
  38035. key: "fromJson",
  38036. value: function fromJson(jsonObject) {
  38037. if (!jsonObject) {
  38038. return;
  38039. }
  38040. return new TransferLine({
  38041. lineID: jsonObject['lineID'],
  38042. lineName: jsonObject['lineName'],
  38043. lineAliasName: jsonObject['lineAliasName'],
  38044. startStopIndex: jsonObject['startStopIndex'],
  38045. startStopName: jsonObject['startStopName'],
  38046. startStopAliasName: jsonObject['startStopAliasName'],
  38047. endStopIndex: jsonObject['endStopIndex'],
  38048. endStopName: jsonObject['endStopName'],
  38049. endStopAliasName: jsonObject['endStopAliasName']
  38050. });
  38051. }
  38052. }]);
  38053. return TransferLine;
  38054. }();
  38055. SuperMap.TransferLine = TransferLine;
  38056. ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathParameters.js
  38057. function TransferPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38058. 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); } }
  38059. function TransferPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathParameters_defineProperties(Constructor, staticProps); return Constructor; }
  38060. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38061. * This program are made available under the terms of the Apache License, Version 2.0
  38062. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38063. /**
  38064. * @class SuperMap.TransferPathParameters
  38065. * @category iServer TrafficTransferAnalyst TransferPaths
  38066. * @classdesc 交通换乘线路查询参数类。
  38067. * @param {Object} options - 参数。
  38068. * @param {Array.<SuperMap.TransferLine>} options.transferLines - 本换乘分段内可乘车的路线集合。
  38069. * @param {Array.<(string|SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} options.points - 两种查询方式:按照公交站点的起止 ID 进行查询和按照起止点的坐标进行查询。
  38070. *
  38071. */
  38072. var TransferPathParameters = /*#__PURE__*/function () {
  38073. function TransferPathParameters(options) {
  38074. TransferPathParameters_classCallCheck(this, TransferPathParameters);
  38075. options = options || {};
  38076. /**
  38077. * @member {Array.<SuperMap.TransferLine>} SuperMap.TransferPathParameters.prototype.transferLines
  38078. * @description 本换乘分段内可乘车的路线集合,通过交通换乘方案查询得到。
  38079. */
  38080. this.transferLines = null;
  38081. /**
  38082. * @member {Array.<(string|SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.TransferPathParameters.prototype.points
  38083. * @description 两种查询方式:<br>
  38084. * 1. 按照公交站点的起止ID进行查询,则 points 参数的类型为 int[],形如:[起点ID、终点ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  38085. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  38086. */
  38087. this.points = null;
  38088. Util.extend(this, options);
  38089. this.CLASS_NAME = "SuperMap.TransferPathParameters";
  38090. }
  38091. /**
  38092. * @function SuperMap.TransferPathParameters.prototype.destroy
  38093. * @description 释放资源,将引用资源的属性置空。
  38094. */
  38095. TransferPathParameters_createClass(TransferPathParameters, [{
  38096. key: "destroy",
  38097. value: function destroy() {
  38098. Util.reset(this);
  38099. }
  38100. /**
  38101. * @function SuperMap.TransferPathParameters.toJson
  38102. * @description 将 {@link SuperMap.TransferPathParameters} 对象参数转换为 JSON 字符串。
  38103. * @param {SuperMap.TransferPathParameters} params - 交通换乘参数。
  38104. * @returns {string} 转化后的 JSON 字符串。
  38105. */
  38106. }], [{
  38107. key: "toJson",
  38108. value: function toJson(params) {
  38109. if (params) {
  38110. return Util.toJSON(params);
  38111. }
  38112. }
  38113. }]);
  38114. return TransferPathParameters;
  38115. }();
  38116. SuperMap.TransferPathParameters = TransferPathParameters;
  38117. ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathService.js
  38118. function TransferPathService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TransferPathService_typeof = function _typeof(obj) { return typeof obj; }; } else { TransferPathService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TransferPathService_typeof(obj); }
  38119. function TransferPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38120. 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); } }
  38121. function TransferPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathService_defineProperties(Constructor, staticProps); return Constructor; }
  38122. function TransferPathService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TransferPathService_get = Reflect.get; } else { TransferPathService_get = function _get(target, property, receiver) { var base = TransferPathService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return TransferPathService_get(target, property, receiver || target); }
  38123. function TransferPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  38124. function TransferPathService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) TransferPathService_setPrototypeOf(subClass, superClass); }
  38125. function TransferPathService_setPrototypeOf(o, p) { TransferPathService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferPathService_setPrototypeOf(o, p); }
  38126. 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); }; }
  38127. function TransferPathService_possibleConstructorReturn(self, call) { if (call && (TransferPathService_typeof(call) === "object" || typeof call === "function")) { return call; } return TransferPathService_assertThisInitialized(self); }
  38128. function TransferPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38129. function TransferPathService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  38130. function TransferPathService_getPrototypeOf(o) { TransferPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferPathService_getPrototypeOf(o); }
  38131. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38132. * This program are made available under the terms of the Apache License, Version 2.0
  38133. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38134. /**
  38135. * @class SuperMap.TransferPathService
  38136. * @category iServer TrafficTransferAnalyst TransferPath
  38137. * @classdesc 交通换乘线路查询服务类,根据交通换乘分析结果(TransferSolutionResult),获取某一条乘车路线的详细信息。
  38138. * 返回结果通过该类支持的事件的监听函数参数获取
  38139. * @extends {SuperMap.CommonServiceBase}
  38140. * @example 例如:
  38141. * var myService = new SuperMap.TransferPathService(url, {eventListeners: {
  38142. * "processCompleted": TrafficTransferCompleted,
  38143. * "processFailed": TrafficTransferError
  38144. * }
  38145. * };
  38146. * @param {string} url - 与客户端交互的交通换乘线路查询服务地址。
  38147. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  38148. * @param {Object} options - 参数。</br>
  38149. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  38150. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38151. * @param {Object} [options.headers] - 请求头。
  38152. */
  38153. var TransferPathService = /*#__PURE__*/function (_CommonServiceBase) {
  38154. TransferPathService_inherits(TransferPathService, _CommonServiceBase);
  38155. var _super = TransferPathService_createSuper(TransferPathService);
  38156. function TransferPathService(url, options) {
  38157. var _this;
  38158. TransferPathService_classCallCheck(this, TransferPathService);
  38159. _this = _super.call(this, url, options);
  38160. _this.CLASS_NAME = "SuperMap.TransferPathService";
  38161. return _this;
  38162. }
  38163. /**
  38164. * @override
  38165. */
  38166. TransferPathService_createClass(TransferPathService, [{
  38167. key: "destroy",
  38168. value: function destroy() {
  38169. TransferPathService_get(TransferPathService_getPrototypeOf(TransferPathService.prototype), "destroy", this).call(this);
  38170. }
  38171. /**
  38172. * @function SuperMap.TransferPathService.prototype.processAsync
  38173. * @description 负责将客户端的更新参数传递到服务端。
  38174. * @param {SuperMap.TransferPathParameters} params - 交通换乘参数。
  38175. */
  38176. }, {
  38177. key: "processAsync",
  38178. value: function processAsync(params) {
  38179. if (!(params instanceof TransferPathParameters)) {
  38180. return;
  38181. }
  38182. var me = this,
  38183. method = "GET",
  38184. jsonParameters;
  38185. me.url = Util.urlPathAppend(me.url, 'path');
  38186. jsonParameters = {
  38187. points: Util.toJSON(params.points),
  38188. transferLines: Util.toJSON(params['transferLines'])
  38189. };
  38190. me.request({
  38191. method: method,
  38192. params: jsonParameters,
  38193. scope: me,
  38194. success: me.serviceProcessCompleted,
  38195. failure: me.serviceProcessFailed
  38196. });
  38197. }
  38198. }]);
  38199. return TransferPathService;
  38200. }(CommonServiceBase);
  38201. SuperMap.TransferPathService = TransferPathService;
  38202. ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionParameters.js
  38203. function TransferSolutionParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38204. 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); } }
  38205. function TransferSolutionParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionParameters_defineProperties(Constructor, staticProps); return Constructor; }
  38206. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38207. * This program are made available under the terms of the Apache License, Version 2.0
  38208. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38209. /**
  38210. * @class SuperMap.TransferSolutionParameters
  38211. * @category iServer TrafficTransferAnalyst TransferSolutions
  38212. * @classdesc 交通换乘方案查询参数类。
  38213. * @param {Object} options - 参数。
  38214. * @param {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|number)>} options.points - 两种查询方式:按照公交站点的起止ID进行查询和按照起止点的坐标进行查询。
  38215. * @param {number} [options.solutionCount=6] - 乘车方案的数量。
  38216. * @param {SuperMap.TransferTactic} [options.transferTactic=SuperMap.TransferTactic.LESS_TIME] - 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  38217. * @param {SuperMap.TransferPreference} [options.transferPreference=SuperMap.TransferPreference.NONE] - 乘车偏好枚举。
  38218. * @param {number} [options.walkingRatio=10] - 步行与公交的消耗权重比。
  38219. * @param {Array.<number>} [options.evadeLines] - 避让路线的 ID。
  38220. * @param {Array.<number>} [options.evadeStops] - 避让站点的 ID。
  38221. * @param {Array.<number>} [options.priorLines] - 优先路线的 ID。
  38222. * @param {Array.<number>} [options.priorStops] - 优先站点的 ID。
  38223. * @param {string} [options.travelTime] - 出行的时间。
  38224. */
  38225. var TransferSolutionParameters = /*#__PURE__*/function () {
  38226. function TransferSolutionParameters(options) {
  38227. TransferSolutionParameters_classCallCheck(this, TransferSolutionParameters);
  38228. options = options || {};
  38229. /**
  38230. * @member {number} [SuperMap.TransferSolutionParameters.prototype.solutionCount=6]
  38231. * @description 乘车方案的数量。
  38232. */
  38233. this.solutionCount = 6;
  38234. /**
  38235. * @member {SuperMap.TransferPreference} [SuperMap.TransferSolutionParameters.prototype.transferPreference=SuperMap.TransferPreference.NONE]
  38236. * @description 乘车偏好枚举。
  38237. */
  38238. this.transferPreference = TransferPreference.NONE;
  38239. /**
  38240. * @member {SuperMap.TransferTactic} [SuperMap.TransferSolutionParameters.prototype.transferTactic=TransferTactic|SuperMap.TransferTactic.LESS_TIME]
  38241. * @description 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  38242. */
  38243. this.transferTactic = TransferTactic.LESS_TIME;
  38244. /**
  38245. * @member {number} [SuperMap.TransferSolutionParameters.prototype.walkingRatio=10]
  38246. * @description 步行与公交的消耗权重比。此值越大,则步行因素对于方案选择的影响越大。例如:</br>
  38247. * 例如现在有两种换乘方案(在仅考虑消耗因素的情况下):</br>
  38248. * 方案1:坐车 10 公里,走路 1 公里;</br>
  38249. * 方案2:坐车 15 公里,走路 0.5 公里;</br>
  38250. * 1. 假设权重比为 15:</br>
  38251. * •方案 1 的总消耗为:10 + 1*15 = 25</br>
  38252. * •方案 2 的总消耗为:15 + 0.5*15 = 22.5</br>
  38253. * 此时方案 2 消耗更低。</br>
  38254. * 2. 假设权重比为2:</br>
  38255. * •方案 1 的总消耗为:10+1*2 = 12</br>
  38256. * •方案 2 的总消耗为:15+0.5*2 = 17</br>
  38257. * 此时方案 1 消耗更低。</br>
  38258. */
  38259. this.walkingRatio = null;
  38260. /**
  38261. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|string)>} SuperMap.TransferSolutionParameters.prototype.points
  38262. * @description 两种查询方式:</br>
  38263. * 1. 按照公交站点的起止 ID 进行查询,则 points 参数的类型为 int[],形如:[起点 ID、终点 ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  38264. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  38265. */
  38266. this.points = false;
  38267. /**
  38268. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.evadeLinesnull]
  38269. * @description 避让路线 ID。
  38270. * */
  38271. this.evadeLines = null;
  38272. /**
  38273. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.evadeStops=TransferLine]
  38274. * @description 避让站点 ID。
  38275. * */
  38276. this.evadeStops = null;
  38277. /**
  38278. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.priorLines]
  38279. * @description 优先路线 ID。
  38280. * */
  38281. this.priorLines = null;
  38282. /**
  38283. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.priorStops]
  38284. * @description 优先站点 ID。
  38285. * */
  38286. this.priorStops = null;
  38287. /**
  38288. * @member {string} SuperMap.TransferSolutionParameters.prototype.travelTime
  38289. * @description 出行的时间; 格式是:"小时:分钟",如:"08:30"。如果设置了该参数,在分析时,则会考虑线路的首末班车时间的限制,即在返回的结果中会提示公交的首末班发车时间。
  38290. */
  38291. this.travelTime = null;
  38292. Util.extend(this, options);
  38293. this.CLASS_NAME = "SuperMap.TransferSolutionParameters";
  38294. }
  38295. /**
  38296. * @function SuperMap.TransferSolutionParameters.prototype.destroy
  38297. * @description 释放资源,将引用资源的属性置空。
  38298. */
  38299. TransferSolutionParameters_createClass(TransferSolutionParameters, [{
  38300. key: "destroy",
  38301. value: function destroy() {
  38302. Util.reset(this);
  38303. }
  38304. /**
  38305. * @function SuperMap.TransferSolutionParameters.toJsonParameters
  38306. * @description 将 {@link SuperMap.TransferSolutionParameters} 对象参数转换为 JSON 字符串。
  38307. * @param {SuperMap.TransferSolutionParameters} params - 交通换乘参数。
  38308. * @returns {string} 转化后的 JSON 字符串。
  38309. */
  38310. }], [{
  38311. key: "toJson",
  38312. value: function toJson(params) {
  38313. if (params) {
  38314. return Util.toJSON(params);
  38315. }
  38316. }
  38317. }]);
  38318. return TransferSolutionParameters;
  38319. }();
  38320. SuperMap.TransferSolutionParameters = TransferSolutionParameters;
  38321. ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionService.js
  38322. function TransferSolutionService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TransferSolutionService_typeof = function _typeof(obj) { return typeof obj; }; } else { TransferSolutionService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TransferSolutionService_typeof(obj); }
  38323. function TransferSolutionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38324. 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); } }
  38325. function TransferSolutionService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionService_defineProperties(Constructor, staticProps); return Constructor; }
  38326. function TransferSolutionService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TransferSolutionService_get = Reflect.get; } else { TransferSolutionService_get = function _get(target, property, receiver) { var base = TransferSolutionService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return TransferSolutionService_get(target, property, receiver || target); }
  38327. function TransferSolutionService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferSolutionService_getPrototypeOf(object); if (object === null) break; } return object; }
  38328. function TransferSolutionService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) TransferSolutionService_setPrototypeOf(subClass, superClass); }
  38329. function TransferSolutionService_setPrototypeOf(o, p) { TransferSolutionService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferSolutionService_setPrototypeOf(o, p); }
  38330. 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); }; }
  38331. function TransferSolutionService_possibleConstructorReturn(self, call) { if (call && (TransferSolutionService_typeof(call) === "object" || typeof call === "function")) { return call; } return TransferSolutionService_assertThisInitialized(self); }
  38332. function TransferSolutionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38333. function TransferSolutionService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  38334. function TransferSolutionService_getPrototypeOf(o) { TransferSolutionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferSolutionService_getPrototypeOf(o); }
  38335. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38336. * This program are made available under the terms of the Apache License, Version 2.0
  38337. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38338. /**
  38339. * @class SuperMap.TransferSolutionService
  38340. * @category iServer TrafficTransferAnalyst TransferSolutions
  38341. * @classdesc 交通换乘方案查询服务类。
  38342. * 返回结果通过该类支持的事件的监听函数参数获取。
  38343. * @param {string} url - 与客户端交互的交通换乘方案查询服务地址。
  38344. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  38345. * @param {Object} options - 参数。</br>
  38346. * @param {Object} options.eventListeners - 需要被注册的监听器对象。</br>
  38347. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38348. * @param {Object} [options.headers] - 请求头。
  38349. * @extends {SuperMap.CommonServiceBase}
  38350. * @example 例如:
  38351. * (start code)
  38352. * var myService = new SuperMap.TransferSolutionService(url, {eventListeners: {
  38353. * "processCompleted": trafficTransferCompleted,
  38354. * "processFailed": trafficTransferError
  38355. * }
  38356. * };
  38357. * (end)
  38358. *
  38359. */
  38360. var TransferSolutionService = /*#__PURE__*/function (_CommonServiceBase) {
  38361. TransferSolutionService_inherits(TransferSolutionService, _CommonServiceBase);
  38362. var _super = TransferSolutionService_createSuper(TransferSolutionService);
  38363. function TransferSolutionService(url, options) {
  38364. var _this;
  38365. TransferSolutionService_classCallCheck(this, TransferSolutionService);
  38366. _this = _super.call(this, url, options);
  38367. _this.CLASS_NAME = "SuperMap.TransferSolutionService";
  38368. return _this;
  38369. }
  38370. /**
  38371. * @override
  38372. */
  38373. TransferSolutionService_createClass(TransferSolutionService, [{
  38374. key: "destroy",
  38375. value: function destroy() {
  38376. TransferSolutionService_get(TransferSolutionService_getPrototypeOf(TransferSolutionService.prototype), "destroy", this).call(this);
  38377. }
  38378. /**
  38379. * @function SuperMap.TransferSolutionService.prototype.processAsync
  38380. * @description 负责将客户端的更新参数传递到服务端。
  38381. * @param {SuperMap.TransferSolutionParameters} params - 交通换乘参数。
  38382. */
  38383. }, {
  38384. key: "processAsync",
  38385. value: function processAsync(params) {
  38386. if (!(params instanceof TransferSolutionParameters)) {
  38387. return;
  38388. }
  38389. var me = this,
  38390. method = "GET",
  38391. jsonParameters;
  38392. me.url = Util.urlPathAppend(me.url, 'solutions');
  38393. jsonParameters = {
  38394. points: Util.toJSON(params.points),
  38395. walkingRatio: params['walkingRatio'],
  38396. transferTactic: params['transferTactic'],
  38397. solutionCount: params['solutionCount'],
  38398. transferPreference: params["transferPreference"]
  38399. };
  38400. if (params.evadeLines) {
  38401. jsonParameters["evadeLines"] = Util.toJSON(params.evadeLines);
  38402. }
  38403. if (params.evadeStops) {
  38404. jsonParameters["evadeStops"] = Util.toJSON(params.evadeStops);
  38405. }
  38406. if (params.priorLines) {
  38407. jsonParameters["priorLines"] = Util.toJSON(params.priorLines);
  38408. }
  38409. if (params.priorStops) {
  38410. jsonParameters["priorStops"] = Util.toJSON(params.priorStops);
  38411. }
  38412. if (params.travelTime) {
  38413. jsonParameters["travelTime"] = params.travelTime;
  38414. }
  38415. me.request({
  38416. method: method,
  38417. params: jsonParameters,
  38418. scope: me,
  38419. success: me.serviceProcessCompleted,
  38420. failure: me.serviceProcessFailed
  38421. });
  38422. }
  38423. }]);
  38424. return TransferSolutionService;
  38425. }(CommonServiceBase);
  38426. SuperMap.TransferSolutionService = TransferSolutionService;
  38427. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightParameters.js
  38428. function UpdateEdgeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38429. 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); } }
  38430. function UpdateEdgeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightParameters_defineProperties(Constructor, staticProps); return Constructor; }
  38431. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38432. * This program are made available under the terms of the Apache License, Version 2.0
  38433. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38434. /**
  38435. * @class SuperMap.UpdateEdgeWeightParameters
  38436. * @category iServer NetworkAnalyst EdgeWeight
  38437. * @classdesc 边的耗费权重更新服务参数类。
  38438. * @param {Object} options - 参数。
  38439. * @param {string} options.edgeId - 所在边的 ID。
  38440. * @param {string} options.fromNodeId - 起始转向点的 ID。
  38441. * @param {string} options.toNodeId - 终止转向点的 ID。
  38442. * @param {string} options.weightField - 边的耗费字段。
  38443. * @param {string} options.edgeWeight - 耗费权重。
  38444. */
  38445. var UpdateEdgeWeightParameters = /*#__PURE__*/function () {
  38446. function UpdateEdgeWeightParameters(options) {
  38447. UpdateEdgeWeightParameters_classCallCheck(this, UpdateEdgeWeightParameters);
  38448. if (!options) {
  38449. return;
  38450. }
  38451. /**
  38452. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.edgeId
  38453. * @description 所在边的 ID。
  38454. */
  38455. this.edgeId = "";
  38456. /**
  38457. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.fromNodeId
  38458. * @description 起始转向点的 ID。
  38459. */
  38460. this.fromNodeId = "";
  38461. /**
  38462. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.toNodeId
  38463. * @description 终止转向点的 ID。
  38464. */
  38465. this.toNodeId = "";
  38466. /**
  38467. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.weightField
  38468. * @description 边的耗费字段。
  38469. */
  38470. this.weightField = "";
  38471. /**
  38472. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.edgeWeight
  38473. * @description 耗费权重。
  38474. */
  38475. this.edgeWeight = "";
  38476. Util.extend(this, options);
  38477. this.CLASS_NAME = "SuperMap.UpdateEdgeWeightParameters";
  38478. }
  38479. /**
  38480. * @function SuperMap.UpdateEdgeWeightParameters.prototype.destroy
  38481. * @description 释放资源,将引用资源的属性置空。
  38482. */
  38483. UpdateEdgeWeightParameters_createClass(UpdateEdgeWeightParameters, [{
  38484. key: "destroy",
  38485. value: function destroy() {
  38486. this.edgeId = null;
  38487. this.fromNodeId = null;
  38488. this.toNodeId = null;
  38489. this.weightField = null;
  38490. this.edgeWeight = null;
  38491. }
  38492. }]);
  38493. return UpdateEdgeWeightParameters;
  38494. }();
  38495. SuperMap.UpdateEdgeWeightParameters = UpdateEdgeWeightParameters;
  38496. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightService.js
  38497. function UpdateEdgeWeightService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { UpdateEdgeWeightService_typeof = function _typeof(obj) { return typeof obj; }; } else { UpdateEdgeWeightService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return UpdateEdgeWeightService_typeof(obj); }
  38498. function UpdateEdgeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38499. 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); } }
  38500. function UpdateEdgeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightService_defineProperties(Constructor, staticProps); return Constructor; }
  38501. function UpdateEdgeWeightService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { UpdateEdgeWeightService_get = Reflect.get; } else { UpdateEdgeWeightService_get = function _get(target, property, receiver) { var base = UpdateEdgeWeightService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return UpdateEdgeWeightService_get(target, property, receiver || target); }
  38502. function UpdateEdgeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateEdgeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  38503. function UpdateEdgeWeightService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) UpdateEdgeWeightService_setPrototypeOf(subClass, superClass); }
  38504. function UpdateEdgeWeightService_setPrototypeOf(o, p) { UpdateEdgeWeightService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateEdgeWeightService_setPrototypeOf(o, p); }
  38505. 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); }; }
  38506. function UpdateEdgeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateEdgeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } return UpdateEdgeWeightService_assertThisInitialized(self); }
  38507. function UpdateEdgeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38508. function UpdateEdgeWeightService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  38509. function UpdateEdgeWeightService_getPrototypeOf(o) { UpdateEdgeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateEdgeWeightService_getPrototypeOf(o); }
  38510. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38511. * This program are made available under the terms of the Apache License, Version 2.0
  38512. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38513. /**
  38514. * @class SuperMap.UpdateEdgeWeightService
  38515. * @category iServer NetworkAnalyst EdgeWeight
  38516. * @classdesc 更新边的边的耗费权重服务
  38517. * @extends {SuperMap.NetworkAnalystServiceBase}
  38518. * @example
  38519. *(start code)
  38520. * var updateEdgeWeightService = new SuperMap.UpdateEdgeWeightService(url, {
  38521. * eventListeners: {
  38522. * "processCompleted": UpdateEdgeWeightCompleted, //参数为SuperMap.UpdateEdgeWeightEventArgs
  38523. * "processFailed": UpdateEdgeWeightError //参数为SuperMap.ServiceFailedEventArgs
  38524. * }
  38525. * });
  38526. * (end)
  38527. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  38528. * @param {Object} options - 参数。
  38529. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  38530. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38531. * @param {Object} [options.headers] - 请求头。
  38532. */
  38533. var UpdateEdgeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  38534. UpdateEdgeWeightService_inherits(UpdateEdgeWeightService, _NetworkAnalystServic);
  38535. var _super = UpdateEdgeWeightService_createSuper(UpdateEdgeWeightService);
  38536. function UpdateEdgeWeightService(url, options) {
  38537. var _this;
  38538. UpdateEdgeWeightService_classCallCheck(this, UpdateEdgeWeightService);
  38539. _this = _super.call(this, url, options);
  38540. _this.CLASS_NAME = "SuperMap.UpdateEdgeWeightService";
  38541. return _this;
  38542. }
  38543. /**
  38544. * @override
  38545. */
  38546. UpdateEdgeWeightService_createClass(UpdateEdgeWeightService, [{
  38547. key: "destroy",
  38548. value: function destroy() {
  38549. UpdateEdgeWeightService_get(UpdateEdgeWeightService_getPrototypeOf(UpdateEdgeWeightService.prototype), "destroy", this).call(this);
  38550. }
  38551. /**
  38552. * @function SuperMap.UpdateEdgeWeightService.prototype.processAsync
  38553. * @description 开始异步执行边的边的耗费权重的更新
  38554. * @param {SuperMap.UpdateEdgeWeightParameters} params - 边的耗费权重更新服务参数类
  38555. * @example
  38556. * (code)
  38557. * var updateEdgeWeightParam=new SuperMapUpdateEdgeWeightParameters({
  38558. * edgeId:"20",
  38559. * fromNodeId:"26",
  38560. * toNodeId:"109",
  38561. * weightField:"time",
  38562. * edgeWeight:"25"
  38563. * });
  38564. * updateEdgeWeightService.processAsync(updateEdgeWeightParam);
  38565. * (end)
  38566. */
  38567. }, {
  38568. key: "processAsync",
  38569. value: function processAsync(params) {
  38570. if (!(params instanceof UpdateEdgeWeightParameters)) {
  38571. return;
  38572. }
  38573. var me = this;
  38574. var paramStr = me.parse(params);
  38575. me.url = Util.urlPathAppend(me.url, paramStr);
  38576. var data = params.edgeWeight ? params.edgeWeight : null;
  38577. me.request({
  38578. method: "PUT",
  38579. scope: me,
  38580. data: data,
  38581. success: me.serviceProcessCompleted,
  38582. failure: me.serviceProcessFailed
  38583. });
  38584. }
  38585. /**
  38586. * @function SuperMap.UpdateEdgeWeightService.prototype.parse
  38587. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  38588. */
  38589. }, {
  38590. key: "parse",
  38591. value: function parse(params) {
  38592. if (!params) {
  38593. return;
  38594. }
  38595. var paramStr = "";
  38596. for (var attr in params) {
  38597. if (params[attr] === "" || params[attr] === "edgeWeight") {
  38598. continue;
  38599. }
  38600. switch (attr) {
  38601. case "edgeId":
  38602. paramStr += "/edgeweight/" + params[attr];
  38603. break;
  38604. case "fromNodeId":
  38605. paramStr += "/fromnode/" + params[attr];
  38606. break;
  38607. case "toNodeId":
  38608. paramStr += "/tonode/" + params[attr];
  38609. break;
  38610. case "weightField":
  38611. paramStr += "/weightfield/" + params[attr];
  38612. break;
  38613. default:
  38614. break;
  38615. }
  38616. }
  38617. return paramStr;
  38618. }
  38619. }]);
  38620. return UpdateEdgeWeightService;
  38621. }(NetworkAnalystServiceBase);
  38622. SuperMap.UpdateEdgeWeightService = UpdateEdgeWeightService;
  38623. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightParameters.js
  38624. function UpdateTurnNodeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38625. 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); } }
  38626. function UpdateTurnNodeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor, staticProps); return Constructor; }
  38627. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38628. * This program are made available under the terms of the Apache License, Version 2.0
  38629. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38630. /**
  38631. * @class SuperMap.UpdateTurnNodeWeightParameters
  38632. * @category iServer NetworkAnalyst TurnNodeWeight
  38633. * @classdesc 转向耗费权重更新服务参数类。
  38634. * @param {Object} options - 参数。
  38635. * @param {string} options.nodeId - 转向结点的 ID。
  38636. * @param {string} options.fromEdgeId - 起始边的 ID。
  38637. * @param {string} options.toEdgeId - 终止边的 ID。
  38638. * @param {string} options.weightField - 转向结点的耗费字段。
  38639. * @param {string} options.turnNodeWeight - 耗费权重。
  38640. */
  38641. var UpdateTurnNodeWeightParameters = /*#__PURE__*/function () {
  38642. function UpdateTurnNodeWeightParameters(options) {
  38643. UpdateTurnNodeWeightParameters_classCallCheck(this, UpdateTurnNodeWeightParameters);
  38644. if (!options) {
  38645. return;
  38646. }
  38647. /**
  38648. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.nodeId
  38649. * @description 转向结点的 ID。
  38650. */
  38651. this.nodeId = "";
  38652. /**
  38653. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.fromEdgeId
  38654. * @description 起始边的 ID。
  38655. */
  38656. this.fromEdgeId = "";
  38657. /**
  38658. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.toEdgeId
  38659. * @description 终止边的 ID。
  38660. */
  38661. this.toEdgeId = "";
  38662. /**
  38663. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.weightField
  38664. * @description 转向结点的耗费字段。
  38665. */
  38666. this.weightField = "";
  38667. /**
  38668. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.turnNodeWeight
  38669. * @description 耗费权重。
  38670. */
  38671. this.turnNodeWeight = "";
  38672. Util.extend(this, options);
  38673. this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightParameters";
  38674. }
  38675. /**
  38676. * @function SuperMap.UpdateTurnNodeWeightParameters.prototype.destroy
  38677. * @description 释放资源,将引用资源的属性置空。
  38678. */
  38679. UpdateTurnNodeWeightParameters_createClass(UpdateTurnNodeWeightParameters, [{
  38680. key: "destroy",
  38681. value: function destroy() {
  38682. this.nodeId = null;
  38683. this.fromEdgeId = null;
  38684. this.toEdgeId = null;
  38685. this.weightField = null;
  38686. this.turnNodeWeight = null;
  38687. }
  38688. }]);
  38689. return UpdateTurnNodeWeightParameters;
  38690. }();
  38691. SuperMap.UpdateTurnNodeWeightParameters = UpdateTurnNodeWeightParameters;
  38692. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightService.js
  38693. function UpdateTurnNodeWeightService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { UpdateTurnNodeWeightService_typeof = function _typeof(obj) { return typeof obj; }; } else { UpdateTurnNodeWeightService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return UpdateTurnNodeWeightService_typeof(obj); }
  38694. function UpdateTurnNodeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38695. 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); } }
  38696. function UpdateTurnNodeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightService_defineProperties(Constructor, staticProps); return Constructor; }
  38697. function UpdateTurnNodeWeightService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { UpdateTurnNodeWeightService_get = Reflect.get; } else { UpdateTurnNodeWeightService_get = function _get(target, property, receiver) { var base = UpdateTurnNodeWeightService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return UpdateTurnNodeWeightService_get(target, property, receiver || target); }
  38698. function UpdateTurnNodeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateTurnNodeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  38699. function UpdateTurnNodeWeightService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) UpdateTurnNodeWeightService_setPrototypeOf(subClass, superClass); }
  38700. function UpdateTurnNodeWeightService_setPrototypeOf(o, p) { UpdateTurnNodeWeightService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateTurnNodeWeightService_setPrototypeOf(o, p); }
  38701. 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); }; }
  38702. function UpdateTurnNodeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateTurnNodeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } return UpdateTurnNodeWeightService_assertThisInitialized(self); }
  38703. function UpdateTurnNodeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38704. function UpdateTurnNodeWeightService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  38705. function UpdateTurnNodeWeightService_getPrototypeOf(o) { UpdateTurnNodeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateTurnNodeWeightService_getPrototypeOf(o); }
  38706. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38707. * This program are made available under the terms of the Apache License, Version 2.0
  38708. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38709. /**
  38710. * @class SuperMap.UpdateTurnNodeWeightService
  38711. * @category iServer NetworkAnalyst TurnNodeWeight
  38712. * @classdesc 转向耗费权重更新服务类
  38713. * @extends {SuperMap.NetworkAnalystServiceBase}
  38714. * @example
  38715. * var UpdateTurnNodeWeightService = new SuperMap.UpdateTurnNodeWeightService(url, {
  38716. * eventListeners: {
  38717. * "processCompleted": UpdateTurnNodeWeightCompleted, //参数为SuperMap.UpdateTurnNodeWeightEventArgs
  38718. * "processFailed": UpdateTurnNodeWeightError //参数为SuperMap.ServiceFailedEventArgs
  38719. * }
  38720. * });
  38721. * @param {string} url - 服务的访问地址。如:
  38722. * http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  38723. * @param {Object} options - 参数。
  38724. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  38725. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38726. * @param {Object} [options.headers] - 请求头。
  38727. */
  38728. var UpdateTurnNodeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  38729. UpdateTurnNodeWeightService_inherits(UpdateTurnNodeWeightService, _NetworkAnalystServic);
  38730. var _super = UpdateTurnNodeWeightService_createSuper(UpdateTurnNodeWeightService);
  38731. function UpdateTurnNodeWeightService(url, options) {
  38732. var _this;
  38733. UpdateTurnNodeWeightService_classCallCheck(this, UpdateTurnNodeWeightService);
  38734. _this = _super.call(this, url, options);
  38735. _this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightService";
  38736. return _this;
  38737. }
  38738. /**
  38739. * @override
  38740. */
  38741. UpdateTurnNodeWeightService_createClass(UpdateTurnNodeWeightService, [{
  38742. key: "destroy",
  38743. value: function destroy() {
  38744. UpdateTurnNodeWeightService_get(UpdateTurnNodeWeightService_getPrototypeOf(UpdateTurnNodeWeightService.prototype), "destroy", this).call(this);
  38745. }
  38746. /**
  38747. * @function SuperMap.UpdateTurnNodeWeightService.prototype.processAsync
  38748. * @description 开始异步执行转向耗费权重的更新
  38749. * @param {SuperMap.UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类
  38750. * @example
  38751. * (code)
  38752. * var updateTurnNodeWeightParam=new SuperMap.UpdateTurnNodeWeightParameters({
  38753. * nodeId:"106",
  38754. * fromEdgeId:"6508",
  38755. * toEdgeId:"6504",
  38756. * weightField:"TurnCost",
  38757. * turnNodeWeight:"50"
  38758. * });
  38759. * updateTurnNodeWeightService.processAsync(updateTurnNodeWeightParam);
  38760. * (end)
  38761. **/
  38762. }, {
  38763. key: "processAsync",
  38764. value: function processAsync(params) {
  38765. if (!(params instanceof UpdateTurnNodeWeightParameters)) {
  38766. return;
  38767. }
  38768. var me = this;
  38769. var paramStr = me.parse(params);
  38770. me.url = Util.urlPathAppend(me.url, paramStr);
  38771. var data = params.turnNodeWeight ? params.turnNodeWeight : null;
  38772. me.request({
  38773. method: "PUT",
  38774. scope: me,
  38775. data: data,
  38776. success: me.serviceProcessCompleted,
  38777. failure: me.serviceProcessFailed
  38778. });
  38779. }
  38780. /**
  38781. * @function SuperMap.UpdateTurnNodeWeightService.prototype.parse
  38782. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  38783. */
  38784. }, {
  38785. key: "parse",
  38786. value: function parse(params) {
  38787. if (!params) {
  38788. return;
  38789. }
  38790. var paramStr = "";
  38791. for (var attr in params) {
  38792. if (params[attr] === "" || params[attr] === "turnNodeWeight") {
  38793. continue;
  38794. }
  38795. switch (attr) {
  38796. case "nodeId":
  38797. paramStr += "/turnnodeweight/" + params[attr];
  38798. break;
  38799. case "fromEdgeId":
  38800. paramStr += "/fromedge/" + params[attr];
  38801. break;
  38802. case "toEdgeId":
  38803. paramStr += "/toedge/" + params[attr];
  38804. break;
  38805. case "weightField":
  38806. paramStr += "/weightfield/" + params[attr];
  38807. break;
  38808. default:
  38809. break;
  38810. }
  38811. }
  38812. return paramStr;
  38813. }
  38814. }]);
  38815. return UpdateTurnNodeWeightService;
  38816. }(NetworkAnalystServiceBase);
  38817. SuperMap.UpdateTurnNodeWeightService = UpdateTurnNodeWeightService;
  38818. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsParameter.js
  38819. function VectorClipJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38820. 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); } }
  38821. function VectorClipJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  38822. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38823. * This program are made available under the terms of the Apache License, Version 2.0
  38824. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38825. /**
  38826. * @class SuperMap.VectorClipJobsParameter
  38827. * @category iServer ProcessingService VectorClip
  38828. * @classdesc 矢量裁剪分析任务参数类。
  38829. * @param {Object} options - 参数。
  38830. * @param {string} options.datasetName - 数据集名。
  38831. * @param {string} options.datasetOverlay - 裁剪对象数据集。
  38832. * @param {SuperMap.ClipAnalystMode} [options.mode=SuperMap.ClipAnalystMode.CLIP] - 裁剪分析模式。
  38833. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  38834. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  38835. */
  38836. var VectorClipJobsParameter = /*#__PURE__*/function () {
  38837. function VectorClipJobsParameter(options) {
  38838. VectorClipJobsParameter_classCallCheck(this, VectorClipJobsParameter);
  38839. options = options || {};
  38840. /**
  38841. * @member {string} SuperMap.VectorClipJobsParameter.prototype.datasetName
  38842. * @description 数据集名。
  38843. */
  38844. this.datasetName = "";
  38845. /**
  38846. * @member {string} SuperMap.VectorClipJobsParameter.prototype.datasetOverlay
  38847. * @description 裁剪对象数据集。
  38848. */
  38849. this.datasetVectorClip = "";
  38850. /**
  38851. * @member {string} SuperMap.VectorClipJobsParameter.prototype.geometryClip
  38852. * @description 裁剪几何对象。
  38853. */
  38854. this.geometryClip = "";
  38855. /**
  38856. * @member {SuperMap.ClipAnalystMode} [SuperMap.VectorClipJobsParameter.prototype.mode=ClipAnalystMode.CLIP]
  38857. * @description 裁剪分析模式 。
  38858. */
  38859. this.mode = ClipAnalystMode.CLIP;
  38860. /**
  38861. * @member {SuperMap.OutputSetting} SuperMap.VectorClipJobsParameter.prototype.output
  38862. * @description 输出参数设置类。
  38863. */
  38864. this.output = null;
  38865. /**
  38866. * @member {SuperMap.MappingParameters} [SuperMap.VectorClipJobsParameter.prototype.mappingParameters]
  38867. * @description 分析后结果可视化的参数类。
  38868. */
  38869. this.mappingParameters = null;
  38870. Util.extend(this, options);
  38871. this.CLASS_NAME = "SuperMap.VectorClipJobsParameter";
  38872. }
  38873. /**
  38874. * @function SuperMap.VectorClipJobsParameter.prototype.destroy
  38875. * @description 释放资源,将引用资源的属性置空。
  38876. */
  38877. VectorClipJobsParameter_createClass(VectorClipJobsParameter, [{
  38878. key: "destroy",
  38879. value: function destroy() {
  38880. this.datasetName = null;
  38881. this.datasetVectorClip = null;
  38882. this.geometryClip = null;
  38883. this.mode = null;
  38884. if (this.output instanceof OutputSetting) {
  38885. this.output.destroy();
  38886. this.output = null;
  38887. }
  38888. if (this.mappingParameters instanceof MappingParameters) {
  38889. this.mappingParameters.destroy();
  38890. this.mappingParameters = null;
  38891. }
  38892. }
  38893. /**
  38894. * @function SuperMap.VectorClipJobsParameter.toObject
  38895. * @param {Object} vectorClipJobsParameter - 区域汇总分析服务参数。
  38896. * @param {Object} tempObj - 目标对象。
  38897. * @description 矢量裁剪分析任务对象。
  38898. */
  38899. }], [{
  38900. key: "toObject",
  38901. value: function toObject(vectorClipJobsParameter, tempObj) {
  38902. for (var name in vectorClipJobsParameter) {
  38903. if (name === "datasetName") {
  38904. tempObj['input'] = tempObj['input'] || {};
  38905. tempObj['input'][name] = vectorClipJobsParameter[name];
  38906. continue;
  38907. }
  38908. if (name === "output") {
  38909. tempObj['output'] = tempObj['output'] || {};
  38910. tempObj['output'] = vectorClipJobsParameter[name];
  38911. continue;
  38912. }
  38913. tempObj['analyst'] = tempObj['analyst'] || {};
  38914. tempObj['analyst'][name] = vectorClipJobsParameter[name];
  38915. if (name === 'mappingParameters') {
  38916. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  38917. tempObj['analyst']['mappingParameters'] = vectorClipJobsParameter[name];
  38918. }
  38919. }
  38920. }
  38921. }]);
  38922. return VectorClipJobsParameter;
  38923. }();
  38924. SuperMap.VectorClipJobsParameter = VectorClipJobsParameter;
  38925. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsService.js
  38926. function VectorClipJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { VectorClipJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { VectorClipJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return VectorClipJobsService_typeof(obj); }
  38927. function VectorClipJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38928. 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); } }
  38929. function VectorClipJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  38930. function VectorClipJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { VectorClipJobsService_get = Reflect.get; } else { VectorClipJobsService_get = function _get(target, property, receiver) { var base = VectorClipJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return VectorClipJobsService_get(target, property, receiver || target); }
  38931. function VectorClipJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = VectorClipJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  38932. function VectorClipJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) VectorClipJobsService_setPrototypeOf(subClass, superClass); }
  38933. function VectorClipJobsService_setPrototypeOf(o, p) { VectorClipJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorClipJobsService_setPrototypeOf(o, p); }
  38934. 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); }; }
  38935. function VectorClipJobsService_possibleConstructorReturn(self, call) { if (call && (VectorClipJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return VectorClipJobsService_assertThisInitialized(self); }
  38936. function VectorClipJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38937. function VectorClipJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  38938. function VectorClipJobsService_getPrototypeOf(o) { VectorClipJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorClipJobsService_getPrototypeOf(o); }
  38939. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38940. * This program are made available under the terms of the Apache License, Version 2.0
  38941. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38942. /**
  38943. * @class SuperMap.VectorClipJobsService
  38944. * @category iServer ProcessingService VectorClip
  38945. * @classdesc 矢量裁剪分析服务类
  38946. * @extends {SuperMap.ProcessingServiceBase}
  38947. * @param {string} url -矢量裁剪分析服务地址。
  38948. * @param {Object} options - 交互服务时所需可选参数。
  38949. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38950. * @param {Object} [options.headers] - 请求头。
  38951. */
  38952. var VectorClipJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  38953. VectorClipJobsService_inherits(VectorClipJobsService, _ProcessingServiceBas);
  38954. var _super = VectorClipJobsService_createSuper(VectorClipJobsService);
  38955. function VectorClipJobsService(url, options) {
  38956. var _this;
  38957. VectorClipJobsService_classCallCheck(this, VectorClipJobsService);
  38958. _this = _super.call(this, url, options);
  38959. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/vectorclip');
  38960. _this.CLASS_NAME = 'SuperMap.VectorClipJobsService';
  38961. return _this;
  38962. }
  38963. /**
  38964. *@override
  38965. */
  38966. VectorClipJobsService_createClass(VectorClipJobsService, [{
  38967. key: "destroy",
  38968. value: function destroy() {
  38969. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "destroy", this).call(this);
  38970. }
  38971. /**
  38972. * @function SuperMap.VectorClipJobsService.protitype.getVectorClipJobs
  38973. * @description 获取矢量裁剪分析所有任务
  38974. */
  38975. }, {
  38976. key: "getVectorClipJobs",
  38977. value: function getVectorClipJobs() {
  38978. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, this.url);
  38979. }
  38980. /**
  38981. * @function SuperMap.KernelDensityJobsService.protitype.getVectorClipJob
  38982. * @description 获取指定id的矢量裁剪分析服务
  38983. * @param {string} id - 指定要获取数据的id
  38984. */
  38985. }, {
  38986. key: "getVectorClipJob",
  38987. value: function getVectorClipJob(id) {
  38988. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  38989. }
  38990. /**
  38991. * @function SuperMap.VectorClipJobsService.protitype.addVectorClipJob
  38992. * @description 新建矢量裁剪分析服务
  38993. * @param {SuperMap.VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  38994. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  38995. */
  38996. }, {
  38997. key: "addVectorClipJob",
  38998. value: function addVectorClipJob(params, seconds) {
  38999. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "addJob", this).call(this, this.url, params, VectorClipJobsParameter, seconds);
  39000. }
  39001. }]);
  39002. return VectorClipJobsService;
  39003. }(ProcessingServiceBase);
  39004. SuperMap.VectorClipJobsService = VectorClipJobsService;
  39005. ;// CONCATENATED MODULE: ./src/common/iServer/RasterFunctionParameter.js
  39006. function RasterFunctionParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39007. 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); } }
  39008. function RasterFunctionParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) RasterFunctionParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) RasterFunctionParameter_defineProperties(Constructor, staticProps); return Constructor; }
  39009. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39010. * This program are made available under the terms of the Apache License, Version 2.0
  39011. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39012. /**
  39013. * @class SuperMap.RasterFunctionParameter
  39014. * @category iServer Map
  39015. * @classdesc iServer 地图服务栅格分析参数基类
  39016. * @param {Object} options - 参数。
  39017. * @param {SuperMap.RasterFunctionType} options.type - 栅格分析方法。
  39018. */
  39019. var RasterFunctionParameter = /*#__PURE__*/function () {
  39020. function RasterFunctionParameter(options) {
  39021. RasterFunctionParameter_classCallCheck(this, RasterFunctionParameter);
  39022. options = options || {};
  39023. /**
  39024. * @member {SuperMap.RasterFunctionType} [SuperMap.RasterFunctionParameter.prototype.type]
  39025. * @description 栅格分析方法。
  39026. */
  39027. this.type = null;
  39028. Util.extend(this, options);
  39029. this.CLASS_NAME = 'SuperMap.RasterFunctionParameter';
  39030. }
  39031. /**
  39032. * @function SuperMap.RasterFunctionParameter.prototype.destroy
  39033. * @description 释放资源,将资源的属性置空。
  39034. */
  39035. RasterFunctionParameter_createClass(RasterFunctionParameter, [{
  39036. key: "destroy",
  39037. value: function destroy() {
  39038. this.type = null;
  39039. }
  39040. }]);
  39041. return RasterFunctionParameter;
  39042. }();
  39043. SuperMap.RasterFunctionParameter = RasterFunctionParameter;
  39044. ;// CONCATENATED MODULE: ./src/common/iServer/NDVIParameter.js
  39045. function NDVIParameter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { NDVIParameter_typeof = function _typeof(obj) { return typeof obj; }; } else { NDVIParameter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return NDVIParameter_typeof(obj); }
  39046. function NDVIParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39047. 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); } }
  39048. function NDVIParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) NDVIParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) NDVIParameter_defineProperties(Constructor, staticProps); return Constructor; }
  39049. function NDVIParameter_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { NDVIParameter_get = Reflect.get; } else { NDVIParameter_get = function _get(target, property, receiver) { var base = NDVIParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return NDVIParameter_get(target, property, receiver || target); }
  39050. function NDVIParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NDVIParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  39051. function NDVIParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) NDVIParameter_setPrototypeOf(subClass, superClass); }
  39052. function NDVIParameter_setPrototypeOf(o, p) { NDVIParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NDVIParameter_setPrototypeOf(o, p); }
  39053. 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); }; }
  39054. function NDVIParameter_possibleConstructorReturn(self, call) { if (call && (NDVIParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return NDVIParameter_assertThisInitialized(self); }
  39055. function NDVIParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39056. function NDVIParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  39057. function NDVIParameter_getPrototypeOf(o) { NDVIParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NDVIParameter_getPrototypeOf(o); }
  39058. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39059. * This program are made available under the terms of the Apache License, Version 2.0
  39060. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39061. /**
  39062. * @class SuperMap.NDVIParameter
  39063. * @category iServer Map
  39064. * @classdesc 归一化植被指数参数类
  39065. * @param {Object} options - 参数。
  39066. * @param {number} [options.redIndex=0] - 红光谱波段索引。
  39067. * @param {number} [options.nirIndex=1] - 近红外光谱波段索引。
  39068. * @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。仅单波段数据时设定。
  39069. * @extends {SuperMap.RasterFunctionParameter}
  39070. */
  39071. var NDVIParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  39072. NDVIParameter_inherits(NDVIParameter, _RasterFunctionParame);
  39073. var _super = NDVIParameter_createSuper(NDVIParameter);
  39074. function NDVIParameter(options) {
  39075. var _this;
  39076. NDVIParameter_classCallCheck(this, NDVIParameter);
  39077. _this = _super.call(this, options);
  39078. /**
  39079. * @member {number} [SuperMap.NDVIParameter.prototype.redIndex=0]
  39080. * @description 红光谱波段索引。
  39081. */
  39082. _this.redIndex = 0;
  39083. /**
  39084. * @member {number} [SuperMap.NDVIParameter.prototype.nirIndex=1]
  39085. * @description 近红外光谱波段索引。
  39086. */
  39087. _this.nirIndex = 1;
  39088. /**
  39089. * @member {string} [SuperMap.NDVIParameter.prototype.colorMap="0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff"]
  39090. * @description 颜色表。由栅格的中断值和颜色停止之间的映射组成的,如0.3->d9f0a3ff 指的是[0,0.3)显示d9f0a3ff。仅单波段数据时设定。
  39091. */
  39092. _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';
  39093. /**
  39094. * @member {SuperMap.RasterFunctionType} [SuperMap.RasterFunctionParameter.prototype.type]
  39095. * @description 栅格分析方法。
  39096. */
  39097. _this.type = RasterFunctionType.NDVI;
  39098. Util.extend(NDVIParameter_assertThisInitialized(_this), options);
  39099. _this.CLASS_NAME = 'SuperMap.NDVIParameter';
  39100. return _this;
  39101. }
  39102. /**
  39103. * @function SuperMap.NDVIParameter.prototype.destroy
  39104. * @override
  39105. */
  39106. NDVIParameter_createClass(NDVIParameter, [{
  39107. key: "destroy",
  39108. value: function destroy() {
  39109. NDVIParameter_get(NDVIParameter_getPrototypeOf(NDVIParameter.prototype), "destroy", this).call(this);
  39110. this.redIndex = null;
  39111. this.nirIndex = null;
  39112. this.colorMap = null;
  39113. }
  39114. /**
  39115. * @function SuperMap.NDVIParameter.prototype.toJSON
  39116. * @description 将 NDVIParameter 对象转化为 JSON 字符串。
  39117. * @returns {string} 返回转换后的 JSON 字符串。
  39118. */
  39119. }, {
  39120. key: "toJSON",
  39121. value: function toJSON() {
  39122. return {
  39123. redIndex: this.redIndex,
  39124. nirIndex: this.nirIndex,
  39125. colorMap: this.colorMap,
  39126. type: this.type
  39127. };
  39128. }
  39129. }]);
  39130. return NDVIParameter;
  39131. }(RasterFunctionParameter);
  39132. SuperMap.NDVIParameter = NDVIParameter;
  39133. ;// CONCATENATED MODULE: ./src/common/iServer/HillshadeParameter.js
  39134. function HillshadeParameter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { HillshadeParameter_typeof = function _typeof(obj) { return typeof obj; }; } else { HillshadeParameter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return HillshadeParameter_typeof(obj); }
  39135. function HillshadeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39136. 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); } }
  39137. function HillshadeParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) HillshadeParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) HillshadeParameter_defineProperties(Constructor, staticProps); return Constructor; }
  39138. function HillshadeParameter_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { HillshadeParameter_get = Reflect.get; } else { HillshadeParameter_get = function _get(target, property, receiver) { var base = HillshadeParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return HillshadeParameter_get(target, property, receiver || target); }
  39139. function HillshadeParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = HillshadeParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  39140. function HillshadeParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) HillshadeParameter_setPrototypeOf(subClass, superClass); }
  39141. function HillshadeParameter_setPrototypeOf(o, p) { HillshadeParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HillshadeParameter_setPrototypeOf(o, p); }
  39142. 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); }; }
  39143. function HillshadeParameter_possibleConstructorReturn(self, call) { if (call && (HillshadeParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return HillshadeParameter_assertThisInitialized(self); }
  39144. function HillshadeParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39145. function HillshadeParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  39146. function HillshadeParameter_getPrototypeOf(o) { HillshadeParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HillshadeParameter_getPrototypeOf(o); }
  39147. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39148. * This program are made available under the terms of the Apache License, Version 2.0
  39149. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39150. /**
  39151. * @class SuperMap.HillshadeParameter
  39152. * @category iServer Map
  39153. * @classdesc 阴影面分析参数类
  39154. * @param {Object} options - 参数。
  39155. * @param {number} [options.altitude=45] - 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  39156. * @param {number} [options.azimuth=315] - 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  39157. * @param {number} [options.zFactor=1] - 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  39158. * z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  39159. * 如果 x,y 单位和 z 单位采用相同的测量单位,则 z 因子为 1。这是默认设置。
  39160. * 如果 x,y 单位和 z 单位采用不同的测量单位,则必须将 z 因子设置为适当的因子,否则会得到错误的结果。例如,如果 z 单位是英尺而 x,y 单位是米,则应使用 z 因子 0.3048 将 z 单位从英尺转换为米(1 英尺 = 0.3048 米)。
  39161. * 如果输入栅格位于球面坐标系中(如十进制度球面坐标系),则生成的山体阴影可能看起来很独特。这是因为水平地面单位与高程 z 单位之间的测量值存在差异。由于经度的长度随着纬度而变化,因此需要为该纬度指定一个适当的 z 因子。如果 x,y 单位是十进制度而 Z 单位是米,特定纬度的一些合适的 Z 因子为:
  39162. * Latitude Z-factor
  39163. * 0 0.00000898
  39164. * 10 0.00000912
  39165. * 20 0.00000956
  39166. * 30 0.00001036
  39167. * 40 0.00001171
  39168. * 50 0.00001395
  39169. * 60 0.00001792
  39170. * 70 0.00002619
  39171. * 80 0.00005156
  39172. * @extends {SuperMap.RasterFunctionParameter}
  39173. */
  39174. var HillshadeParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  39175. HillshadeParameter_inherits(HillshadeParameter, _RasterFunctionParame);
  39176. var _super = HillshadeParameter_createSuper(HillshadeParameter);
  39177. function HillshadeParameter(options) {
  39178. var _this;
  39179. HillshadeParameter_classCallCheck(this, HillshadeParameter);
  39180. _this = _super.call(this, options);
  39181. /**
  39182. * @member {number} [SuperMap.HillshadeParameter.prototype.altitude = 45]
  39183. * @description 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  39184. */
  39185. _this.altitude = 45;
  39186. /**
  39187. * @member {number} [SuperMap.HillshadeParameter.prototype.azimuth = 315]
  39188. * @description 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  39189. */
  39190. _this.azimuth = 315;
  39191. /**
  39192. * @member {number} [SuperMap.HillshadeParameter.prototype.zFactor = 1]
  39193. * @description 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  39194. */
  39195. _this.zFactor = 1;
  39196. /**
  39197. * @member {SuperMap.RasterFunctionType} SuperMap.RasterFunctionParameter.prototype.type
  39198. * @description 栅格分析方法。
  39199. */
  39200. _this.type = RasterFunctionType.HILLSHADE;
  39201. Util.extend(HillshadeParameter_assertThisInitialized(_this), options);
  39202. _this.CLASS_NAME = 'SuperMap.HillshadeParameter';
  39203. return _this;
  39204. }
  39205. /**
  39206. * @function SuperMap.HillshadeParameter.prototype.destroy
  39207. * @override
  39208. */
  39209. HillshadeParameter_createClass(HillshadeParameter, [{
  39210. key: "destroy",
  39211. value: function destroy() {
  39212. HillshadeParameter_get(HillshadeParameter_getPrototypeOf(HillshadeParameter.prototype), "destroy", this).call(this);
  39213. this.altitude = null;
  39214. this.azimuth = null;
  39215. this.zFactor = null;
  39216. }
  39217. /**
  39218. * @function SuperMap.HillshadeParameter.prototype.toJSON
  39219. * @description 将 HillshadeParameter 对象转化为 JSON 字符串。
  39220. * @returns {string} 返回转换后的 JSON 字符串。
  39221. */
  39222. }, {
  39223. key: "toJSON",
  39224. value: function toJSON() {
  39225. return {
  39226. altitude: this.altitude,
  39227. azimuth: this.azimuth,
  39228. zFactor: this.zFactor,
  39229. type: this.type
  39230. };
  39231. }
  39232. }]);
  39233. return HillshadeParameter;
  39234. }(RasterFunctionParameter);
  39235. SuperMap.HillshadeParameter = HillshadeParameter;
  39236. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobCustomItems.js
  39237. function WebPrintingJobCustomItems_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39238. 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); } }
  39239. function WebPrintingJobCustomItems_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobCustomItems_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobCustomItems_defineProperties(Constructor, staticProps); return Constructor; }
  39240. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39241. * This program are made available under the terms of the Apache License, Version 2.0
  39242. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39243. /**
  39244. * @class SuperMap.WebPrintingJobCustomItems
  39245. * @classdesc Web 打印图例元素参数类。
  39246. * @version 10.1.0
  39247. * @category iServer WebPrintingJob
  39248. * @param {Object} option - 初始化参数。
  39249. * @param {string} option.name - 图例元素的名称。
  39250. * @param {string} [option.picAsUrl] - 图例元素 Base64 格式图片。
  39251. * @param {string} [option.picAsBase64] - 图例元素图片的获取地址。
  39252. */
  39253. var WebPrintingJobCustomItems = /*#__PURE__*/function () {
  39254. function WebPrintingJobCustomItems(option) {
  39255. WebPrintingJobCustomItems_classCallCheck(this, WebPrintingJobCustomItems);
  39256. /**
  39257. * @member {string} SuperMap.WebPrintingJobCustomItems.prototype.name
  39258. * @description 图例元素的名称。
  39259. */
  39260. this.name = null;
  39261. /**
  39262. * @member {string} [SuperMap.WebPrintingJobCustomItems.prototype.picAsUrl]
  39263. * @description 图例元素 Base64 格式图片。
  39264. */
  39265. this.picAsUrl = null;
  39266. /**
  39267. * @member {string} [SuperMap.WebPrintingJobCustomItems.prototype.picAsBase64]
  39268. * @description 图例元素图片的获取地址。
  39269. */
  39270. this.picAsBase64 = null;
  39271. this.CLASS_NAME = 'SuperMap.WebPrintingJobCustomItems';
  39272. Util.extend(this, option);
  39273. }
  39274. /**
  39275. * @function SuperMap.WebPrintingJobCustomItems.prototype.destroy
  39276. * @description 释放资源,将引用资源的属性置空。
  39277. */
  39278. WebPrintingJobCustomItems_createClass(WebPrintingJobCustomItems, [{
  39279. key: "destroy",
  39280. value: function destroy() {
  39281. var me = this;
  39282. me.name = null;
  39283. me.picAsUrl = null;
  39284. me.picAsBase64 = null;
  39285. }
  39286. /**
  39287. * @function SuperMap.WebPrintingJobCustomItems.prototype.toJSON
  39288. * @description 将 SuperMap.WebPrintingJobCustomItems 对象转化为 JSON 字符串。
  39289. * @returns {string} 返回转换后的 JSON 字符串。
  39290. */
  39291. }, {
  39292. key: "toJSON",
  39293. value: function toJSON() {
  39294. var params = {
  39295. name: this.name
  39296. };
  39297. if (this.title) {
  39298. params.title = this.title;
  39299. }
  39300. if (this.picAsUrl) {
  39301. params.picAsUrl = this.picAsUrl;
  39302. } else if (this.picAsBase64) {
  39303. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  39304. }
  39305. return Util.toJSON(params);
  39306. }
  39307. }]);
  39308. return WebPrintingJobCustomItems;
  39309. }();
  39310. SuperMap.WebPrintingJobCustomItems = WebPrintingJobCustomItems;
  39311. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobImage.js
  39312. function WebPrintingJobImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39313. 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); } }
  39314. function WebPrintingJobImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobImage_defineProperties(Constructor, staticProps); return Constructor; }
  39315. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39316. * This program are made available under the terms of the Apache License, Version 2.0
  39317. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39318. /**
  39319. * @class SuperMap.WebPrintingJobImage
  39320. * @classdesc 表达小地图的静态图片参数类。
  39321. * @version 10.1.0
  39322. * @category iServer WebPrintingJob
  39323. * @param {Object} option - 初始化参数。
  39324. * @param {string} [option.picAsUrl] - 小地图的图片 url 地址。
  39325. * @param {string} [option.picAsBase64] - 小地图的base64位图片信息。
  39326. */
  39327. var WebPrintingJobImage = /*#__PURE__*/function () {
  39328. function WebPrintingJobImage(option) {
  39329. WebPrintingJobImage_classCallCheck(this, WebPrintingJobImage);
  39330. /**
  39331. * @member {string} [SuperMap.WebPrintingJobImage.prototype.picAsUrl]
  39332. * @description 小地图的图片 url 地址。
  39333. */
  39334. this.picAsUrl = null;
  39335. /**
  39336. * @member {string} [SuperMap.WebPrintingJobImage.prototype.picAsBase64]
  39337. * @description 小地图的base64位图片信息。
  39338. */
  39339. this.picAsBase64 = null;
  39340. this.CLASS_NAME = 'SuperMap.WebPrintingJobImage';
  39341. Util.extend(this, option);
  39342. }
  39343. /**
  39344. * @function SuperMap.WebPrintingJobImage.prototype.destroy
  39345. * @description 释放资源,将引用资源的属性置空。
  39346. */
  39347. WebPrintingJobImage_createClass(WebPrintingJobImage, [{
  39348. key: "destroy",
  39349. value: function destroy() {
  39350. this.picAsUrl = null;
  39351. this.picAsBase64 = null;
  39352. }
  39353. /**
  39354. * @function SuperMap.WebPrintingJobImage.prototype.toJSON
  39355. * @description 将 SuperMap.WebPrintingJobImage 对象转化为 JSON 字符串。
  39356. * @returns {string} 返回转换后的 JSON 字符串。
  39357. */
  39358. }, {
  39359. key: "toJSON",
  39360. value: function toJSON() {
  39361. var params = {};
  39362. if (this.picAsUrl) {
  39363. params.picAsUrl = this.picAsUrl;
  39364. }
  39365. if (this.picAsBase64) {
  39366. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  39367. }
  39368. return Util.toJSON(params);
  39369. }
  39370. }]);
  39371. return WebPrintingJobImage;
  39372. }();
  39373. SuperMap.WebPrintingJobImage = WebPrintingJobImage;
  39374. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayers.js
  39375. function WebPrintingJobLayers_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39376. 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); } }
  39377. function WebPrintingJobLayers_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayers_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayers_defineProperties(Constructor, staticProps); return Constructor; }
  39378. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39379. * This program are made available under the terms of the Apache License, Version 2.0
  39380. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39381. /**
  39382. * @class SuperMap.WebPrintingJobLayers
  39383. * @classdesc 将图例添加到布局的业务图层参数类。
  39384. * @version 10.1.0
  39385. * @category iServer WebPrintingJob
  39386. * @param {Object} option - 初始化参数。
  39387. * @param {string} [option.name] - 表示图层 name 的字符串。此 name 必须唯一,并且必须与定义业务图层的 LegendOptions_layers 元素中的图层 name 匹配。
  39388. */
  39389. var WebPrintingJobLayers = /*#__PURE__*/function () {
  39390. function WebPrintingJobLayers(option) {
  39391. WebPrintingJobLayers_classCallCheck(this, WebPrintingJobLayers);
  39392. /**
  39393. * @member {string} SuperMap.WebPrintingJobLayers.prototype.name
  39394. * @description 图层 name。
  39395. */
  39396. this.name = null;
  39397. /**
  39398. * @member {string} SuperMap.WebPrintingJobLayers.prototype.layerType
  39399. * @description 图层 type。
  39400. */
  39401. this.layerType = null;
  39402. /**
  39403. * @member {string} SuperMap.WebPrintingJobLayers.prototype.url
  39404. * @description 图层 url。
  39405. */
  39406. this.url = null;
  39407. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayers';
  39408. Util.extend(this, option);
  39409. }
  39410. /**
  39411. * @function SuperMap.WebPrintingJobLayers.prototype.destroy
  39412. * @description 释放资源,将引用资源的属性置空。
  39413. */
  39414. WebPrintingJobLayers_createClass(WebPrintingJobLayers, [{
  39415. key: "destroy",
  39416. value: function destroy() {
  39417. this.name = null;
  39418. this.layerType = null;
  39419. this.url = null;
  39420. }
  39421. }]);
  39422. return WebPrintingJobLayers;
  39423. }();
  39424. SuperMap.WebPrintingJobLayers = WebPrintingJobLayers;
  39425. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLegendOptions.js
  39426. function WebPrintingJobLegendOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39427. 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); } }
  39428. function WebPrintingJobLegendOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLegendOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLegendOptions_defineProperties(Constructor, staticProps); return Constructor; }
  39429. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39430. * This program are made available under the terms of the Apache License, Version 2.0
  39431. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39432. /**
  39433. * @class SuperMap.WebPrintingJobLegendOptions
  39434. * @classdesc Web 打印图例参数类。
  39435. * @version 10.1.0
  39436. * @category iServer WebPrintingJob
  39437. * @param {Object} option - 初始化参数。
  39438. * @param {string} [option.title] - 图例名称。
  39439. * @param {string} [option.picAsUrl] - 图例的图片 url 地址。
  39440. * @param {string} [option.picAsBase64] - 图例的 base64 位图片信息。
  39441. * @param {SuperMap.WebPrintingJobLayers} [option.layers] - 图例的布局业务图层参数类。
  39442. * @param {SuperMap.WebPrintingJobCustomItems} [option.customItems] - 自定义图例元素参数类。
  39443. */
  39444. var WebPrintingJobLegendOptions = /*#__PURE__*/function () {
  39445. function WebPrintingJobLegendOptions(option) {
  39446. WebPrintingJobLegendOptions_classCallCheck(this, WebPrintingJobLegendOptions);
  39447. /**
  39448. * @member {string} SuperMap.WebPrintingJobLegendOptions.prototype.title
  39449. * @description 图例名称。
  39450. */
  39451. this.title = null;
  39452. /**
  39453. * @member {string} [SuperMap.WebPrintingJobLegendOptions.prototype.picAsUrl]
  39454. * @description 图例的图片 url 地址。
  39455. */
  39456. this.picAsUrl = null;
  39457. /**
  39458. * @member {string} [SuperMap.WebPrintingJobLegendOptions.prototype.picAsBase64]
  39459. * @description 图例的 base64 位图片信息。
  39460. */
  39461. this.picAsBase64 = null;
  39462. /**
  39463. * @member {SuperMap.WebPrintingJobLayers} [SuperMap.WebPrintingJobLegendOptions.prototype.layers]
  39464. * @description 图例的布局业务图层参数类。
  39465. */
  39466. this.layers = null;
  39467. /**
  39468. * @member {SuperMap.WebPrintingJobCustomItems} [SuperMap.WebPrintingJobLegendOptions.prototype.customItems]
  39469. * @description 自定义图例元素参数类。
  39470. */
  39471. this.customItems = null;
  39472. this.CLASS_NAME = 'SuperMap.WebPrintingJobLegendOptions';
  39473. Util.extend(this, option);
  39474. }
  39475. /**
  39476. * @function SuperMap.WebPrintingJobLegendOptions.prototype.destroy
  39477. * @description 释放资源,将引用资源的属性置空。
  39478. */
  39479. WebPrintingJobLegendOptions_createClass(WebPrintingJobLegendOptions, [{
  39480. key: "destroy",
  39481. value: function destroy() {
  39482. this.title = null;
  39483. this.picAsUrl = null;
  39484. this.picAsBase64 = null;
  39485. if (this.layers instanceof WebPrintingJobLayers) {
  39486. this.layers.destroy();
  39487. this.layers = null;
  39488. }
  39489. if (this.customItems instanceof WebPrintingJobCustomItems) {
  39490. this.customItems.destroy();
  39491. this.customItems = null;
  39492. }
  39493. }
  39494. /**
  39495. * @function SuperMap.WebPrintingJobLegendOptions.prototype.toJSON
  39496. * @description 将 SuperMap.WebPrintingJobLegendOptions 对象转化为 JSON 字符串。
  39497. * @returns {string} 返回转换后的 JSON 字符串。
  39498. */
  39499. }, {
  39500. key: "toJSON",
  39501. value: function toJSON() {
  39502. var params = {
  39503. title: this.title || ""
  39504. };
  39505. if (this.picAsUrl) {
  39506. params.picAsUrl = this.picAsUrl;
  39507. } else if (this.picAsBase64) {
  39508. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  39509. } else if (this.customItems) {
  39510. params.customItems = this.customItems;
  39511. }
  39512. return Util.toJSON(params);
  39513. }
  39514. }]);
  39515. return WebPrintingJobLegendOptions;
  39516. }();
  39517. SuperMap.WebPrintingJobLegendOptions = WebPrintingJobLegendOptions;
  39518. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLittleMapOptions.js
  39519. function WebPrintingJobLittleMapOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39520. 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); } }
  39521. function WebPrintingJobLittleMapOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor, staticProps); return Constructor; }
  39522. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39523. * This program are made available under the terms of the Apache License, Version 2.0
  39524. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39525. /**
  39526. * @class SuperMap.WebPrintingJobLittleMapOptions
  39527. * @classdesc Web 打印小地图参数类。
  39528. * @version 10.1.0
  39529. * @category iServer WebPrintingJob
  39530. * @param {Object} option - 初始化参数。
  39531. * @param {SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} option.center - 小地图的中心点。
  39532. * @param {number} [option.scale] - 小地图的比例尺。
  39533. * @param {Array.<string>} [option.layerNames] - 指定 WebMap中图层名称的列表,用于渲染小地图。
  39534. * @param {SuperMap.WebPrintingJobImage} [option.image] - 表达小地图的静态图类。
  39535. * @param {SuperMap.WebPrintingJobLayers} [option.layers] - 指定 WebMap 中的 layers 图层类。
  39536. */
  39537. var WebPrintingJobLittleMapOptions = /*#__PURE__*/function () {
  39538. function WebPrintingJobLittleMapOptions(option) {
  39539. WebPrintingJobLittleMapOptions_classCallCheck(this, WebPrintingJobLittleMapOptions);
  39540. /**
  39541. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.WebPrintingJobLittleMapOptions.prototype.center
  39542. * @description 小地图的中心点。
  39543. */
  39544. this.center = null;
  39545. /**
  39546. * @member {number} [SuperMap.WebPrintingJobLittleMapOptions.prototype.scale]
  39547. * @description 小地图的比例尺。
  39548. */
  39549. this.scale = null;
  39550. /**
  39551. * @member {Array.<string>} SuperMap.WebPrintingJobLittleMapOptions.prototype.layerNames
  39552. * @description 指定 WebMap中图层名称的列表,用于渲染小地图。
  39553. */
  39554. this.layerNames = null;
  39555. /**
  39556. * @member {SuperMap.WebPrintingJobImage} [SuperMap.WebPrintingJobLittleMapOptions.prototype.image]
  39557. * @description 表达小地图的静态图类。暂不支持
  39558. */
  39559. this.image = null;
  39560. /**
  39561. * @member {SuperMap.WebPrintingJobLayers} [SuperMap.WebPrintingJobLittleMapOptions.prototype.layers]
  39562. * @description 指定 WebMap 中的 layers 图层类。
  39563. */
  39564. this.layers = null;
  39565. this.CLASS_NAME = 'SuperMap.WebPrintingJobLittleMapOptions';
  39566. Util.extend(this, option);
  39567. }
  39568. /**
  39569. * @function SuperMap.WebPrintingJobLittleMapOptions.prototype.destroy
  39570. * @description 释放资源,将引用资源的属性置空。
  39571. */
  39572. WebPrintingJobLittleMapOptions_createClass(WebPrintingJobLittleMapOptions, [{
  39573. key: "destroy",
  39574. value: function destroy() {
  39575. this.center = null;
  39576. this.scale = null;
  39577. this.layerNames = null;
  39578. if (this.image instanceof WebPrintingJobImage) {
  39579. this.image.destroy();
  39580. this.image = null;
  39581. }
  39582. if (this.layers instanceof WebPrintingJobLayers) {
  39583. this.layers.destroy();
  39584. this.layers = null;
  39585. }
  39586. }
  39587. /**
  39588. * @function SuperMap.WebPrintingJobLittleMapOptions.prototype.toJSON
  39589. * @description 将 SuperMap.WebPrintingJobLittleMapOptions 对象转化为 JSON 字符串。
  39590. * @returns {string} 返回转换后的 JSON 字符串。
  39591. */
  39592. }, {
  39593. key: "toJSON",
  39594. value: function toJSON() {
  39595. var params = {
  39596. scale: this.scale,
  39597. center: this.center
  39598. };
  39599. if (this.layerNames) {
  39600. params.layerNames = this.layerNames;
  39601. } else if (this.layers) {
  39602. params.layers = this.layers;
  39603. }
  39604. if (this.image) {
  39605. params.image = this.image;
  39606. }
  39607. return Util.toJSON(params);
  39608. }
  39609. }]);
  39610. return WebPrintingJobLittleMapOptions;
  39611. }();
  39612. SuperMap.WebPrintingJobLittleMapOptions = WebPrintingJobLittleMapOptions;
  39613. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobNorthArrowOptions.js
  39614. function WebPrintingJobNorthArrowOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39615. 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); } }
  39616. function WebPrintingJobNorthArrowOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor, staticProps); return Constructor; }
  39617. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39618. * This program are made available under the terms of the Apache License, Version 2.0
  39619. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39620. /**
  39621. * @class SuperMap.WebPrintingJobNorthArrowOptions
  39622. * @classdesc Web 打印地图指北针参数类。
  39623. * @version 10.1.0
  39624. * @category iServer WebPrintingJob
  39625. * @param {Object} option - 初始化参数。
  39626. * @param {string} option.picAsUrl - 指北针的图片 url 地址。
  39627. * @param {string} [option.picAsBase64] - 指北针的base64位图片信息。
  39628. */
  39629. var WebPrintingJobNorthArrowOptions = /*#__PURE__*/function () {
  39630. function WebPrintingJobNorthArrowOptions(option) {
  39631. WebPrintingJobNorthArrowOptions_classCallCheck(this, WebPrintingJobNorthArrowOptions);
  39632. /**
  39633. * @member {string} SuperMap.WebPrintingJobNorthArrowOptions.prototype.picAsUrl
  39634. * @description 指北针的图片 url 地址。
  39635. */
  39636. this.picAsUrl = null;
  39637. /**
  39638. * @member {string} [SuperMap.WebPrintingJobNorthArrowOptions.prototype.picAsBase64]
  39639. * @description 指北针的base64位图片信息。
  39640. */
  39641. this.picAsBase64 = null;
  39642. this.CLASS_NAME = 'SuperMap.WebPrintingJobNorthArrowOptions';
  39643. Util.extend(this, option);
  39644. }
  39645. /**
  39646. * @function SuperMap.WebPrintingJobNorthArrowOptions.prototype.destroy
  39647. * @description 释放资源,将引用资源的属性置空。
  39648. */
  39649. WebPrintingJobNorthArrowOptions_createClass(WebPrintingJobNorthArrowOptions, [{
  39650. key: "destroy",
  39651. value: function destroy() {
  39652. this.picAsUrl = null;
  39653. this.picAsBase64 = null;
  39654. }
  39655. /**
  39656. * @function SuperMap.WebPrintingJobNorthArrowOptions.prototype.toJSON
  39657. * @description 将 SuperMap.WebPrintingJobNorthArrowOptions 对象转化为 JSON 字符串。
  39658. * @returns {string} 返回转换后的 JSON 字符串。
  39659. */
  39660. }, {
  39661. key: "toJSON",
  39662. value: function toJSON() {
  39663. var params = {};
  39664. if (this.picAsUrl) {
  39665. params.picAsUrl = this.picAsUrl;
  39666. } else if (this.picAsBase64) {
  39667. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  39668. }
  39669. return Util.toJSON(params);
  39670. }
  39671. }]);
  39672. return WebPrintingJobNorthArrowOptions;
  39673. }();
  39674. SuperMap.WebPrintingJobNorthArrowOptions = WebPrintingJobNorthArrowOptions;
  39675. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobScaleBarOptions.js
  39676. function WebPrintingJobScaleBarOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39677. 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); } }
  39678. function WebPrintingJobScaleBarOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor, staticProps); return Constructor; }
  39679. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39680. * This program are made available under the terms of the Apache License, Version 2.0
  39681. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39682. /**
  39683. * @class SuperMap.WebPrintingJobScaleBarOptions
  39684. * @classdesc Web 打印比例尺参数类。
  39685. * @category iServer WebPrintingJob
  39686. * @version 10.1.0
  39687. * @param {Object} option - 初始化参数。
  39688. * @param {string} [option.scaleText] - 比例尺文本信息。例如:1:1000000
  39689. * @param {SuperMap.WebScaleOrientationType} [option.orientation] - 比例尺的方位样式。
  39690. * @param {SuperMap.WebScaleType} [option.type] - 比例尺的样式。
  39691. * @param {number} [option.intervals] - 比例尺条的段数。
  39692. * @param {SuperMap.WebScaleUnit} [option.unit] - 比例尺的单位制。
  39693. */
  39694. var WebPrintingJobScaleBarOptions = /*#__PURE__*/function () {
  39695. function WebPrintingJobScaleBarOptions(option) {
  39696. WebPrintingJobScaleBarOptions_classCallCheck(this, WebPrintingJobScaleBarOptions);
  39697. /**
  39698. * @member {string} SuperMap.WebPrintingJobScaleBarOptions.prototype.scaleText
  39699. * @description 比例尺文本信息。
  39700. */
  39701. this.scaleText = null;
  39702. /**
  39703. * @member {SuperMap.WebScaleOrientationType} [SuperMap.WebPrintingJobScaleBarOptions.prototype.orientation]
  39704. * @description 比例尺的方位样式。
  39705. */
  39706. this.orientation = null;
  39707. /**
  39708. * @member {SuperMap.WebScaleType} [SuperMap.WebPrintingJobScaleBarOptions.prototype.type]
  39709. * @description 比例尺的样式。
  39710. */
  39711. this.type = null;
  39712. /**
  39713. * @member {object} [SuperMap.WebPrintingJobScaleBarOptions.prototype.intervals]
  39714. * @description 比例尺条的段数。
  39715. */
  39716. this.intervals = null;
  39717. /**
  39718. * @member {SuperMap.WebScaleUnit} [SuperMap.WebPrintingJobScaleBarOptions.prototype.unit]
  39719. * @description 比例尺的单位制。
  39720. */
  39721. this.unit = null;
  39722. this.CLASS_NAME = 'SuperMap.WebPrintingJobScaleBarOptions';
  39723. Util.extend(this, option);
  39724. }
  39725. /**
  39726. * @function SuperMap.WebPrintingJobScaleBarOptions.prototype.destroy
  39727. * @description 释放资源,将引用资源的属性置空。
  39728. */
  39729. WebPrintingJobScaleBarOptions_createClass(WebPrintingJobScaleBarOptions, [{
  39730. key: "destroy",
  39731. value: function destroy() {
  39732. this.scaleText = null;
  39733. this.orientation = null;
  39734. this.type = null;
  39735. this.intervals = null;
  39736. this.unit = null;
  39737. }
  39738. /**
  39739. * @function SuperMap.WebPrintingJobScaleBarOptions.prototype.toJSON
  39740. * @description 将 SuperMap.WebPrintingJobScaleBarOptions 对象转化为 JSON 字符串。
  39741. * @returns {string} 返回转换后的 JSON 字符串。
  39742. */
  39743. }, {
  39744. key: "toJSON",
  39745. value: function toJSON() {
  39746. var params = {
  39747. scaleText: this.scaleText || "",
  39748. type: this.type || "BAR",
  39749. intervals: this.intervals || "",
  39750. unit: this.unit || "METER"
  39751. };
  39752. if (this.orientation) {
  39753. params.orientation = this.orientation;
  39754. }
  39755. return Util.toJSON(params);
  39756. }
  39757. }]);
  39758. return WebPrintingJobScaleBarOptions;
  39759. }();
  39760. SuperMap.WebPrintingJobScaleBarOptions = WebPrintingJobScaleBarOptions;
  39761. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobContent.js
  39762. function WebPrintingJobContent_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39763. 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); } }
  39764. function WebPrintingJobContent_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobContent_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobContent_defineProperties(Constructor, staticProps); return Constructor; }
  39765. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39766. * This program are made available under the terms of the Apache License, Version 2.0
  39767. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39768. /**
  39769. * @class SuperMap.WebPrintingJobContent
  39770. * @classdesc Web 打印内容参数类。
  39771. * @version 10.1.0
  39772. * @category iServer WebPrintingJob
  39773. * @param {Object} option - 初始化参数。
  39774. * @param {string} option.type - Web 打印内容支持的类型。目前支持的类型:WEBMAP
  39775. * @param {string} [option.url] - 待打印的 SuperMap iPortal WebMap 的 url 地址。例如:http://supermapiportal:8190/iportal/web/maps/{mapid}/map.rjson
  39776. * @param {string} [option.token] - 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  39777. * @param {WebMapSummaryObject} [option.value] - 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 json 表达。如果已填了 url 参数,此参数可不传
  39778. */
  39779. var WebPrintingJobContent = /*#__PURE__*/function () {
  39780. function WebPrintingJobContent(option) {
  39781. WebPrintingJobContent_classCallCheck(this, WebPrintingJobContent);
  39782. /**
  39783. * @member {string} SuperMap.WebPrintingJobContent.prototype.type
  39784. * @description Web 打印内容支持的类型。
  39785. */
  39786. this.type = null;
  39787. /**
  39788. * @member {string} [SuperMap.WebPrintingJobContent.prototype.url]
  39789. * @description 待打印的 SuperMap iPortal WebMap 的 url 地址。
  39790. */
  39791. this.url = null;
  39792. /**
  39793. * @member {string} [SuperMap.WebPrintingJobContent.prototype.token]
  39794. * @description 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  39795. */
  39796. this.token = null;
  39797. /**
  39798. * @member {WebMapSummaryObject} [SuperMap.WebPrintingJobContent.prototype.value]
  39799. * @description 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 json 表达。
  39800. */
  39801. this.value = null;
  39802. this.CLASS_NAME = 'SuperMap.WebPrintingJobContent';
  39803. Util.extend(this, option);
  39804. }
  39805. /**
  39806. * @function SuperMap.WebPrintingJobContent.prototype.destroy
  39807. * @description 释放资源,将引用资源的属性置空。
  39808. */
  39809. WebPrintingJobContent_createClass(WebPrintingJobContent, [{
  39810. key: "destroy",
  39811. value: function destroy() {
  39812. this.type = false || "WEBMAP";
  39813. this.url = null;
  39814. this.token = null;
  39815. this.value = null;
  39816. }
  39817. /**
  39818. * @function SuperMap.WebPrintingJobContent.prototype.toJSON
  39819. * @description 将 SuperMap.WebPrintingJobContent 对象转化为 JSON 字符串。
  39820. * @returns {string} 返回转换后的 JSON 字符串。
  39821. */
  39822. }, {
  39823. key: "toJSON",
  39824. value: function toJSON() {
  39825. var params = {
  39826. type: this.type
  39827. };
  39828. if (this.token) {
  39829. params.token = this.token;
  39830. }
  39831. if (this.url) {
  39832. params.url = this.url;
  39833. } else if (this.value) {
  39834. params.value = this.value;
  39835. }
  39836. return Util.toJSON(params);
  39837. }
  39838. }]);
  39839. return WebPrintingJobContent;
  39840. }();
  39841. SuperMap.WebPrintingJobContent = WebPrintingJobContent;
  39842. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayoutOptions.js
  39843. function WebPrintingJobLayoutOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39844. 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); } }
  39845. function WebPrintingJobLayoutOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayoutOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayoutOptions_defineProperties(Constructor, staticProps); return Constructor; }
  39846. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39847. * This program are made available under the terms of the Apache License, Version 2.0
  39848. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39849. /**
  39850. * @class SuperMap.WebPrintingJobLayoutOptions
  39851. * @classdesc Web 打印的布局参数类。
  39852. * @version 10.1.0
  39853. * @category iServer WebPrintingJob
  39854. * @param {Object} option - 初始化参数。
  39855. * @param {string} option.templateName - 布局模板的名称。
  39856. * @param {string} option.title - 地图主标题名称。
  39857. * @param {string} option.subTitle - 地图副标题名称。
  39858. * @param {string} option.author - 地图作者名称。
  39859. * @param {string} option.copyright - 地图版权信息。
  39860. * @param {SuperMap.WebPrintingJobLittleMapOptions} option.littleMapOptions - 小地图参数类。
  39861. * @param {SuperMap.WebPrintingJobLegendOptions} option.legendOptions - 图例参数类。
  39862. * @param {SuperMap.WebPrintingJobScaleBarOptions} [option.scaleBarOptions] - 地图比例尺参数类。
  39863. * @param {SuperMap.WebPrintingJobNorthArrowOptions} [option.northArrowOptions] - 地图指北针参数类。
  39864. */
  39865. var WebPrintingJobLayoutOptions = /*#__PURE__*/function () {
  39866. function WebPrintingJobLayoutOptions(option) {
  39867. WebPrintingJobLayoutOptions_classCallCheck(this, WebPrintingJobLayoutOptions);
  39868. /**
  39869. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.templateName
  39870. * @description 布局模板的名称。
  39871. */
  39872. this.templateName = null;
  39873. /**
  39874. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.title
  39875. * @description 地图主标题名称。
  39876. */
  39877. this.title = null;
  39878. /**
  39879. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.subTitle
  39880. * @description 地图副标题名称。
  39881. */
  39882. this.subTitle = null;
  39883. /**
  39884. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.author
  39885. * @description 地图作者名称。
  39886. */
  39887. this.author = null;
  39888. /**
  39889. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.copyright
  39890. * @description 地图版权信息。
  39891. */
  39892. this.copyright = null;
  39893. /**
  39894. * @member {SuperMap.WebPrintingJobScaleBarOptions} [SuperMap.WebPrintingJobLayoutOptions.prototype.scaleBarOptions]
  39895. * @description 地图比例尺参数类。
  39896. */
  39897. this.scaleBarOptions = null;
  39898. /**
  39899. * @member {SuperMap.WebPrintingJobNorthArrowOptions} [SuperMap.WebPrintingJobLayoutOptions.prototype.northArrowOptions]
  39900. * @description 地图指北针参数类。
  39901. */
  39902. this.northArrowOptions = null;
  39903. /**
  39904. * @member {SuperMap.WebPrintingJobLittleMapOptions} SuperMap.WebPrintingJobLayoutOptions.prototype.littleMapOptions
  39905. * @description 小地图参数类。
  39906. */
  39907. this.littleMapOptions = null;
  39908. /**
  39909. * @member {SuperMap.WebPrintingJobLegendOptions} SuperMap.WebPrintingJobLayoutOptions.prototype.legendOptions
  39910. * @description 图例参数类。
  39911. */
  39912. this.legendOptions = null;
  39913. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayoutOptions';
  39914. Util.extend(this, option);
  39915. }
  39916. /**
  39917. * @function SuperMap.WebPrintingJobLayoutOptions.prototype.destroy
  39918. * @description 释放资源,将引用资源的属性置空。
  39919. */
  39920. WebPrintingJobLayoutOptions_createClass(WebPrintingJobLayoutOptions, [{
  39921. key: "destroy",
  39922. value: function destroy() {
  39923. this.templateName = null;
  39924. this.title = null;
  39925. this.subTitle = null;
  39926. this.author = null;
  39927. this.copyright = null;
  39928. if (this.scaleBarOptions instanceof WebPrintingJobScaleBarOptions) {
  39929. this.scaleBarOptions.destroy();
  39930. this.scaleBarOptions = null;
  39931. }
  39932. if (this.northArrowOptions instanceof WebPrintingJobNorthArrowOptions) {
  39933. this.northArrowOptions.destroy();
  39934. this.northArrowOptions = null;
  39935. }
  39936. if (this.littleMapOptions instanceof WebPrintingJobLittleMapOptions) {
  39937. this.littleMapOptions.destroy();
  39938. this.littleMapOptions = null;
  39939. }
  39940. if (this.legendOptions instanceof WebPrintingJobLegendOptions) {
  39941. this.legendOptions.destroy();
  39942. this.legendOptions = null;
  39943. }
  39944. }
  39945. /**
  39946. * @function SuperMap.WebPrintingJobLayoutOptions.prototype.toJSON
  39947. * @description 将 SuperMap.WebPrintingJobLayoutOptions 对象转化为 JSON 字符串。
  39948. * @returns {string} 返回转换后的 JSON 字符串。
  39949. */
  39950. }, {
  39951. key: "toJSON",
  39952. value: function toJSON() {
  39953. var params = {
  39954. templateName: this.templateName,
  39955. title: this.title,
  39956. subTitle: this.subTitle,
  39957. author: this.author,
  39958. copyright: this.copyright
  39959. };
  39960. if (this.scaleBarOptions) {
  39961. params.scaleBarOptions = this.scaleBarOptions;
  39962. }
  39963. if (this.northArrowOptions) {
  39964. params.northArrowOptions = this.northArrowOptions;
  39965. }
  39966. if (this.littleMapOptions) {
  39967. params.littleMapOptions = this.littleMapOptions;
  39968. }
  39969. if (this.legendOptions) {
  39970. params.legendOptions = this.legendOptions;
  39971. }
  39972. return Util.toJSON(params);
  39973. }
  39974. }]);
  39975. return WebPrintingJobLayoutOptions;
  39976. }();
  39977. SuperMap.WebPrintingJobLayoutOptions = WebPrintingJobLayoutOptions;
  39978. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobExportOptions.js
  39979. function WebPrintingJobExportOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39980. 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); } }
  39981. function WebPrintingJobExportOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobExportOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobExportOptions_defineProperties(Constructor, staticProps); return Constructor; }
  39982. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39983. * This program are made available under the terms of the Apache License, Version 2.0
  39984. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39985. /**
  39986. * @class SuperMap.WebPrintingJobExportOptions
  39987. * @classdesc Web 打印的输出参数类。
  39988. * @version 10.1.0
  39989. * @category iServer WebPrintingJob
  39990. * @param {Object} option - 初始化参数。
  39991. * @param {SuperMap.WebExportFormatType} option.format - Web 打印输出的格式,目前支持:PNG、PDF。
  39992. * @param {number} [option.dpi=96] - Web 打印输出的分辨率,单位为每英寸点数。默认值为 96 dpi。
  39993. * @param {number} [option.scale] - Web 打印输出的地图比例尺。
  39994. * @param {number} [option.rotation] - Web 打印输出的地图角度。
  39995. * @param {SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} [option.center] - Web 打印输出的地图中心点。
  39996. */
  39997. var WebPrintingJobExportOptions = /*#__PURE__*/function () {
  39998. function WebPrintingJobExportOptions(option) {
  39999. WebPrintingJobExportOptions_classCallCheck(this, WebPrintingJobExportOptions);
  40000. /**
  40001. * @member {SuperMap.WebExportFormatType} SuperMap.WebPrintingJobExportOptions.prototype.format
  40002. * @description Web 打印输出的格式。
  40003. */
  40004. this.format = null;
  40005. /**
  40006. * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.dpi=96]
  40007. * @description Web 打印输出的分辨率,单位为每英寸点数。
  40008. */
  40009. this.dpi = 96;
  40010. /**
  40011. * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.scale]
  40012. * @description Web 打印输出的地图比例尺。
  40013. */
  40014. this.scale = null;
  40015. /**
  40016. * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.rotation]
  40017. * @description Web 打印输出的地图角度。
  40018. */
  40019. this.rotation = null;
  40020. /**
  40021. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} [SuperMap.WebPrintingJobExportOptions.prototype.center]
  40022. * @description Web 打印输出的地图中心点。
  40023. */
  40024. this.center = null;
  40025. this.CLASS_NAME = 'SuperMap.WebPrintingJobExportOptions';
  40026. Util.extend(this, option);
  40027. }
  40028. /**
  40029. * @function SuperMap.WebPrintingJobExportOptions.prototype.destroy
  40030. * @description 释放资源,将引用资源的属性置空。
  40031. */
  40032. WebPrintingJobExportOptions_createClass(WebPrintingJobExportOptions, [{
  40033. key: "destroy",
  40034. value: function destroy() {
  40035. this.format = null;
  40036. this.dpi = null;
  40037. this.scale = null;
  40038. this.rotation = null;
  40039. this.center = null;
  40040. this.outputSize = null;
  40041. }
  40042. /**
  40043. * @function SuperMap.WebPrintingJobExportOptions.prototype.toJSON
  40044. * @description 将 SuperMap.WebPrintingJobExportOptions 对象转化为 JSON 字符串。
  40045. * @returns {string} 返回转换后的 JSON 字符串。
  40046. */
  40047. }, {
  40048. key: "toJSON",
  40049. value: function toJSON() {
  40050. var params = {
  40051. format: this.format || "PDF",
  40052. dpi: this.dpi,
  40053. scale: this.scale,
  40054. center: this.center
  40055. };
  40056. if (this.rotation) {
  40057. params.rotation = this.rotation;
  40058. }
  40059. if (this.outputSize) {
  40060. params.outputSize = this.outputSize;
  40061. }
  40062. return Util.toJSON(params);
  40063. }
  40064. }]);
  40065. return WebPrintingJobExportOptions;
  40066. }();
  40067. SuperMap.WebPrintingJobExportOptions = WebPrintingJobExportOptions;
  40068. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobParameters.js
  40069. function WebPrintingJobParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40070. 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); } }
  40071. function WebPrintingJobParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobParameters_defineProperties(Constructor, staticProps); return Constructor; }
  40072. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40073. * This program are made available under the terms of the Apache License, Version 2.0
  40074. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40075. /**
  40076. * @class SuperMap.WebPrintingJobParameters
  40077. * @category iServer WebPrintingJob
  40078. * @version 10.1.0
  40079. * @classdesc Web 打印参数类
  40080. * @param {Object} options - 初始化参数。
  40081. * @param {SuperMap.WebPrintingJobContent} options.content - Web 打印的内容类。
  40082. * @param {SuperMap.WebPrintingJobLayoutOptions} options.layoutOptions - Web 打印的布局类,包含各种布局元素的设置。
  40083. * @param {SuperMap.WebPrintingJobExportOptions} options.exportOptions - Web 打印的输出类,包含 DPI、页面大小等。
  40084. */
  40085. var WebPrintingJobParameters = /*#__PURE__*/function () {
  40086. function WebPrintingJobParameters(options) {
  40087. WebPrintingJobParameters_classCallCheck(this, WebPrintingJobParameters);
  40088. if (!options) {
  40089. return;
  40090. }
  40091. /**
  40092. * @member {SuperMap.WebPrintingJobContent} SuperMap.WebPrintingJobParameters.prototype.content
  40093. * @description Web 打印的内容类。
  40094. */
  40095. this.content = null;
  40096. /**
  40097. * @member {SuperMap.WebPrintingJobLayoutOptions} SuperMap.WebPrintingJobParameters.prototype.layoutOptions
  40098. * @description Web 打印的布局类,包含各种布局元素的设置。
  40099. */
  40100. this.layoutOptions = null;
  40101. /**
  40102. * @member {SuperMap.WebPrintingJobExportOptions} SuperMap.WebPrintingJobParameters.prototype.exportOptions
  40103. * @description Web 打印的输出类,包含 DPI、页面大小等。
  40104. */
  40105. this.exportOptions = null;
  40106. Util.extend(this, options);
  40107. this.CLASS_NAME = 'SuperMap.WebPrintingJobParameters';
  40108. }
  40109. /**
  40110. * @function SuperMap.WebPrintingJobParameters.prototype.destroy
  40111. * @description 释放资源,将引用资源的属性置空。
  40112. */
  40113. WebPrintingJobParameters_createClass(WebPrintingJobParameters, [{
  40114. key: "destroy",
  40115. value: function destroy() {
  40116. if (this.content instanceof WebPrintingJobContent) {
  40117. this.content.destroy();
  40118. this.content = null;
  40119. }
  40120. if (this.layoutOptions instanceof WebPrintingJobLayoutOptions) {
  40121. this.layoutOptions.destroy();
  40122. this.layoutOptions = null;
  40123. }
  40124. if (this.exportOptions instanceof WebPrintingJobExportOptions) {
  40125. this.exportOptions.destroy();
  40126. this.exportOptions = null;
  40127. }
  40128. }
  40129. }]);
  40130. return WebPrintingJobParameters;
  40131. }();
  40132. SuperMap.WebPrintingJobParameters = WebPrintingJobParameters;
  40133. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingService.js
  40134. function WebPrintingService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { WebPrintingService_typeof = function _typeof(obj) { return typeof obj; }; } else { WebPrintingService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return WebPrintingService_typeof(obj); }
  40135. function WebPrintingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40136. 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); } }
  40137. function WebPrintingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingService_defineProperties(Constructor, staticProps); return Constructor; }
  40138. function WebPrintingService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { WebPrintingService_get = Reflect.get; } else { WebPrintingService_get = function _get(target, property, receiver) { var base = WebPrintingService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return WebPrintingService_get(target, property, receiver || target); }
  40139. function WebPrintingService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = WebPrintingService_getPrototypeOf(object); if (object === null) break; } return object; }
  40140. function WebPrintingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) WebPrintingService_setPrototypeOf(subClass, superClass); }
  40141. function WebPrintingService_setPrototypeOf(o, p) { WebPrintingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingService_setPrototypeOf(o, p); }
  40142. 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); }; }
  40143. function WebPrintingService_possibleConstructorReturn(self, call) { if (call && (WebPrintingService_typeof(call) === "object" || typeof call === "function")) { return call; } return WebPrintingService_assertThisInitialized(self); }
  40144. function WebPrintingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40145. function WebPrintingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  40146. function WebPrintingService_getPrototypeOf(o) { WebPrintingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingService_getPrototypeOf(o); }
  40147. /* Copyright© 2000 - 2021 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 SuperMap.WebPrintingService
  40152. * @category iServer WebPrintingJob
  40153. * @version 10.1.0
  40154. * @classdesc 打印地图服务基类。
  40155. * @extends {SuperMap.CommonServiceBase}
  40156. * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  40157. * @param {Object} options - 参数。
  40158. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  40159. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40160. * @param {Object} [options.headers] - 请求头。
  40161. */
  40162. var WebPrintingService = /*#__PURE__*/function (_CommonServiceBase) {
  40163. WebPrintingService_inherits(WebPrintingService, _CommonServiceBase);
  40164. var _super = WebPrintingService_createSuper(WebPrintingService);
  40165. /**
  40166. * @function SuperMap.WebPrintingService.prototype.constructor
  40167. * @description 打印地图服务基类。
  40168. * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  40169. * @param {Object} options -参数。
  40170. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  40171. */
  40172. function WebPrintingService(url, options) {
  40173. var _this;
  40174. WebPrintingService_classCallCheck(this, WebPrintingService);
  40175. _this = _super.call(this, url, options);
  40176. if (options) {
  40177. Util.extend(WebPrintingService_assertThisInitialized(_this), options);
  40178. }
  40179. _this.CLASS_NAME = 'SuperMap.WebPrintingService';
  40180. if (!_this.url) {
  40181. return WebPrintingService_possibleConstructorReturn(_this);
  40182. }
  40183. return _this;
  40184. }
  40185. /**
  40186. * @function SuperMap.WebPrintingService.prototype.destroy
  40187. * @description 释放资源,将引用资源的属性置空。
  40188. */
  40189. WebPrintingService_createClass(WebPrintingService, [{
  40190. key: "destroy",
  40191. value: function destroy() {
  40192. WebPrintingService_get(WebPrintingService_getPrototypeOf(WebPrintingService.prototype), "destroy", this).call(this);
  40193. }
  40194. /**
  40195. * @function SuperMap.WebPrintingService.prototype.createWebPrintingJob
  40196. * @description 创建 Web 打印任务。
  40197. * @param {SuperMap.WebPrintingJobParameters} params - Web 打印的请求参数。
  40198. */
  40199. }, {
  40200. key: "createWebPrintingJob",
  40201. value: function createWebPrintingJob(params) {
  40202. if (!params) {
  40203. return;
  40204. }
  40205. if (params.layoutOptions) {
  40206. if (params.layoutOptions.legendOptions) {
  40207. !params.layoutOptions.legendOptions.title && (params.layoutOptions.legendOptions.title = '');
  40208. params.layoutOptions.legendOptions.picAsBase64 = params.layoutOptions.legendOptions.picAsBase64 && params.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/, '');
  40209. if (params.layoutOptions.legendOptions.customItems && params.layoutOptions.legendOptions.customItems.hasOwnProperty('picAsBase64')) {
  40210. params.layoutOptions.legendOptions.customItems.picAsBase64 = params.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/, '');
  40211. }
  40212. }
  40213. }
  40214. var me = this;
  40215. me.request({
  40216. url: me._processUrl('jobs'),
  40217. method: 'POST',
  40218. data: Util.toJSON(params),
  40219. scope: me,
  40220. success: me.serviceProcessCompleted,
  40221. failure: me.serviceProcessFailed
  40222. });
  40223. }
  40224. /**
  40225. * @function SuperMap.WebPrintingService.prototype.getPrintingJob
  40226. * @description 获取 Web 打印输出文档任务。
  40227. * @param {String} jobId - Web 打印任务 ID
  40228. */
  40229. }, {
  40230. key: "getPrintingJob",
  40231. value: function getPrintingJob(jobId) {
  40232. var me = this;
  40233. var url = me._processUrl("jobs/".concat(jobId));
  40234. me.request({
  40235. url: url,
  40236. method: 'GET',
  40237. scope: me,
  40238. success: function success(result) {
  40239. me.rollingProcess(result, url);
  40240. },
  40241. failure: me.serviceProcessFailed
  40242. });
  40243. }
  40244. /**
  40245. * @function SuperMap.WebPrintingService.prototype.getPrintingJobResult
  40246. * @description 获取 Web 打印任务的输出文档。
  40247. * @param {String} jobId - Web 打印输入文档任务 ID。
  40248. */
  40249. }, {
  40250. key: "getPrintingJobResult",
  40251. value: function getPrintingJobResult(jobId) {
  40252. var me = this;
  40253. me.request({
  40254. url: me._processUrl("jobs/".concat(jobId, "/result")),
  40255. method: 'GET',
  40256. scope: me,
  40257. success: me.serviceProcessCompleted,
  40258. failure: me.serviceProcessFailed
  40259. });
  40260. }
  40261. /**
  40262. * @function SuperMap.WebPrintingService.prototype.getLayoutTemplates
  40263. * @description 查询 Web 打印服务所有可用的模板信息。
  40264. */
  40265. }, {
  40266. key: "getLayoutTemplates",
  40267. value: function getLayoutTemplates() {
  40268. var me = this;
  40269. me.request({
  40270. url: me._processUrl('layouts'),
  40271. method: 'GET',
  40272. scope: me,
  40273. success: me.serviceProcessCompleted,
  40274. failure: me.serviceProcessFailed
  40275. });
  40276. }
  40277. /**
  40278. * @function SuperMap.WebPrintingService.prototype.rollingProcess
  40279. * @description 轮询查询 Web 打印任务。
  40280. * @param {Object} result - 服务器返回的结果对象。
  40281. */
  40282. }, {
  40283. key: "rollingProcess",
  40284. value: function rollingProcess(result, url) {
  40285. var me = this;
  40286. if (!result) {
  40287. return;
  40288. }
  40289. var id = setInterval(function () {
  40290. me.request({
  40291. url: url,
  40292. method: 'GET',
  40293. scope: me,
  40294. success: function success(result) {
  40295. switch (result.status) {
  40296. case 'FINISHED':
  40297. clearInterval(id);
  40298. me.serviceProcessCompleted(result);
  40299. break;
  40300. case 'ERROR':
  40301. clearInterval(id);
  40302. me.serviceProcessFailed(result);
  40303. break;
  40304. case 'RUNNING':
  40305. me.events.triggerEvent('processRunning', result);
  40306. break;
  40307. }
  40308. },
  40309. failure: me.serviceProcessFailed
  40310. });
  40311. }, 1000);
  40312. }
  40313. }, {
  40314. key: "_processUrl",
  40315. value: function _processUrl(appendContent) {
  40316. if (appendContent) {
  40317. return Util.urlPathAppend(this.url, appendContent);
  40318. }
  40319. return this.url;
  40320. }
  40321. }]);
  40322. return WebPrintingService;
  40323. }(CommonServiceBase);
  40324. SuperMap.WebPrintingService = WebPrintingService;
  40325. ;// CONCATENATED MODULE: ./src/common/iServer/index.js
  40326. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40327. * This program are made available under the terms of the Apache License, Version 2.0
  40328. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40329. ;// CONCATENATED MODULE: ./src/common/online/OnlineResources.js
  40330. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40331. * This program are made available under the terms of the Apache License, Version 2.0
  40332. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40333. /**
  40334. * @enum ServiceStatus
  40335. * @memberOf SuperMap
  40336. * @category iPortal/Online
  40337. * @description 服务发布状态。
  40338. */
  40339. var ServiceStatus = SuperMap.ServiceStatus = {
  40340. /** 不涉及,不可发布。 */
  40341. DOES_NOT_INVOLVE: "DOES_NOT_INVOLVE",
  40342. /** 发布失败。 */
  40343. PUBLISH_FAILED: "PUBLISH_FAILED",
  40344. /** 已发布。 */
  40345. PUBLISHED: "PUBLISHED",
  40346. /** 正在发布。 */
  40347. PUBLISHING: "PUBLISHING",
  40348. /** 未发布。 */
  40349. UNPUBLISHED: "UNPUBLISHED",
  40350. /** 取消服务失败。 */
  40351. UNPUBLISHED_FAILED: "UNPUBLISHED_FAILED"
  40352. };
  40353. /**
  40354. *
  40355. * @enum DataItemType
  40356. * @memberOf SuperMap
  40357. * @category iPortal/Online
  40358. * @description 数据项类型。
  40359. */
  40360. var OnlineResources_DataItemType = SuperMap.DataItemType = {
  40361. /** AUDIO */
  40362. AUDIO: "AUDIO",
  40363. /** COLOR */
  40364. COLOR: "COLOR",
  40365. /** COLORSCHEME */
  40366. COLORSCHEME: "COLORSCHEME",
  40367. /** CSV */
  40368. CSV: "CSV",
  40369. /** EXCEL */
  40370. EXCEL: "EXCEL",
  40371. /** FILLSYMBOL */
  40372. FILLSYMBOL: "FILLSYMBOL",
  40373. /** IMAGE */
  40374. IMAGE: "IMAGE",
  40375. /** LAYERTEMPLATE */
  40376. LAYERTEMPLATE: "LAYERTEMPLATE",
  40377. /** LAYOUTTEMPLATE */
  40378. LAYOUTTEMPLATE: "LAYOUTTEMPLATE",
  40379. /** LINESYMBOL */
  40380. LINESYMBOL: "LINESYMBOL",
  40381. /** MAPTEMPLATE */
  40382. MAPTEMPLATE: "MAPTEMPLATE",
  40383. /** MARKERSYMBOL */
  40384. MARKERSYMBOL: "MARKERSYMBOL",
  40385. /** MBTILES */
  40386. MBTILES: "MBTILES",
  40387. /** PHOTOS */
  40388. PHOTOS: "PHOTOS",
  40389. /** SHP */
  40390. SHP: "SHP",
  40391. /** SMTILES */
  40392. SMTILES: "SMTILES",
  40393. /** SVTILES */
  40394. SVTILES: "SVTILES",
  40395. /** THEMETEMPLATE */
  40396. THEMETEMPLATE: "THEMETEMPLATE",
  40397. /** TPK */
  40398. TPK: "TPK",
  40399. /** UDB */
  40400. UDB: "UDB",
  40401. /** UGCV5 */
  40402. UGCV5: "UGCV5",
  40403. /** UNKNOWN */
  40404. UNKNOWN: "UNKNOWN",
  40405. /** VIDEO */
  40406. VIDEO: "VIDEO",
  40407. /** WORKENVIRONMENT */
  40408. WORKENVIRONMENT: "WORKENVIRONMENT",
  40409. /** WORKSPACE */
  40410. WORKSPACE: "WORKSPACE"
  40411. };
  40412. /**
  40413. * @enum DataItemOrderBy
  40414. * @memberOf SuperMap
  40415. * @category iPortal/Online
  40416. * @description 数据排序字段。
  40417. */
  40418. var DataItemOrderBy = SuperMap.DataItemOrderBy = {
  40419. /** FILENAME */
  40420. FILENAME: "FILENAME",
  40421. /** ID */
  40422. ID: "ID",
  40423. /** LASTMODIFIEDTIME */
  40424. LASTMODIFIEDTIME: "LASTMODIFIEDTIME",
  40425. /** NICKNAME */
  40426. NICKNAME: "NICKNAME",
  40427. /** SERVICESTATUS */
  40428. SERVICESTATUS: "SERVICESTATUS",
  40429. /** SIZE */
  40430. SIZE: "SIZE",
  40431. /** STATUS */
  40432. STATUS: "STATUS",
  40433. /** TYPE */
  40434. TYPE: "TYPE",
  40435. /** UPDATETIME */
  40436. UPDATETIME: "UPDATETIME",
  40437. /** USERNAME */
  40438. USERNAME: "USERNAME"
  40439. };
  40440. /**
  40441. * @enum FilterField
  40442. * @memberOf SuperMap
  40443. * @category iPortal/Online
  40444. * @description 关键字查询时的过滤字段。
  40445. */
  40446. var FilterField = SuperMap.FilterField = {
  40447. /** LINKPAGE */
  40448. LINKPAGE: "LINKPAGE",
  40449. /** LINKPAGE */
  40450. MAPTITLE: "MAPTITLE",
  40451. /** LINKPAGE */
  40452. NICKNAME: "NICKNAME",
  40453. /** LINKPAGE */
  40454. RESTITLE: "RESTITLE",
  40455. /** LINKPAGE */
  40456. USERNAME: "USERNAME"
  40457. };
  40458. ;// CONCATENATED MODULE: ./src/common/online/OnlineServiceBase.js
  40459. function OnlineServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40460. 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); } }
  40461. function OnlineServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  40462. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40463. * This program are made available under the terms of the Apache License, Version 2.0
  40464. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40465. // import {SecurityManager} from '../security/SecurityManager';
  40466. /**
  40467. * @class SuperMap.OnlineServiceBase
  40468. * @classdesc Online 服务基类(使用 key 作为权限限制的类需要实现此类)。
  40469. * @category iPortal/Online
  40470. * @param {Object} options - 服务参数。
  40471. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40472. * @param {Object} [options.headers] - 请求头。
  40473. */
  40474. var OnlineServiceBase = /*#__PURE__*/function () {
  40475. function OnlineServiceBase(options) {
  40476. OnlineServiceBase_classCallCheck(this, OnlineServiceBase);
  40477. options = options || {};
  40478. Util.extend(this, options);
  40479. this.serverType = ServerType.ONLINE;
  40480. this.CLASS_NAME = "SuperMap.OnlineServiceBase";
  40481. }
  40482. /**
  40483. * @function SuperMap.OnlineServiceBase.prototype.request
  40484. * @description 请求 online 服务
  40485. * @param {string} [method='GET'] - 请求方式, 'GET', 'PUT', 'POST', 'DELETE'。
  40486. * @param {string} url - 服务地址。
  40487. * @param {Object} param - URL 查询参数。
  40488. * @param {Object} [requestOptions] - http 请求参数, 比如请求头,超时时间等。
  40489. * @returns {Promise} 返回包含请求结果的 Promise 对象。
  40490. */
  40491. OnlineServiceBase_createClass(OnlineServiceBase, [{
  40492. key: "request",
  40493. value: function request(method, url, param) {
  40494. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  40495. url = this.createCredentialUrl(url);
  40496. requestOptions['crossOrigin'] = this.options.crossOrigin;
  40497. requestOptions['headers'] = this.options.headers;
  40498. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  40499. return response.json();
  40500. });
  40501. }
  40502. /**
  40503. * @function SuperMap.OnlineServiceBase.prototype.createCredentialUrl
  40504. * @description 追加授权信息。
  40505. * @param {string} url - 对接的 online 服务地址。
  40506. */
  40507. }, {
  40508. key: "createCredentialUrl",
  40509. value: function createCredentialUrl(url) {
  40510. var newUrl = url,
  40511. key = this.getCredential();
  40512. if (key) {
  40513. var paramStr = "key=" + key;
  40514. var endStr = newUrl.substring(newUrl.length - 1, newUrl.length);
  40515. if (newUrl.indexOf("?") > -1 && endStr === "?") {
  40516. newUrl += paramStr;
  40517. } else if (newUrl.indexOf("?") > -1 && endStr !== "?") {
  40518. newUrl += "&" + paramStr;
  40519. } else {
  40520. newUrl += "?" + paramStr;
  40521. }
  40522. }
  40523. return newUrl;
  40524. } //其子类需要重写该方法,修改其中获取key的字段
  40525. //存储key可能是服务id字段,可能是url,或者是WebAPI类型
  40526. }, {
  40527. key: "getCredential",
  40528. value: function getCredential() {//return SecurityManager.getKey(this.id);
  40529. //或
  40530. //return SecurityManager.getKey(this.serviceUrl);
  40531. }
  40532. }]);
  40533. return OnlineServiceBase;
  40534. }();
  40535. SuperMap.OnlineServiceBase = OnlineServiceBase;
  40536. ;// CONCATENATED MODULE: ./src/common/online/OnlineData.js
  40537. function OnlineData_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { OnlineData_typeof = function _typeof(obj) { return typeof obj; }; } else { OnlineData_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return OnlineData_typeof(obj); }
  40538. function OnlineData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40539. 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); } }
  40540. function OnlineData_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineData_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineData_defineProperties(Constructor, staticProps); return Constructor; }
  40541. function OnlineData_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) OnlineData_setPrototypeOf(subClass, superClass); }
  40542. function OnlineData_setPrototypeOf(o, p) { OnlineData_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OnlineData_setPrototypeOf(o, p); }
  40543. 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); }; }
  40544. function OnlineData_possibleConstructorReturn(self, call) { if (call && (OnlineData_typeof(call) === "object" || typeof call === "function")) { return call; } return OnlineData_assertThisInitialized(self); }
  40545. function OnlineData_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40546. function OnlineData_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  40547. function OnlineData_getPrototypeOf(o) { OnlineData_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OnlineData_getPrototypeOf(o); }
  40548. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40549. * This program are made available under the terms of the Apache License, Version 2.0
  40550. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40551. /**
  40552. * @class SuperMap.OnlineData
  40553. * @classdesc Online myData 服务。
  40554. * @category iPortal/Online
  40555. * @param {string} serviceRootUrl - 服务根地址。
  40556. * @param {Object} options - 服务相关参数。
  40557. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40558. * @param {Object} [options.headers] - 请求头。
  40559. */
  40560. var OnlineData = /*#__PURE__*/function (_OnlineServiceBase) {
  40561. OnlineData_inherits(OnlineData, _OnlineServiceBase);
  40562. var _super = OnlineData_createSuper(OnlineData);
  40563. //TODO 目前并没有对接服务支持的所有操作,日后需要补充完整
  40564. function OnlineData(serviceRootUrl, options) {
  40565. var _this;
  40566. OnlineData_classCallCheck(this, OnlineData);
  40567. _this = _super.call(this, serviceRootUrl);
  40568. options = options || {}; //MD5
  40569. _this.MD5 = null; //文件类型。
  40570. _this.type = null; //数据上传者名称。
  40571. _this.userName = null; //文件名称。
  40572. _this.fileName = null; //文件大小,单位为 B 。
  40573. _this.size = null; //服务发布状态。
  40574. _this.serviceStatus = null; //服务 id 。
  40575. _this.serviceId = null; //数据项 id 。
  40576. _this.id = null; //最后修改时间。
  40577. _this.lastModfiedTime = null; //文件状态。
  40578. _this.status = null; //数据文件存储 id 。
  40579. _this.storageId = null; //数据的发布信息。
  40580. _this.publishInfo = null; //数据的权限信息。
  40581. _this.authorizeSetting = null; //用户的昵称。
  40582. _this.nickname = null; //数据的标签。
  40583. _this.tags = []; //数据的描述信息。
  40584. _this.description = null; //数据发布的服务信息集合。
  40585. _this.dataItemServices = null; //数据坐标类型。
  40586. _this.coordType = null; //数据审核信息
  40587. _this.dataCheckResult = null; //数据元数据信息
  40588. _this.dataMetaInfo = null; //数据的缩略图路径。
  40589. _this.thumbnail = null;
  40590. Util.extend(OnlineData_assertThisInitialized(_this), options);
  40591. if (_this.id) {
  40592. _this.serviceUrl = serviceRootUrl + "/" + _this.id;
  40593. }
  40594. _this.CLASS_NAME = "SuperMap.OnlineData";
  40595. return _this;
  40596. }
  40597. /**
  40598. * @function SuperMap.OnlineData.prototype.load
  40599. * @description 通过 URL 请求获取该服务完整信息。
  40600. * @returns {Promise} 返回不包含请求结果的 Promise 对象,请求返回结果自动填充到该类属性中。
  40601. */
  40602. OnlineData_createClass(OnlineData, [{
  40603. key: "load",
  40604. value: function load() {
  40605. if (!this.serviceUrl) {
  40606. return;
  40607. }
  40608. var me = this;
  40609. return me.request("GET", this.serviceUrl).then(function (result) {
  40610. Util.extend(me, result);
  40611. });
  40612. }
  40613. /**
  40614. * @function SuperMap.OnlineData.prototype.getPublishedServices
  40615. * @description 获取数据发布的所有服务。
  40616. * @returns {Object} 数据发布的所有服务。
  40617. */
  40618. }, {
  40619. key: "getPublishedServices",
  40620. value: function getPublishedServices() {
  40621. return this.dataItemServices;
  40622. }
  40623. /**
  40624. * @function SuperMap.OnlineData.prototype.getAuthorizeSetting
  40625. * @description 获取数据的权限信息。
  40626. * @returns {Object} 权限信息。
  40627. */
  40628. }, {
  40629. key: "getAuthorizeSetting",
  40630. value: function getAuthorizeSetting() {
  40631. return this.authorizeSetting;
  40632. }
  40633. }]);
  40634. return OnlineData;
  40635. }(OnlineServiceBase);
  40636. SuperMap.OnlineData = OnlineData;
  40637. ;// CONCATENATED MODULE: ./src/common/online/Online.js
  40638. function Online_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40639. 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); } }
  40640. function Online_createClass(Constructor, protoProps, staticProps) { if (protoProps) Online_defineProperties(Constructor.prototype, protoProps); if (staticProps) Online_defineProperties(Constructor, staticProps); return Constructor; }
  40641. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40642. * This program are made available under the terms of the Apache License, Version 2.0
  40643. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40644. /**
  40645. * @class SuperMap.Online
  40646. * @classdesc 对接 SuperMap Online 所有基础服务。
  40647. * @category iPortal/Online
  40648. * @example
  40649. * var online=new SuperMap.Online();
  40650. * var services = online.queryDatas(param);
  40651. * service.then(function(services){
  40652. * var service= services[0];
  40653. * service.updateDataInfo();
  40654. * })
  40655. */
  40656. var Online = /*#__PURE__*/function () {
  40657. //TODO 目前并没有对接Online的所有操作,需要补充完整
  40658. //所有查询返回的是一个Promise,在外部使用的时候通过Promise的then方法获取异步结果
  40659. function Online() {
  40660. Online_classCallCheck(this, Online);
  40661. this.rootUrl = "https://www.supermapol.com";
  40662. this.webUrl = this.rootUrl + "/web";
  40663. var mContentUrl = this.webUrl + "/mycontent";
  40664. this.mDatasUrl = mContentUrl + "/datas";
  40665. this.CLASS_NAME = "SuperMap.Online";
  40666. }
  40667. /**
  40668. * @function SuperMap.Online.prototype.load
  40669. * @description 加载 online,验证 online 是否可用。
  40670. * @returns {Promise} 返回包含网络请求结果的 Promise 对象。
  40671. */
  40672. Online_createClass(Online, [{
  40673. key: "load",
  40674. value: function load() {
  40675. return FetchRequest.get(this.rootUrl).then(function (response) {
  40676. return response;
  40677. });
  40678. }
  40679. /**
  40680. * @function SuperMap.Online.prototype.login
  40681. * @description 登录Online
  40682. */
  40683. }, {
  40684. key: "login",
  40685. value: function login() {
  40686. SecurityManager.loginOnline(this.rootUrl, true);
  40687. }
  40688. /**
  40689. * @function SuperMap.Online.prototype.queryDatas
  40690. * @description 查询 Online “我的内容” 下 “我的数据” 服务(需要登录状态获取),并返回可操作的服务对象。
  40691. * @param {SuperMap.OnlineQueryDatasParameter} parameter - myDatas 服务资源查询参数。
  40692. * @returns {Promise} 返回包含所有数据服务信息的 Promise 对象。
  40693. */
  40694. }, {
  40695. key: "queryDatas",
  40696. value: function queryDatas(parameter) {
  40697. var me = this,
  40698. url = me.mDatasUrl;
  40699. if (parameter) {
  40700. parameter = parameter.toJSON();
  40701. }
  40702. return FetchRequest.get(url, parameter).then(function (json) {
  40703. if (!json || !json.content || json.content.length < 1) {
  40704. return;
  40705. }
  40706. var services = [],
  40707. contents = json.content,
  40708. len = contents.length;
  40709. for (var i = 0; i < len; i++) {
  40710. var content = contents[i];
  40711. var service = new OnlineData(me.mDatasUrl, content);
  40712. services.push(service);
  40713. }
  40714. return services;
  40715. });
  40716. }
  40717. }]);
  40718. return Online;
  40719. }();
  40720. SuperMap.Online = Online;
  40721. ;// CONCATENATED MODULE: ./src/common/online/OnlineQueryDatasParameter.js
  40722. function OnlineQueryDatasParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40723. 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); } }
  40724. function OnlineQueryDatasParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineQueryDatasParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineQueryDatasParameter_defineProperties(Constructor, staticProps); return Constructor; }
  40725. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40726. * This program are made available under the terms of the Apache License, Version 2.0
  40727. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40728. /**
  40729. * @class SuperMap.OnlineQueryDatasParameter
  40730. * @classdesc myDatas 服务资源查询参数。
  40731. * @category iPortal/Online
  40732. * @param {Object} options - 查询参数。
  40733. */
  40734. var OnlineQueryDatasParameter = /*#__PURE__*/function () {
  40735. function OnlineQueryDatasParameter(options) {
  40736. OnlineQueryDatasParameter_classCallCheck(this, OnlineQueryDatasParameter);
  40737. options = options || {};
  40738. /**
  40739. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.userNames
  40740. * @description 数据作者名。可以根据数据作者名查询,默认查询全部。
  40741. */
  40742. this.userNames = null;
  40743. /**
  40744. * @member {Array.<Object>} SuperMap.OnlineQueryDatasParameter.prototype.types
  40745. * @description 数据类型。
  40746. */
  40747. this.types = null;
  40748. /**
  40749. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.fileName
  40750. * @description 文件名称。
  40751. */
  40752. this.fileName = null;
  40753. /**
  40754. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.serviceStatuses
  40755. * @description 服务发布状态。
  40756. */
  40757. this.serviceStatuses = null;
  40758. /**
  40759. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.serviceId
  40760. * @description 服务 ID。
  40761. */
  40762. this.serviceId = null;
  40763. /**
  40764. * @member {Array.<integer>} SuperMap.OnlineQueryDatasParameter.prototype.ids
  40765. * @description 由数据项 ID 组成的整型数组。
  40766. */
  40767. this.ids = null;
  40768. /**
  40769. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.keywords
  40770. * @description 关键字。
  40771. */
  40772. this.keywords = null;
  40773. /**
  40774. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.orderBy
  40775. * @description 排序字段。
  40776. */
  40777. this.orderBy = null;
  40778. /**
  40779. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.tags
  40780. * @description 数据的标签。
  40781. */
  40782. this.tags = null;
  40783. /**
  40784. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.filterFields
  40785. * @description 用于关键字查询时的过滤字段。
  40786. */
  40787. this.filterFields = null;
  40788. Util.extend(this, options);
  40789. this.CLASS_NAME = "SuperMap.OnlineQueryDatasParameter";
  40790. }
  40791. /**
  40792. * @function SuperMap.OnlineQueryDatasParameter.prototype.toJSON
  40793. * @description 返回对应的 JSON 对象。
  40794. * @returns {Object} 对应的 JSON 对象。
  40795. */
  40796. OnlineQueryDatasParameter_createClass(OnlineQueryDatasParameter, [{
  40797. key: "toJSON",
  40798. value: function toJSON() {
  40799. var me = this;
  40800. var jsonObj = {
  40801. "types": me.types,
  40802. "fileName": me.fileName,
  40803. "serviceStatuses": me.serviceStatuses,
  40804. "serviceId": me.serviceId,
  40805. "ids": me.ids,
  40806. "keywords": me.keywords,
  40807. "orderBy": me.orderBy,
  40808. "tags": me.tags,
  40809. "filterFields": me.filterFields
  40810. };
  40811. for (var key in jsonObj) {
  40812. if (jsonObj[key] == null) {
  40813. delete jsonObj[key];
  40814. }
  40815. }
  40816. return jsonObj;
  40817. }
  40818. }]);
  40819. return OnlineQueryDatasParameter;
  40820. }();
  40821. SuperMap.OnlineQueryDatasParameter = OnlineQueryDatasParameter;
  40822. ;// CONCATENATED MODULE: ./src/common/online/index.js
  40823. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40824. * This program are made available under the terms of the Apache License, Version 2.0
  40825. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40826. ;// CONCATENATED MODULE: ./src/common/security/KeyServiceParameter.js
  40827. function KeyServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40828. 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); } }
  40829. function KeyServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KeyServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KeyServiceParameter_defineProperties(Constructor, staticProps); return Constructor; }
  40830. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40831. * This program are made available under the terms of the Apache License, Version 2.0
  40832. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40833. /**
  40834. * @class SuperMap.KeyServiceParameter
  40835. * @classdesc key申请参数
  40836. * @category Security
  40837. * @param {Object} options - 参数。
  40838. * @param {string} options.name - 申请服务名称。
  40839. * @param {number} options.serviceIds - 服务 ID。
  40840. * @param {SuperMap.ClientType} [options.clientType=SuperMap.ClientType.SERVER] - 服务端类型。
  40841. * @param {number} options.limitation - 有效期
  40842. */
  40843. var KeyServiceParameter = /*#__PURE__*/function () {
  40844. function KeyServiceParameter(options) {
  40845. KeyServiceParameter_classCallCheck(this, KeyServiceParameter);
  40846. this.name = null;
  40847. this.serviceIds = null;
  40848. this.clientType = ClientType.SERVER;
  40849. this.limitation = null;
  40850. Util.extend(this, options);
  40851. this.CLASS_NAME = "SuperMap.KeyServiceParameter";
  40852. }
  40853. /**
  40854. * @function SuperMap.KeyServiceParameter.prototype.toJSON
  40855. * @description 转换成 JSON 对象
  40856. * @returns {Object} 参数的 JSON 对象
  40857. */
  40858. KeyServiceParameter_createClass(KeyServiceParameter, [{
  40859. key: "toJSON",
  40860. value: function toJSON() {
  40861. return {
  40862. name: this.name,
  40863. serviceIds: this.serviceIds,
  40864. clientType: this.clientType,
  40865. limitation: this.limitation
  40866. };
  40867. }
  40868. }]);
  40869. return KeyServiceParameter;
  40870. }();
  40871. SuperMap.KeyServiceParameter = KeyServiceParameter;
  40872. ;// CONCATENATED MODULE: ./src/common/security/ServerInfo.js
  40873. function ServerInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40874. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40875. * This program are made available under the terms of the Apache License, Version 2.0
  40876. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40877. /**
  40878. * @class SuperMap.ServerInfo
  40879. * @classdesc 服务器信息(安全相关),包含服务器类型,服务地址,token服务地址等
  40880. * @category Security
  40881. * @param {string} type - 服务器类型
  40882. * @param {Object} options - 服务器信息相关可选参数。
  40883. * @param {string} options.server - 服务器地址,如:http://supermapiserver:8090/iserver
  40884. * @param {string} [options.tokenServiceUrl] - 如:http://supermapiserver:8090/iserver/services/security/tokens.json
  40885. * @param {string} [options.keyServiceUrl] - 如:http://supermapiserver:8092/web/mycontent/keys/register.json
  40886. */
  40887. var ServerInfo = function ServerInfo(type, options) {
  40888. ServerInfo_classCallCheck(this, ServerInfo);
  40889. /**
  40890. * @member {SuperMap.ServerType} SuperMap.ServerInfo.prototype.type
  40891. * @description 服务器类型
  40892. */
  40893. this.type = type;
  40894. /**
  40895. * @member {string} SuperMap.ServerInfo.prototype.server
  40896. * @description 服务器地址
  40897. */
  40898. this.server = null;
  40899. /**
  40900. * @member {string} [SuperMap.ServerInfo.prototype.tokenServiceUrl]
  40901. * @description 如:http://supermapiserver:8090/iserver/services/security/tokens.json
  40902. */
  40903. this.tokenServiceUrl = null;
  40904. /**
  40905. * @member {string} [SuperMap.ServerInfo.prototype.keyServiceUrl]
  40906. * @description 如:http://supermapiserver:8092/web/mycontent/keys/register.json
  40907. */
  40908. this.keyServiceUrl = null;
  40909. Util.extend(this, options);
  40910. this.CLASS_NAME = "SuperMap.ServerInfo";
  40911. this.type = this.type || ServerType.ISERVER;
  40912. if (!this.server) {
  40913. console.error('server url require is not undefined');
  40914. } // var patten = /http:\/\/([^\/]+)/i;
  40915. //this.server = this.server.match(patten)[0];
  40916. var tokenServiceSuffix = "/services/security/tokens";
  40917. if (this.type === ServerType.ISERVER && this.server.indexOf("iserver") < 0) {
  40918. tokenServiceSuffix = "/iserver" + tokenServiceSuffix;
  40919. }
  40920. if (!this.tokenServiceUrl) {
  40921. this.tokenServiceUrl = Util.urlPathAppend(this.server, tokenServiceSuffix);
  40922. }
  40923. if (!this.keyServiceUrl) {
  40924. if (this.type === ServerType.IPORTAL) {
  40925. this.keyServiceUrl = Util.urlPathAppend(this.server, "/web/mycontent/keys/register");
  40926. } else if (this.type === ServerType.ONLINE) {
  40927. this.keyServiceUrl = Util.urlPathAppend(this.server, "/web/mycontent/keys");
  40928. }
  40929. }
  40930. };
  40931. SuperMap.ServerInfo = ServerInfo;
  40932. ;// CONCATENATED MODULE: ./src/common/security/TokenServiceParameter.js
  40933. function TokenServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40934. 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); } }
  40935. function TokenServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TokenServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TokenServiceParameter_defineProperties(Constructor, staticProps); return Constructor; }
  40936. /* Copyright© 2000 - 2021 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 SuperMap.TokenServiceParameter
  40941. * @classdesc token 申请参数。
  40942. * @category Security
  40943. * @param {Object} options - token 申请参数。
  40944. * @param {string} options.username - 用户名。
  40945. * @param {string} options.password - 密码。
  40946. * @param {SuperMap.ClientType} [options.clientType='SuperMap.ClientType.NONE'] - token 申请的客户端标识类型。
  40947. * @param {string} [options.ip] - clientType=IP 时,必选。
  40948. * @param {string} [options.referer] -clientType=Referer 时,必选。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  40949. * @param {number} [options.expiration=60] - 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  40950. *
  40951. *
  40952. */
  40953. var TokenServiceParameter = /*#__PURE__*/function () {
  40954. function TokenServiceParameter(options) {
  40955. TokenServiceParameter_classCallCheck(this, TokenServiceParameter);
  40956. /**
  40957. * @member {string} SuperMap.TokenServiceParameter.prototype.userName
  40958. * @description 用户名。
  40959. */
  40960. this.userName = null;
  40961. /**
  40962. * @member {string} SuperMap.TokenServiceParameter.prototype.password
  40963. * @description 密码。
  40964. */
  40965. this.password = null;
  40966. /**
  40967. * @member {SuperMap.ClientType} SuperMap.TokenServiceParameter.prototype.clientType
  40968. * @description token 申请的客户端标识类型。
  40969. */
  40970. this.clientType = ClientType.NONE;
  40971. /**
  40972. * @member {string} [SuperMap.TokenServiceParameter.prototype.ip]
  40973. * @description clientType=IP 时,必选。
  40974. */
  40975. this.ip = null;
  40976. /**
  40977. * @member {string} [SuperMap.TokenServiceParameter.prototype.referer]
  40978. * @description clientType=Referer 时,必选。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  40979. */
  40980. this.referer = null;
  40981. /**
  40982. * @member {number} SuperMap.TokenServiceParameter.prototype.expiration
  40983. * @description 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  40984. */
  40985. this.expiration = 60;
  40986. Util.extend(this, options);
  40987. this.CLASS_NAME = "SuperMap.TokenServiceParameter";
  40988. }
  40989. /**
  40990. * @function SuperMap.TokenServiceParameter.prototype.toJSON
  40991. * @description 将所有信息转成 JSON 字符串
  40992. * @returns {string} 参数的 JSON 字符串
  40993. */
  40994. TokenServiceParameter_createClass(TokenServiceParameter, [{
  40995. key: "toJSON",
  40996. value: function toJSON() {
  40997. return {
  40998. userName: this.userName,
  40999. password: this.password,
  41000. clientType: this.clientType,
  41001. ip: this.ip,
  41002. referer: this.referer,
  41003. expiration: this.expiration
  41004. };
  41005. }
  41006. }]);
  41007. return TokenServiceParameter;
  41008. }();
  41009. SuperMap.TokenServiceParameter = TokenServiceParameter;
  41010. ;// CONCATENATED MODULE: ./src/common/security/index.js
  41011. /* Copyright© 2000 - 2021 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. ;// CONCATENATED MODULE: external "function(){try{return elasticsearch}catch(e){return {}}}()"
  41015. var external_function_try_return_elasticsearch_catch_e_return_namespaceObject = function(){try{return elasticsearch}catch(e){return {}}}();
  41016. var external_function_try_return_elasticsearch_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_elasticsearch_catch_e_return_namespaceObject);
  41017. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/ElasticSearch.js
  41018. function ElasticSearch_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41019. 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); } }
  41020. function ElasticSearch_createClass(Constructor, protoProps, staticProps) { if (protoProps) ElasticSearch_defineProperties(Constructor.prototype, protoProps); if (staticProps) ElasticSearch_defineProperties(Constructor, staticProps); return Constructor; }
  41021. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  41022. * This program are made available under the terms of the Apache License, Version 2.0
  41023. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41024. /**
  41025. * @class SuperMap.ElasticSearch
  41026. * @classdesc ElasticSearch服务类。
  41027. * @category ElasticSearch
  41028. * @param {string} url - ElasticSearch服务地址。
  41029. * @param {Object} options - 参数。
  41030. * @param {function} [options.change] - 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  41031. * @param {boolean} [options.openGeoFence=false] - 是否开启地理围栏验证,默认为不开启。
  41032. * @param {function} [options.outOfGeoFence] - 数据超出地理围栏后执行的函数。
  41033. * @param {Object} [options.geoFence] - 地理围栏。
  41034. */
  41035. var ElasticSearch = /*#__PURE__*/function () {
  41036. function ElasticSearch(url, options) {
  41037. ElasticSearch_classCallCheck(this, ElasticSearch);
  41038. options = options || {};
  41039. /**
  41040. * @member {string} SuperMap.ElasticSearch.prototype.url
  41041. * @description ElasticSearch服务地址
  41042. */
  41043. this.url = url;
  41044. /**
  41045. * @member {Object} SuperMap.ElasticSearch.prototype.client
  41046. * @description client ES客户端
  41047. */
  41048. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  41049. host: this.url
  41050. });
  41051. /**
  41052. * @deprecated
  41053. * @member {function} [SuperMap.ElasticSearch.prototype.change]
  41054. * @description 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  41055. */
  41056. this.change = null;
  41057. /**
  41058. * @member {boolean} [SuperMap.ElasticSearch.prototype.openGeoFence=false]
  41059. * @description 是否开启地理围栏验证,默认为不开启。
  41060. */
  41061. this.openGeoFence = false;
  41062. /**
  41063. * @member {function} [SuperMap.ElasticSearch.prototype.outOfGeoFence]
  41064. * @description 数据超出地理围栏后执行的函数
  41065. */
  41066. this.outOfGeoFence = null;
  41067. /**
  41068. * @member {Object} [SuperMap.ElasticSearch.prototype.geoFence]
  41069. * @description 地理围栏
  41070. * @example {
  41071. * radius: 1000,//单位是m
  41072. * center: [104.40, 30.43],
  41073. * unit: 'meter|degree'
  41074. * }
  41075. */
  41076. this.geoFence = null;
  41077. /*
  41078. * Constant: EVENT_TYPES
  41079. * {Array.<String>}
  41080. * 此类支持的事件类型。
  41081. *
  41082. */
  41083. this.EVENT_TYPES = ['change', 'error', 'outOfGeoFence'];
  41084. /**
  41085. * @member {SuperMap.Events} SuperMap.ElasticSearch.prototype.events
  41086. * @description 事件
  41087. */
  41088. this.events = new Events(this, null, this.EVENT_TYPES);
  41089. /**
  41090. * @member {Object} SuperMap.ElasticSearch.prototype.eventListeners
  41091. * @description 听器对象,在构造函数中设置此参数(可选),对 MapService 支持的两个事件 processCompleted 、processFailed 进行监听,
  41092. * 相当于调用 SuperMap.Events.on(eventListeners)。
  41093. */
  41094. this.eventListeners = null;
  41095. Util.extend(this, options);
  41096. if (this.eventListeners instanceof Object) {
  41097. this.events.on(this.eventListeners);
  41098. }
  41099. }
  41100. /**
  41101. * @function SuperMap.ElasticSearch.prototype.setGeoFence
  41102. * @description 设置地理围栏,openGeoFence参数为true的时候,设置的地理围栏才生效。
  41103. * @param {SuperMap.Geometry} geoFence - 地理围栏。
  41104. */
  41105. ElasticSearch_createClass(ElasticSearch, [{
  41106. key: "setGeoFence",
  41107. value: function setGeoFence(geoFence) {
  41108. this.geoFence = geoFence;
  41109. }
  41110. /**
  41111. * @function SuperMap.ElasticSearch.prototype.bulk
  41112. * @description 批量操作API,允许执行多个索引/删除操作。
  41113. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk}</br>
  41114. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html}</br>
  41115. * @param {Object} params - 参数。
  41116. * @param {function} callback - 回调函数。
  41117. */
  41118. }, {
  41119. key: "bulk",
  41120. value: function bulk(params, callback) {
  41121. return this.client.bulk(params, callback);
  41122. }
  41123. /**
  41124. * @function SuperMap.ElasticSearch.prototype.clearScroll
  41125. * @description 通过指定scroll参数进行查询来清除已经创建的scroll请求。
  41126. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-clearscroll}</br>
  41127. *更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  41128. * @param {Object} params - 参数。
  41129. * @param {function} callback - 回调函数。
  41130. */
  41131. }, {
  41132. key: "clearScroll",
  41133. value: function clearScroll(params, callback) {
  41134. return this.client.clearScroll(params, callback);
  41135. }
  41136. /**
  41137. * @function SuperMap.ElasticSearch.prototype.count
  41138. * @description 获取集群、索引、类型或查询的文档个数。
  41139. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-count}</br>
  41140. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html}</br>
  41141. * @param {Object} params - 参数。
  41142. * @param {function} callback - 回调函数。
  41143. */
  41144. }, {
  41145. key: "count",
  41146. value: function count(params, callback) {
  41147. return this.client.count(params, callback);
  41148. }
  41149. /**
  41150. * @function SuperMap.ElasticSearch.prototype.count
  41151. * @description 在特定索引中添加一个类型化的JSON文档,使其可搜索。如果具有相同index,type且id已经存在的文档将发生错误。</br>
  41152. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create}
  41153. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}
  41154. * @param {Object} params - 参数。
  41155. * @param {function} callback - 回调函数。
  41156. */
  41157. }, {
  41158. key: "create",
  41159. value: function create(params, callback) {
  41160. return this.client.create(params, callback);
  41161. }
  41162. /**
  41163. * @function SuperMap.ElasticSearch.prototype.delete
  41164. * @description 根据其ID从特定索引中删除键入的JSON文档。
  41165. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-delete}</br>
  41166. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html}</br>
  41167. * @param {Object} params - 参数。
  41168. * @param {function} callback - 回调函数。
  41169. */
  41170. }, {
  41171. key: "delete",
  41172. value: function _delete(params, callback) {
  41173. return this.client["delete"](params, callback);
  41174. }
  41175. /**
  41176. * @function SuperMap.ElasticSearch.prototype.delete
  41177. * @description 根据其ID从特定索引中删除键入的JSON文档。
  41178. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletebyquery}</br>
  41179. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html}</br>
  41180. * @param {Object} params - 参数。
  41181. * @param {function} callback - 回调函数。
  41182. */
  41183. }, {
  41184. key: "deleteByQuery",
  41185. value: function deleteByQuery(params, callback) {
  41186. return this.client.deleteByQuery(params, callback);
  41187. }
  41188. /**
  41189. * @function SuperMap.ElasticSearch.prototype.delete
  41190. * @description 根据其ID删除脚本。</br>
  41191. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletescript}</br>
  41192. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  41193. * @param {Object} params - 参数。
  41194. * @param {function} callback - 回调函数。
  41195. */
  41196. }, {
  41197. key: "deleteScript",
  41198. value: function deleteScript(params, callback) {
  41199. return this.client.deleteScript(params, callback);
  41200. }
  41201. /**
  41202. * @function SuperMap.ElasticSearch.prototype.deleteTemplate
  41203. * @description 根据其ID删除模板。</br>
  41204. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletetemplate}</br>
  41205. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  41206. * @param {Object} params - 参数。
  41207. * @param {function} callback - 回调函数。
  41208. */
  41209. }, {
  41210. key: "deleteTemplate",
  41211. value: function deleteTemplate(params, callback) {
  41212. return this.client.deleteTemplate(params, callback);
  41213. }
  41214. /**
  41215. * @function SuperMap.ElasticSearch.prototype.exists
  41216. * @description 检查给定文档是否存在。</br>
  41217. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-exists}</br>
  41218. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  41219. * @param {Object} params - 参数。
  41220. * @param {function} callback - 回调函数。
  41221. */
  41222. }, {
  41223. key: "exists",
  41224. value: function exists(params, callback) {
  41225. return this.client.exists(params, callback);
  41226. }
  41227. /**
  41228. * @function SuperMap.ElasticSearch.prototype.existsSource
  41229. * @description 检查资源是否存在。</br>
  41230. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-existssource}</br>
  41231. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  41232. * @param {Object} params - 参数。
  41233. * @param {function} callback - 回调函数。
  41234. */
  41235. }, {
  41236. key: "existsSource",
  41237. value: function existsSource(params, callback) {
  41238. return this.client.existsSource(params, callback);
  41239. }
  41240. /**
  41241. * @function SuperMap.ElasticSearch.prototype.explain
  41242. * @description 提供与特定查询相关的特定文档分数的详细信息。它还会告诉您文档是否与指定的查询匹配。</br>
  41243. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-explain}</br>
  41244. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html}</br>
  41245. * @param {Object} params - 参数。
  41246. * @param {function} callback - 回调函数。
  41247. */
  41248. }, {
  41249. key: "explain",
  41250. value: function explain(params, callback) {
  41251. return this.client.explain(params, callback);
  41252. }
  41253. /**
  41254. * @function SuperMap.ElasticSearch.prototype.fieldCaps
  41255. * @description 允许检索多个索引之间的字段的功能。(实验性API,可能会在未来版本中删除)</br>
  41256. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-fieldcaps}</br>
  41257. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html}</br>
  41258. * @param {Object} params - 参数。
  41259. * @param {function} callback - 回调函数。
  41260. */
  41261. }, {
  41262. key: "fieldCaps",
  41263. value: function fieldCaps(params, callback) {
  41264. return this.client.fieldCaps(params, callback);
  41265. }
  41266. /**
  41267. * @function SuperMap.ElasticSearch.prototype.get
  41268. * @description 从索引获取一个基于其id的类型的JSON文档。</br>
  41269. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-get}</br>
  41270. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  41271. * @param {Object} params - 参数。
  41272. * @param {function} callback - 回调函数。
  41273. */
  41274. }, {
  41275. key: "get",
  41276. value: function get(params, callback) {
  41277. return this.client.get(params, callback);
  41278. }
  41279. /**
  41280. * @function SuperMap.ElasticSearch.prototype.getScript
  41281. * @description 获取脚本。</br>
  41282. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getscript}</br>
  41283. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  41284. * @param {Object} params - 参数。
  41285. * @param {function} callback - 回调函数。
  41286. */
  41287. }, {
  41288. key: "getScript",
  41289. value: function getScript(params, callback) {
  41290. return this.client.getScript(params, callback);
  41291. }
  41292. /**
  41293. * @function SuperMap.ElasticSearch.prototype.getSource
  41294. * @description 通过索引,类型和ID获取文档的源。</br>
  41295. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource}</br>
  41296. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  41297. * @param {Object} params - 参数。
  41298. * @param {function} callback - 回调函数。
  41299. */
  41300. }, {
  41301. key: "getSource",
  41302. value: function getSource(params, callback) {
  41303. return this.client.getSource(params, callback);
  41304. }
  41305. /**
  41306. * @function SuperMap.ElasticSearch.prototype.getTemplate
  41307. * @description 获取模板。</br>
  41308. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-gettemplate}</br>
  41309. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  41310. * @param {Object} params - 参数。
  41311. * @param {function} callback - 回调函数。
  41312. */
  41313. }, {
  41314. key: "getTemplate",
  41315. value: function getTemplate(params, callback) {
  41316. return this.client.getTemplate(params, callback);
  41317. }
  41318. /**
  41319. * @function SuperMap.ElasticSearch.prototype.index
  41320. * @description 在索引中存储一个键入的JSON文档,使其可搜索。</br>
  41321. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-index}</br>
  41322. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}</br>
  41323. * @param {Object} params - 参数。
  41324. * @param {function} callback - 回调函数。
  41325. */
  41326. }, {
  41327. key: "index",
  41328. value: function index(params, callback) {
  41329. return this.client.index(params, callback);
  41330. }
  41331. /**
  41332. * @function SuperMap.ElasticSearch.prototype.info
  41333. * @description 从当前集群获取基本信息。</br>
  41334. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-info}</br>
  41335. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  41336. * @param {Object} params - 参数。
  41337. * @param {function} callback - 回调函数。
  41338. */
  41339. }, {
  41340. key: "info",
  41341. value: function info(params, callback) {
  41342. return this.client.info(params, callback);
  41343. }
  41344. /**
  41345. * @function SuperMap.ElasticSearch.prototype.mget
  41346. * @description 根据索引,类型(可选)和ids来获取多个文档。mget所需的主体可以采用两种形式:文档位置数组或文档ID数组。</br>
  41347. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mget}</br>
  41348. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html}</br>
  41349. * @param {Object} params - 参数。
  41350. * @param {function} callback - 回调函数。
  41351. */
  41352. }, {
  41353. key: "mget",
  41354. value: function mget(params, callback) {
  41355. return this.client.mget(params, callback);
  41356. }
  41357. /**
  41358. * @function SuperMap.ElasticSearch.prototype.msearch
  41359. * @description 在同一请求中执行多个搜索请求。</br>
  41360. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch}</br>
  41361. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html}</br>
  41362. * @param {Object} params - 参数。
  41363. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  41364. * 回调参数:error,response。结果存储在response.responses中
  41365. */
  41366. }, {
  41367. key: "msearch",
  41368. value: function msearch(params, callback) {
  41369. var me = this;
  41370. return me.client.msearch(params).then(function (resp) {
  41371. me._update(resp.responses, callback);
  41372. return resp;
  41373. }, function (err) {
  41374. callback(err);
  41375. me.events.triggerEvent('error', {
  41376. error: err
  41377. });
  41378. return err;
  41379. });
  41380. }
  41381. /**
  41382. * @function SuperMap.ElasticSearch.prototype.msearchTemplate
  41383. * @description 在同一请求中执行多个搜索模板请求。</br>
  41384. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearchtemplate}</br>
  41385. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  41386. * @param {Object} params - 参数。
  41387. * @param {function} callback - 回调函数。
  41388. */
  41389. }, {
  41390. key: "msearchTemplate",
  41391. value: function msearchTemplate(params, callback) {
  41392. return this.client.msearchTemplate(params, callback);
  41393. }
  41394. /**
  41395. * @function SuperMap.ElasticSearch.prototype.mtermvectors
  41396. * @description 多termvectors API允许一次获得多个termvectors。</br>
  41397. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mtermvectors}</br>
  41398. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html}</br>
  41399. * @param {Object} params - 参数。
  41400. * @param {function} callback - 回调函数。
  41401. */
  41402. }, {
  41403. key: "mtermvectors",
  41404. value: function mtermvectors(params, callback) {
  41405. return this.client.mtermvectors(params, callback);
  41406. }
  41407. /**
  41408. * @function SuperMap.ElasticSearch.prototype.ping
  41409. * @description 测试连接。</br>
  41410. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-ping}</br>
  41411. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  41412. * @param {Object} params - 参数。
  41413. * @param {function} callback - 回调函数。
  41414. */
  41415. }, {
  41416. key: "ping",
  41417. value: function ping(params, callback) {
  41418. return this.client.ping(params, callback);
  41419. }
  41420. /**
  41421. * @function SuperMap.ElasticSearch.prototype.putScript
  41422. * @description 添加脚本。</br>
  41423. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-putscript}</br>
  41424. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  41425. * @param {Object} params - 参数。
  41426. * @param {function} callback - 回调函数。
  41427. */
  41428. }, {
  41429. key: "putScript",
  41430. value: function putScript(params, callback) {
  41431. return this.client.putScript(params, callback);
  41432. }
  41433. /**
  41434. * @function SuperMap.ElasticSearch.prototype.putTemplate
  41435. * @description 添加模板。</br>
  41436. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-puttemplate}</br>
  41437. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  41438. * @param {Object} params - 参数。
  41439. * @param {function} callback - 回调函数。
  41440. */
  41441. }, {
  41442. key: "putTemplate",
  41443. value: function putTemplate(params, callback) {
  41444. return this.client.putTemplate(params, callback);
  41445. }
  41446. /**
  41447. * @function SuperMap.ElasticSearch.prototype.reindex
  41448. * @description 重新索引。</br>
  41449. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindex}</br>
  41450. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  41451. * @param {Object} params - 参数。
  41452. * @param {function} callback - 回调函数。
  41453. */
  41454. }, {
  41455. key: "reindex",
  41456. value: function reindex(params, callback) {
  41457. return this.client.reindex(params, callback);
  41458. }
  41459. /**
  41460. * @function SuperMap.ElasticSearch.prototype.reindexRessrottle
  41461. * @description 重新索引。</br>
  41462. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindexrethrottle}</br>
  41463. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  41464. * @param {Object} params - 参数。
  41465. * @param {function} callback - 回调函数。
  41466. */
  41467. }, {
  41468. key: "reindexRessrottle",
  41469. value: function reindexRessrottle(params, callback) {
  41470. return this.client.reindexRessrottle(params, callback);
  41471. }
  41472. /**
  41473. * @function SuperMap.ElasticSearch.prototype.renderSearchTemplate
  41474. * @description 搜索模板。</br>
  41475. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-rendersearchtemplate}</br>
  41476. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  41477. * @param {Object} params - 参数。
  41478. * @param {function} callback - 回调函数。
  41479. */
  41480. }, {
  41481. key: "renderSearchTemplate",
  41482. value: function renderSearchTemplate(params, callback) {
  41483. return this.client.renderSearchTemplate(params, callback);
  41484. }
  41485. /**
  41486. * @function SuperMap.ElasticSearch.prototype.scroll
  41487. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。</br>
  41488. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-scroll}</br>
  41489. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  41490. * @param {Object} params - 参数。
  41491. * @param {function} callback - 回调函数。
  41492. */
  41493. }, {
  41494. key: "scroll",
  41495. value: function scroll(params, callback) {
  41496. return this.client.scroll(params, callback);
  41497. }
  41498. /**
  41499. * @function SuperMap.ElasticSearch.prototype.search
  41500. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。
  41501. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search}</br>
  41502. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html}</br>
  41503. * @param {Object} params - 参数。
  41504. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  41505. * 回调参数:error,response,结果存储在response.responses中
  41506. */
  41507. }, {
  41508. key: "search",
  41509. value: function search(params, callback) {
  41510. var me = this;
  41511. return me.client.search(params).then(function (resp) {
  41512. me._update(resp.responses, callback);
  41513. return resp;
  41514. }, function (err) {
  41515. callback(err);
  41516. me.events.triggerEvent('error', {
  41517. error: err
  41518. });
  41519. return err;
  41520. });
  41521. }
  41522. /**
  41523. * @function SuperMap.ElasticSearch.prototype.searchShards
  41524. * @description 返回要执行搜索请求的索引和分片。
  41525. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchshards}</br>
  41526. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.html}</br>
  41527. * @param {Object} params - 参数。
  41528. * @param {function} callback - 回调函数。
  41529. */
  41530. }, {
  41531. key: "searchShards",
  41532. value: function searchShards(params, callback) {
  41533. return this.client.searchShards(params, callback);
  41534. }
  41535. /**
  41536. * @function SuperMap.ElasticSearch.prototype.searchTemplate
  41537. * @description 搜索模板。
  41538. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate}</br>
  41539. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  41540. * @param {Object} params - 参数。
  41541. * @param {function} callback - 回调函数。
  41542. */
  41543. }, {
  41544. key: "searchTemplate",
  41545. value: function searchTemplate(params, callback) {
  41546. return this.client.searchTemplate(params, callback);
  41547. }
  41548. /**
  41549. * @function SuperMap.ElasticSearch.prototype.suggest
  41550. * @description 该建议功能通过使用特定的建议者,基于所提供的文本来建议类似的术语。
  41551. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-suggest}</br>
  41552. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  41553. * @param {Object} params - 参数。
  41554. * @param {function} callback - 回调函数。
  41555. */
  41556. }, {
  41557. key: "suggest",
  41558. value: function suggest(params, callback) {
  41559. return this.client.suggest(params, callback);
  41560. }
  41561. /**
  41562. * @function SuperMap.ElasticSearch.prototype.termvectors
  41563. * @description 返回有关特定文档字段中的术语的信息和统计信息。
  41564. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-termvectors}</br>
  41565. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html}</br>
  41566. * @param {Object} params - 参数。
  41567. * @param {function} callback - 回调函数。
  41568. */
  41569. }, {
  41570. key: "termvectors",
  41571. value: function termvectors(params, callback) {
  41572. return this.client.termvectors(params, callback);
  41573. }
  41574. /**
  41575. * @function SuperMap.ElasticSearch.prototype.update
  41576. * @description 更新文档的部分。
  41577. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-update}</br>
  41578. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html}</br>
  41579. * @param {Object} params - 参数。
  41580. * @param {function} callback - 回调函数。
  41581. */
  41582. }, {
  41583. key: "update",
  41584. value: function update(params, callback) {
  41585. return this.client.update(params, callback);
  41586. }
  41587. /**
  41588. * @function SuperMap.ElasticSearch.prototype.update
  41589. * @description 通过查询API来更新文档。
  41590. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery}</br>
  41591. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html}</br>
  41592. * @param {Object} params - 参数。
  41593. * @param {function} callback - 回调函数。
  41594. */
  41595. }, {
  41596. key: "updateByQuery",
  41597. value: function updateByQuery(params, callback) {
  41598. return this.client.updateByQuery(params, callback);
  41599. }
  41600. }, {
  41601. key: "_update",
  41602. value: function _update(data, callback) {
  41603. var me = this;
  41604. if (!data) {
  41605. return;
  41606. }
  41607. me.data = data;
  41608. if (me.openGeoFence && me.geoFence) {
  41609. me._validateDatas(data);
  41610. }
  41611. me.events.triggerEvent('change', {
  41612. data: me.data
  41613. }); //change方法已废弃,不建议使用。建议使用search方法的第二个参数传入请求成功的回调
  41614. if (me.change) {
  41615. me.change && me.change(data);
  41616. } else {
  41617. //加responses是为了保持跟原来es自身的数据结构一致
  41618. callback && callback(undefined, {
  41619. responses: data
  41620. });
  41621. }
  41622. }
  41623. }, {
  41624. key: "_validateDatas",
  41625. value: function _validateDatas(datas) {
  41626. if (!datas) {
  41627. return;
  41628. }
  41629. if (!(datas instanceof Array)) {
  41630. datas = [datas];
  41631. }
  41632. var i,
  41633. len = datas.length;
  41634. for (i = 0; i < len; i++) {
  41635. this._validateData(datas[i]);
  41636. }
  41637. }
  41638. }, {
  41639. key: "_validateData",
  41640. value: function _validateData(data) {
  41641. var me = this;
  41642. data.hits.hits.map(function (source) {
  41643. var content = source._source;
  41644. var meterUnit = me._getMeterPerMapUnit(me.geoFence.unit);
  41645. var geoFenceCX = me.geoFence.center[0] * meterUnit;
  41646. var geoFenceCY = me.geoFence.center[1] * meterUnit;
  41647. var contentX = content.x * meterUnit;
  41648. var contentY = content.y * meterUnit;
  41649. var distance = me._distance(contentX, contentY, geoFenceCX, geoFenceCY);
  41650. var radius = me.geoFence.radius;
  41651. if (distance > radius) {
  41652. me.outOfGeoFence && me.outOfGeoFence(data);
  41653. me.events.triggerEvent('outOfGeoFence', {
  41654. data: data
  41655. });
  41656. }
  41657. return source;
  41658. });
  41659. }
  41660. }, {
  41661. key: "_distance",
  41662. value: function _distance(x1, y1, x2, y2) {
  41663. return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
  41664. }
  41665. }, {
  41666. key: "_getMeterPerMapUnit",
  41667. value: function _getMeterPerMapUnit(mapUnit) {
  41668. var earchRadiusInMeters = 6378137;
  41669. var meterPerMapUnit;
  41670. if (mapUnit === 'meter') {
  41671. meterPerMapUnit = 1;
  41672. } else if (mapUnit === 'degree') {
  41673. // 每度表示多少米。
  41674. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  41675. }
  41676. return meterPerMapUnit;
  41677. }
  41678. }]);
  41679. return ElasticSearch;
  41680. }();
  41681. SuperMap.ElasticSearch = ElasticSearch;
  41682. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/index.js
  41683. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  41684. * This program are made available under the terms of the Apache License, Version 2.0
  41685. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41686. ;// CONCATENATED MODULE: ./src/common/thirdparty/index.js
  41687. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  41688. * This program are made available under the terms of the Apache License, Version 2.0
  41689. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41690. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Util.js
  41691. function levelRenderer_Util_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { levelRenderer_Util_typeof = function _typeof(obj) { return typeof obj; }; } else { levelRenderer_Util_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return levelRenderer_Util_typeof(obj); }
  41692. function Util_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41693. 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); } }
  41694. function Util_createClass(Constructor, protoProps, staticProps) { if (protoProps) Util_defineProperties(Constructor.prototype, protoProps); if (staticProps) Util_defineProperties(Constructor, staticProps); return Constructor; }
  41695. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  41696. * This program are made available under the terms of the Apache License, Version 2.0
  41697. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41698. /**
  41699. * @private
  41700. * @class SuperMap.LevelRenderer.Tool.Util
  41701. * @category Visualization Theme
  41702. * LevelRenderer 基础工具类
  41703. *
  41704. */
  41705. var Util_Util = /*#__PURE__*/function () {
  41706. /**
  41707. * @function SuperMap.LevelRenderer.Tool.Util.constructor
  41708. * @description 构造函数。
  41709. *
  41710. */
  41711. function Util() {
  41712. Util_classCallCheck(this, Util);
  41713. /**
  41714. * @member {Object} SuperMap.LevelRenderer.Tool.Util.prototype.BUILTIN_OBJECT
  41715. * @description 用于处理merge时无法遍历Date等对象的问题
  41716. */
  41717. this.BUILTIN_OBJECT = {
  41718. '[object Function]': 1,
  41719. '[object RegExp]': 1,
  41720. '[object Date]': 1,
  41721. '[object Error]': 1,
  41722. '[object CanvasGradient]': 1
  41723. };
  41724. /**
  41725. * @member {Object} SuperMap.LevelRenderer.Tool.Util.prototype._ctx
  41726. */
  41727. this._ctx = null;
  41728. /**
  41729. * Property: _canvas
  41730. * {Object}
  41731. */
  41732. this._canvas = null;
  41733. /**
  41734. * Property: _pixelCtx
  41735. * {Object}
  41736. */
  41737. this._pixelCtx = null;
  41738. /**
  41739. * Property: _width
  41740. * {Object}
  41741. */
  41742. this._width = null;
  41743. /**
  41744. * Property: _height
  41745. * {Object}
  41746. */
  41747. this._height = null;
  41748. /**
  41749. * Property: _offsetX
  41750. * {Object}
  41751. */
  41752. this._offsetX = 0;
  41753. /**
  41754. * Property: _offsetY
  41755. * {Object}
  41756. */
  41757. this._offsetY = 0;
  41758. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Util";
  41759. }
  41760. /**
  41761. * @function SuperMap.LevelRenderer.Tool.Util.prototype.clone
  41762. * @description 对一个object进行深度拷贝。
  41763. *
  41764. * @param {Object} source - 需要进行拷贝的对象。
  41765. * @return {Object} 拷贝后的新对象。
  41766. */
  41767. Util_createClass(Util, [{
  41768. key: "clone",
  41769. value: function clone(source) {
  41770. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  41771. if (levelRenderer_Util_typeof(source) == 'object' && source !== null) {
  41772. var result = source;
  41773. if (source instanceof Array) {
  41774. result = [];
  41775. for (var i = 0, len = source.length; i < len; i++) {
  41776. result[i] = this.clone(source[i]);
  41777. }
  41778. } else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) {
  41779. result = {};
  41780. for (var key in source) {
  41781. if (source.hasOwnProperty(key)) {
  41782. result[key] = this.clone(source[key]);
  41783. }
  41784. }
  41785. }
  41786. return result;
  41787. }
  41788. return source;
  41789. }
  41790. /**
  41791. * @function SuperMap.LevelRenderer.Tool.Util.prototype.mergeItem
  41792. * @description 合并源对象的单个属性到目标对象。
  41793. *
  41794. * @param {Object} target - 目标对象。
  41795. * @param {Object} source - 源对象。
  41796. * @param {string} key - 键。
  41797. * @param {boolean} overwrite - 是否覆盖。
  41798. * @return {Object} 目标对象
  41799. */
  41800. }, {
  41801. key: "mergeItem",
  41802. value: function mergeItem(target, source, key, overwrite) {
  41803. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  41804. if (source.hasOwnProperty(key)) {
  41805. if (levelRenderer_Util_typeof(target[key]) == 'object' && !BUILTIN_OBJECT[Object.prototype.toString.call(target[key])]) {
  41806. // 如果需要递归覆盖,就递归调用merge
  41807. this.merge(target[key], source[key], overwrite);
  41808. } else if (overwrite || !(key in target)) {
  41809. // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况
  41810. target[key] = source[key];
  41811. }
  41812. }
  41813. }
  41814. /**
  41815. * @function SuperMap.LevelRenderer.Tool.Util.prototype.merge
  41816. * @description 合并源对象的属性到目标对象。
  41817. *
  41818. * @param {Object} target - 目标对象。
  41819. * @param {Object} source - 源对象。
  41820. * @param {boolean} overwrite - 是否覆盖。
  41821. * @return {Object} 目标对象。
  41822. */
  41823. }, {
  41824. key: "merge",
  41825. value: function merge(target, source, overwrite) {
  41826. for (var i in source) {
  41827. this.mergeItem(target, source, i, overwrite);
  41828. }
  41829. return target;
  41830. }
  41831. /**
  41832. * @function SuperMap.LevelRenderer.Tool.Util.prototype.getContext
  41833. * @description 获取 Canvas 上下文。
  41834. * @return {Object} 上下文。
  41835. */
  41836. }, {
  41837. key: "getContext",
  41838. value: function getContext() {
  41839. if (!this._ctx) {
  41840. this._ctx = document.createElement('canvas').getContext('2d');
  41841. }
  41842. return this._ctx;
  41843. }
  41844. /**
  41845. * @function SuperMap.LevelRenderer.Tool.Util.prototype.getPixelContext
  41846. * @description 获取像素拾取专用的上下文。
  41847. * @return {Object} 像素拾取专用的上下文。
  41848. */
  41849. }, {
  41850. key: "getPixelContext",
  41851. value: function getPixelContext() {
  41852. if (!this._pixelCtx) {
  41853. this._canvas = document.createElement('canvas');
  41854. this._width = this._canvas.width;
  41855. this._height = this._canvas.height;
  41856. this._pixelCtx = this._canvas.getContext('2d');
  41857. }
  41858. return this._pixelCtx;
  41859. }
  41860. /**
  41861. * @function SuperMap.LevelRenderer.Tool.Util.prototype.adjustCanvasSize
  41862. * @description 如果坐标处在_canvas外部,改变_canvas的大小,修改canvas的大小 需要重新设置translate
  41863. *
  41864. * @param {number} x - 横坐标。
  41865. * @param {number} y - 纵坐标。
  41866. *
  41867. */
  41868. }, {
  41869. key: "adjustCanvasSize",
  41870. value: function adjustCanvasSize(x, y) {
  41871. var _canvas = this._canvas;
  41872. var _pixelCtx = this._pixelCtx;
  41873. var _width = this._width;
  41874. var _height = this._height;
  41875. var _offsetX = this._offsetX;
  41876. var _offsetY = this._offsetY; // 每次加的长度
  41877. var _v = 100;
  41878. var _flag;
  41879. if (x + _offsetX > _width) {
  41880. _width = x + _offsetX + _v;
  41881. _canvas.width = _width;
  41882. _flag = true;
  41883. }
  41884. if (y + _offsetY > _height) {
  41885. _height = y + _offsetY + _v;
  41886. _canvas.height = _height;
  41887. _flag = true;
  41888. }
  41889. if (x < -_offsetX) {
  41890. _offsetX = Math.ceil(-x / _v) * _v;
  41891. _width += _offsetX;
  41892. _canvas.width = _width;
  41893. _flag = true;
  41894. }
  41895. if (y < -_offsetY) {
  41896. _offsetY = Math.ceil(-y / _v) * _v;
  41897. _height += _offsetY;
  41898. _canvas.height = _height;
  41899. _flag = true;
  41900. }
  41901. if (_flag) {
  41902. _pixelCtx.translate(_offsetX, _offsetY);
  41903. }
  41904. }
  41905. /**
  41906. * @function SuperMap.LevelRenderer.Tool.Util.prototype.getPixelOffset
  41907. * @description 获取像素canvas的偏移量。
  41908. * @return {Object} 偏移量。
  41909. */
  41910. }, {
  41911. key: "getPixelOffset",
  41912. value: function getPixelOffset() {
  41913. return {
  41914. x: this._offsetX,
  41915. y: this._offsetY
  41916. };
  41917. }
  41918. /**
  41919. * @function SuperMap.LevelRenderer.Tool.Util.prototype.indexOf
  41920. * @description 查询数组中元素的index
  41921. * @return {Object} 偏移量。
  41922. */
  41923. }, {
  41924. key: "indexOf",
  41925. value: function indexOf(array, value) {
  41926. if (array.indexOf) {
  41927. return array.indexOf(value);
  41928. }
  41929. for (var i = 0, len = array.length; i < len; i++) {
  41930. if (array[i] === value) {
  41931. return i;
  41932. }
  41933. }
  41934. return -1;
  41935. }
  41936. /**
  41937. * @function SuperMap.LevelRenderer.Tool.Util.prototype.inherits
  41938. * @description 构造类继承关系
  41939. *
  41940. * @param {Function} clazz - 源类。
  41941. * @param {Function} baseClazz - 基类。
  41942. * @return {Object} 偏移量。
  41943. */
  41944. }, {
  41945. key: "inherits",
  41946. value: function inherits(clazz, baseClazz) {
  41947. var clazzPrototype = clazz.prototype;
  41948. function F() {}
  41949. F.prototype = baseClazz.prototype;
  41950. clazz.prototype = new F();
  41951. for (var prop in clazzPrototype) {
  41952. clazz.prototype[prop] = clazzPrototype[prop];
  41953. }
  41954. clazz.constructor = clazz;
  41955. }
  41956. }]);
  41957. return Util;
  41958. }();
  41959. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Color.js
  41960. function Color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41961. 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); } }
  41962. function Color_createClass(Constructor, protoProps, staticProps) { if (protoProps) Color_defineProperties(Constructor.prototype, protoProps); if (staticProps) Color_defineProperties(Constructor, staticProps); return Constructor; }
  41963. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  41964. * This program are made available under the terms of the Apache License, Version 2.0
  41965. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41966. /**
  41967. * @class SuperMap.LevelRenderer.Tool.Color
  41968. * @category Visualization Theme
  41969. * @classdesc LevelRenderer 工具-颜色辅助类
  41970. * @private
  41971. */
  41972. var Color = /*#__PURE__*/function () {
  41973. function Color() {
  41974. Color_classCallCheck(this, Color);
  41975. /**
  41976. * @member {SuperMap.LevelRenderer.Tool.Util} SuperMap.LevelRenderer.Tool.Color.prototype.util
  41977. * @description LevelRenderer 基础工具对象。
  41978. */
  41979. this.util = new Util_Util();
  41980. /**
  41981. * @member {Object} SuperMap.LevelRenderer.Tool.Color.prototype._ctx
  41982. * @description _ctx。
  41983. */
  41984. this._ctx = null;
  41985. /**
  41986. * @member {Array} SuperMap.LevelRenderer.Tool.Color.prototype.palette
  41987. * @description 默认色板。色板是一个包含图表默认颜色系列的数组,当色板中所有颜色被使用过后,又将从新回到色板中的第一个颜色。
  41988. */
  41989. 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'];
  41990. /**
  41991. * @member {Array} SuperMap.LevelRenderer.Tool.Color.prototype._palette
  41992. * @description 复位色板,用于复位 palette
  41993. */
  41994. this._palette = this.palette;
  41995. /**
  41996. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype.highlightColor
  41997. * @description 高亮色
  41998. */
  41999. this.highlightColor = 'rgba(0,0,255,1)';
  42000. /**
  42001. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype._highlightColor
  42002. * @description 复位高亮色
  42003. */
  42004. this._highlightColor = this.highlightColor;
  42005. /**
  42006. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype.colorRegExp
  42007. * @description 颜色格式,正则表达式。
  42008. */
  42009. 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;
  42010. /**
  42011. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype._nameColors
  42012. * @description 颜色名。
  42013. */
  42014. this._nameColors = {
  42015. aliceblue: '#f0f8ff',
  42016. antiquewhite: '#faebd7',
  42017. aqua: '#0ff',
  42018. aquamarine: '#7fffd4',
  42019. azure: '#f0ffff',
  42020. beige: '#f5f5dc',
  42021. bisque: '#ffe4c4',
  42022. black: '#000',
  42023. blanchedalmond: '#ffebcd',
  42024. blue: '#00f',
  42025. blueviolet: '#8a2be2',
  42026. brown: '#a52a2a',
  42027. burlywood: '#deb887',
  42028. cadetblue: '#5f9ea0',
  42029. chartreuse: '#7fff00',
  42030. chocolate: '#d2691e',
  42031. coral: '#ff7f50',
  42032. cornflowerblue: '#6495ed',
  42033. cornsilk: '#fff8dc',
  42034. crimson: '#dc143c',
  42035. cyan: '#0ff',
  42036. darkblue: '#00008b',
  42037. darkcyan: '#008b8b',
  42038. darkgoldenrod: '#b8860b',
  42039. darkgray: '#a9a9a9',
  42040. darkgrey: '#a9a9a9',
  42041. darkgreen: '#006400',
  42042. darkkhaki: '#bdb76b',
  42043. darkmagenta: '#8b008b',
  42044. darkolivegreen: '#556b2f',
  42045. darkorange: '#ff8c00',
  42046. darkorchid: '#9932cc',
  42047. darkred: '#8b0000',
  42048. darksalmon: '#e9967a',
  42049. darkseagreen: '#8fbc8f',
  42050. darkslateblue: '#483d8b',
  42051. darkslategray: '#2f4f4f',
  42052. darkslategrey: '#2f4f4f',
  42053. darkturquoise: '#00ced1',
  42054. darkviolet: '#9400d3',
  42055. deeppink: '#ff1493',
  42056. deepskyblue: '#00bfff',
  42057. dimgray: '#696969',
  42058. dimgrey: '#696969',
  42059. dodgerblue: '#1e90ff',
  42060. firebrick: '#b22222',
  42061. floralwhite: '#fffaf0',
  42062. forestgreen: '#228b22',
  42063. fuchsia: '#f0f',
  42064. gainsboro: '#dcdcdc',
  42065. ghostwhite: '#f8f8ff',
  42066. gold: '#ffd700',
  42067. goldenrod: '#daa520',
  42068. gray: '#808080',
  42069. grey: '#808080',
  42070. green: '#008000',
  42071. greenyellow: '#adff2f',
  42072. honeydew: '#f0fff0',
  42073. hotpink: '#ff69b4',
  42074. indianred: '#cd5c5c',
  42075. indigo: '#4b0082',
  42076. ivory: '#fffff0',
  42077. khaki: '#f0e68c',
  42078. lavender: '#e6e6fa',
  42079. lavenderblush: '#fff0f5',
  42080. lawngreen: '#7cfc00',
  42081. lemonchiffon: '#fffacd',
  42082. lightblue: '#add8e6',
  42083. lightcoral: '#f08080',
  42084. lightcyan: '#e0ffff',
  42085. lightgoldenrodyellow: '#fafad2',
  42086. lightgray: '#d3d3d3',
  42087. lightgrey: '#d3d3d3',
  42088. lightgreen: '#90ee90',
  42089. lightpink: '#ffb6c1',
  42090. lightsalmon: '#ffa07a',
  42091. lightseagreen: '#20b2aa',
  42092. lightskyblue: '#87cefa',
  42093. lightslategray: '#789',
  42094. lightslategrey: '#789',
  42095. lightsteelblue: '#b0c4de',
  42096. lightyellow: '#ffffe0',
  42097. lime: '#0f0',
  42098. limegreen: '#32cd32',
  42099. linen: '#faf0e6',
  42100. magenta: '#f0f',
  42101. maroon: '#800000',
  42102. mediumaquamarine: '#66cdaa',
  42103. mediumblue: '#0000cd',
  42104. mediumorchid: '#ba55d3',
  42105. mediumpurple: '#9370d8',
  42106. mediumseagreen: '#3cb371',
  42107. mediumslateblue: '#7b68ee',
  42108. mediumspringgreen: '#00fa9a',
  42109. mediumturquoise: '#48d1cc',
  42110. mediumvioletred: '#c71585',
  42111. midnightblue: '#191970',
  42112. mintcream: '#f5fffa',
  42113. mistyrose: '#ffe4e1',
  42114. moccasin: '#ffe4b5',
  42115. navajowhite: '#ffdead',
  42116. navy: '#000080',
  42117. oldlace: '#fdf5e6',
  42118. olive: '#808000',
  42119. olivedrab: '#6b8e23',
  42120. orange: '#ffa500',
  42121. orangered: '#ff4500',
  42122. orchid: '#da70d6',
  42123. palegoldenrod: '#eee8aa',
  42124. palegreen: '#98fb98',
  42125. paleturquoise: '#afeeee',
  42126. palevioletred: '#d87093',
  42127. papayawhip: '#ffefd5',
  42128. peachpuff: '#ffdab9',
  42129. peru: '#cd853f',
  42130. pink: '#ffc0cb',
  42131. plum: '#dda0dd',
  42132. powderblue: '#b0e0e6',
  42133. purple: '#800080',
  42134. red: '#f00',
  42135. rosybrown: '#bc8f8f',
  42136. royalblue: '#4169e1',
  42137. saddlebrown: '#8b4513',
  42138. salmon: '#fa8072',
  42139. sandybrown: '#f4a460',
  42140. seagreen: '#2e8b57',
  42141. seashell: '#fff5ee',
  42142. sienna: '#a0522d',
  42143. silver: '#c0c0c0',
  42144. skyblue: '#87ceeb',
  42145. slateblue: '#6a5acd',
  42146. slategray: '#708090',
  42147. slategrey: '#708090',
  42148. snow: '#fffafa',
  42149. springgreen: '#00ff7f',
  42150. steelblue: '#4682b4',
  42151. tan: '#d2b48c',
  42152. teal: '#008080',
  42153. thistle: '#d8bfd8',
  42154. tomato: '#ff6347',
  42155. turquoise: '#40e0d0',
  42156. violet: '#ee82ee',
  42157. wheat: '#f5deb3',
  42158. white: '#fff',
  42159. whitesmoke: '#f5f5f5',
  42160. yellow: '#ff0',
  42161. yellowgreen: '#9acd32'
  42162. };
  42163. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Color";
  42164. }
  42165. /**
  42166. * @function SuperMap.LevelRenderer.Tool.Color.prototype.customPalette
  42167. * @description 自定义调色板。
  42168. * @param {Array} userPalete - 颜色板。
  42169. */
  42170. Color_createClass(Color, [{
  42171. key: "customPalette",
  42172. value: function customPalette(userPalete) {
  42173. this.palette = userPalete;
  42174. }
  42175. /**
  42176. * @function SuperMap.LevelRenderer.Tool.Color.prototype.resetPalette
  42177. * @description 复位默认色板。
  42178. */
  42179. }, {
  42180. key: "resetPalette",
  42181. value: function resetPalette() {
  42182. this.palette = this._palette;
  42183. }
  42184. /**
  42185. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getColor
  42186. * @description 获取色板颜色。
  42187. * @param {number} idx - 色板位置。
  42188. * @param {Array} userPalete - 色板。
  42189. * @returns {string} 颜色值。
  42190. */
  42191. }, {
  42192. key: "getColor",
  42193. value: function getColor(idx, userPalete) {
  42194. idx = idx | 0;
  42195. userPalete = userPalete || this.palette;
  42196. return userPalete[idx % userPalete.length];
  42197. }
  42198. /**
  42199. * @function SuperMap.LevelRenderer.Tool.Color.prototype.customHighlight
  42200. * @description 自定义默认高亮颜色。
  42201. * @param {string} userHighlightColor - 自定义高亮色。
  42202. */
  42203. }, {
  42204. key: "customHighlight",
  42205. value: function customHighlight(userHighlightColor) {
  42206. this.highlightColor = userHighlightColor;
  42207. }
  42208. /**
  42209. * @function SuperMap.LevelRenderer.Tool.Color.prototype.resetHighlight
  42210. * @description 重置默认高亮颜色。将当前的高亮色作为默认高亮颜色
  42211. */
  42212. }, {
  42213. key: "resetHighlight",
  42214. value: function resetHighlight() {
  42215. this.highlightColor = this._highlightColor;
  42216. }
  42217. /**
  42218. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getHighlightColor
  42219. * @description 获取默认高亮颜色
  42220. * @returns {string} 颜色值。
  42221. */
  42222. }, {
  42223. key: "getHighlightColor",
  42224. value: function getHighlightColor() {
  42225. return this.highlightColor;
  42226. }
  42227. /**
  42228. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getRadialGradient
  42229. * @description 径向渐变。
  42230. * @param {number} x0 - 渐变起点横坐标。
  42231. * @param {number} y0 - 渐变起点纵坐标。
  42232. * @param {number} r0 - 半径
  42233. * @param {number} x1 - 渐变终点横坐标。
  42234. * @param {number} y1 - 渐变终点纵坐标。
  42235. * @param {number} r1 - 半径
  42236. * @param {Array} colorList - 颜色列表。
  42237. * @returns {CanvasGradient} Cavans 渐变颜色。
  42238. */
  42239. }, {
  42240. key: "getRadialGradient",
  42241. value: function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) {
  42242. var util = this.util;
  42243. if (!this._ctx) {
  42244. this._ctx = util.getContext();
  42245. }
  42246. var gradient = this._ctx.createRadialGradient(x0, y0, r0, x1, y1, r1);
  42247. for (var i = 0, l = colorList.length; i < l; i++) {
  42248. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  42249. }
  42250. gradient.__nonRecursion = true;
  42251. return gradient;
  42252. }
  42253. /**
  42254. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getLinearGradient
  42255. * @description 线性渐变。
  42256. * @param {number} x0 - 渐变起点横坐标。
  42257. * @param {number} y0 - 渐变起点纵坐标。
  42258. * @param {number} x1 - 渐变终点横坐标。
  42259. * @param {number} y1 - 渐变终点纵坐标。
  42260. * @param {Array} colorList - 颜色列表。
  42261. * @returns {CanvasGradient} Cavans 渐变颜色。
  42262. */
  42263. }, {
  42264. key: "getLinearGradient",
  42265. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  42266. var util = this.util;
  42267. if (!this._ctx) {
  42268. this._ctx = util.getContext();
  42269. }
  42270. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  42271. for (var i = 0, l = colorList.length; i < l; i++) {
  42272. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  42273. }
  42274. gradient.__nonRecursion = true;
  42275. return gradient;
  42276. }
  42277. /**
  42278. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getStepColors
  42279. * @description 获取两种颜色之间渐变颜色数组。
  42280. * @param {Object} start - 起始颜色对象。
  42281. * @param {Object} end - 结束颜色对象。
  42282. * @param {number} step - 渐变级数。
  42283. * @returns {Array} 颜色数组。
  42284. */
  42285. }, {
  42286. key: "getStepColors",
  42287. value: function getStepColors(start, end, step) {
  42288. start = this.toRGBA(start);
  42289. end = this.toRGBA(end);
  42290. start = this.getData(start);
  42291. end = this.getData(end);
  42292. var colors = [];
  42293. var stepR = (end[0] - start[0]) / step;
  42294. var stepG = (end[1] - start[1]) / step;
  42295. var stepB = (end[2] - start[2]) / step;
  42296. var stepA = (end[3] - start[3]) / step; // 生成颜色集合
  42297. // fix by linfeng 颜色堆积
  42298. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  42299. 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');
  42300. r += stepR;
  42301. g += stepG;
  42302. b += stepB;
  42303. a += stepA;
  42304. }
  42305. r = end[0];
  42306. g = end[1];
  42307. b = end[2];
  42308. a = end[3];
  42309. colors[i] = this.toColor([r, g, b, a], 'rgba');
  42310. return colors;
  42311. }
  42312. /**
  42313. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getGradientColors
  42314. * @description 获取指定级数的渐变颜色数组。
  42315. * @param {Array.<string>} colors - 颜色数组。
  42316. * @param {number} [step=20] - 渐变级数。
  42317. * @returns {Array.<string>} 颜色数组。
  42318. */
  42319. }, {
  42320. key: "getGradientColors",
  42321. value: function getGradientColors(colors, step) {
  42322. var ret = [];
  42323. var len = colors.length;
  42324. if (step === undefined) {
  42325. step = 20;
  42326. }
  42327. if (len === 1) {
  42328. ret = this.getStepColors(colors[0], colors[0], step);
  42329. } else if (len > 1) {
  42330. for (var i = 0, n = len - 1; i < n; i++) {
  42331. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  42332. if (i < n - 1) {
  42333. steps.pop();
  42334. }
  42335. ret = ret.concat(steps);
  42336. }
  42337. }
  42338. return ret;
  42339. }
  42340. /**
  42341. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toColor
  42342. * @description 颜色值数组转为指定格式颜色。
  42343. * @param {Array} data - 颜色值数组。
  42344. * @param {string} format - 格式,默认'rgb'
  42345. * @returns {string} 颜色。
  42346. */
  42347. }, {
  42348. key: "toColor",
  42349. value: function toColor(data, format) {
  42350. format = format || 'rgb';
  42351. if (data && (data.length === 3 || data.length === 4)) {
  42352. data = this.map(data, function (c) {
  42353. return c > 1 ? Math.ceil(c) : c;
  42354. });
  42355. if (format.indexOf('hex') > -1) {
  42356. return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + +data[2]).toString(16).slice(1);
  42357. } else if (format.indexOf('hs') > -1) {
  42358. var sx = this.map(data.slice(1, 3), function (c) {
  42359. return c + '%';
  42360. });
  42361. data[1] = sx[0];
  42362. data[2] = sx[1];
  42363. }
  42364. if (format.indexOf('a') > -1) {
  42365. if (data.length === 3) {
  42366. data.push(1);
  42367. }
  42368. data[3] = this.adjust(data[3], [0, 1]);
  42369. return format + '(' + data.slice(0, 4).join(',') + ')';
  42370. }
  42371. return format + '(' + data.slice(0, 3).join(',') + ')';
  42372. }
  42373. }
  42374. /**
  42375. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toArray
  42376. * @description 颜色字符串转换为rgba数组。
  42377. * @param {string} color - 颜色。
  42378. * @returns {Array.<number>} 颜色值数组。
  42379. */
  42380. }, {
  42381. key: "toArray",
  42382. value: function toArray(color) {
  42383. color = this.trim(color);
  42384. if (color.indexOf('rgba') < 0) {
  42385. color = this.toRGBA(color);
  42386. }
  42387. var data = [];
  42388. var i = 0;
  42389. color.replace(/[\d.]+/g, function (n) {
  42390. if (i < 3) {
  42391. n = n | 0;
  42392. } else {
  42393. // Alpha
  42394. n = +n;
  42395. }
  42396. data[i++] = n;
  42397. });
  42398. return data;
  42399. }
  42400. /**
  42401. * @function SuperMap.LevelRenderer.Tool.Color.prototype.convert
  42402. * @description 颜色格式转化。
  42403. * @param {Array} data - 颜色值数组。
  42404. * @param {string} format - 格式,默认'rgb'
  42405. * @returns {string} 颜色。
  42406. */
  42407. }, {
  42408. key: "convert",
  42409. value: function convert(color, format) {
  42410. if (!this.isCalculableColor(color)) {
  42411. return color;
  42412. }
  42413. var data = this.getData(color);
  42414. var alpha = data[3];
  42415. if (typeof alpha === 'undefined') {
  42416. alpha = 1;
  42417. }
  42418. if (color.indexOf('hsb') > -1) {
  42419. data = this._HSV_2_RGB(data);
  42420. } else if (color.indexOf('hsl') > -1) {
  42421. data = this._HSL_2_RGB(data);
  42422. }
  42423. if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) {
  42424. data = this._RGB_2_HSB(data);
  42425. } else if (format.indexOf('hsl') > -1) {
  42426. data = this._RGB_2_HSL(data);
  42427. }
  42428. data[3] = alpha;
  42429. return this.toColor(data, format);
  42430. }
  42431. /**
  42432. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toRGBA
  42433. * @description 转换为rgba格式的颜色。
  42434. * @param {string} color - 颜色。
  42435. * @returns {string} 颜色。
  42436. */
  42437. }, {
  42438. key: "toRGBA",
  42439. value: function toRGBA(color) {
  42440. return this.convert(color, 'rgba');
  42441. }
  42442. /**
  42443. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toRGB
  42444. * @description 转换为rgb数字格式的颜色。
  42445. * @param {string} color - 颜色。
  42446. * @returns {string} 颜色。
  42447. */
  42448. }, {
  42449. key: "toRGB",
  42450. value: function toRGB(color) {
  42451. return this.convert(color, 'rgb');
  42452. }
  42453. /**
  42454. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHex
  42455. * @description 转换为16进制颜色。
  42456. * @param {string} color - 颜色。
  42457. * @returns {string} 16进制颜色,#rrggbb格式
  42458. */
  42459. }, {
  42460. key: "toHex",
  42461. value: function toHex(color) {
  42462. return this.convert(color, 'hex');
  42463. }
  42464. /**
  42465. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSVA
  42466. * @description 转换为HSV颜色。
  42467. * @param {string} color - 颜色。
  42468. * @returns {string} HSVA颜色,hsva(h,s,v,a)
  42469. */
  42470. }, {
  42471. key: "toHSVA",
  42472. value: function toHSVA(color) {
  42473. return this.convert(color, 'hsva');
  42474. }
  42475. /**
  42476. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSV
  42477. * @description 转换为HSV颜色。
  42478. * @param {string} color - 颜色。
  42479. * @returns {string} HSV颜色,hsv(h,s,v)
  42480. */
  42481. }, {
  42482. key: "toHSV",
  42483. value: function toHSV(color) {
  42484. return this.convert(color, 'hsv');
  42485. }
  42486. /**
  42487. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSBA
  42488. * @description 转换为HSBA颜色。
  42489. * @param {string} color - 颜色。
  42490. * @returns {string} HSBA颜色,hsba(h,s,b,a)
  42491. */
  42492. }, {
  42493. key: "toHSBA",
  42494. value: function toHSBA(color) {
  42495. return this.convert(color, 'hsba');
  42496. }
  42497. /**
  42498. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSB
  42499. * @description 转换为HSB颜色。
  42500. * @param {string} color - 颜色。
  42501. * @returns {string} HSB颜色,hsb(h,s,b)
  42502. */
  42503. }, {
  42504. key: "toHSB",
  42505. value: function toHSB(color) {
  42506. return this.convert(color, 'hsb');
  42507. }
  42508. /**
  42509. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSLA
  42510. * @description 转换为HSLA颜色。
  42511. * @param {string} color - 颜色。
  42512. * @returns {string} HSLA颜色,hsla(h,s,l,a)
  42513. */
  42514. }, {
  42515. key: "toHSLA",
  42516. value: function toHSLA(color) {
  42517. return this.convert(color, 'hsla');
  42518. }
  42519. /**
  42520. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSL
  42521. * @description 转换为HSL颜色。
  42522. * @param {string} color - 颜色。
  42523. * @returns {string} HSL颜色,hsl(h,s,l)
  42524. */
  42525. }, {
  42526. key: "toHSL",
  42527. value: function toHSL(color) {
  42528. return this.convert(color, 'hsl');
  42529. }
  42530. /**
  42531. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toName
  42532. * @description 转换颜色名。
  42533. * @param {string} color - 颜色。
  42534. * @returns {string} 颜色名
  42535. */
  42536. }, {
  42537. key: "toName",
  42538. value: function toName(color) {
  42539. for (var key in this._nameColors) {
  42540. if (this.toHex(this._nameColors[key]) === this.toHex(color)) {
  42541. return key;
  42542. }
  42543. }
  42544. return null;
  42545. }
  42546. /**
  42547. * @function SuperMap.LevelRenderer.Tool.Color.prototype.trim
  42548. * @description 移除颜色中多余空格。
  42549. * @param {string} color - 颜色。
  42550. * @returns {string} 无空格颜色
  42551. */
  42552. }, {
  42553. key: "trim",
  42554. value: function trim(color) {
  42555. return String(color).replace(/\s+/g, '');
  42556. }
  42557. /**
  42558. * @function SuperMap.LevelRenderer.Tool.Color.prototype.normalize
  42559. * @description 颜色规范化。
  42560. * @param {string} color - 颜色。
  42561. * @returns {string} 规范化后的颜色
  42562. */
  42563. }, {
  42564. key: "normalize",
  42565. value: function normalize(color) {
  42566. // 颜色名
  42567. if (this._nameColors[color]) {
  42568. color = this._nameColors[color];
  42569. } // 去掉空格
  42570. color = this.trim(color); // hsv与hsb等价
  42571. color = color.replace(/hsv/i, 'hsb'); // rgb转为rrggbb
  42572. if (/^#[\da-f]{3}$/i.test(color)) {
  42573. color = parseInt(color.slice(1), 16);
  42574. var r = (color & 0xf00) << 8;
  42575. var g = (color & 0xf0) << 4;
  42576. var b = color & 0xf;
  42577. color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1);
  42578. } // 或者使用以下正则替换,不过 chrome 下性能相对差点
  42579. // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3');
  42580. return color;
  42581. }
  42582. /**
  42583. * @function SuperMap.LevelRenderer.Tool.Color.prototype.lift
  42584. * @description 颜色加深或减淡,当level>0加深,当level<0减淡。
  42585. * @param {string} color - 颜色。
  42586. * @param {number} level - 升降程度,取值区间[-1,1]。
  42587. * @returns {string} 加深或减淡后颜色值
  42588. */
  42589. }, {
  42590. key: "lift",
  42591. value: function lift(color, level) {
  42592. if (!this.isCalculableColor(color)) {
  42593. return color;
  42594. }
  42595. var direct = level > 0 ? 1 : -1;
  42596. if (typeof level === 'undefined') {
  42597. level = 0;
  42598. }
  42599. level = Math.abs(level) > 1 ? 1 : Math.abs(level);
  42600. color = this.toRGB(color);
  42601. var data = this.getData(color);
  42602. for (var i = 0; i < 3; i++) {
  42603. if (direct === 1) {
  42604. data[i] = data[i] * (1 - level) | 0;
  42605. } else {
  42606. data[i] = (255 - data[i]) * level + data[i] | 0;
  42607. }
  42608. }
  42609. return 'rgb(' + data.join(',') + ')';
  42610. }
  42611. /**
  42612. * @function SuperMap.LevelRenderer.Tool.Color.prototype.reverse
  42613. * @description 颜色翻转。[255-r,255-g,255-b,1-a]
  42614. * @param {string} color - 颜色。
  42615. * @returns {string} 翻转颜色
  42616. */
  42617. }, {
  42618. key: "reverse",
  42619. value: function reverse(color) {
  42620. if (!this.isCalculableColor(color)) {
  42621. return color;
  42622. }
  42623. var data = this.getData(this.toRGBA(color));
  42624. data = this.map(data, function (c) {
  42625. return 255 - c;
  42626. });
  42627. return this.toColor(data, 'rgb');
  42628. }
  42629. /**
  42630. * @function SuperMap.LevelRenderer.Tool.Color.prototype.mix
  42631. * @description 简单两种颜色混合
  42632. * @param {string} color1 - 第一种颜色。
  42633. * @param {string} color2 - 第二种颜色。
  42634. * @param {number} weight - 混合权重[0-1]。
  42635. * @returns {string} 结果色。rgb(r,g,b)或rgba(r,g,b,a)
  42636. */
  42637. }, {
  42638. key: "mix",
  42639. value: function mix(color1, color2, weight) {
  42640. if (!this.isCalculableColor(color1) || !this.isCalculableColor(color2)) {
  42641. return color1;
  42642. }
  42643. if (typeof weight === 'undefined') {
  42644. weight = 0.5;
  42645. }
  42646. weight = 1 - this.adjust(weight, [0, 1]);
  42647. var w = weight * 2 - 1;
  42648. var data1 = this.getData(this.toRGBA(color1));
  42649. var data2 = this.getData(this.toRGBA(color2));
  42650. var d = data1[3] - data2[3];
  42651. var weight1 = ((w * d === -1 ? w : (w + d) / (1 + w * d)) + 1) / 2;
  42652. var weight2 = 1 - weight1;
  42653. var data = [];
  42654. for (var i = 0; i < 3; i++) {
  42655. data[i] = data1[i] * weight1 + data2[i] * weight2;
  42656. }
  42657. var alpha = data1[3] * weight + data2[3] * (1 - weight);
  42658. alpha = Math.max(0, Math.min(1, alpha));
  42659. if (data1[3] === 1 && data2[3] === 1) {
  42660. // 不考虑透明度
  42661. return this.toColor(data, 'rgb');
  42662. }
  42663. data[3] = alpha;
  42664. return this.toColor(data, 'rgba');
  42665. }
  42666. /**
  42667. * @function SuperMap.LevelRenderer.Tool.Color.prototype.random
  42668. * @description 随机颜色
  42669. * @returns {string} 颜色值,#rrggbb格式
  42670. */
  42671. }, {
  42672. key: "random",
  42673. value: function random() {
  42674. return '#' + Math.random().toString(16).slice(2, 8);
  42675. }
  42676. /**
  42677. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getData
  42678. * @description 获取颜色值数组,返回值范围。
  42679. * RGB 范围[0-255]
  42680. * HSL/HSV/HSB 范围[0-1]
  42681. * A透明度范围[0-1]
  42682. * 支持格式:
  42683. * #rgb
  42684. * #rrggbb
  42685. * rgb(r,g,b)
  42686. * rgb(r%,g%,b%)
  42687. * rgba(r,g,b,a)
  42688. * hsb(h,s,b) // hsv与hsb等价
  42689. * hsb(h%,s%,b%)
  42690. * hsba(h,s,b,a)
  42691. * hsl(h,s,l)
  42692. * hsl(h%,s%,l%)
  42693. * hsla(h,s,l,a)
  42694. * @param {string} color - 颜色。
  42695. * @returns {Array.<number>} 颜色值数组或null
  42696. */
  42697. }, {
  42698. key: "getData",
  42699. value: function getData(color) {
  42700. color = this.normalize(color);
  42701. var r = color.match(this.colorRegExp);
  42702. if (r === null) {
  42703. throw new Error('The color format error'); // 颜色格式错误
  42704. }
  42705. var d;
  42706. var a;
  42707. var data = [];
  42708. var rgb;
  42709. if (r[2]) {
  42710. // #rrggbb
  42711. d = r[2].replace('#', '').split('');
  42712. rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]];
  42713. data = this.map(rgb, function (c) {
  42714. return Color.prototype.adjust.call(this, parseInt(c, 16), [0, 255]);
  42715. });
  42716. } else if (r[4]) {
  42717. // rgb rgba
  42718. var rgba = r[4].split(',');
  42719. a = rgba[3];
  42720. rgb = rgba.slice(0, 3);
  42721. data = this.map(rgb, function (c) {
  42722. c = Math.floor(c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c);
  42723. return Color.prototype.adjust.call(this, c, [0, 255]);
  42724. });
  42725. if (typeof a !== 'undefined') {
  42726. data.push(this.adjust(parseFloat(a), [0, 1]));
  42727. }
  42728. } else if (r[5] || r[6]) {
  42729. // hsb hsba hsl hsla
  42730. var hsxa = (r[5] || r[6]).split(',');
  42731. var h = parseInt(hsxa[0], 0) / 360;
  42732. var s = hsxa[1];
  42733. var x = hsxa[2];
  42734. a = hsxa[3];
  42735. data = this.map([s, x], function (c) {
  42736. return Color.prototype.adjust.call(this, parseFloat(c) / 100, [0, 1]);
  42737. });
  42738. data.unshift(h);
  42739. if (typeof a !== 'undefined') {
  42740. data.push(this.adjust(parseFloat(a), [0, 1]));
  42741. }
  42742. }
  42743. return data;
  42744. }
  42745. /**
  42746. * @function SuperMap.LevelRenderer.Tool.Color.prototype.alpha
  42747. * @description 设置颜色透明度
  42748. * @param {string} color - 颜色。
  42749. * @param {number} a - 透明度,区间[0,1]。
  42750. * @returns {string} rgba颜色值
  42751. */
  42752. }, {
  42753. key: "alpha",
  42754. value: function alpha(color, a) {
  42755. if (!this.isCalculableColor(color)) {
  42756. return color;
  42757. }
  42758. if (a === null) {
  42759. a = 1;
  42760. }
  42761. var data = this.getData(this.toRGBA(color));
  42762. data[3] = this.adjust(Number(a).toFixed(4), [0, 1]);
  42763. return this.toColor(data, 'rgba');
  42764. }
  42765. /**
  42766. * @function SuperMap.LevelRenderer.Tool.Color.prototype.map
  42767. * @description 数组映射
  42768. * @param {Array} array - 数组。
  42769. * @param {function} fun - 函数。
  42770. * @returns {string} 数组映射结果
  42771. */
  42772. }, {
  42773. key: "map",
  42774. value: function map(array, fun) {
  42775. if (typeof fun !== 'function') {
  42776. throw new TypeError();
  42777. }
  42778. var len = array ? array.length : 0;
  42779. for (var i = 0; i < len; i++) {
  42780. array[i] = fun(array[i]);
  42781. }
  42782. return array;
  42783. }
  42784. /**
  42785. * @function SuperMap.LevelRenderer.Tool.Color.prototype.adjust
  42786. * @description 调整值区间
  42787. * @param {Array.<number>} value - 数组。
  42788. * @param {Array.<number>} region - 区间。
  42789. * @returns {number} 调整后的值
  42790. */
  42791. }, {
  42792. key: "adjust",
  42793. value: function adjust(value, region) {
  42794. // < to <= & > to >=
  42795. // modify by linzhifeng 2014-05-25 because -0 == 0
  42796. if (value <= region[0]) {
  42797. value = region[0];
  42798. } else if (value >= region[1]) {
  42799. value = region[1];
  42800. }
  42801. return value;
  42802. }
  42803. /**
  42804. * @function SuperMap.LevelRenderer.Tool.Color.prototype.isCalculableColor
  42805. * @description 判断是否是可计算的颜色
  42806. * @param {string} color - 颜色。
  42807. * @returns {boolean} 是否是可计算的颜色
  42808. */
  42809. }, {
  42810. key: "isCalculableColor",
  42811. value: function isCalculableColor(color) {
  42812. return color instanceof Array || typeof color === 'string';
  42813. }
  42814. /**
  42815. * @function SuperMap.LevelRenderer.Tool.Color.prototype._HSV_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  42816. */
  42817. }, {
  42818. key: "_HSV_2_RGB",
  42819. value: function _HSV_2_RGB(data) {
  42820. var H = data[0];
  42821. var S = data[1];
  42822. var V = data[2]; // HSV from 0 to 1
  42823. var R;
  42824. var G;
  42825. var B;
  42826. if (S === 0) {
  42827. R = V * 255;
  42828. G = V * 255;
  42829. B = V * 255;
  42830. } else {
  42831. var h = H * 6;
  42832. if (h === 6) {
  42833. h = 0;
  42834. }
  42835. var i = h | 0;
  42836. var v1 = V * (1 - S);
  42837. var v2 = V * (1 - S * (h - i));
  42838. var v3 = V * (1 - S * (1 - (h - i)));
  42839. var r = 0;
  42840. var g = 0;
  42841. var b = 0;
  42842. if (i === 0) {
  42843. r = V;
  42844. g = v3;
  42845. b = v1;
  42846. } else if (i === 1) {
  42847. r = v2;
  42848. g = V;
  42849. b = v1;
  42850. } else if (i === 2) {
  42851. r = v1;
  42852. g = V;
  42853. b = v3;
  42854. } else if (i === 3) {
  42855. r = v1;
  42856. g = v2;
  42857. b = V;
  42858. } else if (i === 4) {
  42859. r = v3;
  42860. g = v1;
  42861. b = V;
  42862. } else {
  42863. r = V;
  42864. g = v1;
  42865. b = v2;
  42866. } // RGB results from 0 to 255
  42867. R = r * 255;
  42868. G = g * 255;
  42869. B = b * 255;
  42870. }
  42871. return [R, G, B];
  42872. }
  42873. /**
  42874. * @function SuperMap.LevelRenderer.Tool.Color.prototype._HSL_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  42875. */
  42876. }, {
  42877. key: "_HSL_2_RGB",
  42878. value: function _HSL_2_RGB(data) {
  42879. var H = data[0];
  42880. var S = data[1];
  42881. var L = data[2]; // HSL from 0 to 1
  42882. var R;
  42883. var G;
  42884. var B;
  42885. if (S === 0) {
  42886. R = L * 255;
  42887. G = L * 255;
  42888. B = L * 255;
  42889. } else {
  42890. var v2;
  42891. if (L < 0.5) {
  42892. v2 = L * (1 + S);
  42893. } else {
  42894. v2 = L + S - S * L;
  42895. }
  42896. var v1 = 2 * L - v2;
  42897. R = 255 * this._HUE_2_RGB(v1, v2, H + 1 / 3);
  42898. G = 255 * this._HUE_2_RGB(v1, v2, H);
  42899. B = 255 * this._HUE_2_RGB(v1, v2, H - 1 / 3);
  42900. }
  42901. return [R, G, B];
  42902. }
  42903. /**
  42904. * @function SuperMap.LevelRenderer.Tool.Color.prototype._HUE_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  42905. */
  42906. }, {
  42907. key: "_HUE_2_RGB",
  42908. value: function _HUE_2_RGB(v1, v2, vH) {
  42909. if (vH < 0) {
  42910. vH += 1;
  42911. }
  42912. if (vH > 1) {
  42913. vH -= 1;
  42914. }
  42915. if (6 * vH < 1) {
  42916. return v1 + (v2 - v1) * 6 * vH;
  42917. }
  42918. if (2 * vH < 1) {
  42919. return v2;
  42920. }
  42921. if (3 * vH < 2) {
  42922. return v1 + (v2 - v1) * (2 / 3 - vH) * 6;
  42923. }
  42924. return v1;
  42925. }
  42926. /**
  42927. * @function SuperMap.LevelRenderer.Tool.Color.prototype._RGB_2_HSB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  42928. */
  42929. }, {
  42930. key: "_RGB_2_HSB",
  42931. value: function _RGB_2_HSB(data) {
  42932. // RGB from 0 to 255
  42933. var R = data[0] / 255;
  42934. var G = data[1] / 255;
  42935. var B = data[2] / 255;
  42936. var vMin = Math.min(R, G, B); // Min. value of RGB
  42937. var vMax = Math.max(R, G, B); // Max. value of RGB
  42938. var delta = vMax - vMin; // Delta RGB value
  42939. var V = vMax;
  42940. var H;
  42941. var S; // HSV results from 0 to 1
  42942. if (delta === 0) {
  42943. H = 0;
  42944. S = 0;
  42945. } else {
  42946. S = delta / vMax;
  42947. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  42948. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  42949. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  42950. if (R === vMax) {
  42951. H = deltaB - deltaG;
  42952. } else if (G === vMax) {
  42953. H = 1 / 3 + deltaR - deltaB;
  42954. } else if (B === vMax) {
  42955. H = 2 / 3 + deltaG - deltaR;
  42956. }
  42957. if (H < 0) {
  42958. H += 1;
  42959. }
  42960. if (H > 1) {
  42961. H -= 1;
  42962. }
  42963. }
  42964. H = H * 360;
  42965. S = S * 100;
  42966. V = V * 100;
  42967. return [H, S, V];
  42968. }
  42969. /**
  42970. * @function SuperMap.LevelRenderer.Tool.Color.prototype._RGB_2_HSL。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  42971. */
  42972. }, {
  42973. key: "_RGB_2_HSL",
  42974. value: function _RGB_2_HSL(data) {
  42975. // RGB from 0 to 255
  42976. var R = data[0] / 255;
  42977. var G = data[1] / 255;
  42978. var B = data[2] / 255;
  42979. var vMin = Math.min(R, G, B); // Min. value of RGB
  42980. var vMax = Math.max(R, G, B); // Max. value of RGB
  42981. var delta = vMax - vMin; // Delta RGB value
  42982. var L = (vMax + vMin) / 2;
  42983. var H;
  42984. var S; // HSL results from 0 to 1
  42985. if (delta === 0) {
  42986. H = 0;
  42987. S = 0;
  42988. } else {
  42989. if (L < 0.5) {
  42990. S = delta / (vMax + vMin);
  42991. } else {
  42992. S = delta / (2 - vMax - vMin);
  42993. }
  42994. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  42995. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  42996. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  42997. if (R === vMax) {
  42998. H = deltaB - deltaG;
  42999. } else if (G === vMax) {
  43000. H = 1 / 3 + deltaR - deltaB;
  43001. } else if (B === vMax) {
  43002. H = 2 / 3 + deltaG - deltaR;
  43003. }
  43004. if (H < 0) {
  43005. H += 1;
  43006. }
  43007. if (H > 1) {
  43008. H -= 1;
  43009. }
  43010. }
  43011. H = H * 360;
  43012. S = S * 100;
  43013. L = L * 100;
  43014. return [H, S, L];
  43015. }
  43016. }]);
  43017. return Color;
  43018. }();
  43019. ;// CONCATENATED MODULE: ./src/common/util/ColorsPickerUtil.js
  43020. function ColorsPickerUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43021. 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); } }
  43022. function ColorsPickerUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorsPickerUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorsPickerUtil_defineProperties(Constructor, staticProps); return Constructor; }
  43023. var ColorRender = new Color(); // let "http://www.qzu.zj.cn": "#bd10e0"
  43024. // "www.qzct.net": "#7ed321" = new SuperMap.LevelRenderer.Tool.Color();
  43025. /**
  43026. * Created by yzy on 2016/11/9.
  43027. * 色带选择器工具类 用于1、创建canvas对象,2、从几种颜色中获取一定数量的渐变色
  43028. *
  43029. */
  43030. var ColorsPickerUtil = /*#__PURE__*/function () {
  43031. function ColorsPickerUtil() {
  43032. ColorsPickerUtil_classCallCheck(this, ColorsPickerUtil);
  43033. }
  43034. ColorsPickerUtil_createClass(ColorsPickerUtil, null, [{
  43035. key: "createCanvas",
  43036. /**
  43037. * 创建DOM canvas
  43038. * @param height canvas 高度
  43039. * @param width canvas 宽度
  43040. *
  43041. */
  43042. value: function createCanvas(height, width) {
  43043. var canvas = document.createElement("canvas");
  43044. canvas.height = height;
  43045. canvas.width = width;
  43046. return canvas.getContext("2d");
  43047. }
  43048. /**
  43049. * 线性渐变。
  43050. * Parameters:
  43051. * x0 - {Number} 渐变起点。
  43052. * y0 - {Number}
  43053. * x1 - {Number} 渐变终点。
  43054. * y1 - {Number}
  43055. * colorList - {Array} 颜色列表。
  43056. *
  43057. * Returns:
  43058. * {CanvasGradient} Cavans 渐变颜色。
  43059. */
  43060. }, {
  43061. key: "getLinearGradient",
  43062. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  43063. if (!this._ctx) {
  43064. this._ctx = this.getContext();
  43065. }
  43066. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  43067. var leng = colorList.length;
  43068. var add = 1 / (leng - 1);
  43069. var offset = 0;
  43070. for (var i = 0; i < leng; i++) {
  43071. gradient.addColorStop(offset, colorList[i]);
  43072. offset += add;
  43073. }
  43074. gradient.__nonRecursion = true;
  43075. return gradient;
  43076. }
  43077. /**
  43078. * 获取 Cavans 上下文
  43079. *
  43080. * Returns:
  43081. * {Object} Cavans 上下文。
  43082. */
  43083. }, {
  43084. key: "getContext",
  43085. value: function getContext() {
  43086. if (!this._ctx) {
  43087. this._ctx = document.createElement('canvas').getContext('2d');
  43088. }
  43089. return this._ctx;
  43090. }
  43091. /**
  43092. * 获取两种颜色之间渐变颜色数组。
  43093. *
  43094. * Parameters:
  43095. * start - {color} 起始颜色。
  43096. * end - {color} 结束颜色。
  43097. * step - {Number} 渐变级数。
  43098. * colorList - {Array} 颜色列表。
  43099. *
  43100. * Returns:
  43101. * {Array} 颜色数组。
  43102. */
  43103. }, {
  43104. key: "getStepColors",
  43105. value: function getStepColors(start, end, step) {
  43106. start = ColorRender.toRGBA(start);
  43107. end = ColorRender.toRGBA(end);
  43108. start = ColorRender.getData(start);
  43109. end = ColorRender.getData(end);
  43110. var colors = [];
  43111. var stepR = (end[0] - start[0]) / step;
  43112. var stepG = (end[1] - start[1]) / step;
  43113. var stepB = (end[2] - start[2]) / step;
  43114. var stepA = (end[3] - start[3]) / step; // 生成颜色集合
  43115. // fix by linfeng 颜色堆积
  43116. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  43117. 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');
  43118. r += stepR;
  43119. g += stepG;
  43120. b += stepB;
  43121. a += stepA;
  43122. }
  43123. r = end[0];
  43124. g = end[1];
  43125. b = end[2];
  43126. a = end[3];
  43127. colors[i] = ColorRender.toColor([r, g, b, a], 'hex');
  43128. return colors;
  43129. }
  43130. /**
  43131. * APIMethod: getGradientColors
  43132. * 获取指定级数的渐变颜色数组。
  43133. *
  43134. * Parameters:
  43135. * colors - {Array{String}} 颜色组。
  43136. * total - {Number} 颜色总数。
  43137. * total - {String} 专题类型
  43138. *
  43139. * Returns:
  43140. * {Array{String}} 颜色数组。
  43141. */
  43142. }, {
  43143. key: "getGradientColors",
  43144. value: function getGradientColors(colors, total, themeType) {
  43145. var ret = [],
  43146. step;
  43147. var i,
  43148. n,
  43149. len = colors.length;
  43150. if (total === undefined) {
  43151. return;
  43152. }
  43153. if (len >= total) {
  43154. if (themeType === 'RANGE') {
  43155. for (i = 0; i < total; i++) {
  43156. ret.push(colors[i]);
  43157. }
  43158. } else {
  43159. //1/2前后取色
  43160. for (i = 0; i < total; i++) {
  43161. var ii = Math.floor(i / 2);
  43162. if (i % 2 === 0) {
  43163. ret.push(colors[ii]);
  43164. } else {
  43165. var _index = colors.length - 1 - ii;
  43166. ret.push(colors[_index]);
  43167. }
  43168. }
  43169. }
  43170. } else {
  43171. step = Math.ceil(total / (len - 1));
  43172. for (i = 0, n = len - 1; i < n; i++) {
  43173. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  43174. if (i < n - 1) {
  43175. steps.pop();
  43176. }
  43177. ret = ret.concat(steps);
  43178. } //删除多余元素
  43179. var nouse = ret.length - total;
  43180. for (var j = 0, index = 0; j < nouse; j++) {
  43181. ret.splice(index + 2, 1);
  43182. }
  43183. }
  43184. return ret;
  43185. }
  43186. }]);
  43187. return ColorsPickerUtil;
  43188. }();
  43189. SuperMap.ColorsPickerUtil = ColorsPickerUtil;
  43190. ;// CONCATENATED MODULE: ./src/common/util/ArrayStatistic.js
  43191. function ArrayStatistic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43192. 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); } }
  43193. function ArrayStatistic_createClass(Constructor, protoProps, staticProps) { if (protoProps) ArrayStatistic_defineProperties(Constructor.prototype, protoProps); if (staticProps) ArrayStatistic_defineProperties(Constructor, staticProps); return Constructor; }
  43194. var ArrayStatistic = /*#__PURE__*/function () {
  43195. function ArrayStatistic() {
  43196. ArrayStatistic_classCallCheck(this, ArrayStatistic);
  43197. }
  43198. ArrayStatistic_createClass(ArrayStatistic, null, [{
  43199. key: "newInstance",
  43200. // geostatsInstance: null,
  43201. /**
  43202. * 初始化插件实例
  43203. */
  43204. value: function newInstance() {
  43205. // if(!this.geostatsInstance) {
  43206. // // this.geostatsInstance = new geostats();
  43207. // // }
  43208. // window.dataList = [];
  43209. if (!this.geostatsInstance) {
  43210. this.geostatsInstance = new window.geostats();
  43211. }
  43212. return this.geostatsInstance;
  43213. }
  43214. /**
  43215. * 设置需要被处理的数组
  43216. *
  43217. * @param array
  43218. */
  43219. }, {
  43220. key: "getInstance",
  43221. value: function getInstance(array) {
  43222. var instance = this.newInstance();
  43223. instance.setSerie(array);
  43224. return instance;
  43225. }
  43226. /**
  43227. * 获取数组统计的值
  43228. *
  43229. * @param array 需要统计的数组
  43230. * @param type 统计方法
  43231. */
  43232. }, {
  43233. key: "getArrayStatistic",
  43234. value: function getArrayStatistic(array, type) {
  43235. if (!array.length) {
  43236. return 0;
  43237. }
  43238. if (type === "Sum" || type === "求和") {
  43239. return this.getSum(array);
  43240. } else if (type === "Maximum" || type === "最大值") {
  43241. return this.getMax(array);
  43242. } else if (type === "Minimum" || type === "最小值") {
  43243. return this.getMin(array);
  43244. } else if (type === "Average" || type === "平均值") {
  43245. return this.getMean(array);
  43246. } else if (type === "Median" || type === "中位数") {
  43247. return this.getMedian(array);
  43248. } else if (type === "times" || type === "计数") {
  43249. return this.getTimes(array);
  43250. }
  43251. }
  43252. /**
  43253. * 获取数组分段后的数值
  43254. *
  43255. * @param array 需要分段的数组
  43256. * @param type 分段方法
  43257. * @param segNum 分段个数
  43258. */
  43259. }, {
  43260. key: "getArraySegments",
  43261. value: function getArraySegments(array, type, segNum) {
  43262. if (type === "offset") {
  43263. return this.getEqInterval(array, segNum);
  43264. } else if (type === "jenks") {
  43265. return this.getJenks(array, segNum);
  43266. } else if (type === "square") {
  43267. // 数据都必须 >= 0
  43268. var minValue = this.getMin(array);
  43269. if (minValue >= 0) {
  43270. return this.getSqrtInterval(array, segNum);
  43271. } else {
  43272. //console.log('数据都必须 >= 0');
  43273. // Util.showMessage(Language.hasNegValue + Language.noSupportRange, 'ERROR');
  43274. return false;
  43275. }
  43276. } else if (type === "logarithm") {
  43277. // 数据都必须 > 0
  43278. var _minValue = this.getMin(array);
  43279. if (_minValue > 0) {
  43280. return this.getGeometricProgression(array, segNum);
  43281. } else {
  43282. //console.log('数据都必须 > 0');
  43283. // Util.showMessage(Language.hasZeroNegValue + Language.noSupportRange, 'ERROR');
  43284. return false;
  43285. }
  43286. }
  43287. }
  43288. /**
  43289. * 求和
  43290. * @param array
  43291. * @returns {number}
  43292. */
  43293. }, {
  43294. key: "getSum",
  43295. value: function getSum(array) {
  43296. return this.getInstance(array).sum();
  43297. }
  43298. /**
  43299. * 最小值
  43300. * @param array
  43301. * @returns {*}
  43302. */
  43303. }, {
  43304. key: "getMax",
  43305. value: function getMax(array) {
  43306. return this.getInstance(array).max();
  43307. }
  43308. /**
  43309. * 最大值
  43310. * @param array
  43311. * @returns {*}
  43312. */
  43313. }, {
  43314. key: "getMin",
  43315. value: function getMin(array) {
  43316. return this.getInstance(array).min();
  43317. }
  43318. /**
  43319. * 求平均
  43320. * @param array
  43321. * @returns {number}
  43322. */
  43323. }, {
  43324. key: "getMean",
  43325. value: function getMean(array) {
  43326. return this.getInstance(array).mean();
  43327. }
  43328. /**
  43329. * 求中位数
  43330. *
  43331. * @param array
  43332. * @returns {number}
  43333. */
  43334. }, {
  43335. key: "getMedian",
  43336. value: function getMedian(array) {
  43337. return this.getInstance(array).median();
  43338. }
  43339. /**
  43340. * 计数
  43341. *
  43342. * @param array
  43343. * @returns {number}
  43344. */
  43345. }, {
  43346. key: "getTimes",
  43347. value: function getTimes(array) {
  43348. return array.length;
  43349. }
  43350. /**
  43351. * 等距分段法
  43352. *
  43353. * @param array
  43354. * @param segNum
  43355. */
  43356. }, {
  43357. key: "getEqInterval",
  43358. value: function getEqInterval(array, segNum) {
  43359. return this.getInstance(array).getClassEqInterval(segNum);
  43360. }
  43361. /**
  43362. * 自然断裂法
  43363. *
  43364. * @param array
  43365. * @param segNum
  43366. */
  43367. }, {
  43368. key: "getJenks",
  43369. value: function getJenks(array, segNum) {
  43370. return this.getInstance(array).getClassJenks(segNum);
  43371. }
  43372. /**
  43373. * 平方根分段法
  43374. *
  43375. * @param array
  43376. * @param segNum
  43377. */
  43378. }, {
  43379. key: "getSqrtInterval",
  43380. value: function getSqrtInterval(array, segNum) {
  43381. array = array.map(function (value) {
  43382. return Math.sqrt(value);
  43383. });
  43384. var breaks = this.getInstance(array).getClassEqInterval(segNum);
  43385. return breaks.map(function (value) {
  43386. return value * value;
  43387. });
  43388. }
  43389. /**
  43390. * 对数分段法
  43391. *
  43392. * @param array
  43393. * @param segNum
  43394. */
  43395. }, {
  43396. key: "getGeometricProgression",
  43397. value: function getGeometricProgression(array, segNum) {
  43398. return this.getInstance(array).getClassGeometricProgression(segNum);
  43399. }
  43400. }]);
  43401. return ArrayStatistic;
  43402. }();
  43403. SuperMap.ArrayStatistic = ArrayStatistic;
  43404. ;// CONCATENATED MODULE: ./src/common/util/MapCalculateUtil.js
  43405. var getMeterPerMapUnit = function getMeterPerMapUnit(mapUnit) {
  43406. var earchRadiusInMeters = 6378137;
  43407. var meterPerMapUnit;
  43408. if (mapUnit === Unit.METER) {
  43409. meterPerMapUnit = 1;
  43410. } else if (mapUnit === Unit.DEGREE) {
  43411. // 每度表示多少米。
  43412. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  43413. } else if (mapUnit === Unit.KILOMETER) {
  43414. meterPerMapUnit = 1.0e-3;
  43415. } else if (mapUnit === Unit.INCH) {
  43416. meterPerMapUnit = 1 / 2.5399999918e-2;
  43417. } else if (mapUnit === Unit.FOOT) {
  43418. meterPerMapUnit = 0.3048;
  43419. } else {
  43420. return meterPerMapUnit;
  43421. }
  43422. return meterPerMapUnit;
  43423. };
  43424. function getWrapNum(x) {
  43425. var includeMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  43426. var includeMin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  43427. var range = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [-180, 180];
  43428. var max = range[1],
  43429. min = range[0],
  43430. d = max - min;
  43431. if (x === max && includeMax) {
  43432. return x;
  43433. }
  43434. if (x === min && includeMin) {
  43435. return x;
  43436. }
  43437. var tmp = ((x - min) % d + d) % d;
  43438. if (tmp === 0 && includeMax) {
  43439. return max;
  43440. }
  43441. return ((x - min) % d + d) % d + min;
  43442. }
  43443. function conversionDegree(degrees) {
  43444. var degree = parseInt(degrees);
  43445. var fraction = parseInt((degrees - degree) * 60);
  43446. var second = parseInt(((degrees - degree) * 60 - fraction) * 60);
  43447. fraction = parseInt(fraction / 10) === 0 ? "0".concat(fraction) : fraction;
  43448. second = parseInt(second / 10) === 0 ? "0".concat(second) : second;
  43449. return "".concat(degree, "\xB0").concat(fraction, "'").concat(second);
  43450. }
  43451. ;// CONCATENATED MODULE: ./src/common/util/index.js
  43452. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  43453. * This program are made available under the terms of the Apache License, Version 2.0
  43454. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43455. // EXTERNAL MODULE: ./node_modules/lodash.topairs/index.js
  43456. var lodash_topairs = __webpack_require__(820);
  43457. var lodash_topairs_default = /*#__PURE__*/__webpack_require__.n(lodash_topairs);
  43458. ;// CONCATENATED MODULE: ./src/common/style/CartoCSS.js
  43459. function CartoCSS_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { CartoCSS_typeof = function _typeof(obj) { return typeof obj; }; } else { CartoCSS_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return CartoCSS_typeof(obj); }
  43460. function CartoCSS_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43461. 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); } }
  43462. function CartoCSS_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartoCSS_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartoCSS_defineProperties(Constructor, staticProps); return Constructor; }
  43463. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  43464. * This program are made available under the terms of the Apache License, Version 2.0
  43465. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43466. /**
  43467. * @class SuperMap.CartoCSS
  43468. * @classdesc CartoCSS 解析类,其主要功能为将 CartoCSS 字符串解析为 CartoCSS 的 shader 属性风格对象。
  43469. * @category BaseTypes Style
  43470. * @param {string} cartoStr - CartoCSS 样式表字符串
  43471. * @example
  43472. * var cartocss = "@provinceLineColor:#ddd;
  43473. * #China_Provinces_L___China400{
  43474. * line-dasharray:10,10;
  43475. * line-color:@provinceLineColor;
  43476. * line-width:1;
  43477. * }";
  43478. * new SuperMap.CartoCSS(cartocss);
  43479. */
  43480. /*eslint no-useless-escape: "off"*/
  43481. var CartoCSS = /*#__PURE__*/function () {
  43482. function CartoCSS(cartoStr) {
  43483. CartoCSS_classCallCheck(this, CartoCSS);
  43484. this.env = null;
  43485. /**
  43486. * @member SuperMap.CartoCSS.prototype.parser
  43487. * @description 解析器
  43488. */
  43489. this.parser = null;
  43490. /**
  43491. * @member SuperMap.CartoCSS.prototype.ruleSet
  43492. * @description CartoCSS 规则对象
  43493. */
  43494. this.ruleSet = null;
  43495. /**
  43496. * @member SuperMap.CartoCSS.prototype.cartoStr
  43497. * @description CartoCSS 样式表字符串
  43498. */
  43499. this.cartoStr = "";
  43500. /**
  43501. * @member SuperMap.CartoCSS.prototype.shaders
  43502. * @description Carto 着色器集
  43503. */
  43504. this.shaders = null;
  43505. if (typeof cartoStr === "string") {
  43506. this.cartoStr = cartoStr;
  43507. this.env = {
  43508. frames: [],
  43509. errors: [],
  43510. error: function error(obj) {
  43511. this.errors.push(obj);
  43512. }
  43513. };
  43514. this.parser = this.getParser(this.env);
  43515. this.parse(cartoStr);
  43516. this.shaders = this.toShaders();
  43517. }
  43518. }
  43519. /**
  43520. * @function SuperMap.CartoCSS.prototype.getParser
  43521. * @description 获取 CartoCSS 解析器
  43522. */
  43523. CartoCSS_createClass(CartoCSS, [{
  43524. key: "getParser",
  43525. value: function getParser(env) {
  43526. var input, // LeSS input string
  43527. i, // current index in `input`
  43528. j, // current chunk
  43529. temp, // temporarily holds a chunk's state, for backtracking
  43530. memo, // temporarily holds `i`, when backtracking
  43531. furthest, // furthest index the parser has gone to
  43532. chunks, // chunkified input
  43533. current, // index of current chunk, in `input`
  43534. parser;
  43535. var that = this; // This function is called after all files
  43536. // have been imported through `@import`.
  43537. var finish = function finish() {//NOSONAR
  43538. //所有文件导入完成之后调用
  43539. };
  43540. function save() {
  43541. temp = chunks[j];
  43542. memo = i;
  43543. current = i;
  43544. }
  43545. function restore() {
  43546. chunks[j] = temp;
  43547. i = memo;
  43548. current = i;
  43549. }
  43550. function sync() {
  43551. if (i > current) {
  43552. chunks[j] = chunks[j].slice(i - current);
  43553. current = i;
  43554. }
  43555. } //
  43556. // Parse from a token, regexp or string, and move forward if match
  43557. //
  43558. function _match(tok) {
  43559. var match, length, c, endIndex; // Non-terminal
  43560. if (tok instanceof Function) {
  43561. return tok.call(parser.parsers); // Terminal
  43562. // Either match a single character in the input,
  43563. // or match a regexp in the current chunk (chunk[j]).
  43564. } else if (typeof tok === 'string') {
  43565. match = input.charAt(i) === tok ? tok : null;
  43566. length = 1;
  43567. sync();
  43568. } else {
  43569. sync();
  43570. match = tok.exec(chunks[j]);
  43571. if (match) {
  43572. length = match[0].length;
  43573. } else {
  43574. return null;
  43575. }
  43576. } // The match is confirmed, add the match length to `i`,
  43577. // and consume any extra white-space characters (' ' || '\n')
  43578. // which come after that. The reason for this is that LeSS's
  43579. // grammar is mostly white-space insensitive.
  43580. if (match) {
  43581. var mem = i += length;
  43582. endIndex = i + chunks[j].length - length;
  43583. while (i < endIndex) {
  43584. c = input.charCodeAt(i);
  43585. if (!(c === 32 || c === 10 || c === 9)) {
  43586. break;
  43587. }
  43588. i++;
  43589. }
  43590. chunks[j] = chunks[j].slice(length + (i - mem));
  43591. current = i;
  43592. if (chunks[j].length === 0 && j < chunks.length - 1) {
  43593. j++;
  43594. }
  43595. if (typeof match === 'string') {
  43596. return match;
  43597. } else {
  43598. return match.length === 1 ? match[0] : match;
  43599. }
  43600. }
  43601. } // Same as _match(), but don't change the state of the parser,
  43602. // just return the match.
  43603. function peek(tok) {
  43604. if (typeof tok === 'string') {
  43605. return input.charAt(i) === tok;
  43606. } else {
  43607. return !!tok.test(chunks[j]);
  43608. }
  43609. } // Make an error object from a passed set of properties.
  43610. // Accepted properties:
  43611. // - `message`: Text of the error message.
  43612. // - `filename`: Filename where the error occurred.
  43613. // - `index`: Char. index where the error occurred.
  43614. function makeError(err) {
  43615. var einput;
  43616. var defautls = {
  43617. index: furthest,
  43618. filename: env.filename,
  43619. message: 'Parse error.',
  43620. line: 0,
  43621. column: -1
  43622. };
  43623. for (var prop in defautls) {
  43624. if (err[prop] === 0) {
  43625. err[prop] = defautls[prop];
  43626. }
  43627. }
  43628. if (err.filename && that.env.inputs && that.env.inputs[err.filename]) {
  43629. einput = that.env.inputs[err.filename];
  43630. } else {
  43631. einput = input;
  43632. }
  43633. err.line = (einput.slice(0, err.index).match(/\n/g) || '').length + 1;
  43634. for (var n = err.index; n >= 0 && einput.charAt(n) !== '\n'; n--) {
  43635. err.column++;
  43636. }
  43637. return new Error([err.filename, err.line, err.column, err.message].join(";"));
  43638. }
  43639. this.env = env = env || {};
  43640. this.env.filename = this.env.filename || null;
  43641. this.env.inputs = this.env.inputs || {}; // The Parser
  43642. parser = {
  43643. // Parse an input string into an abstract syntax tree.
  43644. // Throws an error on parse errors.
  43645. parse: function parse(str) {
  43646. var root,
  43647. error = null;
  43648. i = j = current = furthest = 0;
  43649. chunks = [];
  43650. input = str.replace(/\r\n/g, '\n');
  43651. if (env.filename) {
  43652. that.env.inputs[env.filename] = input;
  43653. } // Split the input into chunks.
  43654. chunks = function (chunks) {
  43655. var j = 0,
  43656. skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
  43657. comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
  43658. string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
  43659. level = 0,
  43660. match,
  43661. chunk = chunks[0],
  43662. inParam;
  43663. for (var i = 0, c, cc; i < input.length;) {
  43664. skip.lastIndex = i;
  43665. if (match = skip.exec(input)) {
  43666. if (match.index === i) {
  43667. i += match[0].length;
  43668. chunk.push(match[0]);
  43669. }
  43670. }
  43671. c = input.charAt(i);
  43672. comment.lastIndex = string.lastIndex = i;
  43673. if (match = string.exec(input)) {
  43674. if (match.index === i) {
  43675. i += match[0].length;
  43676. chunk.push(match[0]);
  43677. continue;
  43678. }
  43679. }
  43680. if (!inParam && c === '/') {
  43681. cc = input.charAt(i + 1);
  43682. if (cc === '/' || cc === '*') {
  43683. if (match = comment.exec(input)) {
  43684. if (match.index === i) {
  43685. i += match[0].length;
  43686. chunk.push(match[0]);
  43687. continue;
  43688. }
  43689. }
  43690. }
  43691. }
  43692. switch (c) {
  43693. case '{':
  43694. //NOSONAR
  43695. if (!inParam) {
  43696. level++;
  43697. chunk.push(c);
  43698. break;
  43699. }
  43700. case '}':
  43701. //NOSONAR
  43702. if (!inParam) {
  43703. level--;
  43704. chunk.push(c);
  43705. chunks[++j] = chunk = [];
  43706. break;
  43707. }
  43708. case '(':
  43709. //NOSONAR
  43710. if (!inParam) {
  43711. inParam = true;
  43712. chunk.push(c);
  43713. break;
  43714. }
  43715. case ')':
  43716. //NOSONAR
  43717. if (inParam) {
  43718. inParam = false;
  43719. chunk.push(c);
  43720. break;
  43721. }
  43722. default:
  43723. chunk.push(c);
  43724. break;
  43725. }
  43726. i++;
  43727. }
  43728. if (level !== 0) {
  43729. error = {
  43730. index: i - 1,
  43731. type: 'Parse',
  43732. message: level > 0 ? "missing closing `}`" : "missing opening `{`"
  43733. };
  43734. }
  43735. return chunks.map(function (c) {
  43736. return c.join('');
  43737. });
  43738. }([[]]);
  43739. if (error) {
  43740. throw makeError(error);
  43741. } // Sort rules by specificity: this function expects selectors to be
  43742. // split already.
  43743. //
  43744. // Written to be used as a .sort(Function);
  43745. // argument.
  43746. //
  43747. // [1, 0, 0, 467] > [0, 0, 1, 520]
  43748. var specificitySort = function specificitySort(a, b) {
  43749. var as = a.specificity;
  43750. var bs = b.specificity;
  43751. if (as[0] != bs[0]) {
  43752. return bs[0] - as[0];
  43753. }
  43754. if (as[1] != bs[1]) {
  43755. return bs[1] - as[1];
  43756. }
  43757. if (as[2] != bs[2]) {
  43758. return bs[2] - as[2];
  43759. }
  43760. return bs[3] - as[3];
  43761. }; // Start with the primary rule.
  43762. // The whole syntax tree is held under a Ruleset node,
  43763. // with the `root` property set to true, so no `{}` are
  43764. // output.
  43765. root = new SuperMap.CartoCSS.Tree.Ruleset([], _match(this.parsers.primary));
  43766. root.root = true; // Get an array of Ruleset objects, flattened
  43767. // and sorted according to specificitySort
  43768. root.toList = function () {
  43769. return function (env) {
  43770. env.error = function (e) {
  43771. if (!env.errors) {
  43772. env.errors = new Error('');
  43773. }
  43774. if (env.errors.message) {
  43775. env.errors.message += '\n' + makeError(e).message;
  43776. } else {
  43777. env.errors.message = makeError(e).message;
  43778. }
  43779. };
  43780. env.frames = env.frames || []; // call populates Invalid-caused errors
  43781. var definitions = this.flatten([], [], env);
  43782. definitions.sort(specificitySort);
  43783. return definitions;
  43784. };
  43785. }();
  43786. return root;
  43787. },
  43788. // Here in, the parsing rules/functions
  43789. //
  43790. // The basic structure of the syntax tree generated is as follows:
  43791. //
  43792. // Ruleset -> Rule -> Value -> Expression -> Entity
  43793. //
  43794. // In general, most rules will try to parse a token with the `_match()` function, and if the return
  43795. // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
  43796. // first, before parsing, that's when we use `peek()`.
  43797. parsers: {
  43798. // The `primary` rule is the *entry* and *exit* point of the parser.
  43799. // The rules here can appear at any level of the parse tree.
  43800. //
  43801. // The recursive nature of the grammar is an interplay between the `block`
  43802. // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
  43803. // as represented by this simplified grammar:
  43804. //
  43805. // primary → (ruleset | rule)+
  43806. // ruleset → selector+ block
  43807. // block → '{' primary '}'
  43808. //
  43809. // Only at one point is the primary rule not called from the
  43810. // block rule: at the root level.
  43811. primary: function primary() {
  43812. var node,
  43813. root = [];
  43814. while ((node = _match(this.rule) || _match(this.ruleset) || _match(this.comment)) || _match(/^[\s\n]+/) || (node = _match(this.invalid))) {
  43815. if (node) {
  43816. root.push(node);
  43817. }
  43818. }
  43819. return root;
  43820. },
  43821. invalid: function invalid() {
  43822. var chunk = _match(/^[^;\n]*[;\n]/); // To fail gracefully, match everything until a semicolon or linebreak.
  43823. if (chunk) {
  43824. return new SuperMap.CartoCSS.Tree.Invalid(chunk, memo);
  43825. }
  43826. },
  43827. // We create a Comment node for CSS comments `/* */`,
  43828. // but keep the LeSS comments `//` silent, by just skipping
  43829. // over them.
  43830. comment: function comment() {
  43831. var comment;
  43832. if (input.charAt(i) !== '/') {
  43833. return;
  43834. }
  43835. if (input.charAt(i + 1) === '/') {
  43836. return new SuperMap.CartoCSS.Tree.Comment(_match(/^\/\/.*/), true);
  43837. } else if (comment = _match(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
  43838. return new SuperMap.CartoCSS.Tree.Comment(comment);
  43839. }
  43840. },
  43841. // Entities are tokens which can be found inside an Expression
  43842. entities: {
  43843. // A string, which supports escaping " and ' "milky way" 'he\'s the one!'
  43844. quoted: function quoted() {
  43845. if (input.charAt(i) !== '"' && input.charAt(i) !== "'") {
  43846. return;
  43847. }
  43848. var str = _match(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);
  43849. if (str) {
  43850. return new SuperMap.CartoCSS.Tree.Quoted(str[1] || str[2]);
  43851. }
  43852. },
  43853. // A reference to a Mapnik field, like [NAME]
  43854. // Behind the scenes, this has the same representation, but Carto
  43855. // needs to be careful to warn when unsupported operations are used.
  43856. field: function field() {
  43857. var l = '[',
  43858. r = ']';
  43859. if (!_match(l)) {
  43860. return;
  43861. }
  43862. var field_name = _match(/(^[^\]]+)/);
  43863. if (!_match(r)) {
  43864. return;
  43865. }
  43866. if (field_name) {
  43867. return new SuperMap.CartoCSS.Tree.Field(field_name[1]);
  43868. }
  43869. },
  43870. // This is a comparison operator
  43871. comparison: function comparison() {
  43872. var str = _match(/^=~|=|!=|<=|>=|<|>/);
  43873. if (str) {
  43874. return str;
  43875. }
  43876. },
  43877. // A catch-all word, such as: hard-light
  43878. // These can start with either a letter or a dash (-),
  43879. // and then contain numbers, underscores, and letters.
  43880. keyword: function keyword() {
  43881. var k = _match(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);
  43882. if (k) {
  43883. return new SuperMap.CartoCSS.Tree.Keyword(k);
  43884. }
  43885. },
  43886. // A function call like rgb(255, 0, 255)
  43887. // The arguments are parsed with the `entities.arguments` parser.
  43888. call: function call() {
  43889. var name, args;
  43890. if (!(name = /^([\w\-]+|%)\(/.exec(chunks[j]))) {
  43891. return;
  43892. }
  43893. name = name[1];
  43894. if (name === 'url') {
  43895. // url() is handled by the url parser instead
  43896. return null;
  43897. } else {
  43898. i += name.length;
  43899. }
  43900. var l = '(',
  43901. r = ')';
  43902. _match(l); // Parse the '(' and consume whitespace.
  43903. args = _match(this.entities['arguments']);
  43904. if (!_match(r)) {
  43905. return;
  43906. }
  43907. if (name) {
  43908. return new SuperMap.CartoCSS.Tree.Call(name, args, i);
  43909. }
  43910. },
  43911. // Arguments are comma-separated expressions
  43912. 'arguments': function _arguments() {
  43913. var args = [],
  43914. arg;
  43915. while (arg = _match(this.expression)) {
  43916. args.push(arg);
  43917. var q = ',';
  43918. if (!_match(q)) {
  43919. break;
  43920. }
  43921. }
  43922. return args;
  43923. },
  43924. literal: function literal() {
  43925. return _match(this.entities.dimension) || _match(this.entities.keywordcolor) || _match(this.entities.hexcolor) || _match(this.entities.quoted);
  43926. },
  43927. // Parse url() tokens
  43928. //
  43929. // We use a specific rule for urls, because they don't really behave like
  43930. // standard function calls. The difference is that the argument doesn't have
  43931. // to be enclosed within a string, so it can't be parsed as an Expression.
  43932. url: function url() {
  43933. var value;
  43934. if (input.charAt(i) !== 'u' || !_match(/^url\(/)) {
  43935. return;
  43936. }
  43937. value = _match(this.entities.quoted) || _match(this.entities.variable) || _match(/^[\-\w%@_match\/.&=:;#+?~]+/) || '';
  43938. var r = ')';
  43939. if (!_match(r)) {
  43940. return new SuperMap.CartoCSS.Tree.Invalid(value, memo, 'Missing closing ) in URL.');
  43941. } else {
  43942. return new SuperMap.CartoCSS.Tree.URL(typeof value.value !== 'undefined' || value instanceof SuperMap.CartoCSS.Tree.Variable ? value : new SuperMap.CartoCSS.Tree.Quoted(value));
  43943. }
  43944. },
  43945. // A Variable entity, such as `@fink`, in
  43946. //
  43947. // width: @fink + 2px
  43948. //
  43949. // We use a different parser for variable definitions,
  43950. // see `parsers.variable`.
  43951. variable: function variable() {
  43952. var name,
  43953. index = i;
  43954. if (input.charAt(i) === '@' && (name = _match(/^@[\w-]+/))) {
  43955. return new SuperMap.CartoCSS.Tree.Variable(name, index, env.filename);
  43956. }
  43957. },
  43958. hexcolor: function hexcolor() {
  43959. var rgb;
  43960. if (input.charAt(i) === '#' && (rgb = _match(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
  43961. return new SuperMap.CartoCSS.Tree.Color(rgb[1]);
  43962. }
  43963. },
  43964. keywordcolor: function keywordcolor() {
  43965. var rgb = chunks[j].match(/^[a-z]+/);
  43966. if (rgb && rgb[0] in SuperMap.CartoCSS.Tree.Reference.data.colors) {
  43967. return new SuperMap.CartoCSS.Tree.Color(SuperMap.CartoCSS.Tree.Reference.data.colors[_match(/^[a-z]+/)]);
  43968. }
  43969. },
  43970. // A Dimension, that is, a number and a unit. The only
  43971. // unit that has an effect is %
  43972. dimension: function dimension() {
  43973. var c = input.charCodeAt(i);
  43974. if (c > 57 || c < 45 || c === 47) {
  43975. return;
  43976. }
  43977. var value = _match(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);
  43978. if (value) {
  43979. return new SuperMap.CartoCSS.Tree.Dimension(value[1], value[2], memo);
  43980. }
  43981. }
  43982. },
  43983. // The variable part of a variable definition.
  43984. // Used in the `rule` parser. Like @fink:
  43985. variable: function variable() {
  43986. var name;
  43987. if (input.charAt(i) === '@' && (name = _match(/^(@[\w-]+)\s*:/))) {
  43988. return name[1];
  43989. }
  43990. },
  43991. // Entities are the smallest recognized token,
  43992. // and can be found inside a rule's value.
  43993. entity: function entity() {
  43994. var property1 = _match(this.entities.call) || _match(this.entities.literal);
  43995. var property2 = _match(this.entities.field) || _match(this.entities.variable);
  43996. var property3 = _match(this.entities.url) || _match(this.entities.keyword);
  43997. return property1 || property2 || property3;
  43998. },
  43999. // A Rule terminator. Note that we use `peek()` to check for '}',
  44000. // because the `block` rule will be expecting it, but we still need to make sure
  44001. // it's there, if ';' was ommitted.
  44002. end: function end() {
  44003. var q = ';';
  44004. return _match(q) || peek('}');
  44005. },
  44006. // Elements are the building blocks for Selectors. They consist of
  44007. // an element name, such as a tag a class, or `*`.
  44008. //增加对中文的支持,[\u4e00-\u9fa5]
  44009. element: function element() {
  44010. var e = _match(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);
  44011. if (e) {
  44012. return new SuperMap.CartoCSS.Tree.Element(e);
  44013. }
  44014. },
  44015. // Attachments allow adding multiple lines, polygons etc. to an
  44016. // object. There can only be one attachment per selector.
  44017. attachment: function attachment() {
  44018. var s = _match(/^::([\w\-]+(?:\/[\w\-]+)*)/);
  44019. if (s) {
  44020. return s[1];
  44021. }
  44022. },
  44023. // Selectors are made out of one or more Elements, see above.
  44024. selector: function selector() {
  44025. var a,
  44026. attachment,
  44027. e,
  44028. elements = [],
  44029. f,
  44030. filters = new SuperMap.CartoCSS.Tree.Filterset(),
  44031. z,
  44032. zooms = [],
  44033. segments = 0,
  44034. conditions = 0;
  44035. while ((e = _match(this.element)) || (z = _match(this.zoom)) || (f = _match(this.filter)) || (a = _match(this.attachment))) {
  44036. segments++;
  44037. if (e) {
  44038. elements.push(e);
  44039. } else if (z) {
  44040. zooms.push(z);
  44041. conditions++;
  44042. } else if (f) {
  44043. var err = filters.add(f);
  44044. if (err) {
  44045. throw makeError({
  44046. message: err,
  44047. index: i - 1
  44048. });
  44049. }
  44050. conditions++;
  44051. } else if (attachment) {
  44052. throw makeError({
  44053. message: 'Encountered second attachment name.',
  44054. index: i - 1
  44055. });
  44056. } else {
  44057. attachment = a;
  44058. }
  44059. var c = input.charAt(i);
  44060. if (c === '{' || c === '}' || c === ';' || c === ',') {
  44061. break;
  44062. }
  44063. }
  44064. if (segments) {
  44065. return new SuperMap.CartoCSS.Tree.Selector(filters, zooms, elements, attachment, conditions, memo);
  44066. }
  44067. },
  44068. filter: function filter() {
  44069. save();
  44070. var key,
  44071. op,
  44072. val,
  44073. l = '[',
  44074. r = ']';
  44075. if (!_match(l)) {
  44076. return;
  44077. }
  44078. if (key = _match(/^[a-zA-Z0-9\-_]+/) || _match(this.entities.quoted) || _match(this.entities.variable) || _match(this.entities.keyword) || _match(this.entities.field)) {
  44079. if (key instanceof SuperMap.CartoCSS.Tree.Quoted) {
  44080. key = new SuperMap.CartoCSS.Tree.Field(key.toString());
  44081. }
  44082. 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))) {
  44083. if (!_match(r)) {
  44084. throw makeError({
  44085. message: 'Missing closing ] of filter.',
  44086. index: memo - 1
  44087. });
  44088. }
  44089. if (!key.is) {
  44090. key = new SuperMap.CartoCSS.Tree.Field(key);
  44091. }
  44092. return new SuperMap.CartoCSS.Tree.Filter(key, op, val, memo, env.filename);
  44093. }
  44094. }
  44095. },
  44096. zoom: function zoom() {
  44097. save();
  44098. var op,
  44099. val,
  44100. r = ']';
  44101. if (_match(/^\[\s*zoom/g) && (op = _match(this.entities.comparison)) && (val = _match(this.entities.variable) || _match(this.entities.dimension)) && _match(r)) {
  44102. return new SuperMap.CartoCSS.Tree.Zoom(op, val, memo);
  44103. } else {
  44104. // backtrack
  44105. restore();
  44106. }
  44107. },
  44108. // The `block` rule is used by `ruleset`
  44109. // It's a wrapper around the `primary` rule, with added `{}`.
  44110. block: function block() {
  44111. var content,
  44112. l = '{',
  44113. r = '}';
  44114. if (_match(l) && (content = _match(this.primary)) && _match(r)) {
  44115. return content;
  44116. }
  44117. },
  44118. // div, .class, body > p {...}
  44119. ruleset: function ruleset() {
  44120. var selectors = [],
  44121. s,
  44122. rules,
  44123. q = ',';
  44124. save();
  44125. while (s = _match(this.selector)) {
  44126. selectors.push(s);
  44127. while (_match(this.comment)) {//NOSONAR
  44128. }
  44129. if (!_match(q)) {
  44130. break;
  44131. }
  44132. while (_match(this.comment)) {//NOSONAR
  44133. }
  44134. }
  44135. if (s) {
  44136. while (_match(this.comment)) {//NOSONAR
  44137. }
  44138. }
  44139. if (selectors.length > 0 && (rules = _match(this.block))) {
  44140. if (selectors.length === 1 && selectors[0].elements.length && selectors[0].elements[0].value === 'Map') {
  44141. var rs = new SuperMap.CartoCSS.Tree.Ruleset(selectors, rules);
  44142. rs.isMap = true;
  44143. return rs;
  44144. }
  44145. return new SuperMap.CartoCSS.Tree.Ruleset(selectors, rules);
  44146. } else {
  44147. // Backtrack
  44148. restore();
  44149. }
  44150. },
  44151. rule: function rule() {
  44152. var name,
  44153. value,
  44154. c = input.charAt(i);
  44155. save();
  44156. if (c === '.' || c === '#') {
  44157. return;
  44158. }
  44159. if (name = _match(this.variable) || _match(this.property)) {
  44160. value = _match(this.value);
  44161. if (value && _match(this.end)) {
  44162. return new SuperMap.CartoCSS.Tree.Rule(name, value, memo, env.filename);
  44163. } else {
  44164. furthest = i;
  44165. restore();
  44166. }
  44167. }
  44168. },
  44169. font: function font() {
  44170. var value = [],
  44171. expression = [],
  44172. e,
  44173. q = ',';
  44174. while (e = _match(this.entity)) {
  44175. expression.push(e);
  44176. }
  44177. value.push(new SuperMap.CartoCSS.Tree.Expression(expression));
  44178. if (_match(q)) {
  44179. while (e = _match(this.expression)) {
  44180. value.push(e);
  44181. if (!_match(q)) {
  44182. break;
  44183. }
  44184. }
  44185. }
  44186. return new SuperMap.CartoCSS.Tree.Value(value);
  44187. },
  44188. // A Value is a comma-delimited list of Expressions
  44189. // In a Rule, a Value represents everything after the `:`,
  44190. // and before the `;`.
  44191. value: function value() {
  44192. var e,
  44193. expressions = [],
  44194. q = ',';
  44195. while (e = _match(this.expression)) {
  44196. expressions.push(e);
  44197. if (!_match(q)) {
  44198. break;
  44199. }
  44200. }
  44201. if (expressions.length > 1) {
  44202. return new SuperMap.CartoCSS.Tree.Value(expressions.map(function (e) {
  44203. return e.value[0];
  44204. }));
  44205. } else if (expressions.length === 1) {
  44206. return new SuperMap.CartoCSS.Tree.Value(expressions);
  44207. }
  44208. },
  44209. // A sub-expression, contained by parenthensis
  44210. sub: function sub() {
  44211. var e,
  44212. l = '(',
  44213. r = ")";
  44214. if (_match(l) && (e = _match(this.expression)) && _match(r)) {
  44215. return e;
  44216. }
  44217. },
  44218. // This is a misnomer because it actually handles multiplication
  44219. // and division.
  44220. multiplication: function multiplication() {
  44221. var m,
  44222. a,
  44223. op,
  44224. operation,
  44225. q = '/';
  44226. if (m = _match(this.operand)) {
  44227. while ((op = _match(q) || _match('*') || _match('%')) && (a = _match(this.operand))) {
  44228. operation = new SuperMap.CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  44229. }
  44230. return operation || m;
  44231. }
  44232. },
  44233. addition: function addition() {
  44234. var m,
  44235. a,
  44236. op,
  44237. operation,
  44238. plus = '+';
  44239. if (m = _match(this.multiplication)) {
  44240. while ((op = _match(/^[-+]\s+/) || input.charAt(i - 1) != ' ' && (_match(plus) || _match('-'))) && (a = _match(this.multiplication))) {
  44241. operation = new SuperMap.CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  44242. }
  44243. return operation || m;
  44244. }
  44245. },
  44246. // An operand is anything that can be part of an operation,
  44247. // such as a Color, or a Variable
  44248. operand: function operand() {
  44249. return _match(this.sub) || _match(this.entity);
  44250. },
  44251. // Expressions either represent mathematical operations,
  44252. // or white-space delimited Entities. @var * 2
  44253. expression: function expression() {
  44254. var e,
  44255. entities = [];
  44256. while (e = _match(this.addition) || _match(this.entity)) {
  44257. entities.push(e);
  44258. }
  44259. if (entities.length > 0) {
  44260. return new SuperMap.CartoCSS.Tree.Expression(entities);
  44261. }
  44262. },
  44263. property: function property() {
  44264. var name = _match(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);
  44265. if (name) {
  44266. return name[1];
  44267. }
  44268. }
  44269. }
  44270. };
  44271. return parser;
  44272. }
  44273. /**
  44274. * @function SuperMap.CartoCSS.prototype.parse
  44275. * @description 利用CartoCSS解析器里面的parse方法,将CartoCSS样式表字符串转化为CartoCSS规则集
  44276. * @returns {Object} CartoCSS规则集
  44277. */
  44278. }, {
  44279. key: "parse",
  44280. value: function parse(str) {
  44281. var parser = this.parser;
  44282. var ruleSet = this.ruleSet = parser.parse(str);
  44283. return ruleSet;
  44284. }
  44285. /**
  44286. * @function SuperMap.CartoCSS.prototype.toShaders
  44287. * @description 将CartoCSS规则集转化为着色器
  44288. * @returns {Array} CartoCSS着色器集
  44289. */
  44290. }, {
  44291. key: "toShaders",
  44292. value: function toShaders() {
  44293. if (this.ruleSet) {
  44294. var ruleset = this.ruleSet;
  44295. if (ruleset) {
  44296. var defs = ruleset.toList(this.env);
  44297. defs.reverse();
  44298. var shaders = {};
  44299. var keys = [];
  44300. this._toShaders(shaders, keys, defs);
  44301. var ordered_shaders = [];
  44302. var done = {};
  44303. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  44304. var def = defs[i];
  44305. var k = def.attachment;
  44306. var shader = shaders[keys[i]];
  44307. var shaderArray = [];
  44308. if (!done[k]) {
  44309. var j = 0;
  44310. for (var prop in shader) {
  44311. if (prop !== 'zoom' && prop !== 'frames' && prop !== "attachment" && prop != "elements") {
  44312. //对layer-index作特殊处理以实现图层的控制
  44313. if (prop === "layer-index") {
  44314. /*var getLayerIndex = Function("attributes", "zoom", "var _value = null;" + shader[prop].join('\n') + "; return _value; ");*/
  44315. var getLayerIndex = function getLayerIndex(attributes, zoom) {
  44316. //NOSONAR
  44317. var _value = null;
  44318. shader[prop].join('\n');
  44319. return _value;
  44320. };
  44321. var layerIndex = getLayerIndex();
  44322. Object.defineProperty(shaderArray, "layerIndex", {
  44323. configurable: true,
  44324. enumerable: false,
  44325. value: layerIndex
  44326. });
  44327. } else {
  44328. shaderArray[j++] = function (ops, shaderArray) {
  44329. //NOSONAR
  44330. if (!Array.isArray(ops)) {
  44331. return ops;
  44332. }
  44333. var body = ops.join('\n');
  44334. var myKeyword = 'attributes["FEATUREID"]&&attributes["FEATUREID"]';
  44335. var index = body.indexOf(myKeyword);
  44336. if (index >= 0) {
  44337. //对featureID作一些特殊处理,以将featureID提取出来
  44338. if (!shaderArray.featureFilter) {
  44339. var featureFilterStart = index + myKeyword.length;
  44340. var featureFilterEnd = body.indexOf(")", featureFilterStart + 1);
  44341. var featureFilterStr = "featureId&&(featureId" + body.substring(featureFilterStart, featureFilterEnd) + ")";
  44342. /*var featureFilter = Function("featureId", "if(" + featureFilterStr + "){return true;}return false;");*/
  44343. var featureFilter = function featureFilter(featureId) {
  44344. if (featureFilterStr) {
  44345. return true;
  44346. }
  44347. return false;
  44348. };
  44349. Object.defineProperty(shaderArray, "featureFilter", {
  44350. configurable: true,
  44351. enumerable: false,
  44352. value: featureFilter
  44353. });
  44354. }
  44355. return {
  44356. "property": prop,
  44357. "getValue": Function("attributes", "zoom", "seftFilter", "var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){" + body + ";} return _value; ") //NOSONAR
  44358. };
  44359. } else {
  44360. return {
  44361. "property": prop,
  44362. "getValue": Function("attributes", "zoom", "var _value = null;" + body + "; return _value; ") //NOSONAR
  44363. };
  44364. }
  44365. }(shader[prop], shaderArray);
  44366. }
  44367. }
  44368. }
  44369. Object.defineProperty(shaderArray, "attachment", {
  44370. configurable: true,
  44371. enumerable: false,
  44372. value: k
  44373. });
  44374. Object.defineProperty(shaderArray, "elements", {
  44375. configurable: true,
  44376. enumerable: false,
  44377. value: def.elements
  44378. });
  44379. ordered_shaders.push(shaderArray);
  44380. done[keys[i]] = true;
  44381. }
  44382. Object.defineProperty(shaderArray, "zoom", {
  44383. configurable: true,
  44384. enumerable: false,
  44385. value: def.zoom
  44386. }); //shader.frames.push(def.frame_offset);
  44387. }
  44388. return ordered_shaders;
  44389. }
  44390. }
  44391. return null;
  44392. }
  44393. }, {
  44394. key: "_toShaders",
  44395. value: function _toShaders(shaders, keys, defs) {
  44396. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  44397. var def = defs[i];
  44398. var element_str = [];
  44399. for (var j = 0, len1 = def.elements.length; j < len1; j++) {
  44400. element_str.push(def.elements[j]);
  44401. }
  44402. var filters = def.filters.filters;
  44403. var filterStr = [];
  44404. for (var attr in filters) {
  44405. filterStr.push(filters[attr].id);
  44406. }
  44407. var key = element_str.join("/") + "::" + def.attachment + "_" + filterStr.join("_");
  44408. keys.push(key);
  44409. var shader = shaders[key] = shaders[key] || {}; //shader.frames = [];
  44410. shader.zoom = SuperMap.CartoCSS.Tree.Zoom.all;
  44411. var props = def.toJS(this.env);
  44412. for (var v in props) {
  44413. (shader[v] = shader[v] || []).push(props[v].join('\n'));
  44414. }
  44415. }
  44416. }
  44417. /**
  44418. * @function SuperMap.CartoCSS.prototype.getShaders
  44419. * @description 获取CartoCSS着色器
  44420. * @returns {Array} 着色器集
  44421. * @example
  44422. * //shaders的结构大概如下:
  44423. * var shaders=[
  44424. * {
  44425. * attachment:"one",
  44426. * elements:[],
  44427. * zoom:23,
  44428. * length:2,
  44429. * 0:{property:"line-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  44430. * 1:{preoperty:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  44431. * },
  44432. * {
  44433. * attachment:"two",
  44434. * elements:[],
  44435. * zoom:23,
  44436. * length:2,
  44437. * 0:{property:"polygon-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  44438. * 1:{property:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  44439. * }
  44440. * ];
  44441. */
  44442. }, {
  44443. key: "getShaders",
  44444. value: function getShaders() {
  44445. return this.shaders;
  44446. }
  44447. /**
  44448. * @function SuperMap.CartoCSS.prototype.destroy
  44449. * @description CartoCSS解析对象的析构函数,用于销毁CartoCSS解析对象
  44450. */
  44451. }, {
  44452. key: "destroy",
  44453. value: function destroy() {
  44454. this.cartoStr = null;
  44455. this.env = null;
  44456. this.ruleSet = null;
  44457. this.parser = null;
  44458. this.shaders = null;
  44459. }
  44460. }]);
  44461. return CartoCSS;
  44462. }();
  44463. SuperMap._mapnik_reference_latest = {
  44464. "version": "2.1.1",
  44465. "style": {
  44466. "filter-mode": {
  44467. "type": ["all", "first"],
  44468. "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)",
  44469. "default-value": "all",
  44470. "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."
  44471. },
  44472. "image-filters": {
  44473. "css": "image-filters",
  44474. "default-value": "none",
  44475. "default-meaning": "no filters",
  44476. "type": "functions",
  44477. "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]],
  44478. "doc": "A list of image filters."
  44479. },
  44480. "comp-op": {
  44481. "css": "comp-op",
  44482. "default-value": "src-over",
  44483. "default-meaning": "add the current layer on top of other layers",
  44484. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  44485. "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"]
  44486. },
  44487. "opacity": {
  44488. "css": "opacity",
  44489. "type": "float",
  44490. "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)",
  44491. "default-value": 1,
  44492. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  44493. }
  44494. },
  44495. "layer": {
  44496. "name": {
  44497. "default-value": "",
  44498. "type": "string",
  44499. "required": true,
  44500. "default-meaning": "No layer name has been provided",
  44501. "doc": "The name of a layer. Can be anything you wish and is not strictly validated, but ideally unique in the map"
  44502. },
  44503. "srs": {
  44504. "default-value": "",
  44505. "type": "string",
  44506. "default-meaning": "No srs value is provided and the value will be inherited from the Map's srs",
  44507. "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'"
  44508. },
  44509. "status": {
  44510. "default-value": true,
  44511. "type": "boolean",
  44512. "default-meaning": "This layer will be marked as active and available for processing",
  44513. "doc": "A property that can be set to false to disable this layer from being processed"
  44514. },
  44515. "minzoom": {
  44516. "default-value": "0",
  44517. "type": "float",
  44518. "default-meaning": "The layer will be visible at the minimum possible scale",
  44519. "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"
  44520. },
  44521. "maxzoom": {
  44522. "default-value": "1.79769e+308",
  44523. "type": "float",
  44524. "default-meaning": "The layer will be visible at the maximum possible scale",
  44525. "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"
  44526. },
  44527. "queryable": {
  44528. "default-value": false,
  44529. "type": "boolean",
  44530. "default-meaning": "The layer will not be available for the direct querying of data values",
  44531. "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"
  44532. },
  44533. "clear-label-cache": {
  44534. "default-value": false,
  44535. "type": "boolean",
  44536. "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",
  44537. "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"
  44538. },
  44539. "group-by": {
  44540. "default-value": "",
  44541. "type": "string",
  44542. "default-meaning": "No special layer grouping will be used during rendering",
  44543. "doc": "https://github.com/mapnik/mapnik/wiki/Grouped-rendering"
  44544. },
  44545. "buffer-size": {
  44546. "default-value": "0",
  44547. "type": "float",
  44548. "default-meaning": "No buffer will be used",
  44549. "doc": "Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"
  44550. },
  44551. "maximum-extent": {
  44552. "default-value": "none",
  44553. "type": "bbox",
  44554. "default-meaning": "No clipping extent will be used",
  44555. "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."
  44556. }
  44557. },
  44558. "symbolizers": {
  44559. "*": {
  44560. "image-filters": {
  44561. "css": "image-filters",
  44562. "default-value": "none",
  44563. "default-meaning": "no filters",
  44564. "type": "functions",
  44565. "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]],
  44566. "doc": "A list of image filters."
  44567. },
  44568. "comp-op": {
  44569. "css": "comp-op",
  44570. "default-value": "src-over",
  44571. "default-meaning": "add the current layer on top of other layers",
  44572. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  44573. "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"]
  44574. },
  44575. "opacity": {
  44576. "css": "opacity",
  44577. "type": "float",
  44578. "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)",
  44579. "default-value": 1,
  44580. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  44581. }
  44582. },
  44583. "map": {
  44584. "background-color": {
  44585. "css": "background-color",
  44586. "default-value": "none",
  44587. "default-meaning": "transparent",
  44588. "type": "color",
  44589. "doc": "Map Background color"
  44590. },
  44591. "background-image": {
  44592. "css": "background-image",
  44593. "type": "uri",
  44594. "default-value": "",
  44595. "default-meaning": "transparent",
  44596. "doc": "An image that is repeated below all features on a map as a background.",
  44597. "description": "Map Background image"
  44598. },
  44599. "srs": {
  44600. "css": "srs",
  44601. "type": "string",
  44602. "default-value": "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
  44603. "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",
  44604. "doc": "Map spatial reference (proj4 string)"
  44605. },
  44606. "buffer-size": {
  44607. "css": "buffer-size",
  44608. "default-value": "0",
  44609. "type": "float",
  44610. "default-meaning": "No buffer will be used",
  44611. "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\"."
  44612. },
  44613. "maximum-extent": {
  44614. "css": "",
  44615. "default-value": "none",
  44616. "type": "bbox",
  44617. "default-meaning": "No clipping extent will be used",
  44618. "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."
  44619. },
  44620. "base": {
  44621. "css": "base",
  44622. "default-value": "",
  44623. "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.",
  44624. "type": "string",
  44625. "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."
  44626. },
  44627. "paths-from-xml": {
  44628. "css": "",
  44629. "default-value": true,
  44630. "default-meaning": "Paths read from XML will be interpreted from the location of the XML",
  44631. "type": "boolean",
  44632. "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()"
  44633. },
  44634. "minimum-version": {
  44635. "css": "",
  44636. "default-value": "none",
  44637. "default-meaning": "Mapnik version will not be detected and no error will be thrown about compatibility",
  44638. "type": "string",
  44639. "doc": "The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"
  44640. },
  44641. "font-directory": {
  44642. "css": "font-directory",
  44643. "type": "uri",
  44644. "default-value": "none",
  44645. "default-meaning": "No map-specific fonts will be registered",
  44646. "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)."
  44647. }
  44648. },
  44649. "polygon": {
  44650. "fill": {
  44651. "css": "polygon-fill",
  44652. "type": "color",
  44653. "default-value": "rgba(128,128,128,1)",
  44654. "default-meaning": "gray and fully opaque (alpha = 1), same as rgb(128,128,128)",
  44655. "doc": "Fill color to assign to a polygon"
  44656. },
  44657. "fill-opacity": {
  44658. "css": "polygon-opacity",
  44659. "type": "float",
  44660. "doc": "The opacity of the polygon",
  44661. "default-value": 1,
  44662. "default-meaning": "opaque"
  44663. },
  44664. "gamma": {
  44665. "css": "polygon-gamma",
  44666. "type": "float",
  44667. "default-value": 1,
  44668. "default-meaning": "fully antialiased",
  44669. "range": "0-1",
  44670. "doc": "Level of antialiasing of polygon edges"
  44671. },
  44672. "gamma-method": {
  44673. "css": "polygon-gamma-method",
  44674. "type": ["power", "linear", "none", "threshold", "multiply"],
  44675. "default-value": "power",
  44676. "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",
  44677. "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"
  44678. },
  44679. "clip": {
  44680. "css": "polygon-clip",
  44681. "type": "boolean",
  44682. "default-value": true,
  44683. "default-meaning": "geometry will be clipped to map bounds before rendering",
  44684. "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."
  44685. },
  44686. "smooth": {
  44687. "css": "polygon-smooth",
  44688. "type": "float",
  44689. "default-value": 0,
  44690. "default-meaning": "no smoothing",
  44691. "range": "0-1",
  44692. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  44693. },
  44694. "geometry-transform": {
  44695. "css": "polygon-geometry-transform",
  44696. "type": "functions",
  44697. "default-value": "none",
  44698. "default-meaning": "geometry will not be transformed",
  44699. "doc": "Allows transformation functions to be applied to the geometry.",
  44700. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  44701. },
  44702. "comp-op": {
  44703. "css": "polygon-comp-op",
  44704. "default-value": "src-over",
  44705. "default-meaning": "add the current symbolizer on top of other symbolizer",
  44706. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  44707. "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"]
  44708. }
  44709. },
  44710. "line": {
  44711. "stroke": {
  44712. "css": "line-color",
  44713. "default-value": "rgba(0,0,0,1)",
  44714. "type": "color",
  44715. "default-meaning": "black and fully opaque (alpha = 1), same as rgb(0,0,0)",
  44716. "doc": "The color of a drawn line"
  44717. },
  44718. "stroke-width": {
  44719. "css": "line-width",
  44720. "default-value": 1,
  44721. "type": "float",
  44722. "doc": "The width of a line in pixels"
  44723. },
  44724. "stroke-opacity": {
  44725. "css": "line-opacity",
  44726. "default-value": 1,
  44727. "type": "float",
  44728. "default-meaning": "opaque",
  44729. "doc": "The opacity of a line"
  44730. },
  44731. "stroke-linejoin": {
  44732. "css": "line-join",
  44733. "default-value": "miter",
  44734. "type": ["miter", "round", "bevel"],
  44735. "doc": "The behavior of lines when joining"
  44736. },
  44737. "stroke-linecap": {
  44738. "css": "line-cap",
  44739. "default-value": "butt",
  44740. "type": ["butt", "round", "square"],
  44741. "doc": "The display of line endings"
  44742. },
  44743. "stroke-gamma": {
  44744. "css": "line-gamma",
  44745. "type": "float",
  44746. "default-value": 1,
  44747. "default-meaning": "fully antialiased",
  44748. "range": "0-1",
  44749. "doc": "Level of antialiasing of stroke line"
  44750. },
  44751. "stroke-gamma-method": {
  44752. "css": "line-gamma-method",
  44753. "type": ["power", "linear", "none", "threshold", "multiply"],
  44754. "default-value": "power",
  44755. "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",
  44756. "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"
  44757. },
  44758. "stroke-dasharray": {
  44759. "css": "line-dasharray",
  44760. "type": "numbers",
  44761. "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.",
  44762. "default-value": "none",
  44763. "default-meaning": "solid line"
  44764. },
  44765. "stroke-dashoffset": {
  44766. "css": "line-dash-offset",
  44767. "type": "numbers",
  44768. "doc": "valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)",
  44769. "default-value": "none",
  44770. "default-meaning": "solid line"
  44771. },
  44772. "stroke-miterlimit": {
  44773. "css": "line-miterlimit",
  44774. "type": "float",
  44775. "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.",
  44776. "default-value": 4.0,
  44777. "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 )'"
  44778. },
  44779. "clip": {
  44780. "css": "line-clip",
  44781. "type": "boolean",
  44782. "default-value": true,
  44783. "default-meaning": "geometry will be clipped to map bounds before rendering",
  44784. "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."
  44785. },
  44786. "smooth": {
  44787. "css": "line-smooth",
  44788. "type": "float",
  44789. "default-value": 0,
  44790. "default-meaning": "no smoothing",
  44791. "range": "0-1",
  44792. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  44793. },
  44794. "offset": {
  44795. "css": "line-offset",
  44796. "type": "float",
  44797. "default-value": 0,
  44798. "default-meaning": "no offset",
  44799. "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)."
  44800. },
  44801. "rasterizer": {
  44802. "css": "line-rasterizer",
  44803. "type": ["full", "fast"],
  44804. "default-value": "full",
  44805. "doc": "Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."
  44806. },
  44807. "geometry-transform": {
  44808. "css": "line-geometry-transform",
  44809. "type": "functions",
  44810. "default-value": "none",
  44811. "default-meaning": "geometry will not be transformed",
  44812. "doc": "Allows transformation functions to be applied to the geometry.",
  44813. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  44814. },
  44815. "comp-op": {
  44816. "css": "line-comp-op",
  44817. "default-value": "src-over",
  44818. "default-meaning": "add the current symbolizer on top of other symbolizer",
  44819. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  44820. "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"]
  44821. }
  44822. },
  44823. "markers": {
  44824. "file": {
  44825. "css": "marker-file",
  44826. "doc": "An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.",
  44827. "default-value": "",
  44828. "default-meaning": "An ellipse or circle, if width equals height",
  44829. "type": "uri"
  44830. },
  44831. "opacity": {
  44832. "css": "marker-opacity",
  44833. "doc": "The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke",
  44834. "default-value": 1,
  44835. "default-meaning": "The stroke-opacity and fill-opacity will be used",
  44836. "type": "float"
  44837. },
  44838. "fill-opacity": {
  44839. "css": "marker-fill-opacity",
  44840. "doc": "The fill opacity of the marker",
  44841. "default-value": 1,
  44842. "default-meaning": "opaque",
  44843. "type": "float"
  44844. },
  44845. "stroke": {
  44846. "css": "marker-line-color",
  44847. "doc": "The color of the stroke around a marker shape.",
  44848. "default-value": "black",
  44849. "type": "color"
  44850. },
  44851. "stroke-width": {
  44852. "css": "marker-line-width",
  44853. "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.",
  44854. "type": "float"
  44855. },
  44856. "stroke-opacity": {
  44857. "css": "marker-line-opacity",
  44858. "default-value": 1,
  44859. "default-meaning": "opaque",
  44860. "doc": "The opacity of a line",
  44861. "type": "float"
  44862. },
  44863. "placement": {
  44864. "css": "marker-placement",
  44865. "type": ["point", "line", "interior"],
  44866. "default-value": "point",
  44867. "default-meaning": "Place markers at the center point (centroid) of the geometry",
  44868. "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"
  44869. },
  44870. "multi-policy": {
  44871. "css": "marker-multi-policy",
  44872. "type": ["each", "whole", "largest"],
  44873. "default-value": "each",
  44874. "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",
  44875. "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)."
  44876. },
  44877. "marker-type": {
  44878. "css": "marker-type",
  44879. "type": ["arrow", "ellipse"],
  44880. "default-value": "ellipse",
  44881. "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)"
  44882. },
  44883. "width": {
  44884. "css": "marker-width",
  44885. "default-value": 10,
  44886. "doc": "The width of the marker, if using one of the default types.",
  44887. "type": "expression"
  44888. },
  44889. "height": {
  44890. "css": "marker-height",
  44891. "default-value": 10,
  44892. "doc": "The height of the marker, if using one of the default types.",
  44893. "type": "expression"
  44894. },
  44895. "fill": {
  44896. "css": "marker-fill",
  44897. "default-value": "blue",
  44898. "doc": "The color of the area of the marker.",
  44899. "type": "color"
  44900. },
  44901. "allow-overlap": {
  44902. "css": "marker-allow-overlap",
  44903. "type": "boolean",
  44904. "default-value": false,
  44905. "doc": "Control whether overlapping markers are shown or hidden.",
  44906. "default-meaning": "Do not allow makers to overlap with each other - overlapping markers will not be shown."
  44907. },
  44908. "ignore-placement": {
  44909. "css": "marker-ignore-placement",
  44910. "type": "boolean",
  44911. "default-value": false,
  44912. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  44913. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  44914. },
  44915. "spacing": {
  44916. "css": "marker-spacing",
  44917. "doc": "Space between repeated labels",
  44918. "default-value": 100,
  44919. "type": "float"
  44920. },
  44921. "max-error": {
  44922. "css": "marker-max-error",
  44923. "type": "float",
  44924. "default-value": 0.2,
  44925. "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."
  44926. },
  44927. "transform": {
  44928. "css": "marker-transform",
  44929. "type": "functions",
  44930. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  44931. "default-value": "",
  44932. "default-meaning": "No transformation",
  44933. "doc": "SVG transformation definition"
  44934. },
  44935. "clip": {
  44936. "css": "marker-clip",
  44937. "type": "boolean",
  44938. "default-value": true,
  44939. "default-meaning": "geometry will be clipped to map bounds before rendering",
  44940. "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."
  44941. },
  44942. "smooth": {
  44943. "css": "marker-smooth",
  44944. "type": "float",
  44945. "default-value": 0,
  44946. "default-meaning": "no smoothing",
  44947. "range": "0-1",
  44948. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  44949. },
  44950. "geometry-transform": {
  44951. "css": "marker-geometry-transform",
  44952. "type": "functions",
  44953. "default-value": "none",
  44954. "default-meaning": "geometry will not be transformed",
  44955. "doc": "Allows transformation functions to be applied to the geometry.",
  44956. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  44957. },
  44958. "comp-op": {
  44959. "css": "marker-comp-op",
  44960. "default-value": "src-over",
  44961. "default-meaning": "add the current symbolizer on top of other symbolizer",
  44962. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  44963. "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"]
  44964. }
  44965. },
  44966. "shield": {
  44967. "name": {
  44968. "css": "shield-name",
  44969. "type": "expression",
  44970. "serialization": "content",
  44971. "doc": "Value to use for a shield\"s text label. Data columns are specified using brackets like [column_name]"
  44972. },
  44973. "file": {
  44974. "css": "shield-file",
  44975. "required": true,
  44976. "type": "uri",
  44977. "default-value": "none",
  44978. "doc": "Image file to render behind the shield text"
  44979. },
  44980. "face-name": {
  44981. "css": "shield-face-name",
  44982. "type": "string",
  44983. "validate": "font",
  44984. "doc": "Font name and style to use for the shield text",
  44985. "default-value": "",
  44986. "required": true
  44987. },
  44988. "unlock-image": {
  44989. "css": "shield-unlock-image",
  44990. "type": "boolean",
  44991. "doc": "This parameter should be set to true if you are trying to position text beside rather than on top of the shield image",
  44992. "default-value": false,
  44993. "default-meaning": "text alignment relative to the shield image uses the center of the image as the anchor for text positioning."
  44994. },
  44995. "size": {
  44996. "css": "shield-size",
  44997. "type": "float",
  44998. "doc": "The size of the shield text in pixels"
  44999. },
  45000. "fill": {
  45001. "css": "shield-fill",
  45002. "type": "color",
  45003. "doc": "The color of the shield text"
  45004. },
  45005. "placement": {
  45006. "css": "shield-placement",
  45007. "type": ["point", "line", "vertex", "interior"],
  45008. "default-value": "point",
  45009. "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."
  45010. },
  45011. "avoid-edges": {
  45012. "css": "shield-avoid-edges",
  45013. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  45014. "type": "boolean",
  45015. "default-value": false
  45016. },
  45017. "allow-overlap": {
  45018. "css": "shield-allow-overlap",
  45019. "type": "boolean",
  45020. "default-value": false,
  45021. "doc": "Control whether overlapping shields are shown or hidden.",
  45022. "default-meaning": "Do not allow shields to overlap with other map elements already placed."
  45023. },
  45024. "minimum-distance": {
  45025. "css": "shield-min-distance",
  45026. "type": "float",
  45027. "default-value": 0,
  45028. "doc": "Minimum distance to the next shield symbol, not necessarily the same shield."
  45029. },
  45030. "spacing": {
  45031. "css": "shield-spacing",
  45032. "type": "float",
  45033. "default-value": 0,
  45034. "doc": "The spacing between repeated occurrences of the same shield on a line"
  45035. },
  45036. "minimum-padding": {
  45037. "css": "shield-min-padding",
  45038. "default-value": 0,
  45039. "doc": "Determines the minimum amount of padding that a shield gets relative to other shields",
  45040. "type": "float"
  45041. },
  45042. "wrap-width": {
  45043. "css": "shield-wrap-width",
  45044. "type": "unsigned",
  45045. "default-value": 0,
  45046. "doc": "Length of a chunk of text in characters before wrapping text"
  45047. },
  45048. "wrap-before": {
  45049. "css": "shield-wrap-before",
  45050. "type": "boolean",
  45051. "default-value": false,
  45052. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  45053. },
  45054. "wrap-character": {
  45055. "css": "shield-wrap-character",
  45056. "type": "string",
  45057. "default-value": " ",
  45058. "doc": "Use this character instead of a space to wrap long names."
  45059. },
  45060. "halo-fill": {
  45061. "css": "shield-halo-fill",
  45062. "type": "color",
  45063. "default-value": "#FFFFFF",
  45064. "default-meaning": "white",
  45065. "doc": "Specifies the color of the halo around the text."
  45066. },
  45067. "halo-radius": {
  45068. "css": "shield-halo-radius",
  45069. "doc": "Specify the radius of the halo in pixels",
  45070. "default-value": 0,
  45071. "default-meaning": "no halo",
  45072. "type": "float"
  45073. },
  45074. "character-spacing": {
  45075. "css": "shield-character-spacing",
  45076. "type": "unsigned",
  45077. "default-value": 0,
  45078. "doc": "Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."
  45079. },
  45080. "line-spacing": {
  45081. "css": "shield-line-spacing",
  45082. "doc": "Vertical spacing between lines of multiline labels (in pixels)",
  45083. "type": "unsigned"
  45084. },
  45085. "dx": {
  45086. "css": "shield-text-dx",
  45087. "type": "float",
  45088. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  45089. "default-value": 0
  45090. },
  45091. "dy": {
  45092. "css": "shield-text-dy",
  45093. "type": "float",
  45094. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  45095. "default-value": 0
  45096. },
  45097. "shield-dx": {
  45098. "css": "shield-dx",
  45099. "type": "float",
  45100. "doc": "Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  45101. "default-value": 0
  45102. },
  45103. "shield-dy": {
  45104. "css": "shield-dy",
  45105. "type": "float",
  45106. "doc": "Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  45107. "default-value": 0
  45108. },
  45109. "opacity": {
  45110. "css": "shield-opacity",
  45111. "type": "float",
  45112. "doc": "(Default 1.0) - opacity of the image used for the shield",
  45113. "default-value": 1
  45114. },
  45115. "text-opacity": {
  45116. "css": "shield-text-opacity",
  45117. "type": "float",
  45118. "doc": "(Default 1.0) - opacity of the text placed on top of the shield",
  45119. "default-value": 1
  45120. },
  45121. "horizontal-alignment": {
  45122. "css": "shield-horizontal-alignment",
  45123. "type": ["left", "middle", "right", "auto"],
  45124. "doc": "The shield's horizontal alignment from its centerpoint",
  45125. "default-value": "auto"
  45126. },
  45127. "vertical-alignment": {
  45128. "css": "shield-vertical-alignment",
  45129. "type": ["top", "middle", "bottom", "auto"],
  45130. "doc": "The shield's vertical alignment from its centerpoint",
  45131. "default-value": "middle"
  45132. },
  45133. "text-transform": {
  45134. "css": "shield-text-transform",
  45135. "type": ["none", "uppercase", "lowercase", "capitalize"],
  45136. "doc": "Transform the case of the characters",
  45137. "default-value": "none"
  45138. },
  45139. "justify-alignment": {
  45140. "css": "shield-justify-alignment",
  45141. "type": ["left", "center", "right", "auto"],
  45142. "doc": "Define how text in a shield's label is justified",
  45143. "default-value": "auto"
  45144. },
  45145. "clip": {
  45146. "css": "shield-clip",
  45147. "type": "boolean",
  45148. "default-value": true,
  45149. "default-meaning": "geometry will be clipped to map bounds before rendering",
  45150. "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."
  45151. },
  45152. "comp-op": {
  45153. "css": "shield-comp-op",
  45154. "default-value": "src-over",
  45155. "default-meaning": "add the current symbolizer on top of other symbolizer",
  45156. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  45157. "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"]
  45158. }
  45159. },
  45160. "line-pattern": {
  45161. "file": {
  45162. "css": "line-pattern-file",
  45163. "type": "uri",
  45164. "default-value": "none",
  45165. "required": true,
  45166. "doc": "An image file to be repeated and warped along a line"
  45167. },
  45168. "clip": {
  45169. "css": "line-pattern-clip",
  45170. "type": "boolean",
  45171. "default-value": true,
  45172. "default-meaning": "geometry will be clipped to map bounds before rendering",
  45173. "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."
  45174. },
  45175. "smooth": {
  45176. "css": "line-pattern-smooth",
  45177. "type": "float",
  45178. "default-value": 0,
  45179. "default-meaning": "no smoothing",
  45180. "range": "0-1",
  45181. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  45182. },
  45183. "geometry-transform": {
  45184. "css": "line-pattern-geometry-transform",
  45185. "type": "functions",
  45186. "default-value": "none",
  45187. "default-meaning": "geometry will not be transformed",
  45188. "doc": "Allows transformation functions to be applied to the geometry.",
  45189. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  45190. },
  45191. "comp-op": {
  45192. "css": "line-pattern-comp-op",
  45193. "default-value": "src-over",
  45194. "default-meaning": "add the current symbolizer on top of other symbolizer",
  45195. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  45196. "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"]
  45197. }
  45198. },
  45199. "polygon-pattern": {
  45200. "file": {
  45201. "css": "polygon-pattern-file",
  45202. "type": "uri",
  45203. "default-value": "none",
  45204. "required": true,
  45205. "doc": "Image to use as a repeated pattern fill within a polygon"
  45206. },
  45207. "alignment": {
  45208. "css": "polygon-pattern-alignment",
  45209. "type": ["local", "global"],
  45210. "default-value": "local",
  45211. "doc": "Specify whether to align pattern fills to the layer or to the map."
  45212. },
  45213. "gamma": {
  45214. "css": "polygon-pattern-gamma",
  45215. "type": "float",
  45216. "default-value": 1,
  45217. "default-meaning": "fully antialiased",
  45218. "range": "0-1",
  45219. "doc": "Level of antialiasing of polygon pattern edges"
  45220. },
  45221. "opacity": {
  45222. "css": "polygon-pattern-opacity",
  45223. "type": "float",
  45224. "doc": "(Default 1.0) - Apply an opacity level to the image used for the pattern",
  45225. "default-value": 1,
  45226. "default-meaning": "The image is rendered without modifications"
  45227. },
  45228. "clip": {
  45229. "css": "polygon-pattern-clip",
  45230. "type": "boolean",
  45231. "default-value": true,
  45232. "default-meaning": "geometry will be clipped to map bounds before rendering",
  45233. "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."
  45234. },
  45235. "smooth": {
  45236. "css": "polygon-pattern-smooth",
  45237. "type": "float",
  45238. "default-value": 0,
  45239. "default-meaning": "no smoothing",
  45240. "range": "0-1",
  45241. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  45242. },
  45243. "geometry-transform": {
  45244. "css": "polygon-pattern-geometry-transform",
  45245. "type": "functions",
  45246. "default-value": "none",
  45247. "default-meaning": "geometry will not be transformed",
  45248. "doc": "Allows transformation functions to be applied to the geometry.",
  45249. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  45250. },
  45251. "comp-op": {
  45252. "css": "polygon-pattern-comp-op",
  45253. "default-value": "src-over",
  45254. "default-meaning": "add the current symbolizer on top of other symbolizer",
  45255. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  45256. "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"]
  45257. }
  45258. },
  45259. "raster": {
  45260. "opacity": {
  45261. "css": "raster-opacity",
  45262. "default-value": 1,
  45263. "default-meaning": "opaque",
  45264. "type": "float",
  45265. "doc": "The opacity of the raster symbolizer on top of other symbolizers."
  45266. },
  45267. "filter-factor": {
  45268. "css": "raster-filter-factor",
  45269. "default-value": -1,
  45270. "default-meaning": "Allow the datasource to choose appropriate downscaling.",
  45271. "type": "float",
  45272. "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."
  45273. },
  45274. "scaling": {
  45275. "css": "raster-scaling",
  45276. "type": ["near", "fast", "bilinear", "bilinear8", "bicubic", "spline16", "spline36", "hanning", "hamming", "hermite", "kaiser", "quadric", "catrom", "gaussian", "bessel", "mitchell", "sinc", "lanczos", "blackman"],
  45277. "default-value": "near",
  45278. "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."
  45279. },
  45280. "mesh-size": {
  45281. "css": "raster-mesh-size",
  45282. "default-value": 16,
  45283. "default-meaning": "Reprojection mesh will be 1/16 of the resolution of the source image",
  45284. "type": "unsigned",
  45285. "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."
  45286. },
  45287. "comp-op": {
  45288. "css": "raster-comp-op",
  45289. "default-value": "src-over",
  45290. "default-meaning": "add the current symbolizer on top of other symbolizer",
  45291. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  45292. "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"]
  45293. }
  45294. },
  45295. "point": {
  45296. "file": {
  45297. "css": "point-file",
  45298. "type": "uri",
  45299. "required": false,
  45300. "default-value": "none",
  45301. "doc": "Image file to represent a point"
  45302. },
  45303. "allow-overlap": {
  45304. "css": "point-allow-overlap",
  45305. "type": "boolean",
  45306. "default-value": false,
  45307. "doc": "Control whether overlapping points are shown or hidden.",
  45308. "default-meaning": "Do not allow points to overlap with each other - overlapping markers will not be shown."
  45309. },
  45310. "ignore-placement": {
  45311. "css": "point-ignore-placement",
  45312. "type": "boolean",
  45313. "default-value": false,
  45314. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  45315. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  45316. },
  45317. "opacity": {
  45318. "css": "point-opacity",
  45319. "type": "float",
  45320. "default-value": 1.0,
  45321. "default-meaning": "Fully opaque",
  45322. "doc": "A value from 0 to 1 to control the opacity of the point"
  45323. },
  45324. "placement": {
  45325. "css": "point-placement",
  45326. "type": ["centroid", "interior"],
  45327. "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.",
  45328. "default-value": "centroid"
  45329. },
  45330. "transform": {
  45331. "css": "point-transform",
  45332. "type": "functions",
  45333. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  45334. "default-value": "",
  45335. "default-meaning": "No transformation",
  45336. "doc": "SVG transformation definition"
  45337. },
  45338. "comp-op": {
  45339. "css": "point-comp-op",
  45340. "default-value": "src-over",
  45341. "default-meaning": "add the current symbolizer on top of other symbolizer",
  45342. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  45343. "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"]
  45344. }
  45345. },
  45346. "text": {
  45347. "name": {
  45348. "css": "text-name",
  45349. "type": "expression",
  45350. "required": true,
  45351. "default-value": "",
  45352. "serialization": "content",
  45353. "doc": "Value to use for a text label. Data columns are specified using brackets like [column_name]"
  45354. },
  45355. "face-name": {
  45356. "css": "text-face-name",
  45357. "type": "string",
  45358. "validate": "font",
  45359. "doc": "Font name and style to render a label in",
  45360. "required": true
  45361. },
  45362. "size": {
  45363. "css": "text-size",
  45364. "type": "float",
  45365. "default-value": 10,
  45366. "doc": "Text size in pixels"
  45367. },
  45368. "text-ratio": {
  45369. "css": "text-ratio",
  45370. "doc": "Define the amount of text (of the total) present on successive lines when wrapping occurs",
  45371. "default-value": 0,
  45372. "type": "unsigned"
  45373. },
  45374. "wrap-width": {
  45375. "css": "text-wrap-width",
  45376. "doc": "Length of a chunk of text in characters before wrapping text",
  45377. "default-value": 0,
  45378. "type": "unsigned"
  45379. },
  45380. "wrap-before": {
  45381. "css": "text-wrap-before",
  45382. "type": "boolean",
  45383. "default-value": false,
  45384. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  45385. },
  45386. "wrap-character": {
  45387. "css": "text-wrap-character",
  45388. "type": "string",
  45389. "default-value": " ",
  45390. "doc": "Use this character instead of a space to wrap long text."
  45391. },
  45392. "spacing": {
  45393. "css": "text-spacing",
  45394. "type": "unsigned",
  45395. "doc": "Distance between repeated text labels on a line (aka. label-spacing)"
  45396. },
  45397. "character-spacing": {
  45398. "css": "text-character-spacing",
  45399. "type": "float",
  45400. "default-value": 0,
  45401. "doc": "Horizontal spacing adjustment between characters in pixels"
  45402. },
  45403. "line-spacing": {
  45404. "css": "text-line-spacing",
  45405. "default-value": 0,
  45406. "type": "unsigned",
  45407. "doc": "Vertical spacing adjustment between lines in pixels"
  45408. },
  45409. "label-position-tolerance": {
  45410. "css": "text-label-position-tolerance",
  45411. "default-value": 0,
  45412. "type": "unsigned",
  45413. "doc": "Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"
  45414. },
  45415. "max-char-angle-delta": {
  45416. "css": "text-max-char-angle-delta",
  45417. "type": "float",
  45418. "default-value": "22.5",
  45419. "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."
  45420. },
  45421. "fill": {
  45422. "css": "text-fill",
  45423. "doc": "Specifies the color for the text",
  45424. "default-value": "#000000",
  45425. "type": "color"
  45426. },
  45427. "opacity": {
  45428. "css": "text-opacity",
  45429. "doc": "A number from 0 to 1 specifying the opacity for the text",
  45430. "default-value": 1.0,
  45431. "default-meaning": "Fully opaque",
  45432. "type": "float"
  45433. },
  45434. "halo-fill": {
  45435. "css": "text-halo-fill",
  45436. "type": "color",
  45437. "default-value": "#FFFFFF",
  45438. "default-meaning": "white",
  45439. "doc": "Specifies the color of the halo around the text."
  45440. },
  45441. "halo-radius": {
  45442. "css": "text-halo-radius",
  45443. "doc": "Specify the radius of the halo in pixels",
  45444. "default-value": 0,
  45445. "default-meaning": "no halo",
  45446. "type": "float"
  45447. },
  45448. "dx": {
  45449. "css": "text-dx",
  45450. "type": "float",
  45451. "doc": "Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  45452. "default-value": 0
  45453. },
  45454. "dy": {
  45455. "css": "text-dy",
  45456. "type": "float",
  45457. "doc": "Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  45458. "default-value": 0
  45459. },
  45460. "vertical-alignment": {
  45461. "css": "text-vertical-alignment",
  45462. "type": ["top", "middle", "bottom", "auto"],
  45463. "doc": "Position of label relative to point position.",
  45464. "default-value": "auto",
  45465. "default-meaning": "Default affected by value of dy; \"bottom\" for dy>0, \"top\" for dy<0."
  45466. },
  45467. "avoid-edges": {
  45468. "css": "text-avoid-edges",
  45469. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  45470. "default-value": false,
  45471. "type": "boolean"
  45472. },
  45473. "minimum-distance": {
  45474. "css": "text-min-distance",
  45475. "doc": "Minimum permitted distance to the next text symbolizer.",
  45476. "type": "float"
  45477. },
  45478. "minimum-padding": {
  45479. "css": "text-min-padding",
  45480. "doc": "Determines the minimum amount of padding that a text symbolizer gets relative to other text",
  45481. "type": "float"
  45482. },
  45483. "minimum-path-length": {
  45484. "css": "text-min-path-length",
  45485. "type": "float",
  45486. "default-value": 0,
  45487. "default-meaning": "place labels on all paths",
  45488. "doc": "Place labels only on paths longer than this value."
  45489. },
  45490. "allow-overlap": {
  45491. "css": "text-allow-overlap",
  45492. "type": "boolean",
  45493. "default-value": false,
  45494. "doc": "Control whether overlapping text is shown or hidden.",
  45495. "default-meaning": "Do not allow text to overlap with other text - overlapping markers will not be shown."
  45496. },
  45497. "orientation": {
  45498. "css": "text-orientation",
  45499. "type": "expression",
  45500. "doc": "Rotate the text."
  45501. },
  45502. "placement": {
  45503. "css": "text-placement",
  45504. "type": ["point", "line", "vertex", "interior"],
  45505. "default-value": "point",
  45506. "doc": "Control the style of placement of a point versus the geometry it is attached to."
  45507. },
  45508. "placement-type": {
  45509. "css": "text-placement-type",
  45510. "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.",
  45511. "type": ["dummy", "simple"],
  45512. "default-value": "dummy"
  45513. },
  45514. "placements": {
  45515. "css": "text-placements",
  45516. "type": "string",
  45517. "default-value": "",
  45518. "doc": "If \"placement-type\" is set to \"simple\", use this \"POSITIONS,[SIZES]\" string. An example is `text-placements: \"E,NE,SE,W,NW,SW\";` "
  45519. },
  45520. "text-transform": {
  45521. "css": "text-transform",
  45522. "type": ["none", "uppercase", "lowercase", "capitalize"],
  45523. "doc": "Transform the case of the characters",
  45524. "default-value": "none"
  45525. },
  45526. "horizontal-alignment": {
  45527. "css": "text-horizontal-alignment",
  45528. "type": ["left", "middle", "right", "auto"],
  45529. "doc": "The text's horizontal alignment from its centerpoint",
  45530. "default-value": "auto"
  45531. },
  45532. "justify-alignment": {
  45533. "css": "text-align",
  45534. "type": ["left", "right", "center", "auto"],
  45535. "doc": "Define how text is justified",
  45536. "default-value": "auto",
  45537. "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"
  45538. },
  45539. "clip": {
  45540. "css": "text-clip",
  45541. "type": "boolean",
  45542. "default-value": true,
  45543. "default-meaning": "geometry will be clipped to map bounds before rendering",
  45544. "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."
  45545. },
  45546. "comp-op": {
  45547. "css": "text-comp-op",
  45548. "default-value": "src-over",
  45549. "default-meaning": "add the current symbolizer on top of other symbolizer",
  45550. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  45551. "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"]
  45552. }
  45553. },
  45554. "building": {
  45555. "fill": {
  45556. "css": "building-fill",
  45557. "default-value": "#FFFFFF",
  45558. "doc": "The color of the buildings walls.",
  45559. "type": "color"
  45560. },
  45561. "fill-opacity": {
  45562. "css": "building-fill-opacity",
  45563. "type": "float",
  45564. "doc": "The opacity of the building as a whole, including all walls.",
  45565. "default-value": 1
  45566. },
  45567. "height": {
  45568. "css": "building-height",
  45569. "doc": "The height of the building in pixels.",
  45570. "type": "expression",
  45571. "default-value": "0"
  45572. }
  45573. }
  45574. },
  45575. "colors": {
  45576. "aliceblue": [240, 248, 255],
  45577. "antiquewhite": [250, 235, 215],
  45578. "aqua": [0, 255, 255],
  45579. "aquamarine": [127, 255, 212],
  45580. "azure": [240, 255, 255],
  45581. "beige": [245, 245, 220],
  45582. "bisque": [255, 228, 196],
  45583. "black": [0, 0, 0],
  45584. "blanchedalmond": [255, 235, 205],
  45585. "blue": [0, 0, 255],
  45586. "blueviolet": [138, 43, 226],
  45587. "brown": [165, 42, 42],
  45588. "burlywood": [222, 184, 135],
  45589. "cadetblue": [95, 158, 160],
  45590. "chartreuse": [127, 255, 0],
  45591. "chocolate": [210, 105, 30],
  45592. "coral": [255, 127, 80],
  45593. "cornflowerblue": [100, 149, 237],
  45594. "cornsilk": [255, 248, 220],
  45595. "crimson": [220, 20, 60],
  45596. "cyan": [0, 255, 255],
  45597. "darkblue": [0, 0, 139],
  45598. "darkcyan": [0, 139, 139],
  45599. "darkgoldenrod": [184, 134, 11],
  45600. "darkgray": [169, 169, 169],
  45601. "darkgreen": [0, 100, 0],
  45602. "darkgrey": [169, 169, 169],
  45603. "darkkhaki": [189, 183, 107],
  45604. "darkmagenta": [139, 0, 139],
  45605. "darkolivegreen": [85, 107, 47],
  45606. "darkorange": [255, 140, 0],
  45607. "darkorchid": [153, 50, 204],
  45608. "darkred": [139, 0, 0],
  45609. "darksalmon": [233, 150, 122],
  45610. "darkseagreen": [143, 188, 143],
  45611. "darkslateblue": [72, 61, 139],
  45612. "darkslategrey": [47, 79, 79],
  45613. "darkturquoise": [0, 206, 209],
  45614. "darkviolet": [148, 0, 211],
  45615. "deeppink": [255, 20, 147],
  45616. "deepskyblue": [0, 191, 255],
  45617. "dimgray": [105, 105, 105],
  45618. "dimgrey": [105, 105, 105],
  45619. "dodgerblue": [30, 144, 255],
  45620. "firebrick": [178, 34, 34],
  45621. "floralwhite": [255, 250, 240],
  45622. "forestgreen": [34, 139, 34],
  45623. "fuchsia": [255, 0, 255],
  45624. "gainsboro": [220, 220, 220],
  45625. "ghostwhite": [248, 248, 255],
  45626. "gold": [255, 215, 0],
  45627. "goldenrod": [218, 165, 32],
  45628. "gray": [128, 128, 128],
  45629. "grey": [128, 128, 128],
  45630. "green": [0, 128, 0],
  45631. "greenyellow": [173, 255, 47],
  45632. "honeydew": [240, 255, 240],
  45633. "hotpink": [255, 105, 180],
  45634. "indianred": [205, 92, 92],
  45635. "indigo": [75, 0, 130],
  45636. "ivory": [255, 255, 240],
  45637. "khaki": [240, 230, 140],
  45638. "lavender": [230, 230, 250],
  45639. "lavenderblush": [255, 240, 245],
  45640. "lawngreen": [124, 252, 0],
  45641. "lemonchiffon": [255, 250, 205],
  45642. "lightblue": [173, 216, 230],
  45643. "lightcoral": [240, 128, 128],
  45644. "lightcyan": [224, 255, 255],
  45645. "lightgoldenrodyellow": [250, 250, 210],
  45646. "lightgray": [211, 211, 211],
  45647. "lightgreen": [144, 238, 144],
  45648. "lightgrey": [211, 211, 211],
  45649. "lightpink": [255, 182, 193],
  45650. "lightsalmon": [255, 160, 122],
  45651. "lightseagreen": [32, 178, 170],
  45652. "lightskyblue": [135, 206, 250],
  45653. "lightslategray": [119, 136, 153],
  45654. "lightslategrey": [119, 136, 153],
  45655. "lightsteelblue": [176, 196, 222],
  45656. "lightyellow": [255, 255, 224],
  45657. "lime": [0, 255, 0],
  45658. "limegreen": [50, 205, 50],
  45659. "linen": [250, 240, 230],
  45660. "magenta": [255, 0, 255],
  45661. "maroon": [128, 0, 0],
  45662. "mediumaquamarine": [102, 205, 170],
  45663. "mediumblue": [0, 0, 205],
  45664. "mediumorchid": [186, 85, 211],
  45665. "mediumpurple": [147, 112, 219],
  45666. "mediumseagreen": [60, 179, 113],
  45667. "mediumslateblue": [123, 104, 238],
  45668. "mediumspringgreen": [0, 250, 154],
  45669. "mediumturquoise": [72, 209, 204],
  45670. "mediumvioletred": [199, 21, 133],
  45671. "midnightblue": [25, 25, 112],
  45672. "mintcream": [245, 255, 250],
  45673. "mistyrose": [255, 228, 225],
  45674. "moccasin": [255, 228, 181],
  45675. "navajowhite": [255, 222, 173],
  45676. "navy": [0, 0, 128],
  45677. "oldlace": [253, 245, 230],
  45678. "olive": [128, 128, 0],
  45679. "olivedrab": [107, 142, 35],
  45680. "orange": [255, 165, 0],
  45681. "orangered": [255, 69, 0],
  45682. "orchid": [218, 112, 214],
  45683. "palegoldenrod": [238, 232, 170],
  45684. "palegreen": [152, 251, 152],
  45685. "paleturquoise": [175, 238, 238],
  45686. "palevioletred": [219, 112, 147],
  45687. "papayawhip": [255, 239, 213],
  45688. "peachpuff": [255, 218, 185],
  45689. "peru": [205, 133, 63],
  45690. "pink": [255, 192, 203],
  45691. "plum": [221, 160, 221],
  45692. "powderblue": [176, 224, 230],
  45693. "purple": [128, 0, 128],
  45694. "red": [255, 0, 0],
  45695. "rosybrown": [188, 143, 143],
  45696. "royalblue": [65, 105, 225],
  45697. "saddlebrown": [139, 69, 19],
  45698. "salmon": [250, 128, 114],
  45699. "sandybrown": [244, 164, 96],
  45700. "seagreen": [46, 139, 87],
  45701. "seashell": [255, 245, 238],
  45702. "sienna": [160, 82, 45],
  45703. "silver": [192, 192, 192],
  45704. "skyblue": [135, 206, 235],
  45705. "slateblue": [106, 90, 205],
  45706. "slategray": [112, 128, 144],
  45707. "slategrey": [112, 128, 144],
  45708. "snow": [255, 250, 250],
  45709. "springgreen": [0, 255, 127],
  45710. "steelblue": [70, 130, 180],
  45711. "tan": [210, 180, 140],
  45712. "teal": [0, 128, 128],
  45713. "thistle": [216, 191, 216],
  45714. "tomato": [255, 99, 71],
  45715. "turquoise": [64, 224, 208],
  45716. "violet": [238, 130, 238],
  45717. "wheat": [245, 222, 179],
  45718. "white": [255, 255, 255],
  45719. "whitesmoke": [245, 245, 245],
  45720. "yellow": [255, 255, 0],
  45721. "yellowgreen": [154, 205, 50],
  45722. "transparent": [0, 0, 0, 0]
  45723. },
  45724. "filter": {
  45725. "value": ["true", "false", "null", "point", "linestring", "polygon", "collection"]
  45726. }
  45727. };
  45728. CartoCSS['mapnik_reference'] = {
  45729. version: {
  45730. latest: SuperMap._mapnik_reference_latest,
  45731. '2.1.1': SuperMap._mapnik_reference_latest
  45732. }
  45733. };
  45734. SuperMap.CartoCSS = CartoCSS;
  45735. SuperMap.CartoCSS.Tree = {};
  45736. SuperMap.CartoCSS.Tree.operate = function (op, a, b) {
  45737. switch (op) {
  45738. case '+':
  45739. return a + b;
  45740. case '-':
  45741. return a - b;
  45742. case '*':
  45743. return a * b;
  45744. case '%':
  45745. return a % b;
  45746. case '/':
  45747. return a / b;
  45748. }
  45749. };
  45750. SuperMap.CartoCSS.Tree.functions = {
  45751. rgb: function rgb(r, g, b) {
  45752. return this.rgba(r, g, b, 1.0);
  45753. },
  45754. rgba: function rgba(r, g, b, a) {
  45755. var me = this;
  45756. var rgb = [r, g, b].map(function (c) {
  45757. return me.number(c);
  45758. });
  45759. a = me.number(a);
  45760. if (rgb.some(isNaN) || isNaN(a)) {
  45761. return null;
  45762. }
  45763. return new SuperMap.CartoCSS.Tree.Color(rgb, a);
  45764. },
  45765. // Only require val
  45766. stop: function stop(val) {
  45767. var color, mode;
  45768. if (arguments.length > 1) {
  45769. color = arguments[1];
  45770. }
  45771. if (arguments.length > 2) {
  45772. mode = arguments[2];
  45773. }
  45774. return {
  45775. is: 'tag',
  45776. val: val,
  45777. color: color,
  45778. mode: mode,
  45779. toString: function toString(env) {
  45780. return '\n\t<stop value="' + val.ev(env) + '"' + (color ? ' color="' + color.ev(env) + '" ' : '') + (mode ? ' mode="' + mode.ev(env) + '" ' : '') + '/>';
  45781. }
  45782. };
  45783. },
  45784. hsl: function hsl(h, s, l) {
  45785. return this.hsla(h, s, l, 1.0);
  45786. },
  45787. hsla: function hsla(h, s, l, a) {
  45788. h = this.number(h) % 360 / 360;
  45789. s = this.number(s);
  45790. l = this.number(l);
  45791. a = this.number(a);
  45792. if ([h, s, l, a].some(isNaN)) {
  45793. return null;
  45794. }
  45795. var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s,
  45796. m1 = l * 2 - m2;
  45797. return this.rgba(hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255, a);
  45798. function hue(h) {
  45799. h = h < 0 ? h + 1 : h > 1 ? h - 1 : h;
  45800. if (h * 6 < 1) {
  45801. return m1 + (m2 - m1) * h * 6;
  45802. } else if (h * 2 < 1) {
  45803. return m2;
  45804. } else if (h * 3 < 2) {
  45805. return m1 + (m2 - m1) * (2 / 3 - h) * 6;
  45806. } else {
  45807. return m1;
  45808. }
  45809. }
  45810. },
  45811. hue: function hue(color) {
  45812. if (!('toHSL' in color)) {
  45813. return null;
  45814. }
  45815. return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().h));
  45816. },
  45817. saturation: function saturation(color) {
  45818. if (!('toHSL' in color)) {
  45819. return null;
  45820. }
  45821. return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().s * 100), '%');
  45822. },
  45823. lightness: function lightness(color) {
  45824. if (!('toHSL' in color)) {
  45825. return null;
  45826. }
  45827. return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().l * 100), '%');
  45828. },
  45829. alpha: function alpha(color) {
  45830. if (!('toHSL' in color)) {
  45831. return null;
  45832. }
  45833. return new SuperMap.CartoCSS.Tree.Dimension(color.toHSL().a);
  45834. },
  45835. saturate: function saturate(color, amount) {
  45836. if (!('toHSL' in color)) {
  45837. return null;
  45838. }
  45839. var hsl = color.toHSL();
  45840. hsl.s += amount.value / 100;
  45841. hsl.s = this.clamp(hsl.s);
  45842. return this.hsla_simple(hsl);
  45843. },
  45844. desaturate: function desaturate(color, amount) {
  45845. if (!('toHSL' in color)) {
  45846. return null;
  45847. }
  45848. var hsl = color.toHSL();
  45849. hsl.s -= amount.value / 100;
  45850. hsl.s = this.clamp(hsl.s);
  45851. return this.hsla_simple(hsl);
  45852. },
  45853. lighten: function lighten(color, amount) {
  45854. if (!('toHSL' in color)) {
  45855. return null;
  45856. }
  45857. var hsl = color.toHSL();
  45858. hsl.l += amount.value / 100;
  45859. hsl.l = this.clamp(hsl.l);
  45860. return this.hsla_simple(hsl);
  45861. },
  45862. darken: function darken(color, amount) {
  45863. if (!('toHSL' in color)) {
  45864. return null;
  45865. }
  45866. var hsl = color.toHSL();
  45867. hsl.l -= amount.value / 100;
  45868. hsl.l = this.clamp(hsl.l);
  45869. return this.hsla_simple(hsl);
  45870. },
  45871. fadein: function fadein(color, amount) {
  45872. if (!('toHSL' in color)) {
  45873. return null;
  45874. }
  45875. var hsl = color.toHSL();
  45876. hsl.a += amount.value / 100;
  45877. hsl.a = this.clamp(hsl.a);
  45878. return this.hsla_simple(hsl);
  45879. },
  45880. fadeout: function fadeout(color, amount) {
  45881. if (!('toHSL' in color)) {
  45882. return null;
  45883. }
  45884. var hsl = color.toHSL();
  45885. hsl.a -= amount.value / 100;
  45886. hsl.a = this.clamp(hsl.a);
  45887. return this.hsla_simple(hsl);
  45888. },
  45889. spin: function spin(color, amount) {
  45890. if (!('toHSL' in color)) {
  45891. return null;
  45892. }
  45893. var hsl = color.toHSL();
  45894. var hue = (hsl.h + amount.value) % 360;
  45895. hsl.h = hue < 0 ? 360 + hue : hue;
  45896. return this.hsla_simple(hsl);
  45897. },
  45898. replace: function replace(entity, a, b) {
  45899. if (entity.is === 'field') {
  45900. return entity.toString + '.replace(' + a.toString() + ', ' + b.toString() + ')';
  45901. } else {
  45902. return entity.replace(a, b);
  45903. }
  45904. },
  45905. //
  45906. // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
  45907. // http://sass-lang.com
  45908. //
  45909. mix: function mix(color1, color2, weight) {
  45910. var p = weight.value / 100.0;
  45911. var w = p * 2 - 1;
  45912. var a = color1.toHSL().a - color2.toHSL().a;
  45913. var w1 = ((w * a == -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
  45914. var w2 = 1 - w1;
  45915. 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];
  45916. var alpha = color1.alpha * p + color2.alpha * (1 - p);
  45917. return new SuperMap.CartoCSS.Tree.Color(rgb, alpha);
  45918. },
  45919. greyscale: function greyscale(color) {
  45920. return this.desaturate(color, new SuperMap.CartoCSS.Tree.Dimension(100));
  45921. },
  45922. '%': function _(quoted
  45923. /* arg, arg, ...*/
  45924. ) {
  45925. var args = Array.prototype.slice.call(arguments, 1),
  45926. str = quoted.value;
  45927. for (var i = 0; i < args.length; i++) {
  45928. str = str.replace(/%s/, args[i].value).replace(/%[da]/, args[i].toString());
  45929. }
  45930. str = str.replace(/%%/g, '%');
  45931. return new SuperMap.CartoCSS.Tree.Quoted(str);
  45932. },
  45933. hsla_simple: function hsla_simple(h) {
  45934. return this.hsla(h.h, h.s, h.l, h.a);
  45935. },
  45936. number: function number(n) {
  45937. if (n instanceof SuperMap.CartoCSS.Tree.Dimension) {
  45938. return parseFloat(n.unit === '%' ? n.value / 100 : n.value);
  45939. } else if (typeof n === 'number') {
  45940. return n;
  45941. } else {
  45942. return NaN;
  45943. }
  45944. },
  45945. clamp: function clamp(val) {
  45946. return Math.min(1, Math.max(0, val));
  45947. }
  45948. };
  45949. SuperMap.CartoCSS.Tree.Call = /*#__PURE__*/function () {
  45950. function Call(name, args, index) {
  45951. CartoCSS_classCallCheck(this, Call);
  45952. this.is = 'call';
  45953. this.name = name;
  45954. this.args = args;
  45955. this.index = index;
  45956. } // When evuating a function call,
  45957. // we either find the function in `tree.functions` [1],
  45958. // in which case we call it, passing the evaluated arguments,
  45959. // or we simply print it out as it appeared originally [2].
  45960. // The *functions.js* file contains the built-in functions.
  45961. // The reason why we evaluate the arguments, is in the case where
  45962. // we try to pass a variable to a function, like: `saturate(@color)`.
  45963. // The function should receive the value, not the variable.
  45964. CartoCSS_createClass(Call, [{
  45965. key: 'ev',
  45966. value: function ev(env) {
  45967. var args = this.args.map(function (a) {
  45968. return a.ev(env);
  45969. });
  45970. for (var i = 0; i < args.length; i++) {
  45971. if (args[i].is === 'undefined') {
  45972. return {
  45973. is: 'undefined',
  45974. value: 'undefined'
  45975. };
  45976. }
  45977. }
  45978. if (this.name in SuperMap.CartoCSS.Tree.functions) {
  45979. if (SuperMap.CartoCSS.Tree.functions[this.name].length <= args.length) {
  45980. var val = SuperMap.CartoCSS.Tree.functions[this.name].apply(SuperMap.CartoCSS.Tree.functions, args);
  45981. if (val === null) {
  45982. env.error({
  45983. message: 'incorrect arguments given to ' + this.name + '()',
  45984. index: this.index,
  45985. type: 'runtime',
  45986. filename: this.filename
  45987. });
  45988. return {
  45989. is: 'undefined',
  45990. value: 'undefined'
  45991. };
  45992. }
  45993. return val;
  45994. } else {
  45995. env.error({
  45996. message: 'incorrect number of arguments for ' + this.name + '(). ' + SuperMap.CartoCSS.Tree.functions[this.name].length + ' expected.',
  45997. index: this.index,
  45998. type: 'runtime',
  45999. filename: this.filename
  46000. });
  46001. return {
  46002. is: 'undefined',
  46003. value: 'undefined'
  46004. };
  46005. }
  46006. } else {
  46007. var fn = SuperMap.CartoCSS.Tree.Reference.mapnikFunctions[this.name];
  46008. if (fn === undefined) {
  46009. var functions = lodash_topairs_default()(SuperMap.CartoCSS.Tree.Reference.mapnikFunctions); // cheap closest, needs improvement.
  46010. var name = this.name;
  46011. var mean = functions.map(function (f) {
  46012. return [f[0], SuperMap.CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];
  46013. }).sort(function (a, b) {
  46014. return a[1] - b[1];
  46015. });
  46016. env.error({
  46017. message: 'unknown function ' + this.name + '(), did you mean ' + mean[0][0] + '(' + mean[0][2] + ')',
  46018. index: this.index,
  46019. type: 'runtime',
  46020. filename: this.filename
  46021. });
  46022. return {
  46023. is: 'undefined',
  46024. value: 'undefined'
  46025. };
  46026. }
  46027. if (fn !== args.length && // support variable-arg functions like `colorize-alpha`
  46028. fn !== -1) {
  46029. env.error({
  46030. message: 'function ' + this.name + '() takes ' + fn + ' arguments and was given ' + args.length,
  46031. index: this.index,
  46032. type: 'runtime',
  46033. filename: this.filename
  46034. });
  46035. return {
  46036. is: 'undefined',
  46037. value: 'undefined'
  46038. };
  46039. } else {
  46040. // Save the evaluated versions of arguments
  46041. this.args = args;
  46042. return this;
  46043. }
  46044. }
  46045. }
  46046. }, {
  46047. key: "toString",
  46048. value: function toString(env, format) {
  46049. if (this.args.length) {
  46050. return this.name + '(' + this.args.join(',') + ')';
  46051. } else {
  46052. return this.name;
  46053. }
  46054. }
  46055. }]);
  46056. return Call;
  46057. }();
  46058. SuperMap.CartoCSS.Tree.Color = /*#__PURE__*/function () {
  46059. function Color(rgb, a) {
  46060. CartoCSS_classCallCheck(this, Color);
  46061. this.is = 'color'; // The end goal here, is to parse the arguments
  46062. // into an integer triplet, such as `128, 255, 0`
  46063. //
  46064. // This facilitates operations and conversions.
  46065. if (Array.isArray(rgb)) {
  46066. this.rgb = rgb.slice(0, 3);
  46067. } else if (rgb.length == 6) {
  46068. this.rgb = rgb.match(/.{2}/g).map(function (c) {
  46069. return parseInt(c, 16);
  46070. });
  46071. } else {
  46072. this.rgb = rgb.split('').map(function (c) {
  46073. return parseInt(c + c, 16);
  46074. });
  46075. }
  46076. if (typeof a === 'number') {
  46077. this.alpha = a;
  46078. } else if (rgb.length === 4) {
  46079. this.alpha = rgb[3];
  46080. } else {
  46081. this.alpha = 1;
  46082. }
  46083. }
  46084. CartoCSS_createClass(Color, [{
  46085. key: 'ev',
  46086. value: function ev() {
  46087. return this;
  46088. } // If we have some transparency, the only way to represent it
  46089. // is via `rgba`. Otherwise, we use the hex representation,
  46090. // which has better compatibility with older browsers.
  46091. // Values are capped between `0` and `255`, rounded and zero-padded.
  46092. }, {
  46093. key: "toString",
  46094. value: function toString() {
  46095. /* if (this.alpha < 1.0) {*/
  46096. return 'rgba(' + this.rgb.map(function (c) {
  46097. return Math.round(c);
  46098. }).concat(this.alpha).join(', ') + ')';
  46099. /*} else {
  46100. return '#' + this.rgb.map(function(i) {
  46101. i = Math.round(i);
  46102. i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
  46103. return i.length === 1 ? '0' + i : i;
  46104. }).join('');
  46105. }*/
  46106. } // Operations have to be done per-channel, if not,
  46107. // channels will spill onto each other. Once we have
  46108. // our result, in the form of an integer triplet,
  46109. // we create a new Color node to hold the result.
  46110. }, {
  46111. key: "operate",
  46112. value: function operate(env, op, other) {
  46113. var result = [];
  46114. if (!(other instanceof SuperMap.CartoCSS.Tree.Color)) {
  46115. other = other.toColor();
  46116. }
  46117. for (var c = 0; c < 3; c++) {
  46118. result[c] = SuperMap.CartoCSS.Tree.operate(op, this.rgb[c], other.rgb[c]);
  46119. }
  46120. return new SuperMap.CartoCSS.Tree.Color(result);
  46121. }
  46122. }, {
  46123. key: "toHSL",
  46124. value: function toHSL() {
  46125. var r = this.rgb[0] / 255,
  46126. g = this.rgb[1] / 255,
  46127. b = this.rgb[2] / 255,
  46128. a = this.alpha;
  46129. var max = Math.max(r, g, b),
  46130. min = Math.min(r, g, b);
  46131. var h,
  46132. s,
  46133. l = (max + min) / 2,
  46134. d = max - min;
  46135. if (max === min) {
  46136. h = s = 0;
  46137. } else {
  46138. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  46139. switch (max) {
  46140. case r:
  46141. h = (g - b) / d + (g < b ? 6 : 0);
  46142. break;
  46143. case g:
  46144. h = (b - r) / d + 2;
  46145. break;
  46146. case b:
  46147. h = (r - g) / d + 4;
  46148. break;
  46149. default:
  46150. break;
  46151. }
  46152. h /= 6;
  46153. }
  46154. return {
  46155. h: h * 360,
  46156. s: s,
  46157. l: l,
  46158. a: a
  46159. };
  46160. }
  46161. }]);
  46162. return Color;
  46163. }();
  46164. SuperMap.CartoCSS.Tree.Comment = /*#__PURE__*/function () {
  46165. function Comment(value, silent) {
  46166. CartoCSS_classCallCheck(this, Comment);
  46167. this.value = value;
  46168. this.silent = !!silent;
  46169. }
  46170. CartoCSS_createClass(Comment, [{
  46171. key: "toString",
  46172. value: function toString(env) {
  46173. return '<!--' + this.value + '-->';
  46174. }
  46175. }, {
  46176. key: 'ev',
  46177. value: function ev() {
  46178. return this;
  46179. }
  46180. }]);
  46181. return Comment;
  46182. }();
  46183. SuperMap.CartoCSS.Tree.Definition = /*#__PURE__*/function () {
  46184. function Definition(selector, rules) {
  46185. CartoCSS_classCallCheck(this, Definition);
  46186. this.elements = selector.elements; //assert.ok(selector.filters instanceof SuperMap.CartoCSS.Tree.Filterset);
  46187. this.rules = rules;
  46188. this.ruleIndex = {};
  46189. for (var i = 0; i < this.rules.length; i++) {
  46190. if ('zoom' in this.rules[i]) {
  46191. this.rules[i] = this.rules[i].clone();
  46192. }
  46193. this.rules[i].zoom = selector.zoom;
  46194. this.ruleIndex[this.rules[i].updateID()] = true;
  46195. }
  46196. this.filters = selector.filters;
  46197. this.zoom = selector.zoom;
  46198. this.attachment = selector.attachment || '__default__';
  46199. this.specificity = selector.specificity();
  46200. }
  46201. CartoCSS_createClass(Definition, [{
  46202. key: "toString",
  46203. value: function toString() {
  46204. var str = this.filters.toString();
  46205. for (var i = 0; i < this.rules.length; i++) {
  46206. str += '\n ' + this.rules[i];
  46207. }
  46208. return str;
  46209. }
  46210. }, {
  46211. key: "toJS",
  46212. value: function toJS(env) {
  46213. var shaderAttrs = {}; // merge conditions from filters with zoom condition of the
  46214. // definition
  46215. var zoom = this.zoom; //var frame_offset = this.frame_offset;
  46216. var _if = this.filters.toJS(env);
  46217. var filters = [zoom];
  46218. if (_if) {
  46219. filters.push(_if);
  46220. } //if(frame_offset) filters.push('ctx["frame-offset"] === ' + frame_offset);
  46221. _if = filters.join(" && ");
  46222. function eachRule(rule) {
  46223. if (rule instanceof SuperMap.CartoCSS.Tree.Rule) {
  46224. shaderAttrs[rule.name] = shaderAttrs[rule.name] || [];
  46225. if (_if) {
  46226. shaderAttrs[rule.name].push("if(" + _if + "){" + rule.value.toJS(env) + "}");
  46227. } else {
  46228. shaderAttrs[rule.name].push(rule.value.toJS(env));
  46229. }
  46230. } else {
  46231. if (rule instanceof SuperMap.CartoCSS.Tree.Ruleset) {
  46232. var sh = rule.toJS(env);
  46233. for (var v in sh) {
  46234. shaderAttrs[v] = shaderAttrs[v] || [];
  46235. for (var attr in sh[v]) {
  46236. shaderAttrs[v].push(sh[v][attr]);
  46237. }
  46238. }
  46239. }
  46240. }
  46241. }
  46242. for (var id in this.rules) {
  46243. eachRule(this.rules[id]);
  46244. }
  46245. return shaderAttrs;
  46246. }
  46247. }]);
  46248. return Definition;
  46249. }();
  46250. SuperMap.CartoCSS.Tree.Dimension = /*#__PURE__*/function () {
  46251. function Dimension(value, unit, index) {
  46252. CartoCSS_classCallCheck(this, Dimension);
  46253. this.is = 'float';
  46254. this.physical_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc'];
  46255. this.screen_units = ['px', '%'];
  46256. this.all_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc', 'px', '%'];
  46257. this.densities = {
  46258. m: 0.0254,
  46259. mm: 25.4,
  46260. cm: 2.54,
  46261. pt: 72,
  46262. pc: 6
  46263. };
  46264. this.value = parseFloat(value);
  46265. this.unit = unit || null;
  46266. this.index = index;
  46267. }
  46268. CartoCSS_createClass(Dimension, [{
  46269. key: "ev",
  46270. value: function ev(env) {
  46271. if (this.unit && this.all_units.indexOf(this.unit) < 0) {
  46272. env.error({
  46273. message: "Invalid unit: '" + this.unit + "'",
  46274. index: this.index
  46275. });
  46276. return {
  46277. is: 'undefined',
  46278. value: 'undefined'
  46279. };
  46280. } // normalize units which are not px or %
  46281. if (this.unit && this.physical_units.indexOf(this.unit) >= 0) {
  46282. if (!env.ppi) {
  46283. env.error({
  46284. message: "ppi is not set, so metric units can't be used",
  46285. index: this.index
  46286. });
  46287. return {
  46288. is: 'undefined',
  46289. value: 'undefined'
  46290. };
  46291. } // convert all units to inch
  46292. // convert inch to px using ppi
  46293. this.value = this.value / this.densities[this.unit] * env.ppi;
  46294. this.unit = 'px';
  46295. }
  46296. return this;
  46297. }
  46298. }, {
  46299. key: "toColor",
  46300. value: function toColor() {
  46301. return new SuperMap.CartoCSS.Tree.Color([this.value, this.value, this.value]);
  46302. }
  46303. }, {
  46304. key: "round",
  46305. value: function round() {
  46306. this.value = Math.round(this.value);
  46307. return this;
  46308. }
  46309. }, {
  46310. key: "toString",
  46311. value: function toString() {
  46312. return this.value.toString();
  46313. }
  46314. }, {
  46315. key: "operate",
  46316. value: function operate(env, op, other) {
  46317. if (this.unit === '%' && other.unit !== '%') {
  46318. env.error({
  46319. message: 'If two operands differ, the first must not be %',
  46320. index: this.index
  46321. });
  46322. return {
  46323. is: 'undefined',
  46324. value: 'undefined'
  46325. };
  46326. }
  46327. if (this.unit !== '%' && other.unit === '%') {
  46328. if (op === '*' || op === '/' || op === '%') {
  46329. env.error({
  46330. message: 'Percent values can only be added or subtracted from other values',
  46331. index: this.index
  46332. });
  46333. return {
  46334. is: 'undefined',
  46335. value: 'undefined'
  46336. };
  46337. }
  46338. return new SuperMap.CartoCSS.Tree.Dimension(SuperMap.CartoCSS.Tree.operate(op, this.value, this.value * other.value * 0.01), this.unit);
  46339. } //here the operands are either the same (% or undefined or px), or one is undefined and the other is px
  46340. return new SuperMap.CartoCSS.Tree.Dimension(SuperMap.CartoCSS.Tree.operate(op, this.value, other.value), this.unit || other.unit);
  46341. }
  46342. }]);
  46343. return Dimension;
  46344. }();
  46345. SuperMap.CartoCSS.Tree.Element = /*#__PURE__*/function () {
  46346. function Element(value) {
  46347. CartoCSS_classCallCheck(this, Element);
  46348. this.value = value.trim();
  46349. if (this.value[0] === '#') {
  46350. this.type = 'id';
  46351. this.clean = this.value.replace(/^#/, '');
  46352. }
  46353. if (this.value[0] === '.') {
  46354. this.type = 'class';
  46355. this.clean = this.value.replace(/^\./, '');
  46356. }
  46357. if (this.value.indexOf('*') !== -1) {
  46358. this.type = 'wildcard';
  46359. }
  46360. }
  46361. CartoCSS_createClass(Element, [{
  46362. key: "specificity",
  46363. value: function specificity() {
  46364. return [this.type === 'id' ? 1 : 0, // a
  46365. this.type === 'class' ? 1 : 0 // b
  46366. ];
  46367. }
  46368. }, {
  46369. key: "toString",
  46370. value: function toString() {
  46371. return this.value;
  46372. }
  46373. }]);
  46374. return Element;
  46375. }();
  46376. SuperMap.CartoCSS.Tree.Expression = /*#__PURE__*/function () {
  46377. function Expression(value) {
  46378. CartoCSS_classCallCheck(this, Expression);
  46379. this.is = 'expression';
  46380. this.value = value;
  46381. }
  46382. CartoCSS_createClass(Expression, [{
  46383. key: "ev",
  46384. value: function ev(env) {
  46385. if (this.value.length > 1) {
  46386. return new SuperMap.CartoCSS.Tree.Expression(this.value.map(function (e) {
  46387. return e.ev(env);
  46388. }));
  46389. } else {
  46390. return this.value[0].ev(env);
  46391. }
  46392. }
  46393. }, {
  46394. key: "toString",
  46395. value: function toString(env) {
  46396. return this.value.map(function (e) {
  46397. return e.toString(env);
  46398. }).join(' ');
  46399. }
  46400. }]);
  46401. return Expression;
  46402. }();
  46403. SuperMap.CartoCSS.Tree.Field = /*#__PURE__*/function () {
  46404. function Field(content) {
  46405. CartoCSS_classCallCheck(this, Field);
  46406. this.is = 'field';
  46407. this.value = content || '';
  46408. }
  46409. CartoCSS_createClass(Field, [{
  46410. key: "toString",
  46411. value: function toString() {
  46412. return '["' + this.value.toUpperCase() + '"]';
  46413. }
  46414. }, {
  46415. key: 'ev',
  46416. value: function ev() {
  46417. return this;
  46418. }
  46419. }]);
  46420. return Field;
  46421. }();
  46422. SuperMap.CartoCSS.Tree.Filter = /*#__PURE__*/function () {
  46423. function Filter(key, op, val, index, filename) {
  46424. CartoCSS_classCallCheck(this, Filter);
  46425. this.ops = {
  46426. '<': [' &lt; ', 'numeric'],
  46427. '>': [' &gt; ', 'numeric'],
  46428. '=': [' = ', 'both'],
  46429. '!=': [' != ', 'both'],
  46430. '<=': [' &lt;= ', 'numeric'],
  46431. '>=': [' &gt;= ', 'numeric'],
  46432. '=~': ['.match(', 'string', ')']
  46433. };
  46434. this.key = key;
  46435. this.op = op;
  46436. this.val = val;
  46437. this.index = index;
  46438. this.filename = filename;
  46439. this.id = this.key + this.op + this.val;
  46440. }
  46441. CartoCSS_createClass(Filter, [{
  46442. key: "ev",
  46443. value: function ev(env) {
  46444. this.key = this.key.ev(env);
  46445. this.val = this.val.ev(env);
  46446. return this;
  46447. }
  46448. }, {
  46449. key: "toString",
  46450. value: function toString() {
  46451. return '[' + this.id + ']';
  46452. }
  46453. }]);
  46454. return Filter;
  46455. }();
  46456. SuperMap.CartoCSS.Tree.Filterset = /*#__PURE__*/function () {
  46457. function Filterset() {
  46458. CartoCSS_classCallCheck(this, Filterset);
  46459. this.filters = {};
  46460. }
  46461. CartoCSS_createClass(Filterset, [{
  46462. key: "toJS",
  46463. value: function toJS(env) {
  46464. function eachFilter(filter) {
  46465. var op = filter.op;
  46466. if (op === "=") {
  46467. op = "==";
  46468. }
  46469. var val = filter.val;
  46470. if (filter._val !== undefined) {
  46471. val = filter._val.toString(true);
  46472. } //对scale进行特殊处理,将值转换成数值
  46473. if (filter.key && filter.key.value === 'scale') {
  46474. val = +val;
  46475. } else if (typeof val === 'string' || CartoCSS_typeof(val) === 'object') {
  46476. val = "'" + val + "'";
  46477. }
  46478. var attrs = "attributes";
  46479. return attrs + "&&" + attrs + filter.key + "&&" + attrs + filter.key + " " + op + val;
  46480. }
  46481. var results = [];
  46482. for (var id in this.filters) {
  46483. results.push(eachFilter(this.filters[id]));
  46484. }
  46485. return results.join(' && ');
  46486. }
  46487. }, {
  46488. key: "toString",
  46489. value: function toString() {
  46490. var arr = [];
  46491. for (var id in this.filters) {
  46492. arr.push(this.filters[id].id);
  46493. }
  46494. return arr.sort().join('\t');
  46495. }
  46496. }, {
  46497. key: "ev",
  46498. value: function ev(env) {
  46499. for (var i in this.filters) {
  46500. this.filters[i].ev(env);
  46501. }
  46502. return this;
  46503. }
  46504. }, {
  46505. key: "clone",
  46506. value: function clone() {
  46507. var clone = new SuperMap.CartoCSS.Tree.Filterset();
  46508. for (var id in this.filters) {
  46509. clone.filters[id] = this.filters[id];
  46510. }
  46511. return clone;
  46512. }
  46513. }, {
  46514. key: "cloneWith",
  46515. value: function cloneWith(other) {
  46516. var additions = [];
  46517. for (var id in other.filters) {
  46518. var status = this.addable(other.filters[id]); // status is true, false or null. if it's null we don't fail this
  46519. // clone nor do we add the filter.
  46520. if (status === false) {
  46521. return false;
  46522. }
  46523. if (status === true) {
  46524. // Adding the filter will override another value.
  46525. additions.push(other.filters[id]);
  46526. }
  46527. } // Adding the other filters doesn't make this filterset invalid, but it
  46528. // doesn't add anything to it either.
  46529. if (!additions.length) {
  46530. return null;
  46531. } // We can successfully add all filters. Now clone the filterset and add the
  46532. // new rules.
  46533. var clone = new SuperMap.CartoCSS.Tree.Filterset(); // We can add the rules that are already present without going through the
  46534. // add function as a Filterset is always in it's simplest canonical form.
  46535. for (id in this.filters) {
  46536. clone.filters[id] = this.filters[id];
  46537. } // Only add new filters that actually change the filter.
  46538. while (id = additions.shift()) {
  46539. clone.add(id);
  46540. }
  46541. return clone;
  46542. }
  46543. }, {
  46544. key: "addable",
  46545. value: function addable(filter) {
  46546. var key = filter.key.toString(),
  46547. value = filter.val.toString();
  46548. if (value.match(/^[0-9]+(\.[0-9]*)?_match/)) {
  46549. value = parseFloat(value);
  46550. }
  46551. switch (filter.op) {
  46552. case '=':
  46553. // if there is already foo= and we're adding foo=
  46554. if (this.filters[key + '='] !== undefined) {
  46555. if (this.filters[key + '='].val.toString() != value) {
  46556. return false;
  46557. } else {
  46558. return null;
  46559. }
  46560. }
  46561. if (this.filters[key + '!=' + value] !== undefined) {
  46562. return false;
  46563. }
  46564. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  46565. return false;
  46566. }
  46567. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  46568. return false;
  46569. }
  46570. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  46571. return false;
  46572. }
  46573. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  46574. return false;
  46575. }
  46576. return true;
  46577. case '=~':
  46578. return true;
  46579. case '!=':
  46580. if (this.filters[key + '='] !== undefined) {
  46581. return this.filters[key + '='].val === value ? false : null;
  46582. }
  46583. if (this.filters[key + '!=' + value] !== undefined) {
  46584. return null;
  46585. }
  46586. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  46587. return null;
  46588. }
  46589. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  46590. return null;
  46591. }
  46592. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  46593. return null;
  46594. }
  46595. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  46596. return null;
  46597. }
  46598. return true;
  46599. case '>':
  46600. if (key + '=' in this.filters) {
  46601. if (this.filters[key + '='].val <= value) {
  46602. return false;
  46603. } else {
  46604. return null;
  46605. }
  46606. }
  46607. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  46608. return false;
  46609. }
  46610. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  46611. return false;
  46612. }
  46613. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  46614. return null;
  46615. }
  46616. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  46617. return null;
  46618. }
  46619. return true;
  46620. case '>=':
  46621. if (this.filters[key + '='] !== undefined) {
  46622. return this.filters[key + '='].val < value ? false : null;
  46623. }
  46624. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  46625. return false;
  46626. }
  46627. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  46628. return false;
  46629. }
  46630. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  46631. return null;
  46632. }
  46633. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  46634. return null;
  46635. }
  46636. return true;
  46637. case '<':
  46638. if (this.filters[key + '='] !== undefined) {
  46639. return this.filters[key + '='].val >= value ? false : null;
  46640. }
  46641. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  46642. return false;
  46643. }
  46644. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  46645. return false;
  46646. }
  46647. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  46648. return null;
  46649. }
  46650. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  46651. return null;
  46652. }
  46653. return true;
  46654. case '<=':
  46655. if (this.filters[key + '='] !== undefined) {
  46656. return this.filters[key + '='].val > value ? false : null;
  46657. }
  46658. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  46659. return false;
  46660. }
  46661. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  46662. return false;
  46663. }
  46664. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  46665. return null;
  46666. }
  46667. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  46668. return null;
  46669. }
  46670. return true;
  46671. default:
  46672. break;
  46673. }
  46674. }
  46675. }, {
  46676. key: "conflict",
  46677. value: function conflict(filter) {
  46678. var key = filter.key.toString(),
  46679. value = filter.val.toString();
  46680. if (!isNaN(parseFloat(value))) {
  46681. value = parseFloat(value);
  46682. } // if (a=b) && (a=c)
  46683. // if (a=b) && (a!=b)
  46684. // or (a!=b) && (a=b)
  46685. 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()) {
  46686. return filter.toString() + ' added to ' + this.toString() + ' produces an invalid filter';
  46687. }
  46688. return false;
  46689. }
  46690. }, {
  46691. key: "add",
  46692. value: function add(filter, env) {
  46693. var key = filter.key.toString(),
  46694. op = filter.op,
  46695. conflict = this.conflict(filter),
  46696. numval;
  46697. if (conflict) {
  46698. return conflict;
  46699. }
  46700. if (op === '=') {
  46701. for (var i in this.filters) {
  46702. if (this.filters[i].key === key) {
  46703. delete this.filters[i];
  46704. }
  46705. }
  46706. this.filters[key + '='] = filter;
  46707. } else if (op === '!=') {
  46708. this.filters[key + '!=' + filter.val] = filter;
  46709. } else if (op === '=~') {
  46710. this.filters[key + '=~' + filter.val] = filter;
  46711. } else if (op === '>') {
  46712. // If there are other filters that are also >
  46713. // but are less than this one, they don't matter, so
  46714. // remove them.
  46715. for (var j in this.filters) {
  46716. if (this.filters[j].key === key && this.filters[j].val <= filter.val) {
  46717. delete this.filters[j];
  46718. }
  46719. }
  46720. this.filters[key + '>'] = filter;
  46721. } else if (op === '>=') {
  46722. for (var k in this.filters) {
  46723. numval = +this.filters[k].val.toString();
  46724. if (this.filters[k].key === key && numval < filter.val) {
  46725. delete this.filters[k];
  46726. }
  46727. }
  46728. if (this.filters[key + '!=' + filter.val] !== undefined) {
  46729. delete this.filters[key + '!=' + filter.val];
  46730. filter.op = '>';
  46731. this.filters[key + '>'] = filter;
  46732. } else {
  46733. this.filters[key + '>='] = filter;
  46734. }
  46735. } else if (op === '<') {
  46736. for (var l in this.filters) {
  46737. numval = +this.filters[l].val.toString();
  46738. if (this.filters[l].key === key && numval >= filter.val) {
  46739. delete this.filters[l];
  46740. }
  46741. }
  46742. this.filters[key + '<'] = filter;
  46743. } else if (op === '<=') {
  46744. for (var m in this.filters) {
  46745. numval = +this.filters[m].val.toString();
  46746. if (this.filters[m].key === key && numval > filter.val) {
  46747. delete this.filters[m];
  46748. }
  46749. }
  46750. if (this.filters[key + '!=' + filter.val] !== undefined) {
  46751. delete this.filters[key + '!=' + filter.val];
  46752. filter.op = '<';
  46753. this.filters[key + '<'] = filter;
  46754. } else {
  46755. this.filters[key + '<='] = filter;
  46756. }
  46757. }
  46758. }
  46759. }]);
  46760. return Filterset;
  46761. }();
  46762. SuperMap.CartoCSS.Tree.Fontset = function Fontset(env, fonts) {
  46763. CartoCSS_classCallCheck(this, Fontset);
  46764. this.fonts = fonts;
  46765. this.name = 'fontset-' + env.effects.length;
  46766. };
  46767. SuperMap.CartoCSS.Tree.Invalid = /*#__PURE__*/function () {
  46768. function Invalid(chunk, index, message) {
  46769. CartoCSS_classCallCheck(this, Invalid);
  46770. this.is = 'invalid';
  46771. this.chunk = chunk;
  46772. this.index = index;
  46773. this.type = 'syntax';
  46774. this.message = message || "Invalid code: " + this.chunk;
  46775. }
  46776. CartoCSS_createClass(Invalid, [{
  46777. key: "ev",
  46778. value: function ev(env) {
  46779. env.error({
  46780. chunk: this.chunk,
  46781. index: this.index,
  46782. type: 'syntax',
  46783. message: this.message || "Invalid code: " + this.chunk
  46784. });
  46785. return {
  46786. is: 'undefined'
  46787. };
  46788. }
  46789. }]);
  46790. return Invalid;
  46791. }();
  46792. SuperMap.CartoCSS.Tree.Keyword = /*#__PURE__*/function () {
  46793. CartoCSS_createClass(Keyword, [{
  46794. key: "ev",
  46795. value: function ev() {
  46796. return this;
  46797. }
  46798. }]);
  46799. function Keyword(value) {
  46800. CartoCSS_classCallCheck(this, Keyword);
  46801. this.value = value;
  46802. var special = {
  46803. 'transparent': 'color',
  46804. 'true': 'boolean',
  46805. 'false': 'boolean'
  46806. };
  46807. this.is = special[value] ? special[value] : 'keyword';
  46808. }
  46809. CartoCSS_createClass(Keyword, [{
  46810. key: "toString",
  46811. value: function toString() {
  46812. return this.value;
  46813. }
  46814. }]);
  46815. return Keyword;
  46816. }();
  46817. /*Layer:class Invalid ),*/
  46818. SuperMap.CartoCSS.Tree.Literal = /*#__PURE__*/function () {
  46819. function Literal(content) {
  46820. CartoCSS_classCallCheck(this, Literal);
  46821. this.value = content || '';
  46822. this.is = 'field';
  46823. }
  46824. CartoCSS_createClass(Literal, [{
  46825. key: "toString",
  46826. value: function toString() {
  46827. return this.value;
  46828. }
  46829. }, {
  46830. key: 'ev',
  46831. value: function ev() {
  46832. return this;
  46833. }
  46834. }]);
  46835. return Literal;
  46836. }();
  46837. SuperMap.CartoCSS.Tree.Operation = /*#__PURE__*/function () {
  46838. function Operation(op, operands, index) {
  46839. CartoCSS_classCallCheck(this, Operation);
  46840. this.is = 'operation';
  46841. this.op = op.trim();
  46842. this.operands = operands;
  46843. this.index = index;
  46844. }
  46845. CartoCSS_createClass(Operation, [{
  46846. key: "ev",
  46847. value: function ev(env) {
  46848. var a = this.operands[0].ev(env),
  46849. b = this.operands[1].ev(env),
  46850. temp;
  46851. if (a.is === 'undefined' || b.is === 'undefined') {
  46852. return {
  46853. is: 'undefined',
  46854. value: 'undefined'
  46855. };
  46856. }
  46857. if (a instanceof SuperMap.CartoCSS.Tree.Dimension && b instanceof SuperMap.CartoCSS.Tree.Color) {
  46858. if (this.op === '*' || this.op === '+') {
  46859. temp = b;
  46860. b = a;
  46861. a = temp;
  46862. } else {
  46863. env.error({
  46864. name: "OperationError",
  46865. message: "Can't substract or divide a color from a number",
  46866. index: this.index
  46867. });
  46868. }
  46869. } // Only concatenate plain strings, because this is easily
  46870. // pre-processed
  46871. if (a instanceof SuperMap.CartoCSS.Tree.Quoted && b instanceof SuperMap.CartoCSS.Tree.Quoted && this.op !== '+') {
  46872. env.error({
  46873. message: "Can't subtract, divide, or multiply strings.",
  46874. index: this.index,
  46875. type: 'runtime',
  46876. filename: this.filename
  46877. });
  46878. return {
  46879. is: 'undefined',
  46880. value: 'undefined'
  46881. };
  46882. } // Fields, literals, dimensions, and quoted strings can be combined.
  46883. if (a instanceof SuperMap.CartoCSS.Tree.Field || b instanceof SuperMap.CartoCSS.Tree.Field || a instanceof SuperMap.CartoCSS.Tree.Literal || b instanceof SuperMap.CartoCSS.Tree.Literal) {
  46884. if (a.is === 'color' || b.is === 'color') {
  46885. env.error({
  46886. message: "Can't subtract, divide, or multiply colors in expressions.",
  46887. index: this.index,
  46888. type: 'runtime',
  46889. filename: this.filename
  46890. });
  46891. return {
  46892. is: 'undefined',
  46893. value: 'undefined'
  46894. };
  46895. } else {
  46896. return new SuperMap.CartoCSS.Tree.Literal(a.ev(env).toString(true) + this.op + b.ev(env).toString(true));
  46897. }
  46898. }
  46899. if (a.operate === undefined) {
  46900. env.error({
  46901. message: 'Cannot do math with type ' + a.is + '.',
  46902. index: this.index,
  46903. type: 'runtime',
  46904. filename: this.filename
  46905. });
  46906. return {
  46907. is: 'undefined',
  46908. value: 'undefined'
  46909. };
  46910. }
  46911. return a.operate(env, this.op, b);
  46912. }
  46913. }]);
  46914. return Operation;
  46915. }();
  46916. SuperMap.CartoCSS.Tree.Quoted = /*#__PURE__*/function () {
  46917. function Quoted(content) {
  46918. CartoCSS_classCallCheck(this, Quoted);
  46919. this.is = 'string';
  46920. this.value = content || '';
  46921. }
  46922. CartoCSS_createClass(Quoted, [{
  46923. key: "toString",
  46924. value: function toString(quotes) {
  46925. var escapedValue = this.value.replace(/&/g, '&amp;');
  46926. var xmlvalue = escapedValue.replace(/\'/g, '\\\'').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/\>/g, '&gt;');
  46927. return quotes === true ? "'" + xmlvalue + "'" : escapedValue;
  46928. }
  46929. }, {
  46930. key: "ev",
  46931. value: function ev() {
  46932. return this;
  46933. }
  46934. }, {
  46935. key: "operate",
  46936. value: function operate(env, op, other) {
  46937. return new SuperMap.CartoCSS.Tree.Quoted(SuperMap.CartoCSS.Tree.operate(op, this.toString(), other.toString(this.contains_field)));
  46938. }
  46939. }]);
  46940. return Quoted;
  46941. }();
  46942. SuperMap.CartoCSS.Tree.Reference = {
  46943. _validateValue: {
  46944. 'font': function font(env, value) {
  46945. if (env.validation_data && env.validation_data.fonts) {
  46946. return env.validation_data.fonts.indexOf(value) != -1;
  46947. } else {
  46948. return true;
  46949. }
  46950. }
  46951. },
  46952. setData: function setData(data) {
  46953. this.data = data;
  46954. this.selector_cache = generateSelectorCache(data);
  46955. this.mapnikFunctions = generateMapnikFunctions(data);
  46956. this.required_cache = generateRequiredProperties(data);
  46957. function generateSelectorCache(data) {
  46958. var index = {};
  46959. for (var i in data.symbolizers) {
  46960. for (var j in data.symbolizers[i]) {
  46961. if (data.symbolizers[i][j].hasOwnProperty('css')) {
  46962. index[data.symbolizers[i][j].css] = [data.symbolizers[i][j], i, j];
  46963. }
  46964. }
  46965. }
  46966. return index;
  46967. }
  46968. function generateMapnikFunctions(data) {
  46969. var functions = {};
  46970. for (var i in data.symbolizers) {
  46971. for (var j in data.symbolizers[i]) {
  46972. if (data.symbolizers[i][j].type === 'functions') {
  46973. for (var k = 0; k < data.symbolizers[i][j].functions.length; k++) {
  46974. var fn = data.symbolizers[i][j].functions[k];
  46975. functions[fn[0]] = fn[1];
  46976. }
  46977. }
  46978. }
  46979. }
  46980. return functions;
  46981. }
  46982. function generateRequiredProperties(data) {
  46983. var cache = {};
  46984. for (var symbolizer_name in data.symbolizers) {
  46985. cache[symbolizer_name] = [];
  46986. for (var j in data.symbolizers[symbolizer_name]) {
  46987. if (data.symbolizers[symbolizer_name][j].required) {
  46988. cache[symbolizer_name].push(data.symbolizers[symbolizer_name][j].css);
  46989. }
  46990. }
  46991. }
  46992. return cache;
  46993. }
  46994. },
  46995. setVersion: function setVersion(version) {
  46996. if (SuperMap.CartoCSS.mapnik_reference.version.hasOwnProperty(version)) {
  46997. this.setData(SuperMap.CartoCSS.mapnik_reference.version[version]);
  46998. return true;
  46999. }
  47000. return false;
  47001. },
  47002. selectorData: function selectorData(selector, i) {
  47003. if (this.selector_cache && this.selector_cache[selector]) {
  47004. return this.selector_cache[selector][i];
  47005. }
  47006. },
  47007. validSelector: function validSelector(selector) {
  47008. return !!this.selector_cache[selector];
  47009. },
  47010. selectorName: function selectorName(selector) {
  47011. return this.selectorData(selector, 2);
  47012. },
  47013. selector: function selector(_selector) {
  47014. return this.selectorData(_selector, 0);
  47015. },
  47016. symbolizer: function symbolizer(selector) {
  47017. return this.selectorData(selector, 1);
  47018. },
  47019. requiredProperties: function requiredProperties(symbolizer_name, rules) {
  47020. var req = this.required_cache[symbolizer_name];
  47021. for (var i in req) {
  47022. if (!(req[i] in rules)) {
  47023. return 'Property ' + req[i] + ' required for defining ' + symbolizer_name + ' styles.';
  47024. }
  47025. }
  47026. },
  47027. isFont: function isFont(selector) {
  47028. return this.selector(selector).validate === 'font';
  47029. },
  47030. editDistance: function editDistance(a, b) {
  47031. if (a.length === 0) {
  47032. return b.length;
  47033. }
  47034. if (b.length === 0) {
  47035. return a.length;
  47036. }
  47037. var matrix = [];
  47038. for (var i = 0; i <= b.length; i++) {
  47039. matrix[i] = [i];
  47040. }
  47041. for (var j = 0; j <= a.length; j++) {
  47042. matrix[0][j] = j;
  47043. }
  47044. for (i = 1; i <= b.length; i++) {
  47045. for (j = 1; j <= a.length; j++) {
  47046. if (b.charAt(i - 1) === a.charAt(j - 1)) {
  47047. matrix[i][j] = matrix[i - 1][j - 1];
  47048. } else {
  47049. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
  47050. Math.min(matrix[i][j - 1] + 1, // insertion
  47051. matrix[i - 1][j] + 1)); // deletion
  47052. }
  47053. }
  47054. }
  47055. return matrix[b.length][a.length];
  47056. },
  47057. validValue: function validValue(env, selector, value) {
  47058. function validateFunctions(value, selector) {
  47059. if (value.value[0].is === 'string') {
  47060. return true;
  47061. }
  47062. for (var i in value.value) {
  47063. for (var j in value.value[i].value) {
  47064. if (value.value[i].value[j].is !== 'call') {
  47065. return false;
  47066. }
  47067. var f = find(this.selector(selector).functions, function (x) {
  47068. //NOSONAR
  47069. return x[0] === value.value[i].value[j].name;
  47070. });
  47071. if (!(f && f[1] === -1)) {
  47072. // This filter is unknown or given an incorrect number of arguments
  47073. if (!f || f[1] !== value.value[i].value[j].args.length) {
  47074. return false;
  47075. }
  47076. }
  47077. }
  47078. }
  47079. return true;
  47080. }
  47081. function validateKeyword(value, selector) {
  47082. if (CartoCSS_typeof(this.selector(selector).type) === 'object') {
  47083. return this.selector(selector).type.indexOf(value.value[0].value) !== -1;
  47084. } else {
  47085. // allow unquoted keywords as strings
  47086. return this.selector(selector).type === 'string';
  47087. }
  47088. }
  47089. var i;
  47090. if (!this.selector(selector)) {
  47091. return false;
  47092. } else if (value.value[0].is === 'keyword') {
  47093. return validateKeyword(value, selector);
  47094. } else if (value.value[0].is === 'undefined') {
  47095. // caught earlier in the chain - ignore here so that
  47096. // error is not overridden
  47097. return true;
  47098. } else if (this.selector(selector).type === 'numbers') {
  47099. for (i in value.value) {
  47100. if (value.value[i].is !== 'float') {
  47101. return false;
  47102. }
  47103. }
  47104. return true;
  47105. } else if (this.selector(selector).type === 'tags') {
  47106. if (!value.value) {
  47107. return false;
  47108. }
  47109. if (!value.value[0].value) {
  47110. return value.value[0].is === 'tag';
  47111. }
  47112. for (i = 0; i < value.value[0].value.length; i++) {
  47113. if (value.value[0].value[i].is !== 'tag') {
  47114. return false;
  47115. }
  47116. }
  47117. return true;
  47118. } else if (this.selector(selector).type == 'functions') {
  47119. // For backwards compatibility, you can specify a string for `functions`-compatible
  47120. // values, though they will not be validated.
  47121. return validateFunctions(value, selector);
  47122. } else if (this.selector(selector).type === 'expression') {
  47123. return true;
  47124. } else if (this.selector(selector).type === 'unsigned') {
  47125. if (value.value[0].is === 'float') {
  47126. value.value[0].round();
  47127. return true;
  47128. } else {
  47129. return false;
  47130. }
  47131. } else {
  47132. if (this.selector(selector).validate) {
  47133. var valid = false;
  47134. for (i = 0; i < value.value.length; i++) {
  47135. if (this.selector(selector).type === value.value[i].is && this._validateValue[this.selector(selector).validate](env, value.value[i].value)) {
  47136. return true;
  47137. }
  47138. }
  47139. return valid;
  47140. } else {
  47141. return this.selector(selector).type === value.value[0].is;
  47142. }
  47143. }
  47144. }
  47145. };
  47146. SuperMap.CartoCSS.Tree.Reference.setVersion("latest");
  47147. SuperMap.CartoCSS.Tree.Rule = /*#__PURE__*/function () {
  47148. function Rule(name, value, index, filename) {
  47149. CartoCSS_classCallCheck(this, Rule);
  47150. this.is = 'rule';
  47151. var parts = name.split('/');
  47152. this.name = parts.pop();
  47153. this.instance = parts.length ? parts[0] : '__default__';
  47154. this.value = value instanceof SuperMap.CartoCSS.Tree.Value ? value : new SuperMap.CartoCSS.Tree.Value([value]);
  47155. this.index = index;
  47156. this.symbolizer = SuperMap.CartoCSS.Tree.Reference.symbolizer(this.name);
  47157. this.filename = filename;
  47158. this.variable = name.charAt(0) === '@';
  47159. }
  47160. CartoCSS_createClass(Rule, [{
  47161. key: "clone",
  47162. value: function clone() {
  47163. var clone = Object.create(SuperMap.CartoCSS.Tree.Rule.prototype);
  47164. clone.name = this.name;
  47165. clone.value = this.value;
  47166. clone.index = this.index;
  47167. clone.instance = this.instance;
  47168. clone.symbolizer = this.symbolizer;
  47169. clone.filename = this.filename;
  47170. clone.variable = this.variable;
  47171. return clone;
  47172. }
  47173. }, {
  47174. key: "updateID",
  47175. value: function updateID() {
  47176. return this.id = this.zoom + '#' + this.instance + '#' + this.name;
  47177. }
  47178. }, {
  47179. key: "toString",
  47180. value: function toString() {
  47181. return '[' + SuperMap.CartoCSS.Tree.Zoom.toString(this.zoom) + '] ' + this.name + ': ' + this.value;
  47182. }
  47183. }, {
  47184. key: "ev",
  47185. value: function ev(context) {
  47186. return new SuperMap.CartoCSS.Tree.Rule(this.name, this.value.ev(context), this.index, this.filename);
  47187. }
  47188. }]);
  47189. return Rule;
  47190. }();
  47191. SuperMap.CartoCSS.Tree.Ruleset = /*#__PURE__*/function () {
  47192. function Ruleset(selectors, rules) {
  47193. CartoCSS_classCallCheck(this, Ruleset);
  47194. this.is = 'ruleset';
  47195. this.selectors = selectors;
  47196. this.rules = rules; // static cache of find() function
  47197. this._lookups = {};
  47198. }
  47199. CartoCSS_createClass(Ruleset, [{
  47200. key: "ev",
  47201. value: function ev(env) {
  47202. var i,
  47203. rule,
  47204. ruleset = new SuperMap.CartoCSS.Tree.Ruleset(this.selectors, this.rules.slice(0));
  47205. ruleset.root = this.root; // push the current ruleset to the frames stack
  47206. env.frames.unshift(ruleset); // Evaluate everything else
  47207. for (i = 0, rule; i < ruleset.rules.length; i++) {
  47208. rule = ruleset.rules[i];
  47209. ruleset.rules[i] = rule.ev ? rule.ev(env) : rule;
  47210. } // Pop the stack
  47211. env.frames.shift();
  47212. return ruleset;
  47213. }
  47214. }, {
  47215. key: "match",
  47216. value: function match(args) {
  47217. return !args || args.length === 0;
  47218. }
  47219. }, {
  47220. key: "variables",
  47221. value: function variables() {
  47222. if (this._variables) {
  47223. return this._variables;
  47224. } else {
  47225. return this._variables = this.rules.reduce(function (hash, r) {
  47226. if (r instanceof SuperMap.CartoCSS.Tree.Rule && r.variable === true) {
  47227. hash[r.name] = r;
  47228. }
  47229. return hash;
  47230. }, {});
  47231. }
  47232. }
  47233. }, {
  47234. key: "variable",
  47235. value: function variable(name) {
  47236. return this.variables()[name];
  47237. }
  47238. }, {
  47239. key: "rulesets",
  47240. value: function rulesets() {
  47241. if (this._rulesets) {
  47242. return this._rulesets;
  47243. } else {
  47244. return this._rulesets = this.rules.filter(function (r) {
  47245. return r instanceof SuperMap.CartoCSS.Tree.Ruleset;
  47246. });
  47247. }
  47248. }
  47249. }, {
  47250. key: "find",
  47251. value: function find(selector, self) {
  47252. self = self || this;
  47253. var rules = [],
  47254. match,
  47255. key = selector.toString();
  47256. if (key in this._lookups) {
  47257. return this._lookups[key];
  47258. }
  47259. this.rulesets().forEach(function (rule) {
  47260. if (rule !== self) {
  47261. for (var j = 0; j < rule.selectors.length; j++) {
  47262. match = selector.match(rule.selectors[j]);
  47263. if (match) {
  47264. if (selector.elements.length > 1) {
  47265. Array.prototype.push.apply(rules, rule.find(new SuperMap.CartoCSS.Tree.Selector(null, null, selector.elements.slice(1)), self));
  47266. } else {
  47267. rules.push(rule);
  47268. }
  47269. break;
  47270. }
  47271. }
  47272. }
  47273. });
  47274. return this._lookups[key] = rules;
  47275. } // Zooms can use variables. This replaces SuperMap.CartoCSS.Tree.Zoom objects on selectors
  47276. // with simple bit-arrays that we can compare easily.
  47277. }, {
  47278. key: "evZooms",
  47279. value: function evZooms(env) {
  47280. for (var i = 0; i < this.selectors.length; i++) {
  47281. var zval = SuperMap.CartoCSS.Tree.Zoom.all;
  47282. for (var z = 0; z < this.selectors[i].zoom.length; z++) {
  47283. zval = this.selectors[i].zoom[z].ev(env).zoom;
  47284. }
  47285. this.selectors[i].zoom = zval;
  47286. }
  47287. }
  47288. }, {
  47289. key: "flatten",
  47290. value: function flatten(result, parents, env) {
  47291. var selectors = [],
  47292. i,
  47293. j;
  47294. if (this.selectors.length === 0) {
  47295. env.frames = env.frames.concat(this.rules);
  47296. } // evaluate zoom variables on this object.
  47297. this.evZooms(env);
  47298. for (i = 0; i < this.selectors.length; i++) {
  47299. var child = this.selectors[i];
  47300. if (!child.filters) {
  47301. // This is an invalid filterset.
  47302. continue;
  47303. }
  47304. if (parents.length) {
  47305. for (j = 0; j < parents.length; j++) {
  47306. var parent = parents[j];
  47307. var mergedFilters = parent.filters.cloneWith(child.filters);
  47308. if (mergedFilters === null) {
  47309. // Filters could be added, but they didn't change the
  47310. // filters. This means that we only have to clone when
  47311. // the zoom levels or the attachment is different too.
  47312. if (parent.zoom === child.zoom && parent.attachment === child.attachment && parent.elements.join() === child.elements.join()) {
  47313. selectors.push(parent);
  47314. continue;
  47315. } else {
  47316. mergedFilters = parent.filters;
  47317. }
  47318. } else if (!mergedFilters) {
  47319. // The merged filters are invalid, that means we don't
  47320. // have to clone.
  47321. continue;
  47322. }
  47323. var clone = Object.create(SuperMap.CartoCSS.Tree.Selector.prototype);
  47324. clone.filters = mergedFilters;
  47325. clone.zoom = child.zoom;
  47326. clone.elements = parent.elements.concat(child.elements);
  47327. if (parent.attachment && child.attachment) {
  47328. clone.attachment = parent.attachment + '/' + child.attachment;
  47329. } else {
  47330. clone.attachment = child.attachment || parent.attachment;
  47331. }
  47332. clone.conditions = parent.conditions + child.conditions;
  47333. clone.index = child.index;
  47334. selectors.push(clone);
  47335. }
  47336. } else {
  47337. selectors.push(child);
  47338. }
  47339. }
  47340. var rules = [];
  47341. for (i = 0; i < this.rules.length; i++) {
  47342. var rule = this.rules[i]; // Recursively flatten any nested rulesets
  47343. if (rule instanceof SuperMap.CartoCSS.Tree.Ruleset) {
  47344. rule.flatten(result, selectors, env);
  47345. } else if (rule instanceof SuperMap.CartoCSS.Tree.Rule) {
  47346. rules.push(rule);
  47347. } else if (rule instanceof SuperMap.CartoCSS.Tree.Invalid) {
  47348. env.error(rule);
  47349. }
  47350. }
  47351. var index = rules.length ? rules[0].index : false;
  47352. for (i = 0; i < selectors.length; i++) {
  47353. // For specificity sort, use the position of the first rule to allow
  47354. // defining attachments that are under current element as a descendant
  47355. // selector.
  47356. if (index !== false) {
  47357. selectors[i].index = index;
  47358. }
  47359. result.push(new SuperMap.CartoCSS.Tree.Definition(selectors[i], rules.slice()));
  47360. }
  47361. return result;
  47362. }
  47363. }]);
  47364. return Ruleset;
  47365. }();
  47366. SuperMap.CartoCSS.Tree.Selector = /*#__PURE__*/function () {
  47367. function Selector(filters, zoom, elements, attachment, conditions, index) {
  47368. CartoCSS_classCallCheck(this, Selector);
  47369. this.elements = elements || [];
  47370. this.attachment = attachment;
  47371. this.filters = filters || {};
  47372. this.zoom = typeof zoom !== 'undefined' ? zoom : SuperMap.CartoCSS.Tree.Zoom.all;
  47373. this.conditions = conditions;
  47374. this.index = index;
  47375. }
  47376. CartoCSS_createClass(Selector, [{
  47377. key: "specificity",
  47378. value: function specificity() {
  47379. return this.elements.reduce(function (memo, e) {
  47380. var spec = e.specificity();
  47381. memo[0] += spec[0];
  47382. memo[1] += spec[1];
  47383. return memo;
  47384. }, [0, 0, this.conditions, this.index]);
  47385. }
  47386. }]);
  47387. return Selector;
  47388. }();
  47389. /*style:class Invalid ),*/
  47390. SuperMap.CartoCSS.Tree.URL = /*#__PURE__*/function () {
  47391. function URL(val, paths) {
  47392. CartoCSS_classCallCheck(this, URL);
  47393. this.is = 'uri';
  47394. this.value = val;
  47395. this.paths = paths;
  47396. }
  47397. CartoCSS_createClass(URL, [{
  47398. key: "toString",
  47399. value: function toString() {
  47400. return this.value.toString();
  47401. }
  47402. }, {
  47403. key: "ev",
  47404. value: function ev(ctx) {
  47405. return new SuperMap.CartoCSS.Tree.URL(this.value.ev(ctx), this.paths);
  47406. }
  47407. }]);
  47408. return URL;
  47409. }();
  47410. SuperMap.CartoCSS.Tree.Value = /*#__PURE__*/function () {
  47411. function Value(value) {
  47412. CartoCSS_classCallCheck(this, Value);
  47413. this.is = 'value';
  47414. this.value = value;
  47415. }
  47416. CartoCSS_createClass(Value, [{
  47417. key: "ev",
  47418. value: function ev(env) {
  47419. if (this.value.length === 1) {
  47420. return this.value[0].ev(env);
  47421. } else {
  47422. return new SuperMap.CartoCSS.Tree.Value(this.value.map(function (v) {
  47423. return v.ev(env);
  47424. }));
  47425. }
  47426. }
  47427. }, {
  47428. key: "toJS",
  47429. value: function toJS(env) {
  47430. //var v = this.value[0].value[0];
  47431. var val = this.ev(env);
  47432. var v = val.toString();
  47433. if (val.is === "color" || val.is === 'uri' || val.is === 'string' || val.is === 'keyword') {
  47434. v = "'" + v + "'";
  47435. } else if (val.is === 'field') {
  47436. // replace [varuable] by ctx['variable']
  47437. v = v.replace(/\[(.*)\]/g, "attributes['\_match1']");
  47438. } else if (val.value && CartoCSS_typeof(val.value) === "object") {
  47439. v = "[" + v + "]";
  47440. }
  47441. return "_value = " + v + ";";
  47442. }
  47443. }, {
  47444. key: "toString",
  47445. value: function toString(env, selector, sep, format) {
  47446. return this.value.map(function (e) {
  47447. return e.toString(env, format);
  47448. }).join(sep || ', ');
  47449. }
  47450. }, {
  47451. key: "clone",
  47452. value: function clone() {
  47453. var obj = Object.create(SuperMap.CartoCSS.Tree.Value.prototype);
  47454. if (Array.isArray(obj)) {
  47455. obj.value = this.value.slice();
  47456. } else {
  47457. obj.value = this.value;
  47458. }
  47459. obj.is = this.is;
  47460. return obj;
  47461. }
  47462. }]);
  47463. return Value;
  47464. }();
  47465. SuperMap.CartoCSS.Tree.Variable = /*#__PURE__*/function () {
  47466. function Variable(name, index, filename) {
  47467. CartoCSS_classCallCheck(this, Variable);
  47468. this.is = 'variable';
  47469. this.name = name;
  47470. this.index = index;
  47471. this.filename = filename;
  47472. }
  47473. CartoCSS_createClass(Variable, [{
  47474. key: "toString",
  47475. value: function toString() {
  47476. return this.name;
  47477. }
  47478. }, {
  47479. key: "ev",
  47480. value: function ev(env) {
  47481. if (this._css) {
  47482. return this._css;
  47483. }
  47484. var thisframe = env.frames.filter(function (f) {
  47485. return f.name === this.name;
  47486. }.bind(this));
  47487. if (thisframe.length) {
  47488. return thisframe[0].value.ev(env);
  47489. } else {
  47490. env.error({
  47491. message: 'variable ' + this.name + ' is undefined',
  47492. index: this.index,
  47493. type: 'runtime',
  47494. filename: this.filename
  47495. });
  47496. return {
  47497. is: 'undefined',
  47498. value: 'undefined'
  47499. };
  47500. }
  47501. }
  47502. }]);
  47503. return Variable;
  47504. }();
  47505. SuperMap.CartoCSS.Tree.Zoom = /*#__PURE__*/function () {
  47506. function Zoom(op, value, index) {
  47507. CartoCSS_classCallCheck(this, Zoom);
  47508. this.op = op;
  47509. this.value = value;
  47510. this.index = index;
  47511. }
  47512. CartoCSS_createClass(Zoom, [{
  47513. key: "setZoom",
  47514. value: function setZoom(zoom) {
  47515. this.zoom = zoom;
  47516. return this;
  47517. }
  47518. }, {
  47519. key: "ev",
  47520. value: function ev(env) {
  47521. var value = parseInt(this.value.ev(env).toString(), 10);
  47522. if (value > SuperMap.CartoCSS.Tree.Zoom.maxZoom || value < 0) {
  47523. env.error({
  47524. message: 'Only zoom levels between 0 and ' + SuperMap.CartoCSS.Tree.Zoom.maxZoom + ' supported.',
  47525. index: this.index
  47526. });
  47527. }
  47528. switch (this.op) {
  47529. case '=':
  47530. this.zoom = "zoom && zoom === " + value;
  47531. return this;
  47532. case '>':
  47533. this.zoom = "zoom && zoom > " + value;
  47534. break;
  47535. case '>=':
  47536. this.zoom = "zoom && zoom >= " + value;
  47537. break;
  47538. case '<':
  47539. this.zoom = "zoom && zoom < " + value;
  47540. break;
  47541. case '<=':
  47542. this.zoom = "zoom && zoom <= " + value;
  47543. break;
  47544. default:
  47545. return this;
  47546. break;
  47547. }
  47548. /*
  47549. for (var i = 0; i <= SuperMap.CartoCSS.Tree.Zoom.maxZoom; i++) {
  47550. if (i >= start && i <= end) {
  47551. zoom |= (1 << i);
  47552. }
  47553. }
  47554. this.zoom = zoom;
  47555. this.zoom=value+this.op+"zoom";*/
  47556. return this;
  47557. }
  47558. }, {
  47559. key: "toString",
  47560. value: function toString() {
  47561. var str = '';
  47562. for (var i = 0; i <= SuperMap.CartoCSS.Tree.Zoom.maxZoom; i++) {
  47563. str += this.zoom & 1 << i ? 'X' : '.';
  47564. }
  47565. return str;
  47566. }
  47567. }]);
  47568. return Zoom;
  47569. }(); // Covers all zoomlevels from 0 to 22
  47570. SuperMap.CartoCSS.Tree.Zoom.all = 23;
  47571. SuperMap.CartoCSS.Tree.Zoom.maxZoom = 22;
  47572. SuperMap.CartoCSS.Tree.Zoom.ranges = {
  47573. 0: 1000000000,
  47574. 1: 500000000,
  47575. 2: 200000000,
  47576. 3: 100000000,
  47577. 4: 50000000,
  47578. 5: 25000000,
  47579. 6: 12500000,
  47580. 7: 6500000,
  47581. 8: 3000000,
  47582. 9: 1500000,
  47583. 10: 750000,
  47584. 11: 400000,
  47585. 12: 200000,
  47586. 13: 100000,
  47587. 14: 50000,
  47588. 15: 25000,
  47589. 16: 12500,
  47590. 17: 5000,
  47591. 18: 2500,
  47592. 19: 1500,
  47593. 20: 750,
  47594. 21: 500,
  47595. 22: 250,
  47596. 23: 100
  47597. };
  47598. ;// CONCATENATED MODULE: ./src/common/style/ThemeStyle.js
  47599. function ThemeStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47600. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  47601. * This program are made available under the terms of the Apache License, Version 2.0
  47602. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47603. /**
  47604. * @class SuperMap.ThemeStyle
  47605. * @classdesc 客户端专题图风格类。
  47606. * @category Visualization Theme
  47607. * @param {Object} options - 可选参数。
  47608. * @param {boolean} [options.fill=true] - 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  47609. * @param {string} [options.fillColor='#000000'] - 十六进制填充颜色。
  47610. * @param {number} [options.fillOpacity=1] - 填充不透明度。取值范围[0, 1]。
  47611. * @param {boolean} [options.stroke=false] - 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  47612. * @param {string} [options.strokeColor='#000000'] - 十六进制描边颜色。
  47613. * @param {number} [options.strokeOpacity=1] - 描边的不透明度。取值范围[0, 1]。
  47614. * @param {number} [options.strokeWidth=1] - 线宽度/描边宽度。
  47615. * @param {string} [options.strokeLinecap='butt'] - 线帽样式。strokeLinecap 有三种类型 “butt", "round", "square"。
  47616. * @param {string} [options.strokeLineJoin='iter'] - 线段连接样式。strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  47617. * @param {string} [options.strokeDashstyle='solid'] - 虚线类型。strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"。solid 表示实线。
  47618. * @param {number} [options.pointRadius=6] - 点半径,单位为像素。
  47619. * @param {number} [options.shadowBlur=0] - 阴影模糊度,(大于 0 有效;)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  47620. * @param {string} [options.shadowColor='#000000'] - 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  47621. * @param {number} [options.shadowOffsetX=0] - 阴影 X 方向偏移值。
  47622. * @param {number} [options.shadowOffsetY=0] - 阴影 Y 方向偏移值。
  47623. * @param {string} options.label - 专题要素附加文本标签内容。
  47624. * @param {string} [options.fontColor] - 附加文本字体颜色。
  47625. * @param {number} [options.fontSize=12] - 附加文本字体大小,单位是像素。
  47626. * @param {string} [options.fontStyle='normal'] - 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  47627. * @param {string} [options.fontVariant='normal'] - 附加文本字体变体。可设值:"normal", "small-caps"。
  47628. * @param {string} [options.fontWeight='normal'] - 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  47629. * @param {string} [options.fontFamily='arial,sans-serif'] - 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,
  47630. * 浏览器会使用它可识别的第一个可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称
  47631. * ("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  47632. * @param {string} [options.labelPosition='top'] - 附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。
  47633. * @param {string} [options.labelAlign='center'] - 附加文本水平对齐。可以是 'left', 'right', 'center'。
  47634. * @param {string} [options.labelBaseline='middle'] - 附加文本垂直对齐。 可以是 'top', 'bottom', 'middle' 。
  47635. * @param {number} [options.labelXOffset=0] - 附加文本在x轴方向的偏移量。
  47636. * @param {number} [options.labelYOffset=0] - 附加文本在y轴方向的偏移量。
  47637. */
  47638. var ThemeStyle = function ThemeStyle(options) {
  47639. ThemeStyle_classCallCheck(this, ThemeStyle);
  47640. options = options || {};
  47641. /**
  47642. * @member {boolean} [SuperMap.ThemeStyle.prototype.fill=true]
  47643. * @description 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  47644. */
  47645. this.fill = true;
  47646. /**
  47647. * @member {string} [SuperMap.ThemeStyle.prototype.fillColor="#000000"]
  47648. * @description 十六进制填充颜色。
  47649. */
  47650. this.fillColor = "#000000";
  47651. /**
  47652. * @member {number} [SuperMap.ThemeStyle.prototype.fillOpacity=1]
  47653. * @description 填充不透明度。取值范围[0, 1]。
  47654. */
  47655. this.fillOpacity = 1;
  47656. /**
  47657. * @member {boolean} [SuperMap.ThemeStyle.prototype.stroke=false]
  47658. * @description 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  47659. */
  47660. this.stroke = false;
  47661. /**
  47662. * @member {string} [SuperMap.ThemeStyle.prototype.strokeColor="#000000"]
  47663. * @description 十六进制描边颜色。
  47664. */
  47665. this.strokeColor = "#000000";
  47666. /**
  47667. * @member {number} [SuperMap.ThemeStyle.prototype.strokeOpacity=1]
  47668. * @description 描边的不透明度。取值范围[0, 1]。
  47669. */
  47670. this.strokeOpacity = 1;
  47671. /**
  47672. * @member {number} [SuperMap.ThemeStyle.prototype.strokeWidth=1]
  47673. * @description 线宽度/描边宽度。
  47674. */
  47675. this.strokeWidth = 1;
  47676. /**
  47677. * @member {string} [SuperMap.ThemeStyle.prototype.strokeLinecap="butt"]
  47678. * @description 线帽样式;strokeLinecap 有三种类型 “butt", "round", "square" 。
  47679. */
  47680. this.strokeLinecap = "butt";
  47681. /**
  47682. * @member {string} [SuperMap.ThemeStyle.prototype.strokeLineJoin="miter"]
  47683. * @description 线段连接样式;strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  47684. */
  47685. this.strokeLineJoin = "miter";
  47686. /**
  47687. * @member {string} [SuperMap.ThemeStyle.prototype.strokeDashstyle="solid"]
  47688. * @description 虚线类型; strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted";
  47689. * solid 表示实线。
  47690. */
  47691. this.strokeDashstyle = "solid";
  47692. /**
  47693. * @member {number} [SuperMap.ThemeStyle.prototype.pointRadius=6]
  47694. * @description 点半径。单位为像素。
  47695. */
  47696. this.pointRadius = 6;
  47697. /**
  47698. * @member {number} [SuperMap.ThemeStyle.prototype.shadowBlur=0]
  47699. * @description 阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  47700. */
  47701. this.shadowBlur = 0;
  47702. /**
  47703. * @member {string} [SuperMap.ThemeStyle.prototype.shadowColor='#000000']
  47704. * @description 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  47705. */
  47706. this.shadowColor = "#000000";
  47707. /**
  47708. * @member {number} [SuperMap.ThemeStyle.prototype.shadowOffsetX=0]
  47709. * @description 阴影 X 方向偏移值。
  47710. */
  47711. this.shadowOffsetX = 0;
  47712. /**
  47713. * @member {number} SuperMap.ThemeStyle.prototype.shadowOffsetY
  47714. * @description Y 方向偏移值。
  47715. */
  47716. this.shadowOffsetY = 0;
  47717. /**
  47718. * @member {string} [SuperMap.ThemeStyle.prototype.label]
  47719. * @description 专题要素附加文本标签内容。
  47720. */
  47721. this.label = "";
  47722. /**
  47723. * @member {boolean} [SuperMap.ThemeStyle.prototype.labelRect=false]
  47724. * @description 是否显示文本标签矩形背景。
  47725. */
  47726. this.labelRect = false;
  47727. /**
  47728. * @member {string} [SuperMap.ThemeStyle.prototype.fontColor]
  47729. * @description 附加文本字体颜色。
  47730. */
  47731. this.fontColor = "";
  47732. /**
  47733. * @member {number} [SuperMap.ThemeStyle.prototype.fontSize=12]
  47734. * @description 附加文本字体大小,单位是像素。
  47735. */
  47736. this.fontSize = 12;
  47737. /**
  47738. * @member {string} [SuperMap.ThemeStyle.prototype.fontStyle="normal"]
  47739. * @description 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  47740. */
  47741. this.fontStyle = "normal";
  47742. /**
  47743. * @member {string} [SuperMap.ThemeStyle.prototype.fontVariant="normal"]
  47744. * @description 附加文本字体变体。可设值:"normal", "small-caps"。
  47745. */
  47746. this.fontVariant = "normal";
  47747. /**
  47748. * @member {string} [SuperMap.ThemeStyle.prototype.fontWeight="normal"]
  47749. * @description 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  47750. */
  47751. this.fontWeight = "normal";
  47752. /**
  47753. * @member {string} [SuperMap.ThemeStyle.prototype.fontFamily="arial,sans-serif"]
  47754. * @description 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个
  47755. * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  47756. */
  47757. this.fontFamily = "arial,sans-serif";
  47758. /**
  47759. * @member {string} [SuperMap.ThemeStyle.prototype.labelPosition='top']
  47760. * @description 附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。
  47761. */
  47762. this.labelPosition = "top";
  47763. /**
  47764. * @member {string} [SuperMap.ThemeStyle.prototype.labelAlign='center']
  47765. * @description 附加文本水平对齐。可以是 'left', 'right', 'center'。
  47766. */
  47767. this.labelAlign = "center";
  47768. /**
  47769. * @member {string} [SuperMap.ThemeStyle.prototype.labelBaseline='middle']
  47770. * @description 附加文本垂直对齐。 可以是 'top', 'bottom', 'middle'。
  47771. */
  47772. this.labelBaseline = "middle";
  47773. /**
  47774. * @member {number} [SuperMap.ThemeStyle.prototype.labelXOffset=0]
  47775. * @description 附加文本在 X 轴方向的偏移量。
  47776. */
  47777. this.labelXOffset = 0;
  47778. /**
  47779. * @member {number} [SuperMap.ThemeStyle.prototype.labelYOffset=0]
  47780. * @description 附加文本在 Y 轴方向的偏移量。
  47781. */
  47782. this.labelYOffset = 0;
  47783. Util.extend(this, options);
  47784. };
  47785. SuperMap.ThemeStyle = ThemeStyle;
  47786. ;// CONCATENATED MODULE: ./src/common/style/index.js
  47787. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  47788. * This program are made available under the terms of the Apache License, Version 2.0
  47789. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47790. ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeParameters.js
  47791. function ShapeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47792. 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); } }
  47793. function ShapeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeParameters_defineProperties(Constructor, staticProps); return Constructor; }
  47794. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  47795. * This program are made available under the terms of the Apache License, Version 2.0
  47796. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47797. /**
  47798. * @class SuperMap.Feature.ShapeParameters
  47799. * @category Visualization Theme
  47800. * @classdesc 图形参数基类,此类不可实例化
  47801. */
  47802. var ShapeParameters = /*#__PURE__*/function () {
  47803. /**
  47804. * @function SuperMap.Feature.ShapeParameters.prototype.constructor
  47805. * @description 图形参数对象。
  47806. * @returns {SuperMap.Feature.ShapeParameters} 图形参数对象。
  47807. */
  47808. function ShapeParameters() {
  47809. ShapeParameters_classCallCheck(this, ShapeParameters);
  47810. /**
  47811. * @member {Array} [SuperMap.Feature.ShapeParameters.prototype.refOriginalPosition=[0,0]]
  47812. * @description 图形参考原点位置,图形的参考中心位置。
  47813. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  47814. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  47815. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  47816. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  47817. * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  47818. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  47819. * refOriginalPosition 的值为 [0, 0] 时,图形的位置信息才是 canvas 绝对位置。
  47820. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  47821. */
  47822. this.refOriginalPosition = [0, 0];
  47823. /**
  47824. * @member {string} SuperMap.Feature.ShapeParameters.prototype.refDataID
  47825. * @description 图形所关联数据的 ID(<{@link SuperMap.Feature.Vector}> 的 id)。
  47826. */
  47827. this.refDataID = null;
  47828. /**
  47829. * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.isHoverByRefDataID
  47830. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  47831. */
  47832. this.isHoverByRefDataID = false;
  47833. /**
  47834. * @member {string} SuperMap.Feature.ShapeParameters.prototype.refDataHoverGroup
  47835. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  47836. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  47837. */
  47838. this.refDataHoverGroup = null;
  47839. /**
  47840. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.dataInfo
  47841. * @description 图形携带的附加数据。
  47842. */
  47843. this.dataInfo = null;
  47844. /**
  47845. * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.clickable
  47846. * @description 是否可点击。
  47847. */
  47848. this.clickable = true;
  47849. /**
  47850. * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.hoverable
  47851. * @description 是否可点击。
  47852. */
  47853. this.hoverable = true;
  47854. /**
  47855. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.style
  47856. * @description 图形样式对象,可设样式属性在子类中确定。
  47857. */
  47858. this.style = null;
  47859. /**
  47860. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.highlightStyle
  47861. * @description 高亮样式对象,可设样式属性与 style 的可设样式属性相同。
  47862. */
  47863. this.highlightStyle = {};
  47864. this.CLASS_NAME = "SuperMap.Feature.ShapeParameters";
  47865. }
  47866. /**
  47867. * @function SuperMap.Feature.ShapeParameters.prototype.destroy
  47868. * @description 销毁对象。
  47869. */
  47870. ShapeParameters_createClass(ShapeParameters, [{
  47871. key: "destroy",
  47872. value: function destroy() {
  47873. this.refOriginalPosition = null;
  47874. this.refDataID = null;
  47875. this.isHoverByRefDataID = null;
  47876. this.refDataHoverGroup = null;
  47877. this.dataInfo = null;
  47878. this.clickable = null;
  47879. this.hoverable = null;
  47880. this.style = null;
  47881. this.highlightStyle = null;
  47882. }
  47883. }]);
  47884. return ShapeParameters;
  47885. }();
  47886. SuperMap.Feature = SuperMap.Feature || {};
  47887. SuperMap.Feature.ShapeParameters = ShapeParameters;
  47888. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Point.js
  47889. function feature_Point_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { feature_Point_typeof = function _typeof(obj) { return typeof obj; }; } else { feature_Point_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return feature_Point_typeof(obj); }
  47890. function feature_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47891. 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); } }
  47892. function feature_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Point_defineProperties(Constructor, staticProps); return Constructor; }
  47893. function feature_Point_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { feature_Point_get = Reflect.get; } else { feature_Point_get = function _get(target, property, receiver) { var base = feature_Point_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return feature_Point_get(target, property, receiver || target); }
  47894. function feature_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  47895. function feature_Point_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) feature_Point_setPrototypeOf(subClass, superClass); }
  47896. function feature_Point_setPrototypeOf(o, p) { feature_Point_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Point_setPrototypeOf(o, p); }
  47897. 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); }; }
  47898. function feature_Point_possibleConstructorReturn(self, call) { if (call && (feature_Point_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Point_assertThisInitialized(self); }
  47899. function feature_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47900. function feature_Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  47901. function feature_Point_getPrototypeOf(o) { feature_Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Point_getPrototypeOf(o); }
  47902. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  47903. * This program are made available under the terms of the Apache License, Version 2.0
  47904. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47905. /**
  47906. * @class SuperMap.Feature.ShapeParameters.Point
  47907. * @category Visualization Theme
  47908. * @classdesc 点参数对象。
  47909. * @extends {SuperMap.Feature.ShapeParameters}
  47910. */
  47911. var Point_Point = /*#__PURE__*/function (_ShapeParameters) {
  47912. feature_Point_inherits(Point, _ShapeParameters);
  47913. var _super = feature_Point_createSuper(Point);
  47914. /**
  47915. * @function SuperMap.Feature.ShapeParameters.Point.prototype.constructor
  47916. * @description 创建一个图形点参数对象。
  47917. * @param {number} x - 点 x 坐标,必设参数。
  47918. * @param {number} y - 点 y 坐标,必设参数。
  47919. * @returns {SuperMap.Feature.ShapeParameters.Point} 标签参数对象。
  47920. */
  47921. function Point(x, y) {
  47922. var _this;
  47923. feature_Point_classCallCheck(this, Point);
  47924. _this = _super.call(this, x, y);
  47925. /**
  47926. * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.x
  47927. * @description 点 x 坐标。
  47928. */
  47929. _this.x = !isNaN(x) ? x : 0;
  47930. /**
  47931. * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.y
  47932. * @description 点 y 坐标。
  47933. */
  47934. _this.y = !isNaN(y) ? y : 0;
  47935. /**
  47936. * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.r
  47937. * @description 点的半径。
  47938. */
  47939. _this.r = 6;
  47940. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Point";
  47941. return _this;
  47942. }
  47943. /**
  47944. * @function SuperMap.Feature.ShapeParameters.Point.prototype.destroy
  47945. * @description 销毁对象。
  47946. */
  47947. feature_Point_createClass(Point, [{
  47948. key: "destroy",
  47949. value: function destroy() {
  47950. this.x = null;
  47951. this.y = null;
  47952. this.r = null;
  47953. feature_Point_get(feature_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  47954. }
  47955. }]);
  47956. return Point;
  47957. }(ShapeParameters);
  47958. /**
  47959. * @typedef {Object} SuperMap.Feature.ShapeParameters.Point.style
  47960. * @property {number} pointRadius - 点的半径,默认值:6。
  47961. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  47962. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  47963. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  47964. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  47965. * @property {string} strokeColor - 十六进制描边颜色。
  47966. * @property {number} strokeWidth - 描边宽度,默认值 1。
  47967. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  47968. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  47969. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  47970. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  47971. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  47972. */
  47973. SuperMap.Feature = SuperMap.Feature || {};
  47974. SuperMap.Feature.ShapeParameters.Point = Point_Point;
  47975. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Line.js
  47976. function Line_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Line_typeof = function _typeof(obj) { return typeof obj; }; } else { Line_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Line_typeof(obj); }
  47977. function Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47978. 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); } }
  47979. function Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) Line_defineProperties(Constructor, staticProps); return Constructor; }
  47980. function Line_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Line_get = Reflect.get; } else { Line_get = function _get(target, property, receiver) { var base = Line_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Line_get(target, property, receiver || target); }
  47981. function Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Line_getPrototypeOf(object); if (object === null) break; } return object; }
  47982. function Line_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Line_setPrototypeOf(subClass, superClass); }
  47983. function Line_setPrototypeOf(o, p) { Line_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Line_setPrototypeOf(o, p); }
  47984. 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); }; }
  47985. function Line_possibleConstructorReturn(self, call) { if (call && (Line_typeof(call) === "object" || typeof call === "function")) { return call; } return Line_assertThisInitialized(self); }
  47986. function Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47987. function Line_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  47988. function Line_getPrototypeOf(o) { Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Line_getPrototypeOf(o); }
  47989. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  47990. * This program are made available under the terms of the Apache License, Version 2.0
  47991. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47992. /**
  47993. * @class SuperMap.Feature.ShapeParameters.Line
  47994. * @category Visualization Theme
  47995. * @classdesc 线参数对象。
  47996. * @extends {SuperMap.Feature.ShapeParameters}
  47997. */
  47998. var Line_Line = /*#__PURE__*/function (_ShapeParameters) {
  47999. Line_inherits(Line, _ShapeParameters);
  48000. var _super = Line_createSuper(Line);
  48001. /**
  48002. * @function SuperMap.Feature.ShapeParameters.Line.prototype.constructor
  48003. * @description 创建一个图形线参数对象。
  48004. * @param {Array} pointList - 线要素节点数组,二维数组,必设参数。
  48005. * @returns {SuperMap.Feature.ShapeParameters.Line} 圆形参数对象。
  48006. */
  48007. function Line(pointList) {
  48008. var _this;
  48009. Line_classCallCheck(this, Line);
  48010. _this = _super.call(this, pointList);
  48011. /**
  48012. * @member {Array} SuperMap.Feature.ShapeParameters.Line.prototype.pointList
  48013. * @description 线要素节点数组,二维数组。
  48014. * 数组形如:
  48015. * (start code)
  48016. * [
  48017. * [10, 20], //节点
  48018. * [30, 40],
  48019. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  48020. * ]
  48021. * (end)
  48022. */
  48023. _this.pointList = pointList;
  48024. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Line";
  48025. return _this;
  48026. }
  48027. /**
  48028. * @function SuperMap.Feature.ShapeParameters.Line.prototype.destroy
  48029. * @description 销毁对象。
  48030. */
  48031. Line_createClass(Line, [{
  48032. key: "destroy",
  48033. value: function destroy() {
  48034. this.pointList = null;
  48035. Line_get(Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  48036. }
  48037. }]);
  48038. return Line;
  48039. }(ShapeParameters);
  48040. /**
  48041. * @typedef {Object} SuperMap.Feature.ShapeParameters.Line.style
  48042. * @property {string} strokeColor - 十六进制线颜色。
  48043. * @property {number} strokeWidth - 线宽度,默认值 1。
  48044. * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
  48045. * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
  48046. * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
  48047. * @property {number} strokeOpacity - 线的不透明度。取值范围[0, 1],默认值 1。
  48048. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  48049. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  48050. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  48051. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  48052. */
  48053. SuperMap.Feature = SuperMap.Feature || {};
  48054. SuperMap.Feature.ShapeParameters.Line = Line_Line;
  48055. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Polygon.js
  48056. function feature_Polygon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { feature_Polygon_typeof = function _typeof(obj) { return typeof obj; }; } else { feature_Polygon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return feature_Polygon_typeof(obj); }
  48057. function feature_Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48058. 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); } }
  48059. function feature_Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Polygon_defineProperties(Constructor, staticProps); return Constructor; }
  48060. function Polygon_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Polygon_get = Reflect.get; } else { Polygon_get = function _get(target, property, receiver) { var base = Polygon_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Polygon_get(target, property, receiver || target); }
  48061. function Polygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Polygon_getPrototypeOf(object); if (object === null) break; } return object; }
  48062. function feature_Polygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) feature_Polygon_setPrototypeOf(subClass, superClass); }
  48063. function feature_Polygon_setPrototypeOf(o, p) { feature_Polygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Polygon_setPrototypeOf(o, p); }
  48064. 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); }; }
  48065. function feature_Polygon_possibleConstructorReturn(self, call) { if (call && (feature_Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Polygon_assertThisInitialized(self); }
  48066. function feature_Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48067. function feature_Polygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  48068. function feature_Polygon_getPrototypeOf(o) { feature_Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Polygon_getPrototypeOf(o); }
  48069. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48070. * This program are made available under the terms of the Apache License, Version 2.0
  48071. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48072. /**
  48073. * @class SuperMap.Feature.ShapeParameters.Polygon
  48074. * @category Visualization Theme
  48075. * @classdesc 面参数对象。
  48076. * @extends {SuperMap.Feature.ShapeParameters}
  48077. */
  48078. var Polygon_Polygon = /*#__PURE__*/function (_ShapeParameters) {
  48079. feature_Polygon_inherits(Polygon, _ShapeParameters);
  48080. var _super = feature_Polygon_createSuper(Polygon);
  48081. /**
  48082. * @function SuperMap.Feature.ShapeParameters.Polygon.prototype.constructor
  48083. * @description 创建一个图形面参数对象。
  48084. * @param {Array} pointList - 横坐标,必设参数。
  48085. * @returns {SuperMap.Feature.ShapeParameters.Polygon} 标签参数对象。
  48086. */
  48087. function Polygon(pointList) {
  48088. var _this;
  48089. feature_Polygon_classCallCheck(this, Polygon);
  48090. _this = _super.call(this, pointList);
  48091. /**
  48092. * @member {Array} SuperMap.Feature.ShapeParameters.Polygon.prototype.pointList
  48093. * @description 面要素节点数组,二维数组。
  48094. * 数组形如:
  48095. * (start code)
  48096. * [
  48097. * [10, 20], //节点
  48098. * [30, 40],
  48099. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  48100. * ]
  48101. * (end)
  48102. */
  48103. _this.pointList = pointList;
  48104. /**
  48105. * @member {Array} SuperMap.Feature.ShapeParameters.Polygon.prototype.holePolygonPointLists
  48106. * @description 岛洞面多边形顶点数组(三维数组)
  48107. */
  48108. _this.holePolygonPointLists = null;
  48109. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Polygon";
  48110. return _this;
  48111. }
  48112. /**
  48113. * @function SuperMap.Feature.ShapeParameters.Polygon.prototype.destroy
  48114. * @description 销毁对象。
  48115. */
  48116. feature_Polygon_createClass(Polygon, [{
  48117. key: "destroy",
  48118. value: function destroy() {
  48119. this.pointList = null;
  48120. this.holePolygonPointLists = null;
  48121. Polygon_get(feature_Polygon_getPrototypeOf(Polygon.prototype), "destroy", this).call(this);
  48122. }
  48123. }]);
  48124. return Polygon;
  48125. }(ShapeParameters);
  48126. /**
  48127. * @typedef {Object} SuperMap.Feature.ShapeParameters.Polygon.style
  48128. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  48129. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  48130. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  48131. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  48132. * @property {string} strokeColor - 十六进制描边颜色。
  48133. * @property {number} strokeWidth - 描边宽度,默认值 1。
  48134. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  48135. * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
  48136. * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
  48137. * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
  48138. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  48139. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  48140. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  48141. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  48142. */
  48143. SuperMap.Feature = SuperMap.Feature || {};
  48144. SuperMap.Feature.ShapeParameters.Polygon = Polygon_Polygon;
  48145. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Rectangle.js
  48146. function feature_Rectangle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { feature_Rectangle_typeof = function _typeof(obj) { return typeof obj; }; } else { feature_Rectangle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return feature_Rectangle_typeof(obj); }
  48147. function feature_Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48148. 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); } }
  48149. function feature_Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Rectangle_defineProperties(Constructor, staticProps); return Constructor; }
  48150. function Rectangle_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Rectangle_get = Reflect.get; } else { Rectangle_get = function _get(target, property, receiver) { var base = Rectangle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Rectangle_get(target, property, receiver || target); }
  48151. function Rectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Rectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  48152. function feature_Rectangle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) feature_Rectangle_setPrototypeOf(subClass, superClass); }
  48153. function feature_Rectangle_setPrototypeOf(o, p) { feature_Rectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Rectangle_setPrototypeOf(o, p); }
  48154. 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); }; }
  48155. function feature_Rectangle_possibleConstructorReturn(self, call) { if (call && (feature_Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Rectangle_assertThisInitialized(self); }
  48156. function feature_Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48157. function feature_Rectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  48158. function feature_Rectangle_getPrototypeOf(o) { feature_Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Rectangle_getPrototypeOf(o); }
  48159. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48160. * This program are made available under the terms of the Apache License, Version 2.0
  48161. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48162. /**
  48163. * @class SuperMap.Feature.ShapeParameters.Rectangle
  48164. * @category Visualization Theme
  48165. * @classdesc 矩形参数对象。
  48166. * @extends {SuperMap.Feature.ShapeParameters}
  48167. */
  48168. var Rectangle_Rectangle = /*#__PURE__*/function (_ShapeParameters) {
  48169. feature_Rectangle_inherits(Rectangle, _ShapeParameters);
  48170. var _super = feature_Rectangle_createSuper(Rectangle);
  48171. /**
  48172. * @function SuperMap.Feature.ShapeParameters.Rectangle.prototype.constructor
  48173. * @description 创建一个图形矩形参数对象。
  48174. * @param {number} x - 矩形 x 坐标,必设参数。
  48175. * @param {number} y - 矩形 y 坐标,必设参数。
  48176. * @param {number} width - 矩形 width 坐标,必设参数。
  48177. * @param {number} height - 矩形 height 坐标,必设参数。
  48178. * @returns {SuperMap.Feature.ShapeParameters.Rectangle} 图形矩形参数对象。
  48179. */
  48180. function Rectangle(x, y, width, height) {
  48181. var _this;
  48182. feature_Rectangle_classCallCheck(this, Rectangle);
  48183. _this = _super.call(this, x, y, width, height);
  48184. /**
  48185. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.x
  48186. * @description 左上角 x 坐标。
  48187. */
  48188. _this.x = !isNaN(x) ? x : 0;
  48189. /**
  48190. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.y
  48191. * @description 左上角 y 坐标。
  48192. */
  48193. _this.y = !isNaN(x) ? y : 0;
  48194. /**
  48195. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.width
  48196. * @description 宽度。
  48197. */
  48198. _this.width = !isNaN(width) ? width : 0;
  48199. /**
  48200. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.height
  48201. * @description 高度。
  48202. */
  48203. _this.height = !isNaN(height) ? height : 0;
  48204. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Rectangle";
  48205. return _this;
  48206. }
  48207. /**
  48208. * @function SuperMap.Feature.ShapeParameters.Rectangle.prototype.destroy
  48209. * @description 销毁对象。
  48210. */
  48211. feature_Rectangle_createClass(Rectangle, [{
  48212. key: "destroy",
  48213. value: function destroy() {
  48214. this.x = null;
  48215. this.y = null;
  48216. this.width = null;
  48217. this.height = null;
  48218. Rectangle_get(feature_Rectangle_getPrototypeOf(Rectangle.prototype), "destroy", this).call(this);
  48219. }
  48220. }]);
  48221. return Rectangle;
  48222. }(ShapeParameters);
  48223. /**
  48224. * @typedef {Object} SuperMap.Feature.ShapeParameters.Rectangle.style
  48225. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  48226. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  48227. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  48228. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  48229. * @property {string} strokeColor - 十六进制描边颜色。
  48230. * @property {number} strokeWidth - 描边宽度,默认值 1。
  48231. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  48232. * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
  48233. * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
  48234. * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
  48235. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  48236. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  48237. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  48238. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  48239. */
  48240. SuperMap.Feature = SuperMap.Feature || {};
  48241. SuperMap.Feature.ShapeParameters.Rectangle = Rectangle_Rectangle;
  48242. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Sector.js
  48243. function Sector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Sector_typeof = function _typeof(obj) { return typeof obj; }; } else { Sector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Sector_typeof(obj); }
  48244. function Sector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48245. 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); } }
  48246. function Sector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Sector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Sector_defineProperties(Constructor, staticProps); return Constructor; }
  48247. function Sector_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Sector_get = Reflect.get; } else { Sector_get = function _get(target, property, receiver) { var base = Sector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Sector_get(target, property, receiver || target); }
  48248. function Sector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Sector_getPrototypeOf(object); if (object === null) break; } return object; }
  48249. function Sector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Sector_setPrototypeOf(subClass, superClass); }
  48250. function Sector_setPrototypeOf(o, p) { Sector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Sector_setPrototypeOf(o, p); }
  48251. 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); }; }
  48252. function Sector_possibleConstructorReturn(self, call) { if (call && (Sector_typeof(call) === "object" || typeof call === "function")) { return call; } return Sector_assertThisInitialized(self); }
  48253. function Sector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48254. function Sector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  48255. function Sector_getPrototypeOf(o) { Sector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Sector_getPrototypeOf(o); }
  48256. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48257. * This program are made available under the terms of the Apache License, Version 2.0
  48258. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48259. /**
  48260. * @class SuperMap.Feature.ShapeParameters.Sector
  48261. * @category Visualization Theme
  48262. * @classdesc 扇形参数对象。
  48263. * @extends {SuperMap.Feature.ShapeParameters}
  48264. */
  48265. var Sector = /*#__PURE__*/function (_ShapeParameters) {
  48266. Sector_inherits(Sector, _ShapeParameters);
  48267. var _super = Sector_createSuper(Sector);
  48268. /**
  48269. * @function SuperMap.Feature.ShapeParameters.Sector.prototype.constructor
  48270. * @description 创建一个扇形参数对象。
  48271. * @param {number} x - 圆心 x 坐标,必设参数。
  48272. * @param {number} y - 圆心 y 坐标,必设参数。
  48273. * @param {number} r - 外圆半径,必设参数。
  48274. * @param {number} startAngle - 起始角度,必设参数。取值范围[0, 360)。
  48275. * @param {number} endAngle - 结束角度,必设参数。取值范围(0, 360]。
  48276. * @param {number} [r0=0] - 内圆半径,指定后将出现内弧,同时扇边长度为'r - r0'。取值范围[0, r)。
  48277. * @returns {SuperMap.Feature.ShapeParameters.Sector} 扇形参数对象。
  48278. */
  48279. function Sector(x, y, r, startAngle, endAngle, r0, clockWise) {
  48280. var _this;
  48281. Sector_classCallCheck(this, Sector);
  48282. _this = _super.call(this, x, y, r, startAngle, endAngle, r0, clockWise);
  48283. /**
  48284. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.x
  48285. * @description 圆心 x 坐标。
  48286. */
  48287. _this.x = !isNaN(x) ? x : 0;
  48288. /**
  48289. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.Y
  48290. * @description 圆心 Y 坐标。
  48291. */
  48292. _this.y = !isNaN(y) ? y : 0;
  48293. /**
  48294. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.r
  48295. * @description 外圆半径。
  48296. */
  48297. _this.r = !isNaN(r) ? r : 0;
  48298. /**
  48299. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.startAngle
  48300. * @description 起始角度。取值范围[0, 360),默认值:null。
  48301. */
  48302. _this.startAngle = !isNaN(startAngle) ? startAngle : 0;
  48303. /**
  48304. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.endAngle
  48305. * @description 结束角度。取值范围(0, 360],默认值:null。
  48306. */
  48307. _this.endAngle = !isNaN(endAngle) ? endAngle : 0;
  48308. /**
  48309. * @member {number} [SuperMap.Feature.ShapeParameters.Sector.prototype.r0=0]
  48310. * @description 内圆半径,指定后将出现内弧,同时扇边长度为 r 减 r0。取值范围[0, r)。
  48311. */
  48312. _this.r0 = !isNaN(r0) ? r0 : 0;
  48313. /**
  48314. * @member {number} [SuperMap.Feature.ShapeParameters.Sector.prototype.clockWise=false]
  48315. * @description 是否是顺时针。默认值:false。
  48316. */
  48317. _this.clockWise = clockWise;
  48318. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Sector";
  48319. return _this;
  48320. }
  48321. /**
  48322. * @function SuperMap.Feature.ShapeParameters.Sector.prototype.destroy
  48323. * @description 销毁对象。
  48324. */
  48325. Sector_createClass(Sector, [{
  48326. key: "destroy",
  48327. value: function destroy() {
  48328. this.x = null;
  48329. this.y = null;
  48330. this.r = null;
  48331. this.startAngle = null;
  48332. this.endAngle = null;
  48333. this.r0 = null;
  48334. this.clockWise = null;
  48335. Sector_get(Sector_getPrototypeOf(Sector.prototype), "destroy", this).call(this);
  48336. }
  48337. }]);
  48338. return Sector;
  48339. }(ShapeParameters);
  48340. /**
  48341. * @typedef {Object} SuperMap.Feature.ShapeParameters.Sector.style
  48342. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  48343. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  48344. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  48345. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  48346. * @property {string} strokeColor - 十六进制描边颜色。
  48347. * @property {number} strokeWidth - 描边宽度,默认值 1。
  48348. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  48349. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  48350. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  48351. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  48352. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  48353. */
  48354. SuperMap.Feature = SuperMap.Feature || {};
  48355. SuperMap.Feature.ShapeParameters.Sector = Sector;
  48356. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Label.js
  48357. function Label_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Label_typeof = function _typeof(obj) { return typeof obj; }; } else { Label_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Label_typeof(obj); }
  48358. function Label_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48359. 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); } }
  48360. function Label_createClass(Constructor, protoProps, staticProps) { if (protoProps) Label_defineProperties(Constructor.prototype, protoProps); if (staticProps) Label_defineProperties(Constructor, staticProps); return Constructor; }
  48361. function Label_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Label_get = Reflect.get; } else { Label_get = function _get(target, property, receiver) { var base = Label_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Label_get(target, property, receiver || target); }
  48362. function Label_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Label_getPrototypeOf(object); if (object === null) break; } return object; }
  48363. function Label_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Label_setPrototypeOf(subClass, superClass); }
  48364. function Label_setPrototypeOf(o, p) { Label_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Label_setPrototypeOf(o, p); }
  48365. 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); }; }
  48366. function Label_possibleConstructorReturn(self, call) { if (call && (Label_typeof(call) === "object" || typeof call === "function")) { return call; } return Label_assertThisInitialized(self); }
  48367. function Label_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48368. function Label_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  48369. function Label_getPrototypeOf(o) { Label_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Label_getPrototypeOf(o); }
  48370. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48371. * This program are made available under the terms of the Apache License, Version 2.0
  48372. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48373. /**
  48374. * @class SuperMap.Feature.ShapeParameters.Label
  48375. * @category Visualization Theme
  48376. * @classdesc 标签参数对象。
  48377. * @extent {SuperMap.Feature.ShapeParameters}
  48378. */
  48379. var Label = /*#__PURE__*/function (_ShapeParameters) {
  48380. Label_inherits(Label, _ShapeParameters);
  48381. var _super = Label_createSuper(Label);
  48382. /**
  48383. * @function SuperMap.Feature.ShapeParameters.Label.prototype.constructor
  48384. * @description 创建一个标签参数对象。
  48385. * @param {number} x - 横坐标,必设参数。
  48386. * @param {number} y - 纵坐标,必设参数。
  48387. * @param {string} text - 图形中的附加文本,必设参数。
  48388. * @returns {SuperMap.Feature.ShapeParameters.Label} 标签参数对象。
  48389. */
  48390. function Label(x, y, text) {
  48391. var _this;
  48392. Label_classCallCheck(this, Label);
  48393. _this = _super.call(this, x, y, text);
  48394. /**
  48395. * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.x
  48396. * @description 标签 x 坐标。
  48397. */
  48398. _this.x = x;
  48399. /**
  48400. * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.y
  48401. * @description 标签 y 坐标。
  48402. */
  48403. _this.y = y;
  48404. /**
  48405. * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.text
  48406. * @description 标签的文本内容。
  48407. */
  48408. _this.text = text;
  48409. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Label";
  48410. return _this;
  48411. }
  48412. /**
  48413. * @function SuperMap.Feature.ShapeParameters.Label.prototype.destroy
  48414. * @description 销毁对象。
  48415. */
  48416. Label_createClass(Label, [{
  48417. key: "destroy",
  48418. value: function destroy() {
  48419. this.x = null;
  48420. this.y = null;
  48421. this.text = null;
  48422. Label_get(Label_getPrototypeOf(Label.prototype), "destroy", this).call(this);
  48423. }
  48424. }]);
  48425. return Label;
  48426. }(ShapeParameters);
  48427. /**
  48428. * @typedef {Object} SuperMap.Feature.ShapeParameters.Label.style
  48429. * @property {boolean} fill - 是否填充,不需要填充则设置为 false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  48430. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  48431. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  48432. * @property {boolean} stroke - 是否描边,不需要描边则设置为false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  48433. * @property {string} strokeColor - 十六进制描边颜色。
  48434. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  48435. * @property {number} strokeWidth -描边宽度,默认值 1。
  48436. * @property {number} maxWidth - 最大宽度限制。默认值:null。
  48437. * @property {number} fontSize - 标签文本字体大小。默认值 12,单位是像素。
  48438. * @property {string} fontStyle - 标签文本字体样式。可设值:"normal", "italic", "oblique"; 默认值:"normal" 。
  48439. * @property {string} fontVariant - 标签文本字体变体。可设值:"normal", "small-caps"; 默认值:"normal" 。
  48440. * @property {string} fontWeight - 标签文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"; 默认值:"normal" 。
  48441. * @property {string} fontFamily - 标签文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个值。
  48442. * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。默认值:"arial,sans-serif".
  48443. * @property {string} labelBaseline - 标签文本垂直对齐, 可以是 'top', 'bottom', 'middle',默认值 'middle'。
  48444. * @property {string} labelAlign - 标签文本水平对齐。可以是 'left', 'right', 'center'; 默认值 'center'。
  48445. * @property {number} shadowBlur - 阴影模糊度,大于 0 有效。默认值:0。
  48446. * @property {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  48447. * @property {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  48448. * @property {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  48449. */
  48450. SuperMap.Feature = SuperMap.Feature || {};
  48451. SuperMap.Feature.ShapeParameters.Label = Label;
  48452. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Image.js
  48453. function feature_Image_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { feature_Image_typeof = function _typeof(obj) { return typeof obj; }; } else { feature_Image_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return feature_Image_typeof(obj); }
  48454. function feature_Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48455. 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); } }
  48456. function feature_Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Image_defineProperties(Constructor, staticProps); return Constructor; }
  48457. function feature_Image_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { feature_Image_get = Reflect.get; } else { feature_Image_get = function _get(target, property, receiver) { var base = feature_Image_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return feature_Image_get(target, property, receiver || target); }
  48458. function feature_Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Image_getPrototypeOf(object); if (object === null) break; } return object; }
  48459. function feature_Image_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) feature_Image_setPrototypeOf(subClass, superClass); }
  48460. function feature_Image_setPrototypeOf(o, p) { feature_Image_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Image_setPrototypeOf(o, p); }
  48461. 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); }; }
  48462. function feature_Image_possibleConstructorReturn(self, call) { if (call && (feature_Image_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Image_assertThisInitialized(self); }
  48463. function feature_Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48464. function feature_Image_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  48465. function feature_Image_getPrototypeOf(o) { feature_Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Image_getPrototypeOf(o); }
  48466. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48467. * This program are made available under the terms of the Apache License, Version 2.0
  48468. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48469. /**
  48470. * @class SuperMap.Feature.ShapeParameters.Image
  48471. * @category Visualization Theme
  48472. * @classdesc 图片参数对象。
  48473. * @extends {SuperMap.Feature.ShapeParameters}
  48474. */
  48475. var Image_Image = /*#__PURE__*/function (_ShapeParameters) {
  48476. feature_Image_inherits(Image, _ShapeParameters);
  48477. var _super = feature_Image_createSuper(Image);
  48478. /**
  48479. * @function SuperMap.Feature.ShapeParameters.Image.prototype.constructor
  48480. * @description 创建一个图片参数对象。
  48481. * @param {number} x - 左上角横坐标,必设参数。
  48482. * @param {number} y - 左上角纵坐标,必设参数。
  48483. * @param {(string|Object)} image - 图片地址或Cavans对象,必设参数。
  48484. * @param {number} width - 绘制到画布上的宽度,默认为图片高度。
  48485. * @param {number} height - 绘制到画布上的高度,默认为图片高度。
  48486. * @param {number} sx - 从图片中裁剪的左上角横坐标。
  48487. * @param {number} sy - 从图片中裁剪的左上角纵坐标。
  48488. * @param {number} sWidth - 从图片中裁剪的宽度,默认为图片高度。
  48489. * @param {number} sHeight - 绘制到画布上的高度,默认为图片高度。
  48490. * @returns {SuperMap.Feature.ShapeParameters.Image} 圆形参数对象。
  48491. */
  48492. function Image(x, y, image, width, height, sx, sy, sWidth, sHeight) {
  48493. var _this;
  48494. feature_Image_classCallCheck(this, Image);
  48495. _this = _super.call(this, x, y, image, width, height, sx, sy, sWidth, sHeight);
  48496. /**
  48497. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.x
  48498. * @description 左上角横坐标,必设参数。
  48499. */
  48500. _this.x = x;
  48501. /**
  48502. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.y
  48503. * @description 左上角纵坐标,必设参数。
  48504. */
  48505. _this.y = y;
  48506. /**
  48507. * @member {(string|Object)} SuperMap.Feature.ShapeParameters.Image.prototype.image
  48508. * @description 图片地址。
  48509. */
  48510. _this.image = image;
  48511. /**
  48512. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.width
  48513. * @description 绘制到画布上的宽度,默认为图片高度。
  48514. */
  48515. _this.width = width;
  48516. /**
  48517. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.height
  48518. * @description 绘制到画布上的高度,默认为图片高度。
  48519. */
  48520. _this.height = height;
  48521. /**
  48522. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sx
  48523. * @description 从图片中裁剪的左上角横坐标。
  48524. */
  48525. _this.sx = sx;
  48526. /**
  48527. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sy
  48528. * @description 从图片中裁剪的左上角纵坐标。
  48529. */
  48530. _this.sy = sy;
  48531. /**
  48532. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sWidth
  48533. * @description 从图片中裁剪的宽度,默认为图片高度。
  48534. */
  48535. _this.sWidth = sWidth;
  48536. /**
  48537. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sHeight
  48538. * @description 绘制到画布上的高度,默认为图片高度。
  48539. */
  48540. _this.sHeight = sHeight;
  48541. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Image";
  48542. return _this;
  48543. }
  48544. /**
  48545. * @function SuperMap.Feature.ShapeParameters.Image.prototype.destroy
  48546. * @description 销毁对象。
  48547. */
  48548. feature_Image_createClass(Image, [{
  48549. key: "destroy",
  48550. value: function destroy() {
  48551. this.x = null;
  48552. this.y = null;
  48553. this.image = null;
  48554. this.width = null;
  48555. this.height = null;
  48556. this.sx = null;
  48557. this.sy = null;
  48558. this.sWidth = null;
  48559. this.sHeight = null;
  48560. feature_Image_get(feature_Image_getPrototypeOf(Image.prototype), "destroy", this).call(this);
  48561. }
  48562. }]);
  48563. return Image;
  48564. }(ShapeParameters);
  48565. SuperMap.Feature = SuperMap.Feature || {};
  48566. SuperMap.Feature.ShapeParameters.Image = Image_Image;
  48567. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Circle.js
  48568. function Circle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Circle_typeof = function _typeof(obj) { return typeof obj; }; } else { Circle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Circle_typeof(obj); }
  48569. function Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48570. 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); } }
  48571. function Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Circle_defineProperties(Constructor, staticProps); return Constructor; }
  48572. function Circle_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Circle_get = Reflect.get; } else { Circle_get = function _get(target, property, receiver) { var base = Circle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Circle_get(target, property, receiver || target); }
  48573. function Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  48574. function Circle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Circle_setPrototypeOf(subClass, superClass); }
  48575. function Circle_setPrototypeOf(o, p) { Circle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Circle_setPrototypeOf(o, p); }
  48576. 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); }; }
  48577. function Circle_possibleConstructorReturn(self, call) { if (call && (Circle_typeof(call) === "object" || typeof call === "function")) { return call; } return Circle_assertThisInitialized(self); }
  48578. function Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48579. function Circle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  48580. function Circle_getPrototypeOf(o) { Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Circle_getPrototypeOf(o); }
  48581. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48582. * This program are made available under the terms of the Apache License, Version 2.0
  48583. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48584. /**
  48585. * @class SuperMap.Feature.ShapeParameters.Circle
  48586. * @classdesc 圆形参数对象。
  48587. * @category Visualization Theme
  48588. * @extends {SuperMap.Feature.ShapeParameters}
  48589. */
  48590. var Circle_Circle = /*#__PURE__*/function (_ShapeParameters) {
  48591. Circle_inherits(Circle, _ShapeParameters);
  48592. var _super = Circle_createSuper(Circle);
  48593. /**
  48594. * @function SuperMap.Feature.ShapeParameters.Circle.prototype.constructor
  48595. * @description 创建一个圆形参数对象。
  48596. * @param {number} x - 圆心 x 坐标,必设参数。
  48597. * @param {number} y - 圆心 y 坐标,必设参数。
  48598. * @param {number} r - 圆半径,必设参数。
  48599. * @returns {SuperMap.Feature.ShapeParameters.Circle} 圆形参数对象。
  48600. */
  48601. function Circle(x, y, r) {
  48602. var _this;
  48603. Circle_classCallCheck(this, Circle);
  48604. _this = _super.call(this, x, y, r);
  48605. /**
  48606. * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.x
  48607. * @description 圆心 x 坐标。
  48608. */
  48609. _this.x = !isNaN(x) ? x : 0;
  48610. /**
  48611. * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.y
  48612. * @description 圆心 y 坐标。
  48613. */
  48614. _this.y = !isNaN(y) ? y : 0;
  48615. /**
  48616. * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.r
  48617. * @description 圆半径。
  48618. */
  48619. _this.r = !isNaN(r) ? r : 0;
  48620. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Circle";
  48621. return _this;
  48622. }
  48623. /**
  48624. * @function SuperMap.Feature.ShapeParameters.Circle.prototype.destroy
  48625. * @description 销毁对象。
  48626. */
  48627. Circle_createClass(Circle, [{
  48628. key: "destroy",
  48629. value: function destroy() {
  48630. this.x = null;
  48631. this.y = null;
  48632. this.r = null;
  48633. Circle_get(Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  48634. }
  48635. }]);
  48636. return Circle;
  48637. }(ShapeParameters);
  48638. SuperMap.Feature = SuperMap.Feature || {};
  48639. SuperMap.Feature.ShapeParameters.Circle = Circle_Circle;
  48640. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Eventful.js
  48641. function Eventful_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48642. 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); } }
  48643. function Eventful_createClass(Constructor, protoProps, staticProps) { if (protoProps) Eventful_defineProperties(Constructor.prototype, protoProps); if (staticProps) Eventful_defineProperties(Constructor, staticProps); return Constructor; }
  48644. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48645. * This program are made available under the terms of the Apache License, Version 2.0
  48646. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48647. /**
  48648. * @class SuperMap.LevelRenderer.Eventful
  48649. * @category Visualization Theme
  48650. * @classdesc 事件分发器超类,所有支持事件处理的类均是此类的子类。
  48651. * 此类不可实例化。
  48652. * @private
  48653. */
  48654. var Eventful = /*#__PURE__*/function () {
  48655. /**
  48656. * @function SuperMap.LevelRenderer.Eventful.prototype.constructor
  48657. * @description 构造函数。对象可以通过 onxxxx 绑定事件。
  48658. * 支持的事件:
  48659. * Symbolizer properties:
  48660. * onclick - {function} 默认值:null。
  48661. * onmouseover - {function} 默认值:null。
  48662. * onmouseout - {function} 默认值:null。
  48663. * onmousemove - {function} 默认值:null。
  48664. * onmousewheel - {function} 默认值:null。
  48665. * onmousedown - {function} 默认值:null。
  48666. * onmouseup - {function} 默认值:null。
  48667. * ondragstart - {function} 默认值:null。
  48668. * ondragend - {function} 默认值:null。
  48669. * ondragenter - {function} 默认值:null。
  48670. * ondragleave - {function} 默认值:null。
  48671. * ondragover - {function} 默认值:null。
  48672. * ondrop - {function} 默认值:null。
  48673. */
  48674. function Eventful() {
  48675. Eventful_classCallCheck(this, Eventful);
  48676. /**
  48677. * @member {Object} SuperMap.LevelRenderer.Eventful.prototype._handlers
  48678. * @description 事件处理对象(事件分发器)。
  48679. */
  48680. this._handlers = {};
  48681. this.CLASS_NAME = "SuperMap.LevelRenderer.Eventful";
  48682. }
  48683. /**
  48684. * @function {Object} SuperMap.LevelRenderer.Eventful.prototype.destroy
  48685. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  48686. */
  48687. Eventful_createClass(Eventful, [{
  48688. key: "destroy",
  48689. value: function destroy() {
  48690. this._handlers = null;
  48691. }
  48692. /**
  48693. * @function SuperMap.LevelRenderer.Eventful.prototype.one
  48694. * @description 单次触发绑定,dispatch后销毁。
  48695. * @param {string} event - 事件名。
  48696. * @param {boolean} handler - 响应函数。
  48697. * @param {Object} context - context。
  48698. * @returns {SuperMap.LevelRenderer.Eventful} this
  48699. */
  48700. }, {
  48701. key: "one",
  48702. value: function one(event, handler, context) {
  48703. var _h = this._handlers;
  48704. if (!handler || !event) {
  48705. return this;
  48706. }
  48707. if (!_h[event]) {
  48708. _h[event] = [];
  48709. }
  48710. _h[event].push({
  48711. h: handler,
  48712. one: true,
  48713. ctx: context || this
  48714. });
  48715. return this;
  48716. }
  48717. /**
  48718. * @function SuperMap.LevelRenderer.Eventful.prototype.bind
  48719. * @description 绑定事件。
  48720. * @param {string} event - 事件名。
  48721. * @param {boolean} handler - 响应函数。
  48722. * @param {Object} context - context。
  48723. * @returns {SuperMap.LevelRenderer.Eventful} this
  48724. */
  48725. }, {
  48726. key: "bind",
  48727. value: function bind(event, handler, context) {
  48728. var _h = this._handlers;
  48729. if (!handler || !event) {
  48730. return this;
  48731. }
  48732. if (!_h[event]) {
  48733. _h[event] = [];
  48734. }
  48735. _h[event].push({
  48736. h: handler,
  48737. one: false,
  48738. ctx: context || this
  48739. });
  48740. return this;
  48741. }
  48742. /**
  48743. * @function SuperMap.LevelRenderer.Eventful.prototype.unbind
  48744. * @description 解绑事件。
  48745. * @param {string} event - 事件名。
  48746. * @param {boolean} handler - 响应函数。
  48747. * @returns {SuperMap.LevelRenderer.Eventful} this
  48748. */
  48749. }, {
  48750. key: "unbind",
  48751. value: function unbind(event, handler) {
  48752. var _h = this._handlers;
  48753. if (!event) {
  48754. this._handlers = {};
  48755. return this;
  48756. }
  48757. if (handler) {
  48758. if (_h[event]) {
  48759. var newList = [];
  48760. for (var i = 0, l = _h[event].length; i < l; i++) {
  48761. if (_h[event][i]['h'] != handler) {
  48762. newList.push(_h[event][i]);
  48763. }
  48764. }
  48765. _h[event] = newList;
  48766. }
  48767. if (_h[event] && _h[event].length === 0) {
  48768. delete _h[event];
  48769. }
  48770. } else {
  48771. delete _h[event];
  48772. }
  48773. return this;
  48774. }
  48775. /**
  48776. * @function SuperMap.LevelRenderer.Eventful.prototype.dispatch
  48777. * @description 事件分发。
  48778. * @param {string} type - 事件类型。
  48779. * @returns {SuperMap.LevelRenderer.Eventful} this
  48780. */
  48781. }, {
  48782. key: "dispatch",
  48783. value: function dispatch(type) {
  48784. if (this._handlers[type]) {
  48785. var args = arguments;
  48786. var argLen = args.length;
  48787. if (argLen > 3) {
  48788. args = Array.prototype.slice.call(args, 1);
  48789. }
  48790. var _h = this._handlers[type];
  48791. var len = _h.length;
  48792. for (var i = 0; i < len;) {
  48793. // Optimize advise from backbone
  48794. switch (argLen) {
  48795. case 1:
  48796. _h[i]['h'].call(_h[i]['ctx']);
  48797. break;
  48798. case 2:
  48799. _h[i]['h'].call(_h[i]['ctx'], args[1]);
  48800. break;
  48801. case 3:
  48802. _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]);
  48803. break;
  48804. default:
  48805. // have more than 2 given arguments
  48806. _h[i]['h'].apply(_h[i]['ctx'], args);
  48807. break;
  48808. }
  48809. if (_h[i]['one']) {
  48810. _h.splice(i, 1);
  48811. len--;
  48812. } else {
  48813. i++;
  48814. }
  48815. }
  48816. }
  48817. return this;
  48818. }
  48819. /**
  48820. * @function SuperMap.LevelRenderer.Eventful.prototype.dispatchWithContext
  48821. * @description 带有context的事件分发,最后一个参数是事件回调的 context。
  48822. * @param {string} type - 事件类型。
  48823. * @returns {SuperMap.LevelRenderer.Eventful} this
  48824. */
  48825. }, {
  48826. key: "dispatchWithContext",
  48827. value: function dispatchWithContext(type) {
  48828. if (this._handlers[type]) {
  48829. var args = arguments;
  48830. var argLen = args.length;
  48831. if (argLen > 4) {
  48832. args = Array.prototype.slice.call(args, 1, args.length - 1);
  48833. }
  48834. var ctx = args[args.length - 1];
  48835. var _h = this._handlers[type];
  48836. var len = _h.length;
  48837. for (var i = 0; i < len;) {
  48838. // Optimize advise from backbone
  48839. switch (argLen) {
  48840. case 1:
  48841. _h[i]['h'].call(ctx);
  48842. break;
  48843. case 2:
  48844. _h[i]['h'].call(ctx, args[1]);
  48845. break;
  48846. case 3:
  48847. _h[i]['h'].call(ctx, args[1], args[2]);
  48848. break;
  48849. default:
  48850. // have more than 2 given arguments
  48851. _h[i]['h'].apply(ctx, args);
  48852. break;
  48853. }
  48854. if (_h[i]['one']) {
  48855. _h.splice(i, 1);
  48856. len--;
  48857. } else {
  48858. i++;
  48859. }
  48860. }
  48861. }
  48862. return this;
  48863. }
  48864. }]);
  48865. return Eventful;
  48866. }();
  48867. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Vector.js
  48868. function levelRenderer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48869. 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); } }
  48870. function levelRenderer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) levelRenderer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) levelRenderer_Vector_defineProperties(Constructor, staticProps); return Constructor; }
  48871. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48872. * This program are made available under the terms of the Apache License, Version 2.0
  48873. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48874. /**
  48875. * @private
  48876. * @class SuperMap.LevelRenderer.Tool.Vector
  48877. * @category Visualization Theme
  48878. * @classdesc LevelRenderer 二维向量类
  48879. *
  48880. */
  48881. var levelRenderer_Vector_Vector = /*#__PURE__*/function () {
  48882. /**
  48883. * @function SuperMap.LevelRenderer.Tool.Vector.constructor
  48884. * @description 构造函数
  48885. */
  48886. function Vector() {
  48887. levelRenderer_Vector_classCallCheck(this, Vector);
  48888. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  48889. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Vector";
  48890. }
  48891. /**
  48892. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.create
  48893. * @description 创建一个向量。
  48894. *
  48895. * @param {number} x - x坐标
  48896. * @param {number} y - Y坐标
  48897. * @return {Vector2} 向量。
  48898. */
  48899. levelRenderer_Vector_createClass(Vector, [{
  48900. key: "create",
  48901. value: function create(x, y) {
  48902. var ArrayCtor = this.ArrayCtor;
  48903. var out = new ArrayCtor(2);
  48904. out[0] = x || 0;
  48905. out[1] = y || 0;
  48906. return out;
  48907. }
  48908. /**
  48909. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.copy
  48910. * @description 复制一个向量。
  48911. *
  48912. * @param {Vector2} out - 基础向量。
  48913. * @param {Vector2} v - 向量。
  48914. * @return {Vector2} 克隆向量。
  48915. */
  48916. }, {
  48917. key: "copy",
  48918. value: function copy(out, v) {
  48919. out[0] = v[0];
  48920. out[1] = v[1];
  48921. return out;
  48922. }
  48923. /**
  48924. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.set
  48925. * @description 设置向量的两个项。
  48926. *
  48927. * @param {Vector2} out - 基础向量。
  48928. * @param {number} a - 项 a。
  48929. * @param {number} b - 项 b。
  48930. * @return {Vector2} 结果。
  48931. */
  48932. }, {
  48933. key: "set",
  48934. value: function set(out, a, b) {
  48935. out[0] = a;
  48936. out[1] = b;
  48937. return out;
  48938. }
  48939. /**
  48940. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.add
  48941. * @description 向量相加。
  48942. *
  48943. * @param {Vector2} out - 基础向量。
  48944. * @param {Vector2} v1 - 向量 v1。
  48945. * @param {Vector2} v2 - 向量 v2。
  48946. * @return {Vector2} 结果。
  48947. */
  48948. }, {
  48949. key: "add",
  48950. value: function add(out, v1, v2) {
  48951. out[0] = v1[0] + v2[0];
  48952. out[1] = v1[1] + v2[1];
  48953. return out;
  48954. }
  48955. /**
  48956. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.scaleAndAdd
  48957. * @description 向量缩放后相加。
  48958. * @param {Vector2} out - 基础向量。
  48959. * @param {Vector2} v1 - 向量 v1。
  48960. * @param {Vector2} v2 - 向量 v2(缩放向量)。
  48961. * @param {number} a - 缩放参数。
  48962. * @return {Vector2} 结果。
  48963. */
  48964. }, {
  48965. key: "scaleAndAdd",
  48966. value: function scaleAndAdd(out, v1, v2, a) {
  48967. out[0] = v1[0] + v2[0] * a;
  48968. out[1] = v1[1] + v2[1] * a;
  48969. return out;
  48970. }
  48971. /**
  48972. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.sub
  48973. * @description 向量相减。
  48974. * @param {Vector2} out - 基础向量。
  48975. * @param {Vector2} v1 - 向量 v1。
  48976. * @param {Vector2} v2 - 向量 v2。
  48977. * @return {Vector2} 结果。
  48978. */
  48979. }, {
  48980. key: "sub",
  48981. value: function sub(out, v1, v2) {
  48982. out[0] = v1[0] - v2[0];
  48983. out[1] = v1[1] - v2[1];
  48984. return out;
  48985. }
  48986. /**
  48987. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.len
  48988. * @description 向量长度。
  48989. * @param {Vector2} v - 向量。
  48990. * @return {number} 向量长度。
  48991. */
  48992. }, {
  48993. key: "len",
  48994. value: function len(v) {
  48995. return Math.sqrt(this.lenSquare(v));
  48996. }
  48997. /**
  48998. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lenSquare
  48999. * @description 向量长度平方。
  49000. * @param {Vector2} v - 向量。
  49001. * @return {number} 向量长度平方。
  49002. */
  49003. }, {
  49004. key: "lenSquare",
  49005. value: function lenSquare(v) {
  49006. return v[0] * v[0] + v[1] * v[1];
  49007. }
  49008. /**
  49009. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.mul
  49010. * @description 向量乘法。
  49011. * @param {Vector2} out - 基础向量。
  49012. * @param {Vector2} v1 - 向量 v1。
  49013. * @param {Vector2} v2 - 向量 v2。
  49014. * @return {Vector2} 结果。
  49015. */
  49016. }, {
  49017. key: "mul",
  49018. value: function mul(out, v1, v2) {
  49019. out[0] = v1[0] * v2[0];
  49020. out[1] = v1[1] * v2[1];
  49021. return out;
  49022. }
  49023. /**
  49024. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.div
  49025. * @description 向量除法。
  49026. *
  49027. * @param {Vector2} out - 基础向量。
  49028. * @param {Vector2} v1 - 向量 v1。
  49029. * @param {Vector2} v2 - 向量 v2。
  49030. * @return {Vector2} 结果。
  49031. */
  49032. }, {
  49033. key: "div",
  49034. value: function div(out, v1, v2) {
  49035. out[0] = v1[0] / v2[0];
  49036. out[1] = v1[1] / v2[1];
  49037. return out;
  49038. }
  49039. /**
  49040. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.dot
  49041. * @description 向量点乘。
  49042. *
  49043. * @param {Vector2} v1 - 向量 v1。
  49044. * @param {Vector2} v2 - 向量 v2。
  49045. * @return {number} 向量点乘。
  49046. */
  49047. }, {
  49048. key: "dot",
  49049. value: function dot(v1, v2) {
  49050. return v1[0] * v2[0] + v1[1] * v2[1];
  49051. }
  49052. /**
  49053. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.scale
  49054. * @description 向量缩放。
  49055. *
  49056. * @param {Vector2} out - 基础向量。
  49057. * @param {Vector2} v - 向量v。
  49058. * @param {number} s -缩放参数。
  49059. * @return {Vector2} 结果。
  49060. */
  49061. }, {
  49062. key: "scale",
  49063. value: function scale(out, v, s) {
  49064. out[0] = v[0] * s;
  49065. out[1] = v[1] * s;
  49066. return out;
  49067. }
  49068. /**
  49069. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.normalize
  49070. * @description 向量归一化。
  49071. *
  49072. * @param {Vector2} out - 基础向量。
  49073. * @param {Vector2} v - 向量 v。
  49074. * @return {Vector2} 结果。
  49075. */
  49076. }, {
  49077. key: "normalize",
  49078. value: function normalize(out, v) {
  49079. var d = this.len(v);
  49080. if (d === 0) {
  49081. out[0] = 0;
  49082. out[1] = 0;
  49083. } else {
  49084. out[0] = v[0] / d;
  49085. out[1] = v[1] / d;
  49086. }
  49087. return out;
  49088. }
  49089. /**
  49090. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distance
  49091. * @description 计算向量间距离。
  49092. *
  49093. * @param {Vector2} v1 - 向量 v1。
  49094. * @param {Vector2} v2 - 向量 v2。
  49095. * @return {number} 向量间距离。
  49096. */
  49097. }, {
  49098. key: "distance",
  49099. value: function distance(v1, v2) {
  49100. return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));
  49101. }
  49102. /**
  49103. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distanceSquare
  49104. * @description 向量距离平方。
  49105. *
  49106. * @param {Vector2} v1 - 向量 v1。
  49107. * @param {Vector2} v2 - 向量 v2。
  49108. * @return {number} 向量距离平方。
  49109. */
  49110. }, {
  49111. key: "distanceSquare",
  49112. value: function distanceSquare(v1, v2) {
  49113. return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
  49114. }
  49115. /**
  49116. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.negate
  49117. * @description 求负向量。
  49118. *
  49119. * @param {Vector2} out - 基础向量。
  49120. * @param {Vector2} v - 向量 v。
  49121. * @return {Vector2} 负向量。
  49122. */
  49123. }, {
  49124. key: "negate",
  49125. value: function negate(out, v) {
  49126. out[0] = -v[0];
  49127. out[1] = -v[1];
  49128. return out;
  49129. }
  49130. /**
  49131. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lerp
  49132. * @description 两点之间线性插值。
  49133. *
  49134. * @param {Vector2} out - 基础向量。
  49135. * @param {Vector2} v1 - 向量 v1。
  49136. * @param {Vector2} v2 - 向量 v2。
  49137. * @param {number} t
  49138. * @return {Vector2} 结果。
  49139. */
  49140. }, {
  49141. key: "lerp",
  49142. value: function lerp(out, v1, v2, t) {
  49143. out[0] = v1[0] + t * (v2[0] - v1[0]);
  49144. out[1] = v1[1] + t * (v2[1] - v1[1]);
  49145. return out;
  49146. }
  49147. /**
  49148. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.applyTransform
  49149. * @description 矩阵左乘向量。
  49150. *
  49151. * @param {Vector2} out - 基础向量。
  49152. * @param {Vector2} v1 - 向量 v1。
  49153. * @param {Vector2} v2 - 向量 v2。
  49154. * @return {Vector2} 结果。
  49155. */
  49156. }, {
  49157. key: "applyTransform",
  49158. value: function applyTransform(out, v, m) {
  49159. var x = v[0];
  49160. var y = v[1];
  49161. out[0] = m[0] * x + m[2] * y + m[4];
  49162. out[1] = m[1] * x + m[3] * y + m[5];
  49163. return out;
  49164. }
  49165. /**
  49166. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.min
  49167. * @description 求两个向量最小值。
  49168. * @param {Vector2} out - 基础向量。
  49169. * @param {Vector2} v1 - 向量 v1。
  49170. * @param {Vector2} v2 - 向量 v2。
  49171. * @return {Vector2} 结果。
  49172. */
  49173. }, {
  49174. key: "min",
  49175. value: function min(out, v1, v2) {
  49176. out[0] = Math.min(v1[0], v2[0]);
  49177. out[1] = Math.min(v1[1], v2[1]);
  49178. return out;
  49179. }
  49180. /**
  49181. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.max
  49182. * @description 求两个向量最大值。
  49183. *
  49184. * @param {Vector2} out - 基础向量。
  49185. * @param {Vector2} v1 - 向量 v1。
  49186. * @param {Vector2} v2 - 向量 v2。
  49187. * @return {Vector2} 结果。
  49188. */
  49189. }, {
  49190. key: "max",
  49191. value: function max(out, v1, v2) {
  49192. out[0] = Math.max(v1[0], v2[0]);
  49193. out[1] = Math.max(v1[1], v2[1]);
  49194. return out;
  49195. }
  49196. /**
  49197. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.length
  49198. * @description 向量长度。
  49199. *
  49200. * @param {Vector2} v - 向量。
  49201. * @return {number} 向量长度。
  49202. */
  49203. }, {
  49204. key: "length",
  49205. value: function length(v) {
  49206. return this.len(v);
  49207. }
  49208. /**
  49209. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lengthSquare
  49210. * @description 向量长度平方。
  49211. *
  49212. * @param {Vector2} v - 向量。
  49213. * @return {number} 向量长度平方。
  49214. */
  49215. }, {
  49216. key: "lengthSquare",
  49217. value: function lengthSquare(v) {
  49218. return this.lenSquare(v);
  49219. }
  49220. /**
  49221. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.dist
  49222. * @description 计算向量间距离。
  49223. *
  49224. * @param {Vector2} v1 - 向量 v1。
  49225. * @param {Vector2} v2 - 向量 v2。
  49226. * @return {number} 向量间距离。
  49227. */
  49228. }, {
  49229. key: "dist",
  49230. value: function dist(v1, v2) {
  49231. return this.distance(v1, v2);
  49232. }
  49233. /**
  49234. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distSquare
  49235. * @description 向量距离平方。
  49236. *
  49237. * @param {Vector2} v1 - 向量 v1。
  49238. * @param {Vector2} v2 - 向量 v2。
  49239. * @return {number} 向量距离平方
  49240. */
  49241. }, {
  49242. key: "distSquare",
  49243. value: function distSquare(v1, v2) {
  49244. return this.distanceSquare(v1, v2);
  49245. }
  49246. }]);
  49247. return Vector;
  49248. }();
  49249. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Curve.js
  49250. function levelRenderer_Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49251. 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); } }
  49252. function Curve_createClass(Constructor, protoProps, staticProps) { if (protoProps) Curve_defineProperties(Constructor.prototype, protoProps); if (staticProps) Curve_defineProperties(Constructor, staticProps); return Constructor; }
  49253. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  49254. * This program are made available under the terms of the Apache License, Version 2.0
  49255. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49256. /**
  49257. * @class SuperMap.LevelRenderer.Tool.Curve
  49258. * @category Visualization Theme
  49259. * @classdesc LevelRenderer 工具-曲线
  49260. * @private
  49261. */
  49262. var Curve_Curve = /*#__PURE__*/function () {
  49263. /**
  49264. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.constructor
  49265. * @description 构造函数。
  49266. */
  49267. function Curve() {
  49268. levelRenderer_Curve_classCallCheck(this, Curve);
  49269. /**
  49270. * @member {SuperMap.LevelRenderer.Tool.Vector} SuperMap.LevelRenderer.Tool.Curve.prototype.vector
  49271. * @description 矢量工具。
  49272. */
  49273. this.vector = new levelRenderer_Vector_Vector();
  49274. /**
  49275. * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.EPSILON
  49276. * @description e。
  49277. */
  49278. this.EPSILON = 1e-4;
  49279. /**
  49280. * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.THREE_SQRT
  49281. * @description 3 的平方根。
  49282. */
  49283. this.THREE_SQRT = Math.sqrt(3);
  49284. /**
  49285. * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.ONE_THIRD
  49286. * @description 1/3。
  49287. */
  49288. this.ONE_THIRD = 1 / 3;
  49289. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Curve";
  49290. }
  49291. /*
  49292. * Method: evalCubicCoeff
  49293. *
  49294. * Parameters:
  49295. * a - {number} 值。
  49296. * b - {number} 值。
  49297. * c - {number} 值。
  49298. * d - {number} 值。
  49299. * t - {number} 值。
  49300. *
  49301. * Returns:
  49302. * {number}
  49303. */
  49304. /*
  49305. evalCubicCoeff: function(a, b, c, d, t){
  49306. return ((a * t + b) * t + c) * t + d;
  49307. },
  49308. */
  49309. /**
  49310. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.isAroundZero
  49311. * @description 判断一个值是否趋于0,判断参考值:1e-4。
  49312. * @param {number} val - 值。
  49313. * @returns {boolean} 值是否趋于0。
  49314. */
  49315. Curve_createClass(Curve, [{
  49316. key: "isAroundZero",
  49317. value: function isAroundZero(val) {
  49318. return val > -this.EPSILON && val < this.EPSILON;
  49319. }
  49320. /**
  49321. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.isNotAroundZero
  49322. * @description 判断一个值是否不趋于0,判断参考值:1e-4。
  49323. * @param {number} val - 值。
  49324. * @returns {boolean} 值是否不趋于0。
  49325. */
  49326. }, {
  49327. key: "isNotAroundZero",
  49328. value: function isNotAroundZero(val) {
  49329. return val > this.EPSILON || val < -this.EPSILON;
  49330. }
  49331. /**
  49332. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicAt
  49333. * @description 计算三次贝塞尔值
  49334. * @param {number} p0 - 点p0。
  49335. * @param {number} p1 - 点p1。
  49336. * @param {number} p2 - 点p2。
  49337. * @param {number} p3 - 点p3。
  49338. * @param {number} t - t值。
  49339. * @returns {number} 三次贝塞尔值。
  49340. */
  49341. }, {
  49342. key: "cubicAt",
  49343. value: function cubicAt(p0, p1, p2, p3, t) {
  49344. var onet = 1 - t;
  49345. return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2);
  49346. }
  49347. /**
  49348. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicDerivativeAt
  49349. * @description 计算三次贝塞尔导数值
  49350. * @param {number} p0 - 点p0。
  49351. * @param {number} p1 - 点p1。
  49352. * @param {number} p2 - 点p2。
  49353. * @param {number} p3 - 点p3。
  49354. * @param {number} t - t值。
  49355. * @returns {number} 三次贝塞尔导数值。
  49356. */
  49357. }, {
  49358. key: "cubicDerivativeAt",
  49359. value: function cubicDerivativeAt(p0, p1, p2, p3, t) {
  49360. var onet = 1 - t;
  49361. return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t);
  49362. }
  49363. /**
  49364. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicRootAt
  49365. * @description 计算三次贝塞尔方程根,使用盛金公式
  49366. * @param {number} p0 - 点p0。
  49367. * @param {number} p1 - 点p1。
  49368. * @param {number} p2 - 点p2。
  49369. * @param {number} p3 - 点p3。
  49370. * @param {number} val - 值。
  49371. * @param {Array.<number>} roots - 有效根数目。
  49372. * @returns {number} 有效根。
  49373. */
  49374. }, {
  49375. key: "cubicRootAt",
  49376. value: function cubicRootAt(p0, p1, p2, p3, val, roots) {
  49377. // Evaluate roots of cubic functions
  49378. var a = p3 + 3 * (p1 - p2) - p0;
  49379. var b = 3 * (p2 - p1 * 2 + p0);
  49380. var c = 3 * (p1 - p0);
  49381. var d = p0 - val;
  49382. var A = b * b - 3 * a * c;
  49383. var B = b * c - 9 * a * d;
  49384. var C = c * c - 3 * b * d;
  49385. var n = 0;
  49386. if (this.isAroundZero(A) && this.isAroundZero(B)) {
  49387. if (this.isAroundZero(b)) {
  49388. roots[0] = 0;
  49389. } else {
  49390. var t1 = -c / b; //t1, t2, t3, b is not zero
  49391. if (t1 >= 0 && t1 <= 1) {
  49392. roots[n++] = t1;
  49393. }
  49394. }
  49395. } else {
  49396. var disc = B * B - 4 * A * C;
  49397. if (this.isAroundZero(disc)) {
  49398. var K = B / A;
  49399. var _t2 = -b / a + K; // t1, a is not zero
  49400. var t2 = -K / 2; // t2, t3
  49401. if (_t2 >= 0 && _t2 <= 1) {
  49402. roots[n++] = _t2;
  49403. }
  49404. if (t2 >= 0 && t2 <= 1) {
  49405. roots[n++] = t2;
  49406. }
  49407. } else if (disc > 0) {
  49408. var discSqrt = Math.sqrt(disc);
  49409. var Y1 = A * b + 1.5 * a * (-B + discSqrt);
  49410. var Y2 = A * b + 1.5 * a * (-B - discSqrt);
  49411. if (Y1 < 0) {
  49412. Y1 = -Math.pow(-Y1, this.ONE_THIRD);
  49413. } else {
  49414. Y1 = Math.pow(Y1, this.ONE_THIRD);
  49415. }
  49416. if (Y2 < 0) {
  49417. Y2 = -Math.pow(-Y2, this.ONE_THIRD);
  49418. } else {
  49419. Y2 = Math.pow(Y2, this.ONE_THIRD);
  49420. }
  49421. var _t3 = (-b - (Y1 + Y2)) / (3 * a);
  49422. if (_t3 >= 0 && _t3 <= 1) {
  49423. roots[n++] = _t3;
  49424. }
  49425. } else {
  49426. var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A));
  49427. var theta = Math.acos(T) / 3;
  49428. var ASqrt = Math.sqrt(A);
  49429. var tmp = Math.cos(theta);
  49430. var _t4 = (-b - 2 * ASqrt * tmp) / (3 * a);
  49431. var _t5 = (-b + ASqrt * (tmp + this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  49432. var t3 = (-b + ASqrt * (tmp - this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  49433. if (_t4 >= 0 && _t4 <= 1) {
  49434. roots[n++] = _t4;
  49435. }
  49436. if (_t5 >= 0 && _t5 <= 1) {
  49437. roots[n++] = _t5;
  49438. }
  49439. if (t3 >= 0 && t3 <= 1) {
  49440. roots[n++] = t3;
  49441. }
  49442. }
  49443. }
  49444. return n;
  49445. }
  49446. /**
  49447. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicRootAt
  49448. * @description 计算三次贝塞尔方程极限值的位置
  49449. * @param {number} p0 - 点p0。
  49450. * @param {number} p1 - 点p1。
  49451. * @param {number} p2 - 点p2。
  49452. * @param {number} p3 - 点p3。
  49453. * @param {Array.<number>} extrema - 值。
  49454. * @returns {number} 有效数目。
  49455. */
  49456. }, {
  49457. key: "cubicExtrema",
  49458. value: function cubicExtrema(p0, p1, p2, p3, extrema) {
  49459. var b = 6 * p2 - 12 * p1 + 6 * p0;
  49460. var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;
  49461. var c = 3 * p1 - 3 * p0;
  49462. var n = 0;
  49463. if (this.isAroundZero(a)) {
  49464. if (this.isNotAroundZero(b)) {
  49465. var t1 = -c / b;
  49466. if (t1 >= 0 && t1 <= 1) {
  49467. extrema[n++] = t1;
  49468. }
  49469. }
  49470. } else {
  49471. var disc = b * b - 4 * a * c;
  49472. if (this.isAroundZero(disc)) {
  49473. extrema[0] = -b / (2 * a);
  49474. } else if (disc > 0) {
  49475. var discSqrt = Math.sqrt(disc);
  49476. var _t6 = (-b + discSqrt) / (2 * a);
  49477. var t2 = (-b - discSqrt) / (2 * a);
  49478. if (_t6 >= 0 && _t6 <= 1) {
  49479. extrema[n++] = _t6;
  49480. }
  49481. if (t2 >= 0 && t2 <= 1) {
  49482. extrema[n++] = t2;
  49483. }
  49484. }
  49485. }
  49486. return n;
  49487. }
  49488. /**
  49489. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicSubdivide
  49490. * @description 细分三次贝塞尔曲线
  49491. * @param {number} p0 - 点p0。
  49492. * @param {number} p1 - 点p1。
  49493. * @param {number} p2 - 点p2。
  49494. * @param {number} p3 - 点p3。
  49495. * @param {number} t - t值。
  49496. * @param {Array.<number>} out - 投射点。
  49497. * @returns {number} 投射点。
  49498. */
  49499. }, {
  49500. key: "cubicSubdivide",
  49501. value: function cubicSubdivide(p0, p1, p2, p3, t, out) {
  49502. var p01 = (p1 - p0) * t + p0;
  49503. var p12 = (p2 - p1) * t + p1;
  49504. var p23 = (p3 - p2) * t + p2;
  49505. var p012 = (p12 - p01) * t + p01;
  49506. var p123 = (p23 - p12) * t + p12;
  49507. var p0123 = (p123 - p012) * t + p012; // Seg0
  49508. out[0] = p0;
  49509. out[1] = p01;
  49510. out[2] = p012;
  49511. out[3] = p0123; // Seg1
  49512. out[4] = p0123;
  49513. out[5] = p123;
  49514. out[6] = p23;
  49515. out[7] = p3;
  49516. }
  49517. /**
  49518. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicProjectPoint
  49519. * @description 投射点到三次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  49520. * @param {number} x0 - 点p0横坐标。
  49521. * @param {number} y0 - 点p0纵坐标。
  49522. * @param {number} x1 - 点p1横坐标。
  49523. * @param {number} y1 - 点p1纵坐标。
  49524. * @param {number} x2 - 点p2横坐标。
  49525. * @param {number} y2 - 点p2纵坐标。
  49526. * @param {number} x3 - 点p3横坐标。
  49527. * @param {number} y3 - 点p3纵坐标。
  49528. * @param {number} x - 点p横坐标。
  49529. * @param {number} y - 点p纵坐标。
  49530. * @param {Array.<number>} out - 投射点。
  49531. * @returns {number} 投射点。
  49532. */
  49533. }, {
  49534. key: "cubicProjectPoint",
  49535. value: function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {
  49536. // 临时变量
  49537. var _v0 = this.vector.create();
  49538. var _v1 = this.vector.create();
  49539. var _v2 = this.vector.create(); // var _v3 = vector.create();
  49540. // http://pomax.github.io/bezierinfo/#projections
  49541. var t;
  49542. var interval = 0.005;
  49543. var d = Infinity;
  49544. _v0[0] = x;
  49545. _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值
  49546. // PENDING
  49547. for (var _t = 0; _t < 1; _t += 0.05) {
  49548. _v1[0] = this.cubicAt(x0, x1, x2, x3, _t);
  49549. _v1[1] = this.cubicAt(y0, y1, y2, y3, _t);
  49550. var d1 = this.vector.distSquare(_v0, _v1);
  49551. if (d1 < d) {
  49552. t = _t;
  49553. d = d1;
  49554. }
  49555. }
  49556. d = Infinity; // At most 32 iteration
  49557. for (var i = 0; i < 32; i++) {
  49558. if (interval < this.EPSILON) {
  49559. break;
  49560. }
  49561. var prev = t - interval;
  49562. var next = t + interval; // t - interval
  49563. _v1[0] = this.cubicAt(x0, x1, x2, x3, prev);
  49564. _v1[1] = this.cubicAt(y0, y1, y2, y3, prev);
  49565. var _d = this.vector.distSquare(_v1, _v0);
  49566. if (prev >= 0 && _d < d) {
  49567. t = prev;
  49568. d = _d;
  49569. } else {
  49570. // t + interval
  49571. _v2[0] = this.cubicAt(x0, x1, x2, x3, next);
  49572. _v2[1] = this.cubicAt(y0, y1, y2, y3, next);
  49573. var d2 = this.vector.distSquare(_v2, _v0);
  49574. if (next <= 1 && d2 < d) {
  49575. t = next;
  49576. d = d2;
  49577. } else {
  49578. interval *= 0.5;
  49579. }
  49580. }
  49581. } // t
  49582. if (out) {
  49583. out[0] = this.cubicAt(x0, x1, x2, x3, t);
  49584. out[1] = this.cubicAt(y0, y1, y2, y3, t);
  49585. } // console.log(interval, i);
  49586. return Math.sqrt(d);
  49587. }
  49588. /**
  49589. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticAt
  49590. * @description 计算二次方贝塞尔值。
  49591. * @param {number} p0 - 点p0。
  49592. * @param {number} p1 - 点p1。
  49593. * @param {number} p2 - 点p2。
  49594. * @param {number} t - t值。
  49595. * @returns {number} 二次方贝塞尔值。
  49596. */
  49597. }, {
  49598. key: "quadraticAt",
  49599. value: function quadraticAt(p0, p1, p2, t) {
  49600. var onet = 1 - t;
  49601. return onet * (onet * p0 + 2 * t * p1) + t * t * p2;
  49602. }
  49603. /**
  49604. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticAt
  49605. * @description 计算二次方贝塞尔导数值。
  49606. * @param {number} p0 - 点p0。
  49607. * @param {number} p1 - 点p1。
  49608. * @param {number} p2 - 点p2。
  49609. * @param {number} t - t值。
  49610. * @returns {number} 二次方贝塞尔导数值。
  49611. */
  49612. }, {
  49613. key: "quadraticDerivativeAt",
  49614. value: function quadraticDerivativeAt(p0, p1, p2, t) {
  49615. return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));
  49616. }
  49617. /**
  49618. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticRootAt
  49619. * @description 计算二次方贝塞尔方程根
  49620. * @param {number} p0 - 点p0。
  49621. * @param {number} p1 - 点p1。
  49622. * @param {number} p2 - 点p2。
  49623. * @param {number} val - 值。
  49624. * @param {Array.<number>} roots - 有效根数目。
  49625. * @returns {number} 有效根数目。
  49626. */
  49627. }, {
  49628. key: "quadraticRootAt",
  49629. value: function quadraticRootAt(p0, p1, p2, val, roots) {
  49630. var a = p0 - 2 * p1 + p2;
  49631. var b = 2 * (p1 - p0);
  49632. var c = p0 - val;
  49633. var n = 0;
  49634. if (this.isAroundZero(a)) {
  49635. if (this.isNotAroundZero(b)) {
  49636. var t1 = -c / b;
  49637. if (t1 >= 0 && t1 <= 1) {
  49638. roots[n++] = t1;
  49639. }
  49640. }
  49641. } else {
  49642. var disc = b * b - 4 * a * c;
  49643. if (this.isAroundZero(disc)) {
  49644. var _t7 = -b / (2 * a);
  49645. if (_t7 >= 0 && _t7 <= 1) {
  49646. roots[n++] = _t7;
  49647. }
  49648. } else if (disc > 0) {
  49649. var discSqrt = Math.sqrt(disc);
  49650. var _t8 = (-b + discSqrt) / (2 * a);
  49651. var t2 = (-b - discSqrt) / (2 * a);
  49652. if (_t8 >= 0 && _t8 <= 1) {
  49653. roots[n++] = _t8;
  49654. }
  49655. if (t2 >= 0 && t2 <= 1) {
  49656. roots[n++] = t2;
  49657. }
  49658. }
  49659. }
  49660. return n;
  49661. }
  49662. /**
  49663. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticExtremum
  49664. * @description 计算二次贝塞尔方程极限值
  49665. * @param {number} p0 - 点p0。
  49666. * @param {number} p1 - 点p1。
  49667. * @param {number} p2 - 点p2。
  49668. * @returns {number} 二次贝塞尔方程极限值。
  49669. */
  49670. }, {
  49671. key: "quadraticExtremum",
  49672. value: function quadraticExtremum(p0, p1, p2) {
  49673. var divider = p0 + p2 - 2 * p1;
  49674. if (divider === 0) {
  49675. // p1 is center of p0 and p2
  49676. return 0.5;
  49677. } else {
  49678. return (p0 - p1) / divider;
  49679. }
  49680. }
  49681. /**
  49682. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticProjectPoint
  49683. * @description 投射点到二次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  49684. * @param {number} x0 - 点p0横坐标。
  49685. * @param {number} y0 - 点p0纵坐标。
  49686. * @param {number} x1 - 点p1横坐标。
  49687. * @param {number} y1 - 点p1纵坐标。
  49688. * @param {number} x2 - 点p2横坐标。
  49689. * @param {number} y2 - 点p2纵坐标。
  49690. * @param {number} x - 点p横坐标。
  49691. * @param {number} y - 点p纵坐标。
  49692. * @param {Array.<number>} out - 投射点。
  49693. * @returns {number} 投射距离。
  49694. */
  49695. }, {
  49696. key: "quadraticProjectPoint",
  49697. value: function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {
  49698. // 临时变量
  49699. var _v0 = this.vector.create();
  49700. var _v1 = this.vector.create();
  49701. var _v2 = this.vector.create(); // http://pomax.github.io/bezierinfo/#projections
  49702. var t;
  49703. var interval = 0.005;
  49704. var d = Infinity;
  49705. _v0[0] = x;
  49706. _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值
  49707. // PENDING
  49708. for (var _t = 0; _t < 1; _t += 0.05) {
  49709. _v1[0] = this.quadraticAt(x0, x1, x2, _t);
  49710. _v1[1] = this.quadraticAt(y0, y1, y2, _t);
  49711. var d1 = this.vector.distSquare(_v0, _v1);
  49712. if (d1 < d) {
  49713. t = _t;
  49714. d = d1;
  49715. }
  49716. }
  49717. d = Infinity; // At most 32 iteration
  49718. for (var i = 0; i < 32; i++) {
  49719. if (interval < this.EPSILON) {
  49720. break;
  49721. }
  49722. var prev = t - interval;
  49723. var next = t + interval; // t - interval
  49724. _v1[0] = this.quadraticAt(x0, x1, x2, prev);
  49725. _v1[1] = this.quadraticAt(y0, y1, y2, prev);
  49726. var _d2 = this.vector.distSquare(_v1, _v0);
  49727. if (prev >= 0 && _d2 < d) {
  49728. t = prev;
  49729. d = _d2;
  49730. } else {
  49731. // t + interval
  49732. _v2[0] = this.quadraticAt(x0, x1, x2, next);
  49733. _v2[1] = this.quadraticAt(y0, y1, y2, next);
  49734. var d2 = this.vector.distSquare(_v2, _v0);
  49735. if (next <= 1 && d2 < d) {
  49736. t = next;
  49737. d = d2;
  49738. } else {
  49739. interval *= 0.5;
  49740. }
  49741. }
  49742. } // t
  49743. if (out) {
  49744. out[0] = this.quadraticAt(x0, x1, x2, t);
  49745. out[1] = this.quadraticAt(y0, y1, y2, t);
  49746. } // console.log(interval, i);
  49747. return Math.sqrt(d);
  49748. }
  49749. }]);
  49750. return Curve;
  49751. }();
  49752. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Area.js
  49753. function Area_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49754. 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); } }
  49755. function Area_createClass(Constructor, protoProps, staticProps) { if (protoProps) Area_defineProperties(Constructor.prototype, protoProps); if (staticProps) Area_defineProperties(Constructor, staticProps); return Constructor; }
  49756. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  49757. * This program are made available under the terms of the Apache License, Version 2.0
  49758. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49759. /**
  49760. * @class SuperMap.LevelRenderer.Tool.Area
  49761. * @category Visualization Theme
  49762. * @classdesc LevelRenderer 工具-图形范围判断
  49763. * @private
  49764. */
  49765. var Area = /*#__PURE__*/function () {
  49766. /**
  49767. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.constructor
  49768. * @description 构造函数。
  49769. */
  49770. function Area() {
  49771. Area_classCallCheck(this, Area);
  49772. /**
  49773. * @member {SuperMap.LevelRenderer.Tool.Util} SuperMap.LevelRenderer.Tool.Areal.prototype.util
  49774. * @description 基础工具对象。
  49775. */
  49776. this.util = new Util_Util();
  49777. /**
  49778. * @member {SuperMap.LevelRenderer.Tool.Curve} SuperMap.LevelRenderer.Tool.Areal.prototype.curve
  49779. * @description 曲线工具对象
  49780. */
  49781. this.curve = new Curve_Curve();
  49782. /**
  49783. * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._ctx
  49784. * @description Cavans2D 渲染上下文
  49785. */
  49786. this._ctx = null;
  49787. /**
  49788. * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._textWidthCache
  49789. * @description 文本宽度缓存
  49790. */
  49791. this._textWidthCache = {};
  49792. /**
  49793. * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._textHeightCache
  49794. * @description 文本高度缓存
  49795. */
  49796. this._textHeightCache = {};
  49797. /**
  49798. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype._textWidthCacheCounter
  49799. * @description 文本宽度缓存数量
  49800. */
  49801. this._textWidthCacheCounter = 0;
  49802. /**
  49803. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype._textHeightCacheCounter
  49804. * @description 文本高度缓存数量
  49805. */
  49806. this._textHeightCacheCounter = 0;
  49807. /**
  49808. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype.TEXT_CACHE_MAX
  49809. * @description 文本最大缓存数量
  49810. */
  49811. this.TEXT_CACHE_MAX = 5000;
  49812. /**
  49813. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype.PI2
  49814. * @description 2*PI 的值
  49815. */
  49816. this.PI2 = Math.PI * 2;
  49817. /**
  49818. * @member {Array} SuperMap.LevelRenderer.Tool.Areal.prototype.roots
  49819. * @description 临时数组
  49820. */
  49821. this.roots = [-1, -1, -1];
  49822. /**
  49823. * @member {Array} SuperMap.LevelRenderer.Tool.Areal.prototype.extrema
  49824. * @description 临时数组
  49825. */
  49826. this.extrema = [-1, -1];
  49827. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Area";
  49828. }
  49829. /**
  49830. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.normalizeRadian
  49831. * @description 弧度标准化函数。
  49832. * @param {number} angle - 弧度值。
  49833. * @returns {number} 标准化后的弧度值。
  49834. */
  49835. Area_createClass(Area, [{
  49836. key: "normalizeRadian",
  49837. value: function normalizeRadian(angle) {
  49838. angle %= this.PI2;
  49839. if (angle < 0) {
  49840. angle += this.PI2;
  49841. }
  49842. return angle;
  49843. }
  49844. /**
  49845. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInside
  49846. * @description 包含判断。
  49847. * @param {Object} shape - 图形。
  49848. * @param {number} area - 目标区域。
  49849. * @param {number} x - 横坐标。
  49850. * @param {number} y - 纵坐标。
  49851. * @returns {boolean} 图形是否包含鼠标位置。
  49852. */
  49853. }, {
  49854. key: "isInside",
  49855. value: function isInside(shape, area, x, y) {
  49856. if (!area || !shape) {
  49857. // 无参数或不支持类型
  49858. return false;
  49859. }
  49860. var zoneType = shape.type;
  49861. this._ctx = this._ctx || this.util.getContext(); // 未实现或不可用时则数学运算,主要是line,brokenLine,ring
  49862. var _mathReturn = this._mathMethod(shape, area, x, y);
  49863. if (typeof _mathReturn != 'undefined') {
  49864. return _mathReturn;
  49865. }
  49866. if (shape.buildPath && this._ctx.isPointInPath) {
  49867. return this._buildPathMethod(shape, this._ctx, area, x, y);
  49868. } // 上面的方法都行不通时
  49869. switch (zoneType) {
  49870. case 'ellipse': // Todo,不精确
  49871. case 'smicellipse':
  49872. // Todo,不精确
  49873. return true;
  49874. // 旋轮曲线 不准确
  49875. case 'trochoid':
  49876. var _r = area.location == 'out' ? area.r1 + area.r2 + area.d : area.r1 - area.r2 + area.d;
  49877. return this.isInsideCircle(area, x, y, _r);
  49878. // 玫瑰线 不准确
  49879. case 'rose':
  49880. return this.isInsideCircle(area, x, y, area.maxr);
  49881. // 路径,椭圆,曲线等-----------------13
  49882. default:
  49883. return false;
  49884. // Todo,暂不支持
  49885. }
  49886. }
  49887. /**
  49888. * @function SuperMap.LevelRenderer.Tool.Areal.prototype._mathMethod
  49889. * @description 包含判断。用数学方法判断,三个方法中最快,但是支持的shape少。
  49890. * @param {Object} shape - 图形。
  49891. * @param {number} area - 目标区域。
  49892. * @param {number} x - 横坐标。
  49893. * @param {number} y - 纵坐标。
  49894. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  49895. */
  49896. }, {
  49897. key: "_mathMethod",
  49898. value: function _mathMethod(shape, area, x, y) {
  49899. var zoneType = shape.type; // 在矩形内则部分图形需要进一步判断
  49900. switch (zoneType) {
  49901. // 贝塞尔曲线
  49902. case 'bezier-curve':
  49903. if (typeof area.cpX2 === 'undefined') {
  49904. return this.isInsideQuadraticStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.xEnd, area.yEnd, area.lineWidth, x, y);
  49905. }
  49906. return this.isInsideCubicStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.cpX2, area.cpY2, area.xEnd, area.yEnd, area.lineWidth, x, y);
  49907. // 线
  49908. case 'line':
  49909. return this.isInsideLine(area.xStart, area.yStart, area.xEnd, area.yEnd, area.lineWidth, x, y);
  49910. // 折线
  49911. case 'broken-line':
  49912. return this.isInsideBrokenLine(area.pointList, area.lineWidth, x, y);
  49913. // 扩展折线
  49914. case 'smicbroken-line':
  49915. {
  49916. // SMIC-修改 - start
  49917. var icX = x;
  49918. var icY = y;
  49919. if (shape.refOriginalPosition) {
  49920. icX = x - shape.refOriginalPosition[0];
  49921. icY = y - shape.refOriginalPosition[1];
  49922. }
  49923. return this.isInsideBrokenLine(area.pointList, area.lineWidth, icX, icY);
  49924. }
  49925. //初始代码:
  49926. // return isInsideBrokenLine(
  49927. // area.pointList, area.lineWidth, x, y
  49928. // );
  49929. // SMIC-修改 - end
  49930. // 圆环
  49931. case 'ring':
  49932. return this.isInsideRing(area.x, area.y, area.r0, area.r, x, y);
  49933. case 'smicring':
  49934. {
  49935. var areaX = area.x;
  49936. var areaY = area.y;
  49937. if (shape.refOriginalPosition) {
  49938. areaX = area.x + shape.refOriginalPosition[0];
  49939. areaY = area.y + shape.refOriginalPosition[1];
  49940. }
  49941. return this.isInsideRing(areaX, areaY, area.r0, area.r, x, y);
  49942. }
  49943. // 圆形
  49944. case 'circle':
  49945. return this.isInsideCircle(area.x, area.y, area.r, x, y);
  49946. // 扩展-点
  49947. case 'smicpoint':
  49948. {
  49949. // SMIC-修改 - start
  49950. var _icX = x;
  49951. var _icY = y;
  49952. if (shape.refOriginalPosition) {
  49953. _icX = x - shape.refOriginalPosition[0];
  49954. _icY = y - shape.refOriginalPosition[1];
  49955. }
  49956. return this.isInsideCircle(area.x, area.y, area.r, _icX, _icY);
  49957. }
  49958. //初始代码:
  49959. // 无
  49960. // SMIC-修改 - end
  49961. // 扇形
  49962. case 'sector':
  49963. {
  49964. var startAngle = area.startAngle * Math.PI / 180;
  49965. var endAngle = area.endAngle * Math.PI / 180;
  49966. if (!area.clockWise) {
  49967. startAngle = -startAngle;
  49968. endAngle = -endAngle;
  49969. }
  49970. return this.isInsideSector(area.x, area.y, area.r0, area.r, startAngle, endAngle, !area.clockWise, x, y);
  49971. }
  49972. //初始代码:
  49973. // 无
  49974. // SMIC-增加 - end
  49975. // 扇形
  49976. case 'smicsector':
  49977. {
  49978. var _startAngle = area.startAngle * Math.PI / 180;
  49979. var _endAngle = area.endAngle * Math.PI / 180;
  49980. if (!area.clockWise) {
  49981. _startAngle = -_startAngle;
  49982. _endAngle = -_endAngle;
  49983. }
  49984. var _areaX = area.x;
  49985. var _areaY = area.y;
  49986. if (shape.refOriginalPosition) {
  49987. _areaX = area.x + shape.refOriginalPosition[0];
  49988. _areaY = area.y + shape.refOriginalPosition[1];
  49989. }
  49990. return this.isInsideSector(_areaX, _areaY, area.r0, area.r, _startAngle, _endAngle, !area.clockWise, x, y);
  49991. }
  49992. // 多边形
  49993. case 'path':
  49994. return this.isInsidePath(area.pathArray, Math.max(area.lineWidth, 5), area.brushType, x, y);
  49995. case 'polygon':
  49996. case 'star':
  49997. case 'smicstar':
  49998. case 'isogon':
  49999. case 'smicisogon':
  50000. return this.isInsidePolygon(area.pointList, x, y);
  50001. // 扩展多边形
  50002. case 'smicpolygon':
  50003. {
  50004. // SMIC-修改 - start
  50005. var _icX2 = x;
  50006. var _icY2 = y;
  50007. if (shape.refOriginalPosition) {
  50008. _icX2 = x - shape.refOriginalPosition[0];
  50009. _icY2 = y - shape.refOriginalPosition[1];
  50010. } //岛洞面
  50011. if (shape.holePolygonPointLists && shape.holePolygonPointLists.length > 0) {
  50012. var isOnBase = this.isInsidePolygon(area.pointList, _icX2, _icY2); // 遍历岛洞子面
  50013. var holePLS = shape.holePolygonPointLists;
  50014. var isOnHole = false;
  50015. for (var i = 0, holePLSen = holePLS.length; i < holePLSen; i++) {
  50016. var holePL = holePLS[i];
  50017. var isOnSubHole = this.isInsidePolygon(holePL, _icX2, _icY2);
  50018. if (isOnSubHole === true) {
  50019. isOnHole = true;
  50020. }
  50021. } // 捕获判断
  50022. return isOnBase === true && isOnHole === false;
  50023. } else {
  50024. return this.isInsidePolygon(area.pointList, _icX2, _icY2);
  50025. }
  50026. }
  50027. // 初始代码:
  50028. // 无
  50029. // SMIC-修改 - end
  50030. // 文本
  50031. case 'text':
  50032. var rect = area.__rect || shape.getRect(area);
  50033. return this.isInsideRect(rect.x, rect.y, rect.width, rect.height, x, y);
  50034. // 扩展文本
  50035. case 'smictext':
  50036. //用文本背景矩形判断
  50037. var textBg = shape.getTextBackground(area);
  50038. return this.isInsidePolygon(textBg, x, y);
  50039. //初始代码:
  50040. // 无
  50041. // SMIC-修改 - end
  50042. // 矩形
  50043. case 'rectangle':
  50044. case 'image':
  50045. // 图片
  50046. return this.isInsideRect(area.x, area.y, area.width, area.height, x, y);
  50047. case 'smicimage':
  50048. {
  50049. var _areaX2 = area.x;
  50050. var _areaY2 = area.y;
  50051. if (shape.refOriginalPosition) {
  50052. _areaX2 = area.x + shape.refOriginalPosition[0];
  50053. _areaY2 = area.y + shape.refOriginalPosition[1];
  50054. }
  50055. return this.isInsideRect(_areaX2, _areaY2, area.width, area.height, x, y);
  50056. }
  50057. //// 扩展矩形
  50058. //case 'smicpolygon':
  50059. // // SMIC-修改 - start
  50060. // var icX = x;
  50061. // var icY = y;
  50062. // if(shape.refOriginalPosition) {
  50063. // icX = x - shape.refOriginalPosition[0];
  50064. // icY = y - shape.refOriginalPosition[1];
  50065. // }
  50066. // return this.isInsideRect(
  50067. // area.x, area.y, area.width, area.height, icX, icY
  50068. // );
  50069. //初始代码:
  50070. // 无
  50071. // SMIC-修改 - end
  50072. }
  50073. }
  50074. /**
  50075. * @function SuperMap.LevelRenderer.Tool.Areal.prototype._buildPathMethod
  50076. * @description 包含判断。通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的 shape。
  50077. * @param {Object} shape - 图形。
  50078. * @param {Object} context - 上下文。
  50079. * @param {number} area - 目标区域。
  50080. * @param {number} x - 横坐标。
  50081. * @param {number} y - 纵坐标。
  50082. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  50083. */
  50084. }, {
  50085. key: "_buildPathMethod",
  50086. value: function _buildPathMethod(shape, context, area, x, y) {
  50087. // 图形类实现路径创建了则用类的path
  50088. context.beginPath();
  50089. shape.buildPath(context, area);
  50090. context.closePath();
  50091. return context.isPointInPath(x, y);
  50092. }
  50093. /**
  50094. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isOutside
  50095. * @description 图形是否不包含鼠标位置。
  50096. * @param {Object} shape - 图形。
  50097. * @param {number} area - 目标区域。
  50098. * @param {number} x - 横坐标。
  50099. * @param {number} y - 纵坐标。
  50100. * @returns {boolean} 图形是否不包含鼠标位置, true表示坐标处在图形外。
  50101. */
  50102. }, {
  50103. key: "isOutside",
  50104. value: function isOutside(shape, area, x, y) {
  50105. return !this.isInside(shape, area, x, y);
  50106. }
  50107. /**
  50108. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideLine
  50109. * @description 线段包含判断。
  50110. * @param {number} x0 - 线起始点横坐标。
  50111. * @param {number} y0 - 线起始点纵坐标。
  50112. * @param {number} x1 - 线终点横坐标。
  50113. * @param {number} y1 - 线终点纵坐标。
  50114. * @param {number} lineWidth - 线宽。
  50115. * @param {number} x - 鼠标位置横坐标。
  50116. * @param {number} y - 鼠标位置纵坐标。
  50117. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形内。
  50118. */
  50119. }, {
  50120. key: "isInsideLine",
  50121. value: function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) {
  50122. if (lineWidth === 0) {
  50123. return false;
  50124. }
  50125. var _l = Math.max(lineWidth, 5);
  50126. var _a = 0;
  50127. var _b = 0; // Quick reject
  50128. 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) {
  50129. return false;
  50130. }
  50131. if (x0 !== x1) {
  50132. _a = (y0 - y1) / (x0 - x1);
  50133. _b = (x0 * y1 - x1 * y0) / (x0 - x1);
  50134. } else {
  50135. return Math.abs(x - x0) <= _l / 2;
  50136. }
  50137. var tmp = _a * x - y + _b;
  50138. var _s = tmp * tmp / (_a * _a + 1);
  50139. return _s <= _l / 2 * _l / 2;
  50140. }
  50141. /**
  50142. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideCubicStroke
  50143. * @description 三次贝塞尔曲线描边包含判断。
  50144. * @param {number} x0 - 点1横坐标。
  50145. * @param {number} y0 - 点1纵坐标。
  50146. * @param {number} x1 - 点2横坐标。
  50147. * @param {number} y1 - 点2纵坐标。
  50148. * @param {number} x2 - 点3纵坐标。
  50149. * @param {number} y2 - 点3纵坐标。
  50150. * @param {number} lineWidth - 线宽。
  50151. * @param {number} x - 鼠标位置横坐标。
  50152. * @param {number} y - 鼠标位置纵坐标。
  50153. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  50154. */
  50155. }, {
  50156. key: "isInsideCubicStroke",
  50157. value: function isInsideCubicStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
  50158. if (lineWidth === 0) {
  50159. return false;
  50160. }
  50161. var _l = Math.max(lineWidth, 5); // Quick reject
  50162. 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) {
  50163. return false;
  50164. }
  50165. var d = this.curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);
  50166. return d <= _l / 2;
  50167. }
  50168. /**
  50169. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideQuadraticStroke
  50170. * @description 二次贝塞尔曲线描边包含判断。
  50171. * @param {number} x0 - 点1横坐标。
  50172. * @param {number} y0 - 点1纵坐标。
  50173. * @param {number} x1 - 点2横坐标。
  50174. * @param {number} y1 - 点2纵坐标。
  50175. * @param {number} x2 - 点3纵坐标。
  50176. * @param {number} y2 - 点3纵坐标。
  50177. * @param {number} lineWidth - 线宽。
  50178. * @param {number} x - 鼠标位置横坐标。
  50179. * @param {number} y - 鼠标位置纵坐标。
  50180. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  50181. */
  50182. }, {
  50183. key: "isInsideQuadraticStroke",
  50184. value: function isInsideQuadraticStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
  50185. if (lineWidth === 0) {
  50186. return false;
  50187. }
  50188. var _l = Math.max(lineWidth, 5); // Quick reject
  50189. 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) {
  50190. return false;
  50191. }
  50192. var d = this.curve.quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);
  50193. return d <= _l / 2;
  50194. }
  50195. /**
  50196. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideArcStroke
  50197. * @description 圆弧描边包含判断。
  50198. * @param {number} cx - 圆心横坐标。
  50199. * @param {number} cy - 圆心纵坐标。
  50200. * @param {number} r - 圆半径。
  50201. * @param {number} startAngle - 起始角度。
  50202. * @param {number} endAngle - 终止角度。
  50203. * @param {number} anticlockwise - 顺时针还是逆时针。
  50204. * @param {number} lineWidth - 线宽。
  50205. * @param {number} x - 鼠标位置横坐标。
  50206. * @param {number} y - 鼠标位置纵坐标。
  50207. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  50208. */
  50209. }, {
  50210. key: "isInsideArcStroke",
  50211. value: function isInsideArcStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {
  50212. var PI2 = this.PI2;
  50213. if (lineWidth === 0) {
  50214. return false;
  50215. }
  50216. var _l = Math.max(lineWidth, 5);
  50217. x -= cx;
  50218. y -= cy;
  50219. var d = Math.sqrt(x * x + y * y);
  50220. if (d - _l > r || d + _l < r) {
  50221. return false;
  50222. }
  50223. if (Math.abs(startAngle - endAngle) >= PI2) {
  50224. // Is a circle
  50225. return true;
  50226. }
  50227. if (anticlockwise) {
  50228. var tmp = startAngle;
  50229. startAngle = this.normalizeRadian(endAngle);
  50230. endAngle = this.normalizeRadian(tmp);
  50231. } else {
  50232. startAngle = this.normalizeRadian(startAngle);
  50233. endAngle = this.normalizeRadian(endAngle);
  50234. }
  50235. if (startAngle > endAngle) {
  50236. endAngle += PI2;
  50237. }
  50238. var angle = Math.atan2(y, x);
  50239. if (angle < 0) {
  50240. angle += PI2;
  50241. }
  50242. return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle;
  50243. }
  50244. /**
  50245. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideBrokenLine
  50246. * @description 图形 BrokenLine 是否包含鼠标位置, true表示坐标处在图形内。
  50247. * @param {Array} points - 曲线点对象。
  50248. * @param {number} lineWidth - 线宽。
  50249. * @param {number} x - 鼠标位置横坐标。
  50250. * @param {number} y - 鼠标位置纵坐标。
  50251. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  50252. */
  50253. }, {
  50254. key: "isInsideBrokenLine",
  50255. value: function isInsideBrokenLine(points, lineWidth, x, y) {
  50256. var _lineWidth = Math.max(lineWidth, 10);
  50257. for (var i = 0, l = points.length - 1; i < l; i++) {
  50258. var x0 = points[i][0];
  50259. var y0 = points[i][1];
  50260. var x1 = points[i + 1][0];
  50261. var y1 = points[i + 1][1];
  50262. if (this.isInsideLine(x0, y0, x1, y1, _lineWidth, x, y)) {
  50263. return true;
  50264. }
  50265. }
  50266. return false;
  50267. }
  50268. /**
  50269. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideRing
  50270. * @description 图形 Ring 是否包含鼠标位置, true表示坐标处在图形内。
  50271. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  50272. */
  50273. }, {
  50274. key: "isInsideRing",
  50275. value: function isInsideRing(cx, cy, r0, r, x, y) {
  50276. var d = (x - cx) * (x - cx) + (y - cy) * (y - cy);
  50277. return d < r * r && d > r0 * r0;
  50278. }
  50279. /**
  50280. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideRect
  50281. * @description 图形 Rect 是否包含鼠标位置, true表示坐标处在图形内。
  50282. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  50283. */
  50284. }, {
  50285. key: "isInsideRect",
  50286. value: function isInsideRect(x0, y0, width, height, x, y) {
  50287. return x >= x0 && x <= x0 + width && y >= y0 && y <= y0 + height;
  50288. }
  50289. /**
  50290. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideCircle
  50291. * @description 图形 Circle 是否包含鼠标位置, true表示坐标处在图形内。
  50292. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  50293. */
  50294. }, {
  50295. key: "isInsideCircle",
  50296. value: function isInsideCircle(x0, y0, r, x, y) {
  50297. return (x - x0) * (x - x0) + (y - y0) * (y - y0) < r * r;
  50298. }
  50299. /**
  50300. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideSector
  50301. * @description 图形 Sector 是否包含鼠标位置, true表示坐标处在图形内。
  50302. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  50303. */
  50304. }, {
  50305. key: "isInsideSector",
  50306. value: function isInsideSector(cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y) {
  50307. return this.isInsideArcStroke(cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, r - r0, x, y);
  50308. }
  50309. /**
  50310. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsidePolygon
  50311. * @description 图形 Polygon 是否包含鼠标位置, true表示坐标处在图形内。与 canvas 一样采用 non-zero winding rule
  50312. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  50313. */
  50314. }, {
  50315. key: "isInsidePolygon",
  50316. value: function isInsidePolygon(points, x, y) {
  50317. var N = points.length;
  50318. var w = 0;
  50319. for (var i = 0, j = N - 1; i < N; i++) {
  50320. var x0 = points[j][0];
  50321. var y0 = points[j][1];
  50322. var x1 = points[i][0];
  50323. var y1 = points[i][1];
  50324. w += this.windingLine(x0, y0, x1, y1, x, y);
  50325. j = i;
  50326. }
  50327. return w !== 0;
  50328. }
  50329. /**
  50330. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingLine
  50331. */
  50332. }, {
  50333. key: "windingLine",
  50334. value: function windingLine(x0, y0, x1, y1, x, y) {
  50335. if (y > y0 && y > y1 || y < y0 && y < y1) {
  50336. return 0;
  50337. }
  50338. if (y1 == y0) {
  50339. return 0;
  50340. }
  50341. var dir = y1 < y0 ? 1 : -1;
  50342. var t = (y - y0) / (y1 - y0);
  50343. var x_ = t * (x1 - x0) + x0;
  50344. return x_ > x ? dir : 0;
  50345. }
  50346. /**
  50347. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.swapExtrema
  50348. */
  50349. }, {
  50350. key: "swapExtrema",
  50351. value: function swapExtrema() {
  50352. var tmp = this.extrema[0];
  50353. this.extrema[0] = this.extrema[1];
  50354. this.extrema[1] = tmp;
  50355. }
  50356. /**
  50357. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingCubic
  50358. */
  50359. }, {
  50360. key: "windingCubic",
  50361. value: function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {
  50362. var curve = this.curve;
  50363. var roots = this.roots;
  50364. var extrema = this.extrema; // Quick reject
  50365. if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) {
  50366. return 0;
  50367. }
  50368. var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);
  50369. if (nRoots === 0) {
  50370. return 0;
  50371. } else {
  50372. var w = 0;
  50373. var nExtrema = -1;
  50374. var y0_, y1_;
  50375. for (var i = 0; i < nRoots; i++) {
  50376. var t = roots[i];
  50377. var x_ = curve.cubicAt(x0, x1, x2, x3, t);
  50378. if (x_ < x) {
  50379. // Quick reject
  50380. continue;
  50381. }
  50382. if (nExtrema < 0) {
  50383. nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);
  50384. if (extrema[1] < extrema[0] && nExtrema > 1) {
  50385. this.swapExtrema();
  50386. }
  50387. y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);
  50388. if (nExtrema > 1) {
  50389. y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);
  50390. }
  50391. }
  50392. if (nExtrema == 2) {
  50393. // 分成三段单调函数
  50394. if (t < extrema[0]) {
  50395. w += y0_ < y0 ? 1 : -1;
  50396. } else if (t < extrema[1]) {
  50397. w += y1_ < y0_ ? 1 : -1;
  50398. } else {
  50399. w += y3 < y1_ ? 1 : -1;
  50400. }
  50401. } else {
  50402. // 分成两段单调函数
  50403. if (t < extrema[0]) {
  50404. w += y0_ < y0 ? 1 : -1;
  50405. } else {
  50406. w += y3 < y0_ ? 1 : -1;
  50407. }
  50408. }
  50409. }
  50410. return w;
  50411. }
  50412. }
  50413. /**
  50414. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingQuadratic
  50415. */
  50416. }, {
  50417. key: "windingQuadratic",
  50418. value: function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {
  50419. var curve = this.curve;
  50420. var roots = this.roots; // Quick reject
  50421. if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) {
  50422. return 0;
  50423. }
  50424. var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);
  50425. if (nRoots === 0) {
  50426. return 0;
  50427. } else {
  50428. var t = curve.quadraticExtremum(y0, y1, y2);
  50429. if (t >= 0 && t <= 1) {
  50430. var w = 0;
  50431. var y_ = curve.quadraticAt(y0, y1, y2, t);
  50432. for (var i = 0; i < nRoots; i++) {
  50433. var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);
  50434. if (x_ > x) {
  50435. continue;
  50436. }
  50437. if (roots[i] < t) {
  50438. w += y_ < y0 ? 1 : -1;
  50439. } else {
  50440. w += y2 < y_ ? 1 : -1;
  50441. }
  50442. }
  50443. return w;
  50444. } else {
  50445. var _x_ = curve.quadraticAt(x0, x1, x2, roots[0]);
  50446. if (_x_ > x) {
  50447. return 0;
  50448. }
  50449. return y2 < y0 ? 1 : -1;
  50450. }
  50451. }
  50452. }
  50453. /**
  50454. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingArc
  50455. * // TODO Arc 旋转
  50456. */
  50457. }, {
  50458. key: "windingArc",
  50459. value: function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {
  50460. var roots = this.roots;
  50461. var PI2 = this.PI2;
  50462. y -= cy;
  50463. if (y > r || y < -r) {
  50464. return 0;
  50465. }
  50466. var tmp = Math.sqrt(r * r - y * y);
  50467. roots[0] = -tmp;
  50468. roots[1] = tmp;
  50469. if (Math.abs(startAngle - endAngle) >= PI2) {
  50470. // Is a circle
  50471. startAngle = 0;
  50472. endAngle = PI2;
  50473. var dir = anticlockwise ? 1 : -1;
  50474. if (x >= roots[0] + cx && x <= roots[1] + cx) {
  50475. return dir;
  50476. } else {
  50477. return 0;
  50478. }
  50479. }
  50480. if (anticlockwise) {
  50481. var _tmp = startAngle;
  50482. startAngle = this.normalizeRadian(endAngle);
  50483. endAngle = this.normalizeRadian(_tmp);
  50484. } else {
  50485. startAngle = this.normalizeRadian(startAngle);
  50486. endAngle = this.normalizeRadian(endAngle);
  50487. }
  50488. if (startAngle > endAngle) {
  50489. endAngle += PI2;
  50490. }
  50491. var w = 0;
  50492. for (var i = 0; i < 2; i++) {
  50493. var x_ = roots[i];
  50494. if (x_ + cx > x) {
  50495. var angle = Math.atan2(y, x_);
  50496. var _dir = anticlockwise ? 1 : -1;
  50497. if (angle < 0) {
  50498. angle = PI2 + angle;
  50499. }
  50500. if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {
  50501. if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {
  50502. _dir = -_dir;
  50503. }
  50504. w += _dir;
  50505. }
  50506. }
  50507. }
  50508. return w;
  50509. }
  50510. /**
  50511. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsidePath
  50512. * @description 与 canvas 一样采用 non-zero winding rule
  50513. */
  50514. }, {
  50515. key: "isInsidePath",
  50516. value: function isInsidePath(pathArray, lineWidth, brushType, x, y) {
  50517. var w = 0;
  50518. var xi = 0;
  50519. var yi = 0;
  50520. var x0 = 0;
  50521. var y0 = 0;
  50522. var beginSubpath = true;
  50523. var firstCmd = true;
  50524. brushType = brushType || 'fill';
  50525. var hasStroke = brushType === 'stroke' || brushType === 'both';
  50526. var hasFill = brushType === 'fill' || brushType === 'both'; // var roots = [-1, -1, -1];
  50527. for (var i = 0; i < pathArray.length; i++) {
  50528. var seg = pathArray[i];
  50529. var p = seg.points; // Begin a new subpath
  50530. if (beginSubpath || seg.command === 'M') {
  50531. if (i > 0) {
  50532. // Close previous subpath
  50533. if (hasFill) {
  50534. w += this.windingLine(xi, yi, x0, y0, x, y);
  50535. }
  50536. if (w !== 0) {
  50537. return true;
  50538. }
  50539. }
  50540. x0 = p[p.length - 2];
  50541. y0 = p[p.length - 1];
  50542. beginSubpath = false;
  50543. if (firstCmd && seg.command !== 'A') {
  50544. // 如果第一个命令不是M, 是lineTo, bezierCurveTo
  50545. // 等绘制命令的话,是会从该绘制的起点开始算的
  50546. // Arc 会在之后做单独处理所以这里忽略
  50547. firstCmd = false;
  50548. xi = x0;
  50549. yi = y0;
  50550. }
  50551. }
  50552. switch (seg.command) {
  50553. case 'M':
  50554. xi = p[0];
  50555. yi = p[1];
  50556. break;
  50557. case 'L':
  50558. if (hasStroke) {
  50559. if (this.isInsideLine(xi, yi, p[0], p[1], lineWidth, x, y)) {
  50560. return true;
  50561. }
  50562. }
  50563. if (hasFill) {
  50564. w += this.windingLine(xi, yi, p[0], p[1], x, y);
  50565. }
  50566. xi = p[0];
  50567. yi = p[1];
  50568. break;
  50569. case 'C':
  50570. if (hasStroke) {
  50571. if (this.isInsideCubicStroke(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], lineWidth, x, y)) {
  50572. return true;
  50573. }
  50574. }
  50575. if (hasFill) {
  50576. w += this.windingCubic(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y);
  50577. }
  50578. xi = p[4];
  50579. yi = p[5];
  50580. break;
  50581. case 'Q':
  50582. if (hasStroke) {
  50583. if (this.isInsideQuadraticStroke(xi, yi, p[0], p[1], p[2], p[3], lineWidth, x, y)) {
  50584. return true;
  50585. }
  50586. }
  50587. if (hasFill) {
  50588. w += this.windingQuadratic(xi, yi, p[0], p[1], p[2], p[3], x, y);
  50589. }
  50590. xi = p[2];
  50591. yi = p[3];
  50592. break;
  50593. case 'A':
  50594. // TODO Arc 旋转
  50595. // TODO Arc 判断的开销比较大
  50596. var cx = p[0];
  50597. var cy = p[1];
  50598. var rx = p[2];
  50599. var ry = p[3];
  50600. var theta = p[4];
  50601. var dTheta = p[5];
  50602. var x1 = Math.cos(theta) * rx + cx;
  50603. var y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令
  50604. if (!firstCmd) {
  50605. w += this.windingLine(xi, yi, x1, y1);
  50606. } else {
  50607. firstCmd = false; // 第一个命令起点还未定义
  50608. x0 = x1;
  50609. y0 = y1;
  50610. } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放
  50611. var _x = (x - cx) * ry / rx + cx;
  50612. if (hasStroke) {
  50613. if (this.isInsideArcStroke(cx, cy, ry, theta, theta + dTheta, 1 - p[7], lineWidth, _x, y)) {
  50614. return true;
  50615. }
  50616. }
  50617. if (hasFill) {
  50618. w += this.windingArc(cx, cy, ry, theta, theta + dTheta, 1 - p[7], _x, y);
  50619. }
  50620. xi = Math.cos(theta + dTheta) * rx + cx;
  50621. yi = Math.sin(theta + dTheta) * ry + cy;
  50622. break;
  50623. case 'z':
  50624. if (hasStroke) {
  50625. if (this.isInsideLine(xi, yi, x0, y0, lineWidth, x, y)) {
  50626. return true;
  50627. }
  50628. }
  50629. beginSubpath = true;
  50630. break;
  50631. }
  50632. }
  50633. if (hasFill) {
  50634. w += this.windingLine(xi, yi, x0, y0, x, y);
  50635. }
  50636. return w !== 0;
  50637. }
  50638. /**
  50639. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.getTextWidth
  50640. * @description 测算多行文本宽度
  50641. */
  50642. }, {
  50643. key: "getTextWidth",
  50644. value: function getTextWidth(text, textFont) {
  50645. var key = text + ':' + textFont;
  50646. if (this._textWidthCache[key]) {
  50647. return this._textWidthCache[key];
  50648. }
  50649. this._ctx = this._ctx || this.util.getContext();
  50650. this._ctx.save();
  50651. if (textFont) {
  50652. this._ctx.font = textFont;
  50653. }
  50654. text = (text + '').split('\n');
  50655. var width = 0;
  50656. for (var i = 0, l = text.length; i < l; i++) {
  50657. width = Math.max(this._ctx.measureText(text[i]).width, width);
  50658. }
  50659. this._ctx.restore();
  50660. this._textWidthCache[key] = width;
  50661. if (++this._textWidthCacheCounter > this.TEXT_CACHE_MAX) {
  50662. // 内存释放
  50663. this._textWidthCacheCounter = 0;
  50664. this._textWidthCache = {};
  50665. }
  50666. return width;
  50667. }
  50668. /**
  50669. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.getTextHeight
  50670. * @description 测算多行文本高度
  50671. */
  50672. }, {
  50673. key: "getTextHeight",
  50674. value: function getTextHeight(text, textFont) {
  50675. var key = text + ':' + textFont;
  50676. if (this._textHeightCache[key]) {
  50677. return this._textHeightCache[key];
  50678. }
  50679. this._ctx = this._ctx || this.util.getContext();
  50680. this._ctx.save();
  50681. if (textFont) {
  50682. this._ctx.font = textFont;
  50683. }
  50684. text = (text + '').split('\n'); // 比较粗暴
  50685. //var height = (this._ctx.measureText('国').width + 2) * text.length; //打包不支持中文,替换掉
  50686. var height = (this._ctx.measureText('ZH').width + 2) * text.length;
  50687. this._ctx.restore();
  50688. this._textHeightCache[key] = height;
  50689. if (++this._textHeightCacheCounter > this.TEXT_CACHE_MAX) {
  50690. // 内存释放
  50691. this._textHeightCacheCounter = 0;
  50692. this._textHeightCache = {};
  50693. }
  50694. return height;
  50695. }
  50696. }]);
  50697. return Area;
  50698. }();
  50699. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/ComputeBoundingBox.js
  50700. function ComputeBoundingBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50701. 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); } }
  50702. function ComputeBoundingBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeBoundingBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeBoundingBox_defineProperties(Constructor, staticProps); return Constructor; }
  50703. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  50704. * This program are made available under the terms of the Apache License, Version 2.0
  50705. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50706. /**
  50707. * @class SuperMap.LevelRenderer.Tool.ComputeBoundingBox
  50708. * @category Visualization Theme
  50709. * @classdesc LevelRenderer 工具-图形 Bounds 计算
  50710. * @private
  50711. */
  50712. var ComputeBoundingBox = /*#__PURE__*/function () {
  50713. /**
  50714. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.constructor
  50715. * @description 构造函数。
  50716. */
  50717. function ComputeBoundingBox() {
  50718. ComputeBoundingBox_classCallCheck(this, ComputeBoundingBox);
  50719. if (arguments.length === 3) {
  50720. this.computeBoundingBox(arguments);
  50721. }
  50722. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.ComputeBoundingBox";
  50723. }
  50724. /**
  50725. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.computeBoundingBox
  50726. * @description 从顶点数组中计算出最小包围盒,写入'min'和'max'中。
  50727. * @param {Array.<Object>} points - 顶点数组。
  50728. * @param {Array} min - 最小
  50729. * @param {Array} max - 最大
  50730. */
  50731. ComputeBoundingBox_createClass(ComputeBoundingBox, [{
  50732. key: "computeBoundingBox",
  50733. value: function computeBoundingBox(points, min, max) {
  50734. if (points.length === 0) {
  50735. return;
  50736. }
  50737. var left = points[0][0];
  50738. var right = points[0][0];
  50739. var top = points[0][1];
  50740. var bottom = points[0][1];
  50741. for (var i = 1; i < points.length; i++) {
  50742. var p = points[i];
  50743. if (p[0] < left) {
  50744. left = p[0];
  50745. }
  50746. if (p[0] > right) {
  50747. right = p[0];
  50748. }
  50749. if (p[1] < top) {
  50750. top = p[1];
  50751. }
  50752. if (p[1] > bottom) {
  50753. bottom = p[1];
  50754. }
  50755. }
  50756. min[0] = left;
  50757. min[1] = top;
  50758. max[0] = right;
  50759. max[1] = bottom;
  50760. }
  50761. /**
  50762. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.cubeBezier
  50763. * @description 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入'min'和'max'中。原:computeCubeBezierBoundingBox。
  50764. * @param {Array.<number>} p0 - 三阶贝塞尔曲线p0点
  50765. * @param {Array.<number>} p1 - 三阶贝塞尔曲线p1点
  50766. * @param {Array.<number>} p2 - 三阶贝塞尔曲线p2点
  50767. * @param {Array.<number>} p3 - 三阶贝塞尔曲线p3点
  50768. * @param {Array.<number>} min - 最小
  50769. * @param {Array.<number>} max - 最大
  50770. */
  50771. }, {
  50772. key: "cubeBezier",
  50773. value: function cubeBezier(p0, p1, p2, p3, min, max) {
  50774. var curve = new Curve_Curve();
  50775. var xDim = [];
  50776. curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim);
  50777. for (var i = 0; i < xDim.length; i++) {
  50778. xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]);
  50779. }
  50780. var yDim = [];
  50781. curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim);
  50782. for (var _i = 0; _i < yDim.length; _i++) {
  50783. yDim[_i] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[_i]);
  50784. }
  50785. xDim.push(p0[0], p3[0]);
  50786. yDim.push(p0[1], p3[1]);
  50787. var left = Math.min.apply(null, xDim);
  50788. var right = Math.max.apply(null, xDim);
  50789. var top = Math.min.apply(null, yDim);
  50790. var bottom = Math.max.apply(null, yDim);
  50791. min[0] = left;
  50792. min[1] = top;
  50793. max[0] = right;
  50794. max[1] = bottom;
  50795. }
  50796. /**
  50797. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.quadraticBezier
  50798. * @description 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入'min'和'max'中。原:computeQuadraticBezierBoundingBox。
  50799. * @param {Array.<number>} p0 - 二阶贝塞尔曲线p0点
  50800. * @param {Array.<number>} p1 - 二阶贝塞尔曲线p1点
  50801. * @param {Array.<number>} p2 - 二阶贝塞尔曲线p2点
  50802. * @param {Array.<number>} min - 最小
  50803. * @param {Array.<number>} max - 最大
  50804. */
  50805. }, {
  50806. key: "quadraticBezier",
  50807. value: function quadraticBezier(p0, p1, p2, min, max) {
  50808. var curve = new Curve_Curve(); // Find extremities, where derivative in x dim or y dim is zero
  50809. var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]);
  50810. var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]);
  50811. t1 = Math.max(Math.min(t1, 1), 0);
  50812. t2 = Math.max(Math.min(t2, 1), 0);
  50813. var ct1 = 1 - t1;
  50814. var ct2 = 1 - t2;
  50815. var x1 = ct1 * ct1 * p0[0] + 2 * ct1 * t1 * p1[0] + t1 * t1 * p2[0];
  50816. var y1 = ct1 * ct1 * p0[1] + 2 * ct1 * t1 * p1[1] + t1 * t1 * p2[1];
  50817. var x2 = ct2 * ct2 * p0[0] + 2 * ct2 * t2 * p1[0] + t2 * t2 * p2[0];
  50818. var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1];
  50819. min[0] = Math.min(p0[0], p2[0], x1, x2);
  50820. min[1] = Math.min(p0[1], p2[1], y1, y2);
  50821. max[0] = Math.max(p0[0], p2[0], x1, x2);
  50822. max[1] = Math.max(p0[1], p2[1], y1, y2);
  50823. }
  50824. /**
  50825. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.arc
  50826. * @description 从圆弧中计算出最小包围盒,写入'min'和'max'中。原:computeArcBoundingBox。
  50827. * @param {number} x - 圆弧中心点 x
  50828. * @param {number} y - 圆弧中心点 y
  50829. * @param {number} r - 圆弧半径
  50830. * @param {number} startAngle - 圆弧开始角度
  50831. * @param {number} endAngle - 圆弧结束角度
  50832. * @param {number} anticlockwise - 是否是顺时针
  50833. * @param {number} min - 最小
  50834. * @param {number} max - 最大
  50835. */
  50836. }, {
  50837. key: "arc",
  50838. value: function arc(x, y, r, startAngle, endAngle, anticlockwise, min, max) {
  50839. var vec2 = new levelRenderer_Vector_Vector();
  50840. var start = vec2.create();
  50841. var end = vec2.create();
  50842. var extremity = vec2.create();
  50843. start[0] = Math.cos(startAngle) * r + x;
  50844. start[1] = Math.sin(startAngle) * r + y;
  50845. end[0] = Math.cos(endAngle) * r + x;
  50846. end[1] = Math.sin(endAngle) * r + y;
  50847. vec2.min(min, start, end);
  50848. vec2.max(max, start, end); // Thresh to [0, Math.PI * 2]
  50849. startAngle = startAngle % (Math.PI * 2);
  50850. if (startAngle < 0) {
  50851. startAngle = startAngle + Math.PI * 2;
  50852. }
  50853. endAngle = endAngle % (Math.PI * 2);
  50854. if (endAngle < 0) {
  50855. endAngle = endAngle + Math.PI * 2;
  50856. }
  50857. if (startAngle > endAngle && !anticlockwise) {
  50858. endAngle += Math.PI * 2;
  50859. } else if (startAngle < endAngle && anticlockwise) {
  50860. startAngle += Math.PI * 2;
  50861. }
  50862. if (anticlockwise) {
  50863. var tmp = endAngle;
  50864. endAngle = startAngle;
  50865. startAngle = tmp;
  50866. } // var number = 0;
  50867. // var step = (anticlockwise ? -Math.PI : Math.PI) / 2;
  50868. for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {
  50869. if (angle > startAngle) {
  50870. extremity[0] = Math.cos(angle) * r + x;
  50871. extremity[1] = Math.sin(angle) * r + y;
  50872. vec2.min(min, extremity, min);
  50873. vec2.max(max, extremity, max);
  50874. }
  50875. }
  50876. }
  50877. }]);
  50878. return ComputeBoundingBox;
  50879. }();
  50880. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Env.js
  50881. function Env_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50882. 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); } }
  50883. function Env_createClass(Constructor, protoProps, staticProps) { if (protoProps) Env_defineProperties(Constructor.prototype, protoProps); if (staticProps) Env_defineProperties(Constructor, staticProps); return Constructor; }
  50884. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  50885. * This program are made available under the terms of the Apache License, Version 2.0
  50886. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50887. /**
  50888. * @class SuperMap.LevelRenderer.Tool.Env
  50889. * @category Visualization Theme
  50890. * @classdesc 环境识别
  50891. * @private
  50892. */
  50893. var Env = /*#__PURE__*/function () {
  50894. function Env() {
  50895. Env_classCallCheck(this, Env);
  50896. // Zepto.js
  50897. // (c) 2010-2013 Thomas Fuchs
  50898. // Zepto.js may be freely distributed under the MIT license.
  50899. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Env";
  50900. var me = this;
  50901. function detect(ua) {
  50902. var os = me.os = {};
  50903. var browser = me.browser = {};
  50904. var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/);
  50905. var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
  50906. var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
  50907. var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
  50908. var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
  50909. var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/);
  50910. var touchpad = webos && ua.match(/TouchPad/);
  50911. var kindle = ua.match(/Kindle\/([\d.]+)/);
  50912. var silk = ua.match(/Silk\/([\d._]+)/);
  50913. var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/);
  50914. var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/);
  50915. var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/);
  50916. var playbook = ua.match(/PlayBook/);
  50917. var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/);
  50918. var firefox = ua.match(/Firefox\/([\d.]+)/);
  50919. var ie = ua.match(/MSIE ([\d.]+)/);
  50920. var safari = webkit && ua.match(/Mobile\//) && !chrome;
  50921. var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; // Todo: clean this up with a better OS/browser seperation:
  50922. // - discern (more) between multiple browsers on android
  50923. // - decide if kindle fire in silk mode is android or not
  50924. // - Firefox on Android doesn't specify the Android version
  50925. // - possibly devide in os, device and browser hashes
  50926. /*eslint-disable*/
  50927. if (browser.webkit = !!webkit) {
  50928. browser.version = webkit[1];
  50929. }
  50930. if (android) {
  50931. os.android = true;
  50932. os.version = android[2];
  50933. }
  50934. if (iphone && !ipod) {
  50935. os.ios = os.iphone = true;
  50936. os.version = iphone[2].replace(/_/g, '.');
  50937. }
  50938. if (ipad) {
  50939. os.ios = os.ipad = true;
  50940. os.version = ipad[2].replace(/_/g, '.');
  50941. }
  50942. if (ipod) {
  50943. os.ios = os.ipod = true;
  50944. os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
  50945. }
  50946. if (webos) {
  50947. os.webos = true;
  50948. os.version = webos[2];
  50949. }
  50950. if (touchpad) {
  50951. os.touchpad = true;
  50952. }
  50953. if (blackberry) {
  50954. os.blackberry = true;
  50955. os.version = blackberry[2];
  50956. }
  50957. if (bb10) {
  50958. os.bb10 = true;
  50959. os.version = bb10[2];
  50960. }
  50961. if (rimtabletos) {
  50962. os.rimtabletos = true;
  50963. os.version = rimtabletos[2];
  50964. }
  50965. if (playbook) {
  50966. browser.playbook = true;
  50967. }
  50968. if (kindle) {
  50969. os.kindle = true;
  50970. os.version = kindle[1];
  50971. }
  50972. if (silk) {
  50973. browser.silk = true;
  50974. browser.version = silk[1];
  50975. }
  50976. if (!silk && os.android && ua.match(/Kindle Fire/)) {
  50977. browser.silk = true;
  50978. }
  50979. if (chrome) {
  50980. browser.chrome = true;
  50981. browser.version = chrome[1];
  50982. }
  50983. if (firefox) {
  50984. browser.firefox = true;
  50985. browser.version = firefox[1];
  50986. }
  50987. if (ie) {
  50988. browser.ie = true;
  50989. browser.version = ie[1];
  50990. }
  50991. if (safari && (ua.match(/Safari/) || !!os.ios)) {
  50992. browser.safari = true;
  50993. }
  50994. if (webview) {
  50995. browser.webview = true;
  50996. }
  50997. if (ie) {
  50998. browser.ie = true;
  50999. browser.version = ie[1];
  51000. }
  51001. os.tablet = !!(ipad || playbook || android && !ua.match(/Mobile/) || firefox && ua.match(/Tablet/) || ie && !ua.match(/Phone/) && ua.match(/Touch/));
  51002. 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/)));
  51003. return {
  51004. browser: browser,
  51005. os: os,
  51006. // 原生canvas支持
  51007. canvasSupported: document.createElement('canvas').getContext ? true : false
  51008. };
  51009. }
  51010. return detect(navigator.userAgent);
  51011. }
  51012. Env_createClass(Env, [{
  51013. key: "destory",
  51014. value: function destory() {
  51015. return true;
  51016. }
  51017. }]);
  51018. return Env;
  51019. }();
  51020. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Event.js
  51021. function Event_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51022. 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); } }
  51023. function Event_createClass(Constructor, protoProps, staticProps) { if (protoProps) Event_defineProperties(Constructor.prototype, protoProps); if (staticProps) Event_defineProperties(Constructor, staticProps); return Constructor; }
  51024. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51025. * This program are made available under the terms of the Apache License, Version 2.0
  51026. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51027. /**
  51028. * @class SuperMap.LevelRenderer.Tool.Event
  51029. * @category Visualization Theme
  51030. * @classdesc LevelRenderer 工具-事件辅助类
  51031. * @private
  51032. */
  51033. var Event_Event = /*#__PURE__*/function () {
  51034. /**
  51035. * @function SuperMap.LevelRenderer.Tool.Event.prototype.constructor
  51036. * @description 构造函数。
  51037. */
  51038. function Event() {
  51039. Event_classCallCheck(this, Event);
  51040. /**
  51041. * @member {function} SuperMap.LevelRenderer.Tool.Event.prototype.stop
  51042. * @description 停止冒泡和阻止默认行为
  51043. */
  51044. this.stop = typeof window.addEventListener === 'function' ? function (e) {
  51045. e.preventDefault();
  51046. e.stopPropagation();
  51047. e.cancelBubble = true;
  51048. } : function (e) {
  51049. e.returnValue = false;
  51050. e.cancelBubble = true;
  51051. };
  51052. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Event";
  51053. }
  51054. /**
  51055. * @function SuperMap.LevelRenderer.Tool.Event.prototype.getX
  51056. * @description 提取鼠标(手指)x坐标。
  51057. * @param {Event} e - 事件。
  51058. * @returns {number} 鼠标(手指)x坐标。
  51059. */
  51060. Event_createClass(Event, [{
  51061. key: "getX",
  51062. value: function getX(e) {
  51063. 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;
  51064. }
  51065. /**
  51066. * @function SuperMap.LevelRenderer.Tool.Event.prototype.getY
  51067. * @description 提取鼠标(手指)y坐标。
  51068. * @param {Event} e - 事件。
  51069. * @returns {number} 鼠标(手指)y坐标。
  51070. */
  51071. }, {
  51072. key: "getY",
  51073. value: function getY(e) {
  51074. 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;
  51075. }
  51076. /**
  51077. * @function SuperMap.LevelRenderer.Tool.Event.prototype.getDelta
  51078. * @description 提取鼠标滚轮变化。
  51079. * @param {Event} e - 事件。
  51080. * @returns {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动。
  51081. */
  51082. }, {
  51083. key: "getDelta",
  51084. value: function getDelta(e) {
  51085. return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail;
  51086. }
  51087. }]);
  51088. return Event;
  51089. }();
  51090. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Http.js
  51091. function Http_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Http_typeof = function _typeof(obj) { return typeof obj; }; } else { Http_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Http_typeof(obj); }
  51092. function Http_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51093. 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); } }
  51094. function Http_createClass(Constructor, protoProps, staticProps) { if (protoProps) Http_defineProperties(Constructor.prototype, protoProps); if (staticProps) Http_defineProperties(Constructor, staticProps); return Constructor; }
  51095. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51096. * This program are made available under the terms of the Apache License, Version 2.0
  51097. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51098. /**
  51099. * @private
  51100. * @class SuperMap.LevelRenderer.Tool.Http
  51101. * @category Visualization Theme
  51102. * @classdesc LevelRenderer 工具-Http
  51103. */
  51104. var Http = /*#__PURE__*/function () {
  51105. /**
  51106. * @function SuperMap.LevelRenderer.Tool.Http.constructor
  51107. * @description 构造函数。
  51108. */
  51109. function Http() {
  51110. Http_classCallCheck(this, Http);
  51111. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Http";
  51112. }
  51113. /**
  51114. * @function SuperMap.LevelRenderer.Tool.Http.prototype.get
  51115. * @description get请求。
  51116. * @param {(string|IHTTPGetOption)} url - 请求url
  51117. * @param {function} onsuccess - 请求成功函数
  51118. * @param {function} onerror - 请求失败函数
  51119. * @param {Object} opts - 额外参数
  51120. * @returns {number} cos值
  51121. */
  51122. Http_createClass(Http, [{
  51123. key: "get",
  51124. value: function get(url, onsuccess, onerror) {
  51125. if (Http_typeof(url) === 'object') {
  51126. var obj = url;
  51127. url = obj.url;
  51128. onsuccess = obj.onsuccess;
  51129. onerror = obj.onerror;
  51130. }
  51131. var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new window.ActiveXObject('Microsoft.XMLHTTP');
  51132. xhr.open('GET', url, true);
  51133. xhr.onreadystatechange = function () {
  51134. if (xhr.readyState == 4) {
  51135. if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
  51136. onsuccess && onsuccess(xhr.responseText);
  51137. } else {
  51138. onerror && onerror();
  51139. }
  51140. xhr.onreadystatechange = new Function();
  51141. xhr = null;
  51142. }
  51143. };
  51144. xhr.send(null);
  51145. }
  51146. }]);
  51147. return Http;
  51148. }();
  51149. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Config.js
  51150. function Config_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51151. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51152. * This program are made available under the terms of the Apache License, Version 2.0
  51153. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51154. var Config = function Config() {
  51155. Config_classCallCheck(this, Config);
  51156. };
  51157. /**
  51158. * @enum EVENT
  51159. * @description 事件
  51160. * @type {Object}
  51161. * @private
  51162. */
  51163. Config.EVENT = {
  51164. //窗口大小变化
  51165. RESIZE: 'resize',
  51166. //鼠标按钮被(手指)按下,事件对象是:目标图形元素或空
  51167. CLICK: 'click',
  51168. //双击事件
  51169. DBLCLICK: 'dblclick',
  51170. //鼠标滚轮变化,事件对象是:目标图形元素或空
  51171. MOUSEWHEEL: 'mousewheel',
  51172. //鼠标(手指)被移动,事件对象是:目标图形元素或空
  51173. MOUSEMOVE: 'mousemove',
  51174. //鼠标移到某图形元素之上,事件对象是:目标图形元素
  51175. MOUSEOVER: 'mouseover',
  51176. //鼠标从某图形元素移开,事件对象是:目标图形元素
  51177. MOUSEOUT: 'mouseout',
  51178. //鼠标按钮(手指)被按下,事件对象是:目标图形元素或空
  51179. MOUSEDOWN: 'mousedown',
  51180. //鼠标按键(手指)被松开,事件对象是:目标图形元素或空
  51181. MOUSEUP: 'mouseup',
  51182. //全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定
  51183. GLOBALOUT: 'globalout',
  51184. // 一次成功元素拖拽的行为事件过程是:
  51185. // dragstart > dragenter > dragover [> dragleave] > drop > dragend
  51186. //开始拖拽时触发,事件对象是:被拖拽图形元素
  51187. DRAGSTART: 'dragstart',
  51188. //拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素
  51189. DRAGEND: 'dragend',
  51190. //拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素
  51191. DRAGENTER: 'dragenter',
  51192. //拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素
  51193. DRAGOVER: 'dragover',
  51194. //拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素
  51195. DRAGLEAVE: 'dragleave',
  51196. //拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素
  51197. DROP: 'drop',
  51198. //touch end - start < delay is click
  51199. touchClickDelay: 300
  51200. };
  51201. /**
  51202. * @enum catchBrushException
  51203. * @description 是否异常捕获
  51204. * @type {boolean}
  51205. * @private
  51206. */
  51207. Config.catchBrushException = false;
  51208. /**
  51209. * @enum debugMode
  51210. * @description debug 日志选项:catchBrushException 为 true 下有效。
  51211. * 0 : 不生成debug数据,发布用
  51212. * 1 : 异常抛出,调试用
  51213. * 2 : 控制台输出,调试用
  51214. * @type {boolean}
  51215. * @private
  51216. */
  51217. Config.debugMode = 0;
  51218. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Log.js
  51219. function Log_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51220. 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); } }
  51221. function Log_createClass(Constructor, protoProps, staticProps) { if (protoProps) Log_defineProperties(Constructor.prototype, protoProps); if (staticProps) Log_defineProperties(Constructor, staticProps); return Constructor; }
  51222. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51223. * This program are made available under the terms of the Apache License, Version 2.0
  51224. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51225. /**
  51226. * @private
  51227. * @class SuperMap.LevelRenderer.Tool.Log
  51228. * @category Visualization Theme
  51229. * @classdesc LevelRenderer 工具-日志
  51230. */
  51231. var Log = /*#__PURE__*/function () {
  51232. /**
  51233. * @function SuperMap.LevelRenderer.Tool.Log.constructor
  51234. * @description 构造函数。
  51235. */
  51236. function Log() {
  51237. Log_classCallCheck(this, Log);
  51238. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Log";
  51239. return function () {
  51240. if (Config.debugMode === 0) {
  51241. return;
  51242. } else if (Config.debugMode == 1) {
  51243. for (var k in arguments) {
  51244. throw new Error(arguments[k]);
  51245. }
  51246. } else if (Config.debugMode > 1) {
  51247. for (var _k in arguments) {
  51248. console.log(arguments[_k]);
  51249. }
  51250. }
  51251. };
  51252. /* for debug
  51253. return function(mes) {
  51254. document.getElementById('wrong-message').innerHTML =
  51255. mes + ' ' + (new Date() - 0)
  51256. + '<br/>'
  51257. + document.getElementById('wrong-message').innerHTML;
  51258. };
  51259. */
  51260. }
  51261. Log_createClass(Log, [{
  51262. key: "destory",
  51263. value: function destory() {
  51264. return true;
  51265. }
  51266. }]);
  51267. return Log;
  51268. }();
  51269. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Math.js
  51270. function Math_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51271. 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); } }
  51272. function Math_createClass(Constructor, protoProps, staticProps) { if (protoProps) Math_defineProperties(Constructor.prototype, protoProps); if (staticProps) Math_defineProperties(Constructor, staticProps); return Constructor; }
  51273. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51274. * This program are made available under the terms of the Apache License, Version 2.0
  51275. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51276. /**
  51277. * @private
  51278. * @class SuperMap.LevelRenderer.Tool.Math
  51279. * @category Visualization Theme
  51280. * @classdesc LevelRenderer 工具-数学辅助类
  51281. */
  51282. var MathTool = /*#__PURE__*/function () {
  51283. /**
  51284. * @function SuperMap.LevelRenderer.Tool.Math.constructor
  51285. * @description 构造函数。
  51286. */
  51287. function MathTool() {
  51288. Math_classCallCheck(this, MathTool);
  51289. /**
  51290. * @member {number} SuperMap.LevelRenderer.Tool.Math._radians
  51291. * @description 角度与弧度转化参数
  51292. */
  51293. this._radians = window.Math.PI / 180;
  51294. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Math";
  51295. }
  51296. /**
  51297. * @function SuperMap.LevelRenderer.Tool.Math.prototype.sin
  51298. * @description 正弦函数。
  51299. * @param {number} angle - 弧度(角度)参数。
  51300. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  51301. * @returns {number} sin 值。
  51302. */
  51303. Math_createClass(MathTool, [{
  51304. key: "sin",
  51305. value: function sin(angle, isDegrees) {
  51306. return window.Math.sin(isDegrees ? angle * this._radians : angle);
  51307. }
  51308. /**
  51309. * @function SuperMap.LevelRenderer.Tool.Math.prototype.cos
  51310. * @description 余弦函数。
  51311. * @param {number} angle - 弧度(角度)参数。
  51312. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  51313. * @returns {number} cos 值。
  51314. */
  51315. }, {
  51316. key: "cos",
  51317. value: function cos(angle, isDegrees) {
  51318. return window.Math.cos(isDegrees ? angle * this._radians : angle);
  51319. }
  51320. /**
  51321. * @function SuperMap.LevelRenderer.Tool.Math.prototype.degreeToRadian
  51322. * @description 角度转弧度。
  51323. * @param {number} angle - 弧度(角度)参数。
  51324. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  51325. * @returns {number} 弧度值。
  51326. */
  51327. }, {
  51328. key: "degreeToRadian",
  51329. value: function degreeToRadian(angle) {
  51330. return angle * this._radians;
  51331. }
  51332. /**
  51333. * @function SuperMap.LevelRenderer.Tool.Math.prototype.radianToDegree
  51334. * @description 弧度转角度。
  51335. * @param {number} angle - 弧度(角度)参数。
  51336. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  51337. * @returns {number} 角度。
  51338. */
  51339. }, {
  51340. key: "radianToDegree",
  51341. value: function radianToDegree(angle) {
  51342. return angle / this._radians;
  51343. }
  51344. }]);
  51345. return MathTool;
  51346. }();
  51347. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Matrix.js
  51348. function Matrix_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51349. 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); } }
  51350. function Matrix_createClass(Constructor, protoProps, staticProps) { if (protoProps) Matrix_defineProperties(Constructor.prototype, protoProps); if (staticProps) Matrix_defineProperties(Constructor, staticProps); return Constructor; }
  51351. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51352. * This program are made available under the terms of the Apache License, Version 2.0
  51353. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51354. /**
  51355. * @private
  51356. * @class SuperMap.LevelRenderer.Tool.Matrix
  51357. * @category Visualization Theme
  51358. * @classdesc LevelRenderer 工具-3x2矩阵操作类
  51359. */
  51360. var Matrix = /*#__PURE__*/function () {
  51361. /**
  51362. * @function SuperMap.LevelRenderer.Tool.Matrix.constructor
  51363. * @description 构造函数。
  51364. */
  51365. function Matrix() {
  51366. Matrix_classCallCheck(this, Matrix);
  51367. /**
  51368. * @member {Object} SuperMap.LevelRenderer.Tool.Matrix.prototype.ArrayCtor
  51369. * @description 数组类型控制
  51370. */
  51371. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  51372. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Matrix";
  51373. }
  51374. /**
  51375. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.create
  51376. * @description 创建一个单位矩阵。
  51377. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  51378. */
  51379. Matrix_createClass(Matrix, [{
  51380. key: "create",
  51381. value: function create() {
  51382. var ArrayCtor = this.ArrayCtor;
  51383. var out = new ArrayCtor(6);
  51384. this.identity(out);
  51385. return out;
  51386. }
  51387. /**
  51388. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.identity
  51389. * @description 设置矩阵为单位矩阵。
  51390. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  51391. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  51392. */
  51393. }, {
  51394. key: "identity",
  51395. value: function identity(out) {
  51396. out[0] = 1;
  51397. out[1] = 0;
  51398. out[2] = 0;
  51399. out[3] = 1;
  51400. out[4] = 0;
  51401. out[5] = 0;
  51402. return out;
  51403. }
  51404. /**
  51405. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.copy
  51406. * @description 复制矩阵。
  51407. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  51408. * @returns {(Float32Array|Array.<number>)} 克隆矩阵。
  51409. */
  51410. }, {
  51411. key: "copy",
  51412. value: function copy(out, m) {
  51413. out[0] = m[0];
  51414. out[1] = m[1];
  51415. out[2] = m[2];
  51416. out[3] = m[3];
  51417. out[4] = m[4];
  51418. out[5] = m[5];
  51419. return out;
  51420. }
  51421. /**
  51422. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mul
  51423. * @description 矩阵相乘。
  51424. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  51425. * @param {(Float32Array|Array.<number>)} m1 - 矩阵m1。
  51426. * @param {(Float32Array|Array.<number>)} m2- 矩阵m2。
  51427. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  51428. */
  51429. }, {
  51430. key: "mul",
  51431. value: function mul(out, m1, m2) {
  51432. out[0] = m1[0] * m2[0] + m1[2] * m2[1];
  51433. out[1] = m1[1] * m2[0] + m1[3] * m2[1];
  51434. out[2] = m1[0] * m2[2] + m1[2] * m2[3];
  51435. out[3] = m1[1] * m2[2] + m1[3] * m2[3];
  51436. out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
  51437. out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
  51438. return out;
  51439. }
  51440. /**
  51441. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mul
  51442. * @description 平移变换。
  51443. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  51444. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  51445. * @param {(Float32Array|Array.<number>)} v- 平移参数。
  51446. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  51447. */
  51448. }, {
  51449. key: "translate",
  51450. value: function translate(out, a, v) {
  51451. out[0] = a[0];
  51452. out[1] = a[1];
  51453. out[2] = a[2];
  51454. out[3] = a[3];
  51455. out[4] = a[4] + v[0];
  51456. out[5] = a[5] + v[1];
  51457. return out;
  51458. }
  51459. /**
  51460. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.rotate
  51461. * @description 平移变换。
  51462. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  51463. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  51464. * @param {(Float32Array|Array.<number>)} rad - 旋转参数。
  51465. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  51466. */
  51467. }, {
  51468. key: "rotate",
  51469. value: function rotate(out, a, rad) {
  51470. var aa = a[0];
  51471. var ac = a[2];
  51472. var atx = a[4];
  51473. var ab = a[1];
  51474. var ad = a[3];
  51475. var aty = a[5];
  51476. var st = Math.sin(rad);
  51477. var ct = Math.cos(rad);
  51478. out[0] = aa * ct + ab * st;
  51479. out[1] = -aa * st + ab * ct;
  51480. out[2] = ac * ct + ad * st;
  51481. out[3] = -ac * st + ct * ad;
  51482. out[4] = ct * atx + st * aty;
  51483. out[5] = ct * aty - st * atx;
  51484. return out;
  51485. }
  51486. /**
  51487. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.scale
  51488. * @description 缩放变换。
  51489. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  51490. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  51491. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  51492. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  51493. */
  51494. }, {
  51495. key: "scale",
  51496. value: function scale(out, a, v) {
  51497. var vx = v[0];
  51498. var vy = v[1];
  51499. out[0] = a[0] * vx;
  51500. out[1] = a[1] * vy;
  51501. out[2] = a[2] * vx;
  51502. out[3] = a[3] * vy;
  51503. out[4] = a[4] * vx;
  51504. out[5] = a[5] * vy;
  51505. return out;
  51506. }
  51507. /**
  51508. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.invert
  51509. * @description 求逆矩阵。
  51510. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  51511. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  51512. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  51513. */
  51514. }, {
  51515. key: "invert",
  51516. value: function invert(out, a) {
  51517. var aa = a[0];
  51518. var ac = a[2];
  51519. var atx = a[4];
  51520. var ab = a[1];
  51521. var ad = a[3];
  51522. var aty = a[5];
  51523. var det = aa * ad - ab * ac;
  51524. if (!det) {
  51525. return null;
  51526. }
  51527. det = 1.0 / det;
  51528. out[0] = ad * det;
  51529. out[1] = -ab * det;
  51530. out[2] = -ac * det;
  51531. out[3] = aa * det;
  51532. out[4] = (ac * aty - ad * atx) * det;
  51533. out[5] = (ab * atx - aa * aty) * det;
  51534. return out;
  51535. }
  51536. /**
  51537. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mulVector
  51538. * @description 矩阵左乘向量。
  51539. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  51540. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  51541. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  51542. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  51543. */
  51544. }, {
  51545. key: "mulVector",
  51546. value: function mulVector(out, a, v) {
  51547. var aa = a[0];
  51548. var ac = a[2];
  51549. var atx = a[4];
  51550. var ab = a[1];
  51551. var ad = a[3];
  51552. var aty = a[5];
  51553. out[0] = v[0] * aa + v[1] * ac + atx;
  51554. out[1] = v[0] * ab + v[1] * ad + aty;
  51555. return out;
  51556. }
  51557. }]);
  51558. return Matrix;
  51559. }();
  51560. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SUtil.js
  51561. function SUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51562. 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); } }
  51563. function SUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) SUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) SUtil_defineProperties(Constructor, staticProps); return Constructor; }
  51564. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51565. * This program are made available under the terms of the Apache License, Version 2.0
  51566. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51567. var SUtil_SUtil = /*#__PURE__*/function () {
  51568. function SUtil() {
  51569. SUtil_classCallCheck(this, SUtil);
  51570. }
  51571. SUtil_createClass(SUtil, null, [{
  51572. key: "SUtil_smoothBezier",
  51573. /**
  51574. * @function SuperMap.LevelRenderer.SUtil.SUtil_smoothBezier
  51575. * @description 贝塞尔平滑曲线。
  51576. * @private
  51577. * @param {Array} points - 线段顶点数组。
  51578. * @param {number} smooth - 平滑等级, 0-1。
  51579. * @param {boolean} isLoop - isLoop。
  51580. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  51581. * @param {Array} [originalPosition=[0, 0]] - 参考原点。
  51582. * @return {Array} 生成的平滑节点数组。
  51583. */
  51584. value: function SUtil_smoothBezier(points, smooth, isLoop, constraint, originalPosition) {
  51585. if (!originalPosition || originalPosition !== 2) {
  51586. originalPosition = [0, 0];
  51587. }
  51588. var __OP = originalPosition;
  51589. var cps = [];
  51590. var v = [];
  51591. var v1 = [];
  51592. var v2 = [];
  51593. var hasConstraint = !!constraint;
  51594. var min, max;
  51595. if (hasConstraint) {
  51596. min = [Infinity, Infinity];
  51597. max = [-Infinity, -Infinity];
  51598. var _len = points.length;
  51599. for (var i = 0; i < _len; i++) {
  51600. SUtil.Util_vector.min(min, min, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  51601. SUtil.Util_vector.max(max, max, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  51602. } // 与指定的包围盒做并集
  51603. SUtil.Util_vector.min(min, min, constraint[0]);
  51604. SUtil.Util_vector.max(max, max, constraint[1]);
  51605. }
  51606. var len = points.length;
  51607. for (var _i = 0; _i < len; _i++) {
  51608. var point = [points[_i][0] + __OP[0], points[_i][1] + __OP[1]];
  51609. var prevPoint = void 0;
  51610. var nextPoint = void 0;
  51611. if (isLoop) {
  51612. prevPoint = [points[_i ? _i - 1 : len - 1][0] + __OP[0], points[_i ? _i - 1 : len - 1][1] + __OP[1]];
  51613. nextPoint = [points[(_i + 1) % len][0] + __OP[0], points[(_i + 1) % len][1] + __OP[1]];
  51614. } else {
  51615. if (_i === 0 || _i === len - 1) {
  51616. cps.push([points[_i][0] + __OP[0], points[_i][1] + __OP[1]]);
  51617. continue;
  51618. } else {
  51619. prevPoint = [points[_i - 1][0] + __OP[0], points[_i - 1][1] + __OP[1]];
  51620. nextPoint = [points[_i + 1][0] + __OP[0], points[_i + 1][1] + __OP[1]];
  51621. }
  51622. }
  51623. SUtil.Util_vector.sub(v, nextPoint, prevPoint); // use degree to scale the handle length
  51624. SUtil.Util_vector.scale(v, v, smooth);
  51625. var d0 = SUtil.Util_vector.distance(point, prevPoint);
  51626. var d1 = SUtil.Util_vector.distance(point, nextPoint);
  51627. var sum = d0 + d1;
  51628. if (sum !== 0) {
  51629. d0 /= sum;
  51630. d1 /= sum;
  51631. }
  51632. SUtil.Util_vector.scale(v1, v, -d0);
  51633. SUtil.Util_vector.scale(v2, v, d1);
  51634. var cp0 = SUtil.Util_vector.add([], point, v1);
  51635. var cp1 = SUtil.Util_vector.add([], point, v2);
  51636. if (hasConstraint) {
  51637. SUtil.Util_vector.max(cp0, cp0, min);
  51638. SUtil.Util_vector.min(cp0, cp0, max);
  51639. SUtil.Util_vector.max(cp1, cp1, min);
  51640. SUtil.Util_vector.min(cp1, cp1, max);
  51641. }
  51642. cps.push(cp0);
  51643. cps.push(cp1);
  51644. }
  51645. if (isLoop) {
  51646. cps.push(cps.shift());
  51647. }
  51648. return cps;
  51649. }
  51650. /**
  51651. * @function SuperMap.LevelRenderer.SUtil.SUtil_smoothSpline
  51652. * @description 插值折线。
  51653. * @private
  51654. * @param {Array} points - 线段顶点数组。
  51655. * @param {boolean} isLoop - isLoop。
  51656. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  51657. * @param {Array} originalPosition - 参考原点。默认值:[0, 0]。
  51658. * @return {Array} 生成的平滑节点数组。
  51659. */
  51660. }, {
  51661. key: "SUtil_smoothSpline",
  51662. value: function SUtil_smoothSpline(points, isLoop, constraint, originalPosition) {
  51663. if (!originalPosition || originalPosition !== 2) {
  51664. originalPosition = [0, 0];
  51665. }
  51666. var __OP = originalPosition;
  51667. var len = points.length;
  51668. var ret = [];
  51669. var distance = 0;
  51670. for (var i = 1; i < len; i++) {
  51671. 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]]);
  51672. }
  51673. var segs = distance / 5;
  51674. segs = segs < len ? len : segs;
  51675. for (var _i2 = 0; _i2 < segs; _i2++) {
  51676. var pos = _i2 / (segs - 1) * (isLoop ? len : len - 1);
  51677. var idx = Math.floor(pos);
  51678. var w = pos - idx;
  51679. var p0 = void 0;
  51680. var p1 = [points[idx % len][0] + __OP[0], points[idx % len][1] + __OP[1]];
  51681. var p2 = void 0;
  51682. var p3 = void 0;
  51683. if (!isLoop) {
  51684. p0 = [points[idx === 0 ? idx : idx - 1][0] + __OP[0], points[idx === 0 ? idx : idx - 1][1] + __OP[1]];
  51685. p2 = [points[idx > len - 2 ? len - 1 : idx + 1][0] + __OP[0], points[idx > len - 2 ? len - 1 : idx + 1][1] + __OP[1]];
  51686. p3 = [points[idx > len - 3 ? len - 1 : idx + 2][0] + __OP[0], points[idx > len - 3 ? len - 1 : idx + 2][1] + __OP[1]];
  51687. } else {
  51688. p0 = [points[(idx - 1 + len) % len][0] + __OP[0], points[(idx - 1 + len) % len][1] + __OP[1]];
  51689. p2 = [points[(idx + 1) % len][0] + __OP[0], points[(idx + 1) % len][1] + __OP[1]];
  51690. p3 = [points[(idx + 2) % len][0] + __OP[0], points[(idx + 2) % len][1] + __OP[1]];
  51691. }
  51692. var w2 = w * w;
  51693. var w3 = w * w2;
  51694. 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)]);
  51695. }
  51696. return ret; // inner Function
  51697. function interpolate(p0, p1, p2, p3, t, t2, t3) {
  51698. var v0 = (p2 - p0) * 0.5;
  51699. var v1 = (p3 - p1) * 0.5;
  51700. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  51701. }
  51702. }
  51703. /**
  51704. * @function SuperMap.LevelRenderer.SUtil.SUtil_dashedLineTo
  51705. * @description 虚线 lineTo。
  51706. */
  51707. }, {
  51708. key: "SUtil_dashedLineTo",
  51709. value: function SUtil_dashedLineTo(ctx, x1, y1, x2, y2, dashLength, customDashPattern) {
  51710. // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx
  51711. var dashPattern = [5, 5];
  51712. dashLength = typeof dashLength != 'number' ? 5 : dashLength;
  51713. if (ctx.setLineDash) {
  51714. dashPattern[0] = dashLength;
  51715. dashPattern[1] = dashLength;
  51716. if (customDashPattern && customDashPattern instanceof Array) {
  51717. ctx.setLineDash(customDashPattern);
  51718. } else {
  51719. ctx.setLineDash(dashPattern);
  51720. } // ctx.setLineDash(dashPattern);
  51721. ctx.moveTo(x1, y1);
  51722. ctx.lineTo(x2, y2);
  51723. return;
  51724. }
  51725. var dx = x2 - x1;
  51726. var dy = y2 - y1;
  51727. var numDashes = Math.floor(Math.sqrt(dx * dx + dy * dy) / dashLength);
  51728. dx = dx / numDashes;
  51729. dy = dy / numDashes;
  51730. var flag = true;
  51731. for (var i = 0; i < numDashes; ++i) {
  51732. if (flag) {
  51733. ctx.moveTo(x1, y1);
  51734. } else {
  51735. ctx.lineTo(x1, y1);
  51736. }
  51737. flag = !flag;
  51738. x1 += dx;
  51739. y1 += dy;
  51740. }
  51741. ctx.lineTo(x2, y2);
  51742. }
  51743. }]);
  51744. return SUtil;
  51745. }(); // 把所有工具对象放到全局静态变量上,以便直接调用工具方法,
  51746. // 避免使用工具时频繁的创建工具对象带来的性能消耗。
  51747. SUtil_SUtil.Util_area = new Area();
  51748. SUtil_SUtil.Util_color = new Color();
  51749. SUtil_SUtil.Util_computeBoundingBox = new ComputeBoundingBox();
  51750. SUtil_SUtil.Util_curve = new Curve_Curve();
  51751. SUtil_SUtil.Util_env = new Env();
  51752. SUtil_SUtil.Util_event = new Event_Event();
  51753. SUtil_SUtil.Util_http = new Http();
  51754. SUtil_SUtil.Util_log = new Log();
  51755. SUtil_SUtil.Util_math = new MathTool();
  51756. SUtil_SUtil.Util_matrix = new Matrix();
  51757. SUtil_SUtil.Util = new Util_Util();
  51758. SUtil_SUtil.Util_vector = new levelRenderer_Vector_Vector();
  51759. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Transformable.js
  51760. function Transformable_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51761. 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); } }
  51762. function Transformable_createClass(Constructor, protoProps, staticProps) { if (protoProps) Transformable_defineProperties(Constructor.prototype, protoProps); if (staticProps) Transformable_defineProperties(Constructor, staticProps); return Constructor; }
  51763. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51764. * This program are made available under the terms of the Apache License, Version 2.0
  51765. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51766. /**
  51767. * @private
  51768. * @class SuperMap.LevelRenderer.Transformable
  51769. * @category Visualization Theme
  51770. * @classdesc 可变换超类,所有支持 Canvas Transform 变换操作的类均是此类的子类。此类不可实例化。
  51771. */
  51772. var Transformable = /*#__PURE__*/function () {
  51773. /**
  51774. * @function SuperMap.LevelRenderer.Transformable.constructor
  51775. * @description 构造函数。
  51776. */
  51777. function Transformable() {
  51778. Transformable_classCallCheck(this, Transformable);
  51779. /**
  51780. * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.position
  51781. * @description 平移, 默认值:[0, 0]。
  51782. */
  51783. this.position = [0, 0];
  51784. /**
  51785. * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.rotation
  51786. * @description 旋转,可以通过数组二三项指定旋转的原点, 默认值:[0, 0, 0]。
  51787. */
  51788. this.rotation = [0, 0, 0];
  51789. /**
  51790. * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.scale
  51791. * @description 缩放,可以通过数组三四项指定缩放的原点, 默认值:[1, 1, 0, 0]。
  51792. */
  51793. this.scale = [1, 1, 0, 0];
  51794. /**
  51795. * @member {boolean} SuperMap.LevelRenderer.Transformable.prototype.needLocalTransform
  51796. * @description 是否变换。默认值:false。
  51797. */
  51798. this.needLocalTransform = false;
  51799. /**
  51800. * @member {boolean} SuperMap.LevelRenderer.Transformable.prototype.needTransform
  51801. * @description 是否有坐标变换。默认值:false。
  51802. */
  51803. this.needTransform = false;
  51804. this.CLASS_NAME = "SuperMap.LevelRenderer.Transformable";
  51805. /**
  51806. * @function SuperMap.LevelRenderer.Transformable.prototype.lookAt
  51807. * @description 设置图形的朝向。
  51808. */
  51809. this.lookAt = function () {
  51810. var v = SUtil_SUtil.Util_vector.create(); // {Array.<Number>|Float32Array} target
  51811. return function (target) {
  51812. if (!this.transform) {
  51813. this.transform = SUtil_SUtil.Util_matrix.create();
  51814. }
  51815. var m = this.transform;
  51816. SUtil_SUtil.Util_vector.sub(v, target, this.position);
  51817. if (isAroundZero(v[0]) && isAroundZero(v[1])) {
  51818. return;
  51819. }
  51820. SUtil_SUtil.Util_vector.normalize(v, v); // Y Axis
  51821. // TODO Scale origin ?
  51822. m[2] = v[0] * this.scale[1];
  51823. m[3] = v[1] * this.scale[1]; // X Axis
  51824. m[0] = v[1] * this.scale[0];
  51825. m[1] = -v[0] * this.scale[0]; // Position
  51826. m[4] = this.position[0];
  51827. m[5] = this.position[1];
  51828. this.decomposeTransform();
  51829. function isAroundZero(val) {
  51830. var EPSILON = 5e-5;
  51831. return val > -EPSILON && val < EPSILON;
  51832. }
  51833. };
  51834. }();
  51835. }
  51836. /**
  51837. * @function SuperMap.LevelRenderer.Transformable.prototype.destroy
  51838. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  51839. */
  51840. Transformable_createClass(Transformable, [{
  51841. key: "destroy",
  51842. value: function destroy() {
  51843. this.position = null;
  51844. this.rotation = null;
  51845. this.scale = null;
  51846. this.needLocalTransform = null;
  51847. this.needTransform = null;
  51848. }
  51849. /**
  51850. * @function SuperMap.LevelRenderer.Transformable.prototype.updateNeedTransform
  51851. * @description 更新 needLocalTransform
  51852. */
  51853. }, {
  51854. key: "updateNeedTransform",
  51855. value: function updateNeedTransform() {
  51856. this.needLocalTransform = isNotAroundZero(this.rotation[0]) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1);
  51857. function isNotAroundZero(val) {
  51858. var EPSILON = 5e-5;
  51859. return val > EPSILON || val < -EPSILON;
  51860. }
  51861. }
  51862. /**
  51863. * @function SuperMap.LevelRenderer.Transformable.prototype.updateTransform
  51864. * @description 判断是否需要有坐标变换,更新 needTransform 属性。如果有坐标变换, 则从 position, rotation, scale 以及父节点的 transform 计算出自身的 transform 矩阵
  51865. */
  51866. }, {
  51867. key: "updateTransform",
  51868. value: function updateTransform() {
  51869. this.updateNeedTransform();
  51870. if (this.parent) {
  51871. this.needTransform = this.needLocalTransform || this.parent.needTransform;
  51872. } else {
  51873. this.needTransform = this.needLocalTransform;
  51874. }
  51875. if (!this.needTransform) {
  51876. return;
  51877. }
  51878. var origin = [0, 0];
  51879. var m = this.transform || SUtil_SUtil.Util_matrix.create();
  51880. SUtil_SUtil.Util_matrix.identity(m);
  51881. if (this.needLocalTransform) {
  51882. if (isNotAroundZero(this.scale[0]) || isNotAroundZero(this.scale[1])) {
  51883. origin[0] = -this.scale[2] || 0;
  51884. origin[1] = -this.scale[3] || 0;
  51885. var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  51886. if (haveOrigin) {
  51887. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  51888. }
  51889. SUtil_SUtil.Util_matrix.scale(m, m, this.scale);
  51890. if (haveOrigin) {
  51891. origin[0] = -origin[0];
  51892. origin[1] = -origin[1];
  51893. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  51894. }
  51895. }
  51896. if (this.rotation instanceof Array) {
  51897. if (this.rotation[0] !== 0) {
  51898. origin[0] = -this.rotation[1] || 0;
  51899. origin[1] = -this.rotation[2] || 0;
  51900. var _haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  51901. if (_haveOrigin) {
  51902. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  51903. }
  51904. SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation[0]);
  51905. if (_haveOrigin) {
  51906. origin[0] = -origin[0];
  51907. origin[1] = -origin[1];
  51908. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  51909. }
  51910. }
  51911. } else {
  51912. if (this.rotation !== 0) {
  51913. SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation);
  51914. }
  51915. }
  51916. if (isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1])) {
  51917. SUtil_SUtil.Util_matrix.translate(m, m, this.position);
  51918. }
  51919. } // 保存这个变换矩阵
  51920. this.transform = m; // 应用父节点变换
  51921. if (this.parent && this.parent.needTransform) {
  51922. if (this.needLocalTransform) {
  51923. SUtil_SUtil.Util_matrix.mul(this.transform, this.parent.transform, this.transform);
  51924. } else {
  51925. SUtil_SUtil.Util_matrix.copy(this.transform, this.parent.transform);
  51926. }
  51927. }
  51928. function isNotAroundZero(val) {
  51929. var EPSILON = 5e-5;
  51930. return val > EPSILON || val < -EPSILON;
  51931. }
  51932. }
  51933. /**
  51934. * @function SuperMap.LevelRenderer.Transformable.prototype.setTransform
  51935. * @description 将自己的 transform 应用到 context 上。
  51936. *
  51937. * @param {Context2D} ctx - Context2D 上下文。
  51938. */
  51939. }, {
  51940. key: "setTransform",
  51941. value: function setTransform(ctx) {
  51942. if (this.needTransform) {
  51943. var m = this.transform;
  51944. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  51945. }
  51946. }
  51947. /**
  51948. * @function SuperMap.LevelRenderer.Transformable.prototype.decomposeTransform
  51949. * @description 分解`transform`矩阵到`position`, `rotation`, `scale` 。
  51950. */
  51951. }, {
  51952. key: "decomposeTransform",
  51953. value: function decomposeTransform() {
  51954. if (!this.transform) {
  51955. return;
  51956. }
  51957. var m = this.transform;
  51958. var sx = m[0] * m[0] + m[1] * m[1];
  51959. var position = this.position;
  51960. var scale = this.scale;
  51961. var rotation = this.rotation;
  51962. if (isNotAroundZero(sx - 1)) {
  51963. sx = Math.sqrt(sx);
  51964. }
  51965. var sy = m[2] * m[2] + m[3] * m[3];
  51966. if (isNotAroundZero(sy - 1)) {
  51967. sy = Math.sqrt(sy);
  51968. }
  51969. position[0] = m[4];
  51970. position[1] = m[5];
  51971. scale[0] = sx;
  51972. scale[1] = sy;
  51973. scale[2] = scale[3] = 0;
  51974. rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx);
  51975. rotation[1] = rotation[2] = 0;
  51976. function isNotAroundZero(val) {
  51977. var EPSILON = 5e-5;
  51978. return val > EPSILON || val < -EPSILON;
  51979. }
  51980. }
  51981. }]);
  51982. return Transformable;
  51983. }();
  51984. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Shape.js
  51985. function Shape_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Shape_typeof = function _typeof(obj) { return typeof obj; }; } else { Shape_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Shape_typeof(obj); }
  51986. function Shape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51987. 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); } }
  51988. function Shape_createClass(Constructor, protoProps, staticProps) { if (protoProps) Shape_defineProperties(Constructor.prototype, protoProps); if (staticProps) Shape_defineProperties(Constructor, staticProps); return Constructor; }
  51989. function Shape_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Shape_get = Reflect.get; } else { Shape_get = function _get(target, property, receiver) { var base = Shape_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Shape_get(target, property, receiver || target); }
  51990. function Shape_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Shape_getPrototypeOf(object); if (object === null) break; } return object; }
  51991. function Shape_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Shape_setPrototypeOf(subClass, superClass); }
  51992. function Shape_setPrototypeOf(o, p) { Shape_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Shape_setPrototypeOf(o, p); }
  51993. 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); }; }
  51994. function Shape_possibleConstructorReturn(self, call) { if (call && (Shape_typeof(call) === "object" || typeof call === "function")) { return call; } return Shape_assertThisInitialized(self); }
  51995. function Shape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51996. function Shape_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  51997. function Shape_getPrototypeOf(o) { Shape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Shape_getPrototypeOf(o); }
  51998. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51999. * This program are made available under the terms of the Apache License, Version 2.0
  52000. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52001. /**
  52002. * @private
  52003. * @class SuperMap.LevelRenderer.Shape
  52004. * @category Visualization Theme
  52005. * @classdesc 图形(shape)基类。
  52006. * @extends SuperMap.LevelRenderer.Eventful
  52007. * @extends SuperMap.LevelRenderer.Transformable
  52008. */
  52009. var Shape_Shape = /*#__PURE__*/function (_SuperMap$mixin) {
  52010. Shape_inherits(Shape, _SuperMap$mixin);
  52011. var _super = Shape_createSuper(Shape);
  52012. /**
  52013. * @function SuperMap.LevelRenderer.Shape.constructor
  52014. * @description 构造函数。
  52015. *
  52016. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  52017. *
  52018. */
  52019. function Shape(options) {
  52020. var _this;
  52021. Shape_classCallCheck(this, Shape);
  52022. _this = _super.call(this, options);
  52023. options = options || {};
  52024. /**
  52025. * @member {string} SuperMap.LevelRenderer.Shape.prototype.id
  52026. * @description 唯一标识。
  52027. */
  52028. _this.id = null;
  52029. /**
  52030. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.style
  52031. * @description 基础绘制样式。
  52032. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  52033. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  52034. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  52035. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  52036. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  52037. * @param {number} style.opacity - 绘制透明度。默认值:1。
  52038. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  52039. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  52040. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  52041. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  52042. * @param {string} style.text - 图形中的附加文本。默认值:""。
  52043. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  52044. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  52045. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  52046. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  52047. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  52048. *
  52049. */
  52050. _this.style = {};
  52051. /**
  52052. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.style.__rect
  52053. * @description 包围图形的最小矩形盒子。
  52054. *
  52055. * @param {number} x - 左上角顶点x轴坐标。
  52056. * @param {number} y - 左上角顶点y轴坐标。
  52057. * @param {number} width - 包围盒矩形宽度。
  52058. * @param {number} height - 包围盒矩形高度。
  52059. */
  52060. /**
  52061. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.highlightStyle
  52062. * @description 高亮样式。
  52063. *
  52064. * @param {string} highlightStyle.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  52065. * @param {string} highlightStyle.color - 填充颜色。默认值:"#000000'"。
  52066. * @param {string} highlightStyle.strokeColor - 描边颜色。默认值:"#000000'"。
  52067. * @param {string} highlightStyle.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  52068. * @param {number} highlightStyle.lineWidth - 描边宽度。默认值:1。
  52069. * @param {number} highlightStyle.opacity - 绘制透明度。默认值:1。
  52070. * @param {number} highlightStyle.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  52071. * @param {number} highlightStyle.shadowColor - 阴影颜色。默认值:"#000000'"。
  52072. * @param {number} highlightStyle.shadowOffsetX - 阴影横向偏移。默认值:0。
  52073. * @param {number} highlightStyle.shadowOffsetY - 阴影纵向偏移。默认值:0。
  52074. * @param {string} highlightStyle.text - 图形中的附加文本。默认值:""。
  52075. * @param {string} highlightStyle.textColor - 文本颜色。默认值:"#000000'"。
  52076. * @param {string} highlightStyle.textFont - 附加文本样式。示例:'bold 18px verdana'。
  52077. * @param {string} highlightStyle.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  52078. * @param {string} highlightStyle.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  52079. * @param {string} highlightStyle.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  52080. */
  52081. _this.highlightStyle = null;
  52082. /**
  52083. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.parent
  52084. * @description 父节点,只读属性。<SuperMap.LevelRenderer.Group>
  52085. */
  52086. _this.parent = null;
  52087. /**
  52088. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.__dirty
  52089. * @description {boolean}
  52090. */
  52091. _this.__dirty = true;
  52092. /**
  52093. * @member {Array} SuperMap.LevelRenderer.Shape.prototype.__clipShapes
  52094. * @description {Array}
  52095. *
  52096. */
  52097. _this.__clipShapes = [];
  52098. /**
  52099. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.invisible
  52100. * @description 图形是否可见,为 true 时不绘制图形,但是仍能触发鼠标事件。默认值:false。
  52101. */
  52102. _this.invisible = false;
  52103. /**
  52104. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.ignore
  52105. * @description 图形是否忽略,为 true 时忽略图形的绘制以及事件触发。默认值:false。
  52106. */
  52107. _this.ignore = false;
  52108. /**
  52109. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.zlevel
  52110. * @description z 层 level,决定绘画在哪层 canvas 中。默认值:0。
  52111. */
  52112. _this.zlevel = 0;
  52113. /**
  52114. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.draggable
  52115. * @description 是否可拖拽。默认值:false。
  52116. */
  52117. _this.draggable = false;
  52118. /**
  52119. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.clickable
  52120. * @description 是否可点击。默认值:false。
  52121. */
  52122. _this.clickable = false;
  52123. /**
  52124. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.hoverable
  52125. * @description 是否可以 hover。默认值:true。
  52126. */
  52127. _this.hoverable = true;
  52128. /**
  52129. * @member {number} SuperMap.LevelRenderer.Shape.prototype.z
  52130. * @description z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面,但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。默认值:0。
  52131. */
  52132. _this.z = 0; //地理扩展
  52133. /**
  52134. * @member {Array} SuperMap.LevelRenderer.Shape.prototype.refOriginalPosition
  52135. * @description 图形参考原点位置,图形的参考中心位置。
  52136. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  52137. *
  52138. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  52139. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  52140. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  52141. *
  52142. * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  52143. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  52144. * refOriginalPosition 的值为 [0, 0] 时,形的位置信息才是 canvas 绝对位置。
  52145. *
  52146. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  52147. *
  52148. * refOriginalPosition。默认值是: [0, 0]。
  52149. */
  52150. _this.refOriginalPosition = [0, 0];
  52151. /**
  52152. * @member {string} SuperMap.LevelRenderer.Shape.prototype.refDataID
  52153. * @description 图形所关联数据的 ID。
  52154. *
  52155. */
  52156. _this.refDataID = null;
  52157. /**
  52158. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.isHoverByRefDataID
  52159. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  52160. *
  52161. */
  52162. _this.isHoverByRefDataID = false;
  52163. /**
  52164. * @member {string} SuperMap.LevelRenderer.Shape.prototype.refDataHoverGroup
  52165. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  52166. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  52167. *
  52168. */
  52169. _this.refDataHoverGroup = null;
  52170. /**
  52171. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.dataInfo
  52172. * @description 图形的数据信息。
  52173. *
  52174. */
  52175. _this.dataInfo = null;
  52176. Util.extend(Shape_assertThisInitialized(_this), options);
  52177. _this.id = _this.id || Util.createUniqueID("smShape_");
  52178. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape";
  52179. /**
  52180. * @function SuperMap.LevelRenderer.Shape.prototype.getTansform
  52181. * @description 变换鼠标位置到 shape 的局部坐标空间
  52182. *
  52183. */
  52184. _this.getTansform = function () {
  52185. var invTransform = [];
  52186. return function (x, y) {
  52187. var originPos = [x, y]; // 对鼠标的坐标也做相同的变换
  52188. if (this.needTransform && this.transform) {
  52189. SUtil_SUtil.Util_matrix.invert(invTransform, this.transform);
  52190. SUtil_SUtil.Util_matrix.mulVector(originPos, invTransform, [x, y, 1]);
  52191. if (x == originPos[0] && y == originPos[1]) {
  52192. // 避免外部修改导致的 needTransform 不准确
  52193. this.updateNeedTransform();
  52194. }
  52195. }
  52196. return originPos;
  52197. };
  52198. }();
  52199. return _this;
  52200. }
  52201. /**
  52202. * @function SuperMap.LevelRenderer.Shape.prototype.destroy
  52203. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  52204. */
  52205. Shape_createClass(Shape, [{
  52206. key: "destroy",
  52207. value: function destroy() {
  52208. this.id = null;
  52209. this.style = null;
  52210. this.highlightStyle = null;
  52211. this.parent = null;
  52212. this.__dirty = null;
  52213. this.__clipShapes = null;
  52214. this.invisible = null;
  52215. this.ignore = null;
  52216. this.zlevel = null;
  52217. this.draggable = null;
  52218. this.clickable = null;
  52219. this.hoverable = null;
  52220. this.z = null;
  52221. this.refOriginalPosition = null;
  52222. this.refDataID = null;
  52223. this.refDataHoverGroup = null;
  52224. this.isHoverByRefDataID = null;
  52225. this.dataInfo = null;
  52226. Shape_get(Shape_getPrototypeOf(Shape.prototype), "destroy", this).call(this);
  52227. }
  52228. /**
  52229. * @function SuperMap.LevelRenderer.Shape.prototype.brush
  52230. * @description 绘制图形。
  52231. *
  52232. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52233. * @param {boolean} isHighlight - 是否使用高亮属性。
  52234. * @param {Function} updateCallback - 需要异步加载资源的 shape 可以通过这个 callback(e),让painter更新视图,base.brush 没用,需要的话重载 brush。
  52235. */
  52236. }, {
  52237. key: "brush",
  52238. value: function brush(ctx, isHighlight) {
  52239. var style = this.beforeBrush(ctx, isHighlight);
  52240. ctx.beginPath();
  52241. this.buildPath(ctx, style);
  52242. switch (style.brushType) {
  52243. /* jshint ignore:start */
  52244. case 'both':
  52245. this.setCtxGlobalAlpha(ctx, "fill", style);
  52246. ctx.fill();
  52247. if (style.lineWidth > 0) {
  52248. this.setCtxGlobalAlpha(ctx, "stroke", style);
  52249. ctx.stroke();
  52250. }
  52251. this.setCtxGlobalAlpha(ctx, "reset", style);
  52252. break;
  52253. case 'stroke':
  52254. this.setCtxGlobalAlpha(ctx, "stroke", style);
  52255. style.lineWidth > 0 && ctx.stroke();
  52256. this.setCtxGlobalAlpha(ctx, "reset", style);
  52257. break;
  52258. /* jshint ignore:end */
  52259. default:
  52260. this.setCtxGlobalAlpha(ctx, "fill", style);
  52261. ctx.fill();
  52262. this.setCtxGlobalAlpha(ctx, "reset", style);
  52263. break;
  52264. }
  52265. this.drawText(ctx, style, this.style);
  52266. this.afterBrush(ctx);
  52267. }
  52268. /**
  52269. * @function SuperMap.LevelRenderer.Shape.prototype.beforeBrush
  52270. * @description 具体绘制操作前的一些公共操作。
  52271. *
  52272. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52273. * @param {boolean} isHighlight - 是否使用高亮属性。
  52274. * @return {Object} 处理后的样式。
  52275. */
  52276. }, {
  52277. key: "beforeBrush",
  52278. value: function beforeBrush(ctx, isHighlight) {
  52279. var style = this.style;
  52280. if (this.brushTypeOnly) {
  52281. style.brushType = this.brushTypeOnly;
  52282. }
  52283. if (isHighlight) {
  52284. // 根据style扩展默认高亮样式
  52285. style = this.getHighlightStyle(style, this.highlightStyle || {}, this.brushTypeOnly);
  52286. }
  52287. if (this.brushTypeOnly == 'stroke') {
  52288. style.strokeColor = style.strokeColor || style.color;
  52289. }
  52290. ctx.save();
  52291. this.doClip(ctx);
  52292. this.setContext(ctx, style); // 设置transform
  52293. this.setTransform(ctx);
  52294. return style;
  52295. }
  52296. /**
  52297. * @function SuperMap.LevelRenderer.Shape.prototype.afterBrush
  52298. * @description 绘制后的处理。
  52299. *
  52300. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52301. *
  52302. */
  52303. }, {
  52304. key: "afterBrush",
  52305. value: function afterBrush(ctx) {
  52306. ctx.restore();
  52307. }
  52308. /**
  52309. * @function SuperMap.LevelRenderer.Shape.prototype.setContext
  52310. * @description 设置 fillStyle, strokeStyle, shadow 等通用绘制样式。
  52311. *
  52312. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52313. * @param {Object} style - 样式。
  52314. *
  52315. */
  52316. }, {
  52317. key: "setContext",
  52318. value: function setContext(ctx, style) {
  52319. 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']];
  52320. for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) {
  52321. var styleProp = STYLE_CTX_MAP[i][0];
  52322. var styleValue = style[styleProp];
  52323. var ctxProp = STYLE_CTX_MAP[i][1];
  52324. if (typeof styleValue != 'undefined') {
  52325. ctx[ctxProp] = styleValue;
  52326. }
  52327. }
  52328. }
  52329. /**
  52330. * @function SuperMap.LevelRenderer.Shape.prototype.doClip
  52331. *
  52332. */
  52333. }, {
  52334. key: "doClip",
  52335. value: function doClip(ctx) {
  52336. var clipShapeInvTransform = SUtil_SUtil.Util_matrix.create();
  52337. if (this.__clipShapes) {
  52338. for (var i = 0; i < this.__clipShapes.length; i++) {
  52339. var clipShape = this.__clipShapes[i];
  52340. if (clipShape.needTransform) {
  52341. var m = clipShape.transform;
  52342. SUtil_SUtil.Util_matrix.invert(clipShapeInvTransform, m);
  52343. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  52344. }
  52345. ctx.beginPath();
  52346. clipShape.buildPath(ctx, clipShape.style);
  52347. ctx.clip(); // Transform back
  52348. if (clipShape.needTransform) {
  52349. var _m = clipShapeInvTransform;
  52350. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  52351. }
  52352. }
  52353. }
  52354. }
  52355. /**
  52356. * @function SuperMap.LevelRenderer.Shape.prototype.getHighlightStyle
  52357. * @description 根据默认样式扩展高亮样式
  52358. *
  52359. * @param {Object} style - 样式。
  52360. * @param {Object} highlightStyle - 高亮样式。
  52361. * @param {string} brushTypeOnly - brushTypeOnly。
  52362. *
  52363. */
  52364. }, {
  52365. key: "getHighlightStyle",
  52366. value: function getHighlightStyle(style, highlightStyle, brushTypeOnly) {
  52367. var newStyle = {};
  52368. for (var k in style) {
  52369. newStyle[k] = style[k];
  52370. }
  52371. var highlightColor = SUtil_SUtil.Util_color.getHighlightColor(); // 根据highlightStyle扩展
  52372. if (style.brushType != 'stroke') {
  52373. // 带填充则用高亮色加粗边线
  52374. newStyle.strokeColor = highlightColor; // SMIC-方法修改 - start
  52375. newStyle.lineWidth = style.lineWidth || 1; // 原始代码
  52376. // newStyle.lineWidth = (style.lineWidth || 1)
  52377. // + this.getHighlightZoom();
  52378. // 修改代码1
  52379. // if(!style.lineType || style.lineType === "solid"){
  52380. // newStyle.lineWidth = (style.lineWidth || 1)
  52381. // + this.getHighlightZoom();
  52382. // }
  52383. // else{
  52384. // newStyle.lineWidth = (style.lineWidth || 1);
  52385. // }
  52386. // SMIC-方法修改 - end
  52387. newStyle.brushType = 'both';
  52388. } else {
  52389. if (brushTypeOnly != 'stroke') {
  52390. // 描边型的则用原色加工高亮
  52391. newStyle.strokeColor = highlightColor; // SMIC-方法修改 - start
  52392. newStyle.lineWidth = style.lineWidth || 1; // 原始代码
  52393. // newStyle.lineWidth = (style.lineWidth || 1)
  52394. // + this.getHighlightZoom();
  52395. // 修改代码1
  52396. // if(!style.lineType || style.lineType === "solid"){
  52397. // newStyle.lineWidth = (style.lineWidth || 1)
  52398. // + this.getHighlightZoom();
  52399. // }
  52400. // else{
  52401. // newStyle.lineWidth = (style.lineWidth || 1);
  52402. // }
  52403. // SMIC-方法修改 - end
  52404. } else {
  52405. // 线型的则用原色加工高亮
  52406. newStyle.strokeColor = highlightStyle.strokeColor || SUtil_SUtil.Util_color.mix(style.strokeColor, SUtil_SUtil.Util_color.toRGB(highlightColor));
  52407. }
  52408. } // 可自定义覆盖默认值
  52409. for (var _k in highlightStyle) {
  52410. if (typeof highlightStyle[_k] != 'undefined') {
  52411. newStyle[_k] = highlightStyle[_k];
  52412. }
  52413. }
  52414. return newStyle;
  52415. }
  52416. /**
  52417. * @function SuperMap.LevelRenderer.Shape.prototype.getHighlightZoom
  52418. * @description 高亮放大效果参数,当前统一设置为6,如有需要差异设置,通过 this.type 判断实例类型
  52419. *
  52420. */
  52421. }, {
  52422. key: "getHighlightZoom",
  52423. value: function getHighlightZoom() {
  52424. return this.type != 'text' ? 6 : 2;
  52425. }
  52426. /**
  52427. * @function SuperMap.LevelRenderer.Shape.prototype.drift
  52428. * @description 移动位置
  52429. *
  52430. * @param {Object} dx - 横坐标变化。
  52431. * @param {Object} dy - 纵坐标变化。
  52432. *
  52433. */
  52434. }, {
  52435. key: "drift",
  52436. value: function drift(dx, dy) {
  52437. this.position[0] += dx;
  52438. this.position[1] += dy;
  52439. }
  52440. /**
  52441. * @function SuperMap.LevelRenderer.Shape.prototype.buildPath
  52442. * @description 构建绘制的Path。子类必须重新实现此方法。
  52443. *
  52444. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52445. * @param {Object} style - 样式。
  52446. */
  52447. }, {
  52448. key: "buildPath",
  52449. value: function buildPath(ctx, style) {
  52450. // eslint-disable-line no-unused-vars
  52451. SUtil_SUtil.Util_log('buildPath not implemented in ' + this.type);
  52452. }
  52453. /**
  52454. * @function SuperMap.LevelRenderer.Shape.prototype.getRect
  52455. * @description 计算返回包围盒矩形。子类必须重新实现此方法。
  52456. *
  52457. * @param {Object} style - 样式。
  52458. */
  52459. }, {
  52460. key: "getRect",
  52461. value: function getRect(style) {
  52462. // eslint-disable-line no-unused-vars
  52463. SUtil_SUtil.Util_log('getRect not implemented in ' + this.type);
  52464. }
  52465. /**
  52466. * @function SuperMap.LevelRenderer.Shape.prototype.isCover
  52467. * @description 判断鼠标位置是否在图形内。
  52468. *
  52469. * @param {number} x - x。
  52470. * @param {number} y - y。
  52471. */
  52472. }, {
  52473. key: "isCover",
  52474. value: function isCover(x, y) {
  52475. var originPos = this.getTansform(x, y);
  52476. x = originPos[0];
  52477. y = originPos[1]; // 快速预判并保留判断矩形
  52478. var rect = this.style.__rect;
  52479. if (!rect) {
  52480. rect = this.style.__rect = this.getRect(this.style);
  52481. }
  52482. if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) {
  52483. // 矩形内
  52484. return SUtil_SUtil.Util_area.isInside(this, this.style, x, y);
  52485. }
  52486. return false;
  52487. }
  52488. /**
  52489. * @function SuperMap.LevelRenderer.Shape.prototype.drawText
  52490. * @description 绘制附加文本。
  52491. *
  52492. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52493. * @param {string} style - 样式。
  52494. * @param {string} normalStyle - normalStyle 默认样式,用于定位文字显示。
  52495. */
  52496. }, {
  52497. key: "drawText",
  52498. value: function drawText(ctx, style, normalStyle) {
  52499. if (typeof style.text == 'undefined' || style.text === false) {
  52500. return;
  52501. } // 字体颜色策略
  52502. var textColor = style.textColor || style.color || style.strokeColor;
  52503. ctx.fillStyle = textColor; // 文本与图形间空白间隙
  52504. var dd = 10;
  52505. var al; // 文本水平对齐
  52506. var bl; // 文本垂直对齐
  52507. var tx; // 文本横坐标
  52508. var ty; // 文本纵坐标
  52509. var textPosition = style.textPosition // 用户定义
  52510. || this.textPosition // shape默认
  52511. || 'top'; // 全局默认
  52512. // Smic 方法修改 -start
  52513. var __OP = [];
  52514. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52515. __OP = [0, 0];
  52516. } else {
  52517. __OP = this.refOriginalPosition;
  52518. } //原代码:
  52519. // Smic 方法修改 -end
  52520. switch (textPosition) {
  52521. case 'inside':
  52522. case 'top':
  52523. case 'bottom':
  52524. case 'left':
  52525. case 'right':
  52526. if (this.getRect) {
  52527. var rect = (normalStyle || style).__rect || this.getRect(normalStyle || style);
  52528. switch (textPosition) {
  52529. case 'inside':
  52530. tx = rect.x + rect.width / 2;
  52531. ty = rect.y + rect.height / 2;
  52532. al = 'center';
  52533. bl = 'middle';
  52534. if (style.brushType != 'stroke' && textColor == style.color) {
  52535. ctx.fillStyle = '#fff';
  52536. }
  52537. break;
  52538. case 'left':
  52539. tx = rect.x - dd;
  52540. ty = rect.y + rect.height / 2;
  52541. al = 'end';
  52542. bl = 'middle';
  52543. break;
  52544. case 'right':
  52545. tx = rect.x + rect.width + dd;
  52546. ty = rect.y + rect.height / 2;
  52547. al = 'start';
  52548. bl = 'middle';
  52549. break;
  52550. case 'top':
  52551. tx = rect.x + rect.width / 2;
  52552. ty = rect.y - dd;
  52553. al = 'center';
  52554. bl = 'bottom';
  52555. break;
  52556. case 'bottom':
  52557. tx = rect.x + rect.width / 2;
  52558. ty = rect.y + rect.height + dd;
  52559. al = 'center';
  52560. bl = 'top';
  52561. break;
  52562. }
  52563. }
  52564. break;
  52565. case 'start':
  52566. case 'end':
  52567. var xStart = 0;
  52568. var xEnd = 0;
  52569. var yStart = 0;
  52570. var yEnd = 0;
  52571. if (typeof style.pointList != 'undefined') {
  52572. var pointList = style.pointList;
  52573. if (pointList.length < 2) {
  52574. // 少于2个点就不画了~
  52575. return;
  52576. }
  52577. var length = pointList.length;
  52578. switch (textPosition) {
  52579. // Smic 方法修改 -start
  52580. case 'start':
  52581. xStart = pointList[0][0] + __OP[0];
  52582. xEnd = pointList[1][0] + __OP[0];
  52583. yStart = pointList[0][1] + __OP[1];
  52584. yEnd = pointList[1][1] + __OP[1];
  52585. break;
  52586. case 'end':
  52587. xStart = pointList[length - 2][0] + __OP[0];
  52588. xEnd = pointList[length - 1][0] + __OP[0];
  52589. yStart = pointList[length - 2][1] + __OP[1];
  52590. yEnd = pointList[length - 1][1] + __OP[1];
  52591. break;
  52592. //原代码:
  52593. /*
  52594. case 'start':
  52595. xStart = pointList[0][0];
  52596. xEnd = pointList[1][0];
  52597. yStart = pointList[0][1];
  52598. yEnd = pointList[1][1];
  52599. break;
  52600. case 'end':
  52601. xStart = pointList[length - 2][0];
  52602. xEnd = pointList[length - 1][0];
  52603. yStart = pointList[length - 2][1];
  52604. yEnd = pointList[length - 1][1];
  52605. break;
  52606. */
  52607. // Smic 方法修改 -end
  52608. }
  52609. } else {
  52610. // Smic 方法修改 -start
  52611. xStart = style.xStart + __OP[0] || 0;
  52612. xEnd = style.xEnd + __OP[0] || 0;
  52613. yStart = style.yStart + __OP[1] || 0;
  52614. yEnd = style.yEnd + __OP[1] || 0; //原代码:
  52615. /*
  52616. xStart = style.xStart || 0;
  52617. xEnd = style.xEnd || 0;
  52618. yStart = style.yStart || 0;
  52619. yEnd = style.yEnd || 0;
  52620. */
  52621. // Smic 方法修改 -end
  52622. }
  52623. switch (textPosition) {
  52624. case 'start':
  52625. al = xStart < xEnd ? 'end' : 'start';
  52626. bl = yStart < yEnd ? 'bottom' : 'top';
  52627. tx = xStart;
  52628. ty = yStart;
  52629. break;
  52630. case 'end':
  52631. al = xStart < xEnd ? 'start' : 'end';
  52632. bl = yStart < yEnd ? 'top' : 'bottom';
  52633. tx = xEnd;
  52634. ty = yEnd;
  52635. break;
  52636. }
  52637. dd -= 4;
  52638. if (xStart && xEnd && xStart != xEnd) {
  52639. tx -= al == 'end' ? dd : -dd;
  52640. } else {
  52641. al = 'center';
  52642. }
  52643. if (yStart != yEnd) {
  52644. ty -= bl == 'bottom' ? dd : -dd;
  52645. } else {
  52646. bl = 'middle';
  52647. }
  52648. break;
  52649. case 'specific':
  52650. tx = style.textX || 0;
  52651. ty = style.textY || 0;
  52652. al = 'start';
  52653. bl = 'middle';
  52654. break;
  52655. } // Smic 方法修改 -start
  52656. if (style.labelXOffset && !isNaN(style.labelXOffset)) {
  52657. tx += style.labelXOffset;
  52658. }
  52659. if (style.labelYOffset && !isNaN(style.labelYOffset)) {
  52660. ty += style.labelYOffset;
  52661. } //原代码:
  52662. // Smic 方法修改 -end
  52663. if (tx != null && ty != null) {
  52664. Shape._fillText(ctx, style.text, tx, ty, style.textFont, style.textAlign || al, style.textBaseline || bl);
  52665. }
  52666. }
  52667. /**
  52668. * @function SuperMap.LevelRenderer.Shape.prototype.modSelf
  52669. * @description 图形发生改变
  52670. */
  52671. }, {
  52672. key: "modSelf",
  52673. value: function modSelf() {
  52674. this.__dirty = true;
  52675. if (this.style) {
  52676. this.style.__rect = null;
  52677. }
  52678. if (this.highlightStyle) {
  52679. this.highlightStyle.__rect = null;
  52680. }
  52681. }
  52682. /**
  52683. * @function SuperMap.LevelRenderer.Shape.prototype.isSilent
  52684. * @description 图形是否会触发事件,通过 bind 绑定的事件
  52685. */
  52686. }, {
  52687. key: "isSilent",
  52688. value: function isSilent() {
  52689. 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);
  52690. }
  52691. /**
  52692. * @function SuperMap.LevelRenderer.Shape.prototype.setCtxGlobalAlpha
  52693. * @description 设置 Cavans 上下文全局透明度
  52694. *
  52695. * @param {Object} _ctx - Cavans 上下文
  52696. * @param {string} type - one of 'stroke', 'fill', or 'reset'
  52697. * @param {Object} style - Symbolizer hash
  52698. */
  52699. }, {
  52700. key: "setCtxGlobalAlpha",
  52701. value: function setCtxGlobalAlpha(_ctx, type, style) {
  52702. if (type === "fill") {
  52703. _ctx.globalAlpha = typeof style["fillOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['fillOpacity'];
  52704. } else if (type === "stroke") {
  52705. _ctx.globalAlpha = typeof style["strokeOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['strokeOpacity'];
  52706. } else {
  52707. _ctx.globalAlpha = typeof style["opacity"] === "undefined" ? 1 : style['opacity'];
  52708. }
  52709. }
  52710. /**
  52711. * @function SuperMap.LevelRenderer.Shape.prototype._fillText
  52712. * @description 填充文本
  52713. */
  52714. }], [{
  52715. key: "_fillText",
  52716. value: function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) {
  52717. if (textFont) {
  52718. ctx.font = textFont;
  52719. }
  52720. ctx.textAlign = textAlign;
  52721. ctx.textBaseline = textBaseline;
  52722. var rect = Shape._getTextRect(text, x, y, textFont, textAlign, textBaseline);
  52723. text = (text + '').split('\n');
  52724. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
  52725. switch (textBaseline) {
  52726. case 'top':
  52727. y = rect.y;
  52728. break;
  52729. case 'bottom':
  52730. y = rect.y + lineHeight;
  52731. break;
  52732. default:
  52733. y = rect.y + lineHeight / 2;
  52734. }
  52735. for (var i = 0, l = text.length; i < l; i++) {
  52736. ctx.fillText(text[i], x, y);
  52737. y += lineHeight;
  52738. }
  52739. }
  52740. /**
  52741. * @function SuperMap.LevelRenderer.Shape._getTextRect
  52742. * @description 返回矩形区域,用于局部刷新和文字定位
  52743. *
  52744. * @param {string} text - text。
  52745. * @param {number} x - x。
  52746. * @param {number} y - y。
  52747. * @param {string} textFont - textFont。
  52748. * @param {string} textAlign - textAlign。
  52749. * @param {string} textBaseline - textBaseline。
  52750. * @return {Object} 矩形区域。
  52751. */
  52752. }, {
  52753. key: "_getTextRect",
  52754. value: function _getTextRect(text, x, y, textFont, textAlign, textBaseline) {
  52755. var width = SUtil_SUtil.Util_area.getTextWidth(text, textFont);
  52756. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
  52757. text = (text + '').split('\n');
  52758. switch (textAlign) {
  52759. case 'end':
  52760. case 'right':
  52761. x -= width;
  52762. break;
  52763. case 'center':
  52764. x -= width / 2;
  52765. break;
  52766. }
  52767. switch (textBaseline) {
  52768. case 'top':
  52769. break;
  52770. case 'bottom':
  52771. y -= lineHeight * text.length;
  52772. break;
  52773. default:
  52774. y -= lineHeight * text.length / 2;
  52775. }
  52776. return {
  52777. x: x,
  52778. y: y,
  52779. width: width,
  52780. height: lineHeight * text.length
  52781. };
  52782. }
  52783. }]);
  52784. return Shape;
  52785. }(SuperMap.mixin(Eventful, Transformable));
  52786. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPoint.js
  52787. function SmicPoint_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicPoint_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicPoint_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicPoint_typeof(obj); }
  52788. function SmicPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52789. 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); } }
  52790. function SmicPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPoint_defineProperties(Constructor, staticProps); return Constructor; }
  52791. function SmicPoint_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicPoint_get = Reflect.get; } else { SmicPoint_get = function _get(target, property, receiver) { var base = SmicPoint_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicPoint_get(target, property, receiver || target); }
  52792. function SmicPoint_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPoint_getPrototypeOf(object); if (object === null) break; } return object; }
  52793. function SmicPoint_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicPoint_setPrototypeOf(subClass, superClass); }
  52794. function SmicPoint_setPrototypeOf(o, p) { SmicPoint_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPoint_setPrototypeOf(o, p); }
  52795. 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); }; }
  52796. function SmicPoint_possibleConstructorReturn(self, call) { if (call && (SmicPoint_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicPoint_assertThisInitialized(self); }
  52797. function SmicPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52798. function SmicPoint_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  52799. function SmicPoint_getPrototypeOf(o) { SmicPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPoint_getPrototypeOf(o); }
  52800. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  52801. * This program are made available under the terms of the Apache License, Version 2.0
  52802. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52803. /**
  52804. * @private
  52805. * @class SuperMap.LevelRenderer.Shape.SmicPoint
  52806. * @category Visualization Theme
  52807. * @classdesc 点。
  52808. * @extends SuperMap.LevelRenderer.Shape
  52809. * @example
  52810. * var shape = new SuperMap.LevelRenderer.Shape.SmicPoint({
  52811. * style: {
  52812. * x: 100,
  52813. * y: 100,
  52814. * r: 40,
  52815. * brushType: 'both',
  52816. * color: 'blue',
  52817. * strokeColor: 'red',
  52818. * lineWidth: 3,
  52819. * text: 'point'
  52820. * }
  52821. * });
  52822. * levelRenderer.addShape(shape);
  52823. *
  52824. *
  52825. */
  52826. var SmicPoint = /*#__PURE__*/function (_Shape) {
  52827. SmicPoint_inherits(SmicPoint, _Shape);
  52828. var _super = SmicPoint_createSuper(SmicPoint);
  52829. /**
  52830. * @member {Object} SuperMap.LevelRenderer.Shape.SmicPoint.prototype.style
  52831. * @description 绘制样式。
  52832. *
  52833. * @param {number} style.x - 圆心x坐标,必设参数。
  52834. * @param {number} style.y - 圆心y坐标,必设参数。
  52835. * @param {number} style.r - 半径,必设参数。
  52836. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  52837. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  52838. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  52839. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  52840. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  52841. * @param {number} style.opacity - 绘制透明度。默认值:1。
  52842. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  52843. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  52844. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  52845. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  52846. * @param {string} style.text - 图形中的附加文本。默认值:""。
  52847. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  52848. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  52849. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  52850. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  52851. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  52852. */
  52853. //打开接口 style
  52854. /**
  52855. * @function SuperMap.LevelRenderer.Shape.SmicPoint.constructor
  52856. * @description 构造函数。
  52857. *
  52858. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  52859. *
  52860. */
  52861. function SmicPoint(options) {
  52862. var _this;
  52863. SmicPoint_classCallCheck(this, SmicPoint);
  52864. _this = _super.call(this, options);
  52865. /**
  52866. * @member {string} SuperMap.LevelRenderer.Shape.SmicPoint.prototype.type
  52867. * @description 图形类型。
  52868. */
  52869. _this.type = 'smicpoint';
  52870. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  52871. _this.refOriginalPosition = [0, 0];
  52872. }
  52873. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPoint";
  52874. return _this;
  52875. }
  52876. /**
  52877. * @function cdestroy
  52878. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  52879. */
  52880. SmicPoint_createClass(SmicPoint, [{
  52881. key: "destroy",
  52882. value: function destroy() {
  52883. this.type = null;
  52884. SmicPoint_get(SmicPoint_getPrototypeOf(SmicPoint.prototype), "destroy", this).call(this);
  52885. }
  52886. /**
  52887. * @function SuperMap.LevelRenderer.Shape.SmicPoint.prototype.buildPath
  52888. * @description 创建点触。
  52889. *
  52890. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52891. * @param {Object} style - style。
  52892. *
  52893. */
  52894. }, {
  52895. key: "buildPath",
  52896. value: function buildPath(ctx, style) {
  52897. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52898. this.refOriginalPosition = [0, 0];
  52899. }
  52900. var __OP = this.refOriginalPosition;
  52901. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, true);
  52902. return;
  52903. }
  52904. /**
  52905. * @function SuperMap.LevelRenderer.Shape.SmicPoint.prototype.getRect
  52906. * @description 计算返回点的包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  52907. *
  52908. * @param {Object} style - style
  52909. * @return {Object} 边框对象。包含属性:x,y,width,height。
  52910. */
  52911. }, {
  52912. key: "getRect",
  52913. value: function getRect(style) {
  52914. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52915. this.refOriginalPosition = [0, 0];
  52916. }
  52917. var __OP = this.refOriginalPosition;
  52918. if (style.__rect) {
  52919. return style.__rect;
  52920. }
  52921. var lineWidth;
  52922. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  52923. lineWidth = style.lineWidth || 1;
  52924. } else {
  52925. lineWidth = 0;
  52926. }
  52927. style.__rect = {
  52928. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  52929. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  52930. width: style.r * 2 + lineWidth,
  52931. height: style.r * 2 + lineWidth
  52932. };
  52933. return style.__rect;
  52934. }
  52935. }]);
  52936. return SmicPoint;
  52937. }(Shape_Shape);
  52938. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicText.js
  52939. function SmicText_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicText_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicText_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicText_typeof(obj); }
  52940. function SmicText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52941. 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); } }
  52942. function SmicText_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicText_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicText_defineProperties(Constructor, staticProps); return Constructor; }
  52943. function SmicText_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicText_get = Reflect.get; } else { SmicText_get = function _get(target, property, receiver) { var base = SmicText_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicText_get(target, property, receiver || target); }
  52944. function SmicText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicText_getPrototypeOf(object); if (object === null) break; } return object; }
  52945. function SmicText_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicText_setPrototypeOf(subClass, superClass); }
  52946. function SmicText_setPrototypeOf(o, p) { SmicText_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicText_setPrototypeOf(o, p); }
  52947. 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); }; }
  52948. function SmicText_possibleConstructorReturn(self, call) { if (call && (SmicText_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicText_assertThisInitialized(self); }
  52949. function SmicText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52950. function SmicText_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  52951. function SmicText_getPrototypeOf(o) { SmicText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicText_getPrototypeOf(o); }
  52952. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  52953. * This program are made available under the terms of the Apache License, Version 2.0
  52954. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52955. /**
  52956. * @private
  52957. * @class SuperMap.LevelRenderer.Shape.SmicText
  52958. * @category Visualization Theme
  52959. * @extends {SuperMap.LevelRenderer.Shape}
  52960. * @example
  52961. * var shape = new SuperMap.LevelRenderer.Shape.SmicText({
  52962. * style: {
  52963. * text: 'Label',
  52964. * x: 100,
  52965. * y: 100,
  52966. * textFont: '14px Arial'
  52967. * }
  52968. * });
  52969. * levelRenderer.addShape(shape);
  52970. *
  52971. */
  52972. var SmicText = /*#__PURE__*/function (_Shape) {
  52973. SmicText_inherits(SmicText, _Shape);
  52974. var _super = SmicText_createSuper(SmicText);
  52975. /**
  52976. * @member {Object} SuperMap.LevelRenderer.Shape.SmicText.prototype.style
  52977. * @description 绘制样式。
  52978. *
  52979. * @param {number} style.x - 横坐标,必设参数。
  52980. * @param {number} style.y - 纵坐标,必设参数。
  52981. * @param {string} style.text - 图形中的附加文本。默认值:""。
  52982. * @param {number} style.maxWidth - 最大宽度限制。默认值:null。
  52983. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  52984. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  52985. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  52986. * @param {string} style.brushType -画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  52987. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  52988. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  52989. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  52990. * @param {number} style.opacity - 绘制透明度。默认值:1。
  52991. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  52992. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  52993. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  52994. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  52995. */
  52996. //打开接口 style
  52997. /**
  52998. * @function SuperMap.LevelRenderer.Shape.SmicText.constructor
  52999. * @description 构造函数。
  53000. *
  53001. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  53002. *
  53003. */
  53004. function SmicText(options) {
  53005. var _this;
  53006. SmicText_classCallCheck(this, SmicText);
  53007. _this = _super.call(this, options);
  53008. /**
  53009. * @member {string} SuperMap.LevelRenderer.Shape.SmicText.prototype.type
  53010. * @description 图形类型.
  53011. */
  53012. _this.type = 'smictext';
  53013. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  53014. _this.refOriginalPosition = [0, 0];
  53015. }
  53016. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicText";
  53017. return _this;
  53018. }
  53019. /**
  53020. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.destroy
  53021. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  53022. */
  53023. SmicText_createClass(SmicText, [{
  53024. key: "destroy",
  53025. value: function destroy() {
  53026. this.type = null;
  53027. SmicText_get(SmicText_getPrototypeOf(SmicText.prototype), "destroy", this).call(this);
  53028. }
  53029. /**
  53030. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.brush
  53031. * @description 笔触。
  53032. *
  53033. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  53034. * @param {boolean} isHighlight - 是否使用高亮属性。
  53035. *
  53036. */
  53037. }, {
  53038. key: "brush",
  53039. value: function brush(ctx, isHighlight) {
  53040. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  53041. this.refOriginalPosition = [0, 0];
  53042. }
  53043. var __OP = this.refOriginalPosition;
  53044. var style = this.style;
  53045. if (isHighlight) {
  53046. // 根据style扩展默认高亮样式
  53047. style = this.getHighlightStyle(style, this.highlightStyle || {});
  53048. }
  53049. if (typeof style.text == 'undefined' || style.text === false) {
  53050. return;
  53051. }
  53052. ctx.save();
  53053. this.doClip(ctx);
  53054. this.setContext(ctx, style); // 设置transform
  53055. this.setTransform(ctx);
  53056. if (style.textFont) {
  53057. ctx.font = style.textFont;
  53058. }
  53059. ctx.textAlign = style.textAlign || 'start';
  53060. ctx.textBaseline = style.textBaseline || 'middle';
  53061. var text = (style.text + '').split('\n');
  53062. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
  53063. var rect = this.getRectNoRotation(style); // var x = style.x;
  53064. var x = style.x + __OP[0];
  53065. var y;
  53066. if (style.textBaseline == 'top') {
  53067. y = rect.y;
  53068. } else if (style.textBaseline == 'bottom') {
  53069. y = rect.y + lineHeight;
  53070. } else {
  53071. y = rect.y + lineHeight / 2;
  53072. }
  53073. var ox = style.x + __OP[0];
  53074. var oy = style.y + __OP[1]; //文本绘制
  53075. for (var i = 0, l = text.length; i < l; i++) {
  53076. //是否渲染矩形背景及颜色
  53077. if (style.labelRect) {
  53078. //+4,-2是为了让文字距边框左右边缘有点间隔
  53079. ctx.fillRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  53080. ctx.fillStyle = style.strokeColor;
  53081. ctx.strokeRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  53082. ctx.fillStyle = style.textColor;
  53083. }
  53084. switch (style.brushType) {
  53085. case 'stroke':
  53086. this.setCtxGlobalAlpha(ctx, "stroke", style);
  53087. if (style.textRotation && style.textRotation !== 0) {
  53088. ctx.save();
  53089. ctx.translate(ox, oy);
  53090. ctx.rotate(style.textRotation * Math.PI / 180);
  53091. if (style.textBaseline == 'top') {
  53092. if (style.maxWidth) {
  53093. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  53094. } else {
  53095. ctx.strokeText(text[i], 0, lineHeight * i);
  53096. }
  53097. } else if (style.textBaseline == 'bottom') {
  53098. if (style.maxWidth) {
  53099. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  53100. } else {
  53101. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  53102. }
  53103. } else {
  53104. if (style.maxWidth) {
  53105. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  53106. } else {
  53107. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  53108. }
  53109. }
  53110. ctx.restore();
  53111. } else {
  53112. if (style.maxWidth) {
  53113. ctx.strokeText(text[i], x, y, style.maxWidth);
  53114. } else {
  53115. ctx.strokeText(text[i], x, y);
  53116. }
  53117. }
  53118. this.setCtxGlobalAlpha(ctx, "reset", style);
  53119. break;
  53120. case 'both':
  53121. if (style.textRotation && style.textRotation !== 0) {
  53122. ctx.save();
  53123. ctx.translate(ox, oy);
  53124. ctx.rotate(style.textRotation * Math.PI / 180);
  53125. if (style.textBaseline == 'top') {
  53126. if (style.maxWidth) {
  53127. this.setCtxGlobalAlpha(ctx, "fill", style);
  53128. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  53129. this.setCtxGlobalAlpha(ctx, "reset", style);
  53130. this.setCtxGlobalAlpha(ctx, "stroke", style);
  53131. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  53132. this.setCtxGlobalAlpha(ctx, "reset", style);
  53133. } else {
  53134. this.setCtxGlobalAlpha(ctx, "fill", style);
  53135. ctx.fillText(text[i], 0, lineHeight * i);
  53136. this.setCtxGlobalAlpha(ctx, "reset", style);
  53137. this.setCtxGlobalAlpha(ctx, "stroke", style);
  53138. ctx.strokeText(text[i], 0, lineHeight * i);
  53139. this.setCtxGlobalAlpha(ctx, "reset", style);
  53140. }
  53141. } else if (style.textBaseline == 'bottom') {
  53142. if (style.maxWidth) {
  53143. this.setCtxGlobalAlpha(ctx, "fill", style);
  53144. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  53145. this.setCtxGlobalAlpha(ctx, "reset", style);
  53146. this.setCtxGlobalAlpha(ctx, "stroke", style);
  53147. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  53148. this.setCtxGlobalAlpha(ctx, "reset", style);
  53149. } else {
  53150. this.setCtxGlobalAlpha(ctx, "fill", style);
  53151. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  53152. this.setCtxGlobalAlpha(ctx, "reset", style);
  53153. this.setCtxGlobalAlpha(ctx, "stroke", style);
  53154. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  53155. this.setCtxGlobalAlpha(ctx, "reset", style);
  53156. }
  53157. } else {
  53158. if (style.maxWidth) {
  53159. this.setCtxGlobalAlpha(ctx, "fill", style);
  53160. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  53161. this.setCtxGlobalAlpha(ctx, "reset", style);
  53162. this.setCtxGlobalAlpha(ctx, "stroke", style);
  53163. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  53164. this.setCtxGlobalAlpha(ctx, "reset", style);
  53165. } else {
  53166. this.setCtxGlobalAlpha(ctx, "fill", style);
  53167. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  53168. this.setCtxGlobalAlpha(ctx, "reset", style);
  53169. this.setCtxGlobalAlpha(ctx, "stroke", style);
  53170. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  53171. this.setCtxGlobalAlpha(ctx, "reset", style);
  53172. }
  53173. }
  53174. ctx.restore();
  53175. } else {
  53176. if (style.maxWidth) {
  53177. this.setCtxGlobalAlpha(ctx, "fill", style);
  53178. ctx.fillText(text[i], x, y, style.maxWidth);
  53179. this.setCtxGlobalAlpha(ctx, "reset", style);
  53180. this.setCtxGlobalAlpha(ctx, "stroke", style);
  53181. ctx.strokeText(text[i], x, y, style.maxWidth);
  53182. this.setCtxGlobalAlpha(ctx, "reset", style);
  53183. } else {
  53184. this.setCtxGlobalAlpha(ctx, "fill", style);
  53185. ctx.fillText(text[i], x, y);
  53186. this.setCtxGlobalAlpha(ctx, "reset", style);
  53187. this.setCtxGlobalAlpha(ctx, "stroke", style);
  53188. ctx.strokeText(text[i], x, y);
  53189. this.setCtxGlobalAlpha(ctx, "reset", style);
  53190. }
  53191. }
  53192. break;
  53193. default:
  53194. //fill or others
  53195. this.setCtxGlobalAlpha(ctx, "fill", style);
  53196. if (style.textRotation && style.textRotation !== 0) {
  53197. ctx.save();
  53198. ctx.translate(ox, oy);
  53199. ctx.rotate(style.textRotation * Math.PI / 180);
  53200. if (style.textBaseline == 'top') {
  53201. if (style.maxWidth) {
  53202. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  53203. } else {
  53204. ctx.fillText(text[i], 0, lineHeight * i);
  53205. }
  53206. } else if (style.textBaseline == 'bottom') {
  53207. if (style.maxWidth) {
  53208. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  53209. } else {
  53210. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  53211. }
  53212. } else {
  53213. if (style.maxWidth) {
  53214. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  53215. } else {
  53216. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  53217. }
  53218. }
  53219. ctx.restore();
  53220. } else {
  53221. if (style.maxWidth) {
  53222. ctx.fillText(text[i], x, y, style.maxWidth);
  53223. } else {
  53224. ctx.fillText(text[i], x, y);
  53225. }
  53226. }
  53227. this.setCtxGlobalAlpha(ctx, "reset", style);
  53228. }
  53229. y += lineHeight;
  53230. }
  53231. ctx.restore();
  53232. return;
  53233. }
  53234. /**
  53235. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRect
  53236. * @description 返回文字包围盒矩形
  53237. */
  53238. }, {
  53239. key: "getRect",
  53240. value: function getRect(style) {
  53241. if (style.__rect) {
  53242. return style.__rect;
  53243. }
  53244. var left, top, right, bottom;
  53245. var tbg = this.getTextBackground(style, true);
  53246. for (var i = 0, len = tbg.length; i < len; i++) {
  53247. var poi = tbg[i]; //用第一个点初始化
  53248. if (i == 0) {
  53249. left = poi[0];
  53250. right = poi[0];
  53251. top = poi[1];
  53252. bottom = poi[1];
  53253. } else {
  53254. if (poi[0] < left) {
  53255. left = poi[0];
  53256. }
  53257. if (poi[0] > right) {
  53258. right = poi[0];
  53259. }
  53260. if (poi[1] < top) {
  53261. top = poi[1];
  53262. }
  53263. if (poi[1] > bottom) {
  53264. bottom = poi[1];
  53265. }
  53266. }
  53267. }
  53268. style.__rect = {
  53269. x: left,
  53270. y: top,
  53271. width: right - left,
  53272. height: bottom - top
  53273. };
  53274. return style.__rect;
  53275. }
  53276. /**
  53277. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRectNoRotation
  53278. * @description 返回忽略旋转和maxWidth时文字包围盒矩形
  53279. */
  53280. }, {
  53281. key: "getRectNoRotation",
  53282. value: function getRectNoRotation(style) {
  53283. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  53284. this.refOriginalPosition = [0, 0];
  53285. }
  53286. var __OP = this.refOriginalPosition;
  53287. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
  53288. var width = SUtil_SUtil.Util_area.getTextWidth(style.text, style.textFont);
  53289. var height = SUtil_SUtil.Util_area.getTextHeight(style.text, style.textFont); //处理文字位置,注:文本的绘制是由此 rect 决定
  53290. var textX = style.x + __OP[0]; // 默认start == left
  53291. if (style.textAlign == 'end' || style.textAlign == 'right') {
  53292. textX -= width;
  53293. } else if (style.textAlign == 'center') {
  53294. textX -= width / 2;
  53295. }
  53296. var textY;
  53297. if (style.textBaseline == 'top') {
  53298. // textY = style.y;
  53299. textY = style.y + __OP[1];
  53300. } else if (style.textBaseline == 'bottom') {
  53301. textY = style.y + __OP[1] - height;
  53302. } else {
  53303. // middle
  53304. textY = style.y + __OP[1] - height / 2;
  53305. }
  53306. var isWidthChangeByMaxWidth = false;
  53307. var widthBeforeChangeByMaxWidth; //处理 maxWidth
  53308. if (style.maxWidth) {
  53309. var maxWidth = parseInt(style.maxWidth);
  53310. if (maxWidth < width) {
  53311. widthBeforeChangeByMaxWidth = width;
  53312. isWidthChangeByMaxWidth = true;
  53313. width = maxWidth;
  53314. }
  53315. textX = style.x + __OP[0];
  53316. if (style.textAlign == 'end' || style.textAlign == 'right') {
  53317. textX -= width;
  53318. } else if (style.textAlign == 'center') {
  53319. textX -= width / 2;
  53320. }
  53321. } //处理斜体字
  53322. if (style.textFont) {
  53323. var textFont = style.textFont;
  53324. var textFontStr = textFont.toLowerCase();
  53325. if (textFontStr.indexOf("italic") > -1) {
  53326. if (isWidthChangeByMaxWidth === true) {
  53327. width += lineHeight / 3 * (width / widthBeforeChangeByMaxWidth);
  53328. } else {
  53329. width += lineHeight / 3;
  53330. }
  53331. }
  53332. }
  53333. var rect = {
  53334. x: textX,
  53335. y: textY,
  53336. width: width,
  53337. height: height
  53338. };
  53339. return rect;
  53340. }
  53341. /**
  53342. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getTextBackground
  53343. * @description 获取文本背景框范围
  53344. *
  53345. * @param {Object} style - 样式。
  53346. * @param {boolean} redo - 是否强制重新计算 textBackground。
  53347. */
  53348. }, {
  53349. key: "getTextBackground",
  53350. value: function getTextBackground(style, redo) {
  53351. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  53352. this.refOriginalPosition = [0, 0];
  53353. }
  53354. var __OP = this.refOriginalPosition;
  53355. if (!redo && style.__textBackground) {
  53356. return style.__textBackground;
  53357. } //不旋转时矩形框
  53358. var rect = this.getRectNoRotation(style); //旋转中心点
  53359. var ox = style.x + __OP[0];
  53360. var oy = style.y + __OP[1]; //背景框
  53361. var background = [];
  53362. if (style.textRotation && style.textRotation !== 0) {
  53363. var textRotation = style.textRotation;
  53364. var ltPoi = this.getRotatedLocation(rect.x, rect.y, ox, oy, textRotation);
  53365. var rtPoi = this.getRotatedLocation(rect.x + rect.width, rect.y, ox, oy, textRotation);
  53366. var rbPoi = this.getRotatedLocation(rect.x + rect.width, rect.y + rect.height, ox, oy, textRotation);
  53367. var lbPoi = this.getRotatedLocation(rect.x, rect.y + rect.height, ox, oy, textRotation);
  53368. background.push(ltPoi);
  53369. background.push(rtPoi);
  53370. background.push(rbPoi);
  53371. background.push(lbPoi);
  53372. } else {
  53373. var _ltPoi = [rect.x, rect.y];
  53374. var _rtPoi = [rect.x + rect.width, rect.y];
  53375. var _rbPoi = [rect.x + rect.width, rect.y + rect.height];
  53376. var _lbPoi = [rect.x, rect.y + rect.height];
  53377. background.push(_ltPoi);
  53378. background.push(_rtPoi);
  53379. background.push(_rbPoi);
  53380. background.push(_lbPoi);
  53381. }
  53382. style.__textBackground = background;
  53383. return style.__textBackground;
  53384. }
  53385. /**
  53386. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRotatedLocation
  53387. * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)
  53388. *
  53389. * @param {number} x - 旋转点横坐标。
  53390. * @param {number} y - 旋转点纵坐标。
  53391. * @param {number} rx - 旋转中心点横坐标。
  53392. * @param {number} ry - 旋转中心点纵坐标。
  53393. * @param {number} angle - 旋转角度(度)。
  53394. * @return {Array} 旋转后的坐标位置,长度为 2 的一维数组,数组第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53395. */
  53396. }, {
  53397. key: "getRotatedLocation",
  53398. value: function getRotatedLocation(x, y, rx, ry, angle) {
  53399. var loc = new Array(),
  53400. x0,
  53401. y0;
  53402. y = -y;
  53403. ry = -ry;
  53404. angle = -angle; //顺时针旋转
  53405. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  53406. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  53407. loc[0] = x0;
  53408. loc[1] = -y0;
  53409. return loc;
  53410. }
  53411. }]);
  53412. return SmicText;
  53413. }(Shape_Shape);
  53414. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicCircle.js
  53415. function SmicCircle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicCircle_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicCircle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicCircle_typeof(obj); }
  53416. function SmicCircle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53417. 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); } }
  53418. function SmicCircle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicCircle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicCircle_defineProperties(Constructor, staticProps); return Constructor; }
  53419. function SmicCircle_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicCircle_get = Reflect.get; } else { SmicCircle_get = function _get(target, property, receiver) { var base = SmicCircle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicCircle_get(target, property, receiver || target); }
  53420. function SmicCircle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicCircle_getPrototypeOf(object); if (object === null) break; } return object; }
  53421. function SmicCircle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicCircle_setPrototypeOf(subClass, superClass); }
  53422. function SmicCircle_setPrototypeOf(o, p) { SmicCircle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicCircle_setPrototypeOf(o, p); }
  53423. 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); }; }
  53424. function SmicCircle_possibleConstructorReturn(self, call) { if (call && (SmicCircle_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicCircle_assertThisInitialized(self); }
  53425. function SmicCircle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53426. function SmicCircle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  53427. function SmicCircle_getPrototypeOf(o) { SmicCircle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicCircle_getPrototypeOf(o); }
  53428. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  53429. * This program are made available under the terms of the Apache License, Version 2.0
  53430. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53431. /**
  53432. * @private
  53433. * @class SuperMap.LevelRenderer.Shape.SmicCircle
  53434. * @category Visualization Theme
  53435. * @classdesc 圆形
  53436. * @extends SuperMap.LevelRenderer.Shape
  53437. * @example
  53438. * var shape = new SuperMap.LevelRenderer.Shape.SmicCircle({
  53439. * style: {
  53440. * x: 100,
  53441. * y: 100,
  53442. * r: 60,
  53443. * brushType: "both",
  53444. * color: "blue",
  53445. * strokeColor: "red",
  53446. * lineWidth: 3,
  53447. * text: "Circle"
  53448. * }
  53449. * });
  53450. * levelRenderer.addShape(shape);
  53451. *
  53452. *
  53453. */
  53454. var SmicCircle = /*#__PURE__*/function (_Shape) {
  53455. SmicCircle_inherits(SmicCircle, _Shape);
  53456. var _super = SmicCircle_createSuper(SmicCircle);
  53457. /**
  53458. * @member {Object} SuperMap.LevelRenderer.Shape.SmicCircle.prototype.style
  53459. * @description 绘制样式。
  53460. *
  53461. * @param {number} x - 圆心x坐标,必设参数
  53462. * @param {number} y - 圆心y坐标,必设参数
  53463. * @param {number} r - 半径,必设参数
  53464. * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  53465. * @param {string} color - 填充颜色,默认值"#000000"
  53466. * @param {string} strokeColor - 描边颜色,默认值为'#000000'
  53467. * @param {string} lineCape — 线帽样式,可以是 butt, round, square,默认是butt
  53468. * @param {number} lineWidth - 描边宽度、默认是1
  53469. * @param {number} opacity - 绘制透明度、默认是1,不透明
  53470. * @param {number} shadowBlur - 阴影模糊度,大于0有效,默认是0
  53471. * @param {string} shadowColor - 阴影颜色,默认是'#000000'
  53472. * @param {number} shadowOffsetX - 阴影横向偏移,默认是0
  53473. * @param {number} shadowOffsetY - 阴影纵向偏移,默认是0
  53474. * @param {string} text - 图形中的附加文本,默认是0
  53475. * @param {string} textColor - 文本颜色,默认是'#000000'
  53476. * @param {string} textFont - 附加文本样式,eg:'bold 18px verdana'
  53477. * @param {string} textPosition - 附加文本位置, 可以是 inside, left, right, top, bottom
  53478. * @param {string} textAlign - 默认根据textPosition自动设置,附加文本水平对齐。可以是start, end, left, right, center
  53479. * @param {string} textBaseline 默认根据textPosition自动设置,附加文本垂直对齐。可以是top, bottom, middle, alphabetic, hanging, ideographic
  53480. */
  53481. //打开接口 style
  53482. /**
  53483. * @function SuperMap.LevelRenderer.Shape.SmicCircle.constructor
  53484. * @description 构造函数。
  53485. *
  53486. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  53487. *
  53488. */
  53489. function SmicCircle(options) {
  53490. var _this;
  53491. SmicCircle_classCallCheck(this, SmicCircle);
  53492. _this = _super.call(this, options);
  53493. /**
  53494. * @member {string} SuperMap.LevelRenderer.Shape.SmicCircle.prototype.type
  53495. * @description 图形类型。
  53496. */
  53497. _this.type = 'smiccircle';
  53498. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  53499. _this.refOriginalPosition = [0, 0];
  53500. }
  53501. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicCircle";
  53502. return _this;
  53503. }
  53504. /**
  53505. * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.destroy
  53506. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  53507. */
  53508. SmicCircle_createClass(SmicCircle, [{
  53509. key: "destroy",
  53510. value: function destroy() {
  53511. this.type = null;
  53512. SmicCircle_get(SmicCircle_getPrototypeOf(SmicCircle.prototype), "destroy", this).call(this);
  53513. }
  53514. /**
  53515. * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.buildPath
  53516. * @description 创建图形路径。
  53517. *
  53518. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  53519. * @param {Object} style - style。
  53520. *
  53521. */
  53522. }, {
  53523. key: "buildPath",
  53524. value: function buildPath(ctx, style) {
  53525. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  53526. this.refOriginalPosition = [0, 0];
  53527. }
  53528. var __OP = this.refOriginalPosition;
  53529. var x = style.x + __OP[0]; // 圆心x
  53530. var y = style.y + __OP[1]; // 圆心y
  53531. ctx.moveTo(x + style.r, y);
  53532. ctx.arc(x, y, style.r, 0, Math.PI * 2, true);
  53533. return true;
  53534. }
  53535. /**
  53536. * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.getRect
  53537. * @description 返回圆形包围盒矩形
  53538. *
  53539. * @param {Object} style - style
  53540. * @return {Object} 边框对象。包含属性:x,y,width,height。
  53541. *
  53542. */
  53543. }, {
  53544. key: "getRect",
  53545. value: function getRect(style) {
  53546. if (style.__rect) {
  53547. return style.__rect;
  53548. }
  53549. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  53550. this.refOriginalPosition = [0, 0];
  53551. }
  53552. var __OP = this.refOriginalPosition;
  53553. var x = style.x + __OP[0]; // 圆心x
  53554. var y = style.y + __OP[1]; // 圆心y
  53555. var r = style.r; // 圆r
  53556. var lineWidth;
  53557. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  53558. lineWidth = style.lineWidth || 1;
  53559. } else {
  53560. lineWidth = 0;
  53561. }
  53562. style.__rect = {
  53563. x: Math.round(x - r - lineWidth / 2),
  53564. y: Math.round(y - r - lineWidth / 2),
  53565. width: r * 2 + lineWidth,
  53566. height: r * 2 + lineWidth
  53567. };
  53568. return style.__rect;
  53569. }
  53570. }]);
  53571. return SmicCircle;
  53572. }(Shape_Shape);
  53573. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPolygon.js
  53574. function SmicPolygon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicPolygon_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicPolygon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicPolygon_typeof(obj); }
  53575. function SmicPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53576. 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); } }
  53577. function SmicPolygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPolygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPolygon_defineProperties(Constructor, staticProps); return Constructor; }
  53578. function SmicPolygon_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicPolygon_get = Reflect.get; } else { SmicPolygon_get = function _get(target, property, receiver) { var base = SmicPolygon_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicPolygon_get(target, property, receiver || target); }
  53579. function SmicPolygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPolygon_getPrototypeOf(object); if (object === null) break; } return object; }
  53580. function SmicPolygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicPolygon_setPrototypeOf(subClass, superClass); }
  53581. function SmicPolygon_setPrototypeOf(o, p) { SmicPolygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPolygon_setPrototypeOf(o, p); }
  53582. 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); }; }
  53583. function SmicPolygon_possibleConstructorReturn(self, call) { if (call && (SmicPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicPolygon_assertThisInitialized(self); }
  53584. function SmicPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53585. function SmicPolygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  53586. function SmicPolygon_getPrototypeOf(o) { SmicPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPolygon_getPrototypeOf(o); }
  53587. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  53588. * This program are made available under the terms of the Apache License, Version 2.0
  53589. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53590. /**
  53591. * @private
  53592. * @class SuperMap.LevelRenderer.Shape.SmicPolygon
  53593. * @category Visualization Theme
  53594. * @classdesc 多边形。
  53595. * @extends SuperMap.LevelRenderer.Shape
  53596. * @example
  53597. * var shape = new SuperMap.LevelRenderer.Shape.SmicPolygon({
  53598. * style: {
  53599. * // 100x100 的正方形
  53600. * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]],
  53601. * color: 'blue'
  53602. * }
  53603. * });
  53604. * levelRenderer.addShape(shape);
  53605. *
  53606. */
  53607. var SmicPolygon = /*#__PURE__*/function (_Shape) {
  53608. SmicPolygon_inherits(SmicPolygon, _Shape);
  53609. var _super = SmicPolygon_createSuper(SmicPolygon);
  53610. /**
  53611. * @member {Object} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.style
  53612. * @description 绘制样式。
  53613. *
  53614. * @param {Array} pointList - 节点数组,二维数组。默认值:null,必设参数。其形式如下:
  53615. * (code)
  53616. * (start code)
  53617. * [
  53618. * [10, 20], //单个节点
  53619. * [30, 40],
  53620. * [25, 30]
  53621. * ]
  53622. * (end)
  53623. * @param {string} style.smooth - 是否做平滑插值, 平滑算法可以选择 "bezier", "spline"。默认值:"";
  53624. * @param {number} style.smoothConstraint - 平滑约束。
  53625. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  53626. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  53627. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  53628. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  53629. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  53630. * @param {number} style.opacity - 绘制透明度。默认值:1。
  53631. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  53632. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  53633. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  53634. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  53635. * @param {string} style.text - 图形中的附加文本。默认值:""。
  53636. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  53637. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  53638. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  53639. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  53640. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  53641. */
  53642. //打开接口 style
  53643. /**
  53644. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.constructor
  53645. * @description 构造函数。
  53646. *
  53647. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  53648. *
  53649. */
  53650. function SmicPolygon(options) {
  53651. var _this;
  53652. SmicPolygon_classCallCheck(this, SmicPolygon);
  53653. _this = _super.call(this, options);
  53654. /**
  53655. * @member {string} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.type
  53656. * @description 图形类型.
  53657. */
  53658. _this.type = 'smicpolygon';
  53659. /**
  53660. * @member {Array} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype._holePolygonPointList
  53661. * @description 岛洞面多边形顶点数组(三维数组)
  53662. *
  53663. */
  53664. _this.holePolygonPointLists = null;
  53665. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  53666. _this.refOriginalPosition = [0, 0];
  53667. }
  53668. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPolygon";
  53669. return _this;
  53670. }
  53671. /**
  53672. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.destroy
  53673. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  53674. */
  53675. SmicPolygon_createClass(SmicPolygon, [{
  53676. key: "destroy",
  53677. value: function destroy() {
  53678. this.type = null;
  53679. this.holePolygonPointLists = null;
  53680. SmicPolygon_get(SmicPolygon_getPrototypeOf(SmicPolygon.prototype), "destroy", this).call(this);
  53681. }
  53682. /**
  53683. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.brush
  53684. * @description 笔触。
  53685. *
  53686. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  53687. * @param {boolean} isHighlight - 是否使用高亮属性。
  53688. *
  53689. */
  53690. }, {
  53691. key: "brush",
  53692. value: function brush(ctx, isHighlight) {
  53693. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  53694. this.refOriginalPosition = [0, 0];
  53695. }
  53696. var style = this.style;
  53697. if (isHighlight) {
  53698. // 根据style扩展默认高亮样式
  53699. style = this.getHighlightStyle(style, this.highlightStyle || {});
  53700. }
  53701. ctx.save();
  53702. this.setContext(ctx, style); // 设置 transform
  53703. this.setTransform(ctx); // 先 fill 再stroke
  53704. var hasPath = false;
  53705. if (style.brushType == 'fill' || style.brushType == 'both' || typeof style.brushType == 'undefined') {
  53706. // 默认为fill
  53707. ctx.beginPath();
  53708. if (style.lineType == 'dashed' || style.lineType == 'dotted' || style.lineType == 'dot' || style.lineType == 'dash' || style.lineType == 'dashdot' || style.lineType == 'longdash' || style.lineType == 'longdashdot') {
  53709. // 特殊处理,虚线围不成path,实线再build一次
  53710. this.buildPath(ctx, {
  53711. lineType: 'solid',
  53712. lineWidth: style.lineWidth,
  53713. pointList: style.pointList
  53714. });
  53715. } else {
  53716. this.buildPath(ctx, style);
  53717. hasPath = true; // 这个path能用
  53718. }
  53719. ctx.closePath();
  53720. this.setCtxGlobalAlpha(ctx, "fill", style);
  53721. ctx.fill();
  53722. this.setCtxGlobalAlpha(ctx, "reset", style);
  53723. }
  53724. if (style.lineWidth > 0 && (style.brushType == 'stroke' || style.brushType == 'both')) {
  53725. if (!hasPath) {
  53726. ctx.beginPath();
  53727. this.buildPath(ctx, style);
  53728. }
  53729. this.setCtxGlobalAlpha(ctx, "stroke", style);
  53730. ctx.stroke();
  53731. this.setCtxGlobalAlpha(ctx, "reset", style);
  53732. }
  53733. this.drawText(ctx, style, this.style); //岛洞
  53734. var hpStyle = Util.cloneObject(style);
  53735. if (hpStyle.pointList) {
  53736. if (this.holePolygonPointLists && this.holePolygonPointLists.length > 0) {
  53737. var holePLS = this.holePolygonPointLists;
  53738. var holePLSen = holePLS.length;
  53739. for (var i = 0; i < holePLSen; i++) {
  53740. var holePL = holePLS[i]; //岛洞面
  53741. hpStyle.pointList = holePL;
  53742. ctx.globalCompositeOperation = "destination-out"; // 先 fill 再stroke
  53743. hasPath = false;
  53744. if (hpStyle.brushType == 'fill' || hpStyle.brushType == 'both' || typeof hpStyle.brushType == 'undefined') {
  53745. // 默认为fill
  53746. ctx.beginPath();
  53747. if (hpStyle.lineType == 'dashed' || hpStyle.lineType == 'dotted' || hpStyle.lineType == 'dot' || hpStyle.lineType == 'dash' || hpStyle.lineType == 'dashdot' || hpStyle.lineType == 'longdash' || hpStyle.lineType == 'longdashdot') {
  53748. // 特殊处理,虚线围不成path,实线再build一次
  53749. this.buildPath(ctx, {
  53750. lineType: 'solid',
  53751. lineWidth: hpStyle.lineWidth,
  53752. pointList: hpStyle.pointList
  53753. });
  53754. } else {
  53755. this.buildPath(ctx, hpStyle);
  53756. hasPath = true; // 这个path能用
  53757. }
  53758. ctx.closePath();
  53759. this.setCtxGlobalAlpha(ctx, "fill", hpStyle);
  53760. ctx.fill();
  53761. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  53762. }
  53763. if (hpStyle.lineWidth > 0 && (hpStyle.brushType == 'stroke' || hpStyle.brushType == 'both')) {
  53764. if (!hasPath) {
  53765. ctx.beginPath();
  53766. this.buildPath(ctx, hpStyle);
  53767. } //如果描边,先回复 globalCompositeOperation 默认值再描边。
  53768. ctx.globalCompositeOperation = "source-over";
  53769. this.setCtxGlobalAlpha(ctx, "stroke", hpStyle);
  53770. ctx.stroke();
  53771. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  53772. } else {
  53773. ctx.globalCompositeOperation = "source-over";
  53774. }
  53775. }
  53776. }
  53777. }
  53778. ctx.restore();
  53779. return;
  53780. }
  53781. /**
  53782. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.buildPath
  53783. * @description 创建多边形路径。
  53784. *
  53785. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  53786. * @param {Object} style - style。
  53787. *
  53788. */
  53789. }, {
  53790. key: "buildPath",
  53791. value: function buildPath(ctx, style) {
  53792. if (style.showShadow) {
  53793. ctx.shadowBlur = style.shadowBlur;
  53794. ctx.shadowColor = style.shadowColor;
  53795. ctx.shadowOffsetX = style.shadowOffsetX;
  53796. ctx.shadowOffsetY = style.shadowOffsetY;
  53797. }
  53798. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  53799. this.refOriginalPosition = [0, 0];
  53800. }
  53801. var __OP = this.refOriginalPosition; // 虽然能重用 brokenLine,但底层图形基于性能考虑,重复代码减少调用吧
  53802. var pointList = style.pointList;
  53803. if (pointList.length < 2) {
  53804. // 少于2个点就不画了~
  53805. return;
  53806. }
  53807. if (style.smooth && style.smooth !== 'spline') {
  53808. var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, true, style.smoothConstraint, __OP);
  53809. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  53810. var cp1;
  53811. var cp2;
  53812. var p;
  53813. var len = pointList.length;
  53814. for (var i = 0; i < len; i++) {
  53815. cp1 = controlPoints[i * 2];
  53816. cp2 = controlPoints[i * 2 + 1];
  53817. p = [pointList[(i + 1) % len][0] + __OP[0], pointList[(i + 1) % len][1] + __OP[1]];
  53818. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  53819. }
  53820. } else {
  53821. if (style.smooth === 'spline') {
  53822. pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, true, null, __OP);
  53823. }
  53824. if (!style.lineType || style.lineType == 'solid') {
  53825. // 默认为实线
  53826. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  53827. for (var _i = 1; _i < pointList.length; _i++) {
  53828. ctx.lineTo(pointList[_i][0] + __OP[0], pointList[_i][1] + __OP[1]);
  53829. }
  53830. ctx.lineTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  53831. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  53832. // SMIC-方法修改 - start
  53833. var dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  53834. style._dashLength = dashLengthForStyle;
  53835. var dashLength = style.lineWidth || 1;
  53836. var pattern1 = dashLength;
  53837. var pattern2 = dashLength; //dashed
  53838. if (style.lineType === 'dashed') {
  53839. pattern1 *= 5;
  53840. pattern2 *= 5;
  53841. if (style.lineCap && style.lineCap !== "butt") {
  53842. pattern1 -= dashLength;
  53843. pattern2 += dashLength;
  53844. }
  53845. } //dotted
  53846. if (style.lineType === 'dotted') {
  53847. if (style.lineCap && style.lineCap !== "butt") {
  53848. pattern1 = 1;
  53849. pattern2 += dashLength;
  53850. }
  53851. } //dot
  53852. if (style.lineType === 'dot') {
  53853. pattern2 *= 4;
  53854. if (style.lineCap && style.lineCap !== "butt") {
  53855. pattern1 = 1;
  53856. pattern2 += dashLength;
  53857. }
  53858. } //dash
  53859. if (style.lineType === 'dash') {
  53860. pattern1 *= 4;
  53861. pattern2 *= 4;
  53862. if (style.lineCap && style.lineCap !== "butt") {
  53863. pattern1 -= dashLength;
  53864. pattern2 += dashLength;
  53865. }
  53866. } //longdash
  53867. if (style.lineType === 'longdash') {
  53868. pattern1 *= 8;
  53869. pattern2 *= 4;
  53870. if (style.lineCap && style.lineCap !== "butt") {
  53871. pattern1 -= dashLength;
  53872. pattern2 += dashLength;
  53873. }
  53874. }
  53875. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  53876. for (var _i2 = 1; _i2 < pointList.length; _i2++) {
  53877. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i2 - 1][0] + __OP[0], pointList[_i2 - 1][1] + __OP[1], pointList[_i2][0] + __OP[0], pointList[_i2][1] + __OP[1], dashLength, [pattern1, pattern2]);
  53878. }
  53879. 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]);
  53880. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  53881. var _dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  53882. style._dashLength = _dashLengthForStyle;
  53883. var _dashLength = style.lineWidth || 1;
  53884. var _pattern = _dashLength;
  53885. var _pattern2 = _dashLength;
  53886. var pattern3 = _dashLength;
  53887. var pattern4 = _dashLength; //dashdot
  53888. if (style.lineType === 'dashdot') {
  53889. _pattern *= 4;
  53890. _pattern2 *= 4;
  53891. pattern4 *= 4;
  53892. if (style.lineCap && style.lineCap !== "butt") {
  53893. _pattern -= _dashLength;
  53894. _pattern2 += _dashLength;
  53895. pattern3 = 1;
  53896. pattern4 += _dashLength;
  53897. }
  53898. } //longdashdot
  53899. if (style.lineType === 'longdashdot') {
  53900. _pattern *= 8;
  53901. _pattern2 *= 4;
  53902. pattern4 *= 4;
  53903. if (style.lineCap && style.lineCap !== "butt") {
  53904. _pattern -= _dashLength;
  53905. _pattern2 += _dashLength;
  53906. pattern3 = 1;
  53907. pattern4 += _dashLength;
  53908. }
  53909. }
  53910. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  53911. for (var _i3 = 1; _i3 < pointList.length; _i3++) {
  53912. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i3 - 1][0] + __OP[0], pointList[_i3 - 1][1] + __OP[1], pointList[_i3][0] + __OP[0], pointList[_i3][1] + __OP[1], _dashLength, [_pattern, _pattern2, pattern3, pattern4]);
  53913. }
  53914. 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]);
  53915. }
  53916. }
  53917. return;
  53918. }
  53919. /**
  53920. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.getRect
  53921. * @description 计算返回多边形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  53922. *
  53923. * @param {Object} style - style
  53924. * @return {Object} 边框对象。包含属性:x,y,width,height。
  53925. *
  53926. */
  53927. }, {
  53928. key: "getRect",
  53929. value: function getRect(style, refOriginalPosition) {
  53930. var __OP;
  53931. if (!refOriginalPosition) {
  53932. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  53933. this.refOriginalPosition = [0, 0];
  53934. }
  53935. __OP = this.refOriginalPosition;
  53936. } else {
  53937. __OP = refOriginalPosition;
  53938. }
  53939. if (style.__rect) {
  53940. return style.__rect;
  53941. }
  53942. var minX = Number.MAX_VALUE;
  53943. var maxX = Number.MIN_VALUE;
  53944. var minY = Number.MAX_VALUE;
  53945. var maxY = Number.MIN_VALUE;
  53946. var pointList = style.pointList;
  53947. for (var i = 0, l = pointList.length; i < l; i++) {
  53948. if (pointList[i][0] + __OP[0] < minX) {
  53949. minX = pointList[i][0] + __OP[0];
  53950. }
  53951. if (pointList[i][0] + __OP[0] > maxX) {
  53952. maxX = pointList[i][0] + __OP[0];
  53953. }
  53954. if (pointList[i][1] + __OP[1] < minY) {
  53955. minY = pointList[i][1] + __OP[1];
  53956. }
  53957. if (pointList[i][1] + __OP[1] > maxY) {
  53958. maxY = pointList[i][1] + __OP[1];
  53959. }
  53960. }
  53961. var lineWidth;
  53962. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  53963. lineWidth = style.lineWidth || 1;
  53964. } else {
  53965. lineWidth = 0;
  53966. }
  53967. style.__rect = {
  53968. x: Math.round(minX - lineWidth / 2),
  53969. y: Math.round(minY - lineWidth / 2),
  53970. width: maxX - minX + lineWidth,
  53971. height: maxY - minY + lineWidth
  53972. };
  53973. return style.__rect;
  53974. }
  53975. }]);
  53976. return SmicPolygon;
  53977. }(Shape_Shape);
  53978. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicBrokenLine.js
  53979. function SmicBrokenLine_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicBrokenLine_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicBrokenLine_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicBrokenLine_typeof(obj); }
  53980. function SmicBrokenLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53981. 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); } }
  53982. function SmicBrokenLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicBrokenLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicBrokenLine_defineProperties(Constructor, staticProps); return Constructor; }
  53983. function SmicBrokenLine_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicBrokenLine_get = Reflect.get; } else { SmicBrokenLine_get = function _get(target, property, receiver) { var base = SmicBrokenLine_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicBrokenLine_get(target, property, receiver || target); }
  53984. function SmicBrokenLine_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicBrokenLine_getPrototypeOf(object); if (object === null) break; } return object; }
  53985. function SmicBrokenLine_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicBrokenLine_setPrototypeOf(subClass, superClass); }
  53986. function SmicBrokenLine_setPrototypeOf(o, p) { SmicBrokenLine_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicBrokenLine_setPrototypeOf(o, p); }
  53987. 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); }; }
  53988. function SmicBrokenLine_possibleConstructorReturn(self, call) { if (call && (SmicBrokenLine_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicBrokenLine_assertThisInitialized(self); }
  53989. function SmicBrokenLine_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53990. function SmicBrokenLine_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  53991. function SmicBrokenLine_getPrototypeOf(o) { SmicBrokenLine_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicBrokenLine_getPrototypeOf(o); }
  53992. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  53993. * This program are made available under the terms of the Apache License, Version 2.0
  53994. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53995. /**
  53996. * @private
  53997. * @class SuperMap.LevelRenderer.Shape.SmicBrokenLine
  53998. * @category Visualization Theme
  53999. * @classdesc 折线(ic)。
  54000. * @extends SuperMap.LevelRenderer.Shape
  54001. * @example
  54002. * var shape = new SuperMap.LevelRenderer.Shape.SmicBrokenLine({
  54003. * style: {
  54004. * pointList: [[0, 0], [100, 100], [100, 0]],
  54005. * smooth: 'bezier',
  54006. * strokeColor: 'purple'
  54007. * }
  54008. * });
  54009. * levelRenderer.addShape(shape);
  54010. *
  54011. *
  54012. */
  54013. var SmicBrokenLine = /*#__PURE__*/function (_Shape) {
  54014. SmicBrokenLine_inherits(SmicBrokenLine, _Shape);
  54015. var _super = SmicBrokenLine_createSuper(SmicBrokenLine);
  54016. /**
  54017. * @member {Object} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.style
  54018. * @description 绘制样式。
  54019. *
  54020. * @param {Array} pointList - 节点数组,二维数组。默认值:null,必设参数。其形式如下:
  54021. * (code)
  54022. * (start code)
  54023. * [
  54024. * [10, 20], //单个节点
  54025. * [30, 40],
  54026. * [25, 30]
  54027. * ]
  54028. * (end)
  54029. * @param {string} smooth - 是否做平滑插值, 平滑算法可以选择 "bezier", "spline"。默认值:"";
  54030. * @param {number} smoothConstraint - 平滑约束。
  54031. * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
  54032. * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  54033. * @param {number} lineWidth - 描边宽度。默认值:1。
  54034. * @param {number} opacity - 绘制透明度。默认值:1。
  54035. * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  54036. * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  54037. * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  54038. * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  54039. * @param {string} text - 图形中的附加文本。默认值:""。
  54040. * @param {string} textColor - 文本颜色。默认值:"#000000'"。
  54041. * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
  54042. * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  54043. * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  54044. * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  54045. */
  54046. //打开接口 style
  54047. /**
  54048. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.constructor
  54049. * @description 构造函数。
  54050. *
  54051. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  54052. *
  54053. */
  54054. function SmicBrokenLine(options) {
  54055. var _this;
  54056. SmicBrokenLine_classCallCheck(this, SmicBrokenLine);
  54057. _this = _super.call(this, options);
  54058. /**
  54059. * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.brushTypeOnly
  54060. * @description 线条只能描边。
  54061. */
  54062. _this.brushTypeOnly = 'stroke';
  54063. /**
  54064. * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.textPosition
  54065. * @description 文本位置。
  54066. */
  54067. _this.textPosition = 'end';
  54068. /**
  54069. * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.type
  54070. * @description 图形类型.
  54071. */
  54072. _this.type = 'smicbroken-line';
  54073. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  54074. _this.refOriginalPosition = [0, 0];
  54075. }
  54076. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicBrokenLine";
  54077. return _this;
  54078. }
  54079. /**
  54080. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.destroy
  54081. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  54082. */
  54083. SmicBrokenLine_createClass(SmicBrokenLine, [{
  54084. key: "destroy",
  54085. value: function destroy() {
  54086. this.brushTypeOnly = null;
  54087. this.textPosition = null;
  54088. this.type = null;
  54089. SmicBrokenLine_get(SmicBrokenLine_getPrototypeOf(SmicBrokenLine.prototype), "destroy", this).call(this);
  54090. }
  54091. /**
  54092. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.buildPath
  54093. * @description 创建折线路径。
  54094. *
  54095. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  54096. * @param {Object} style - style。
  54097. *
  54098. */
  54099. }, {
  54100. key: "buildPath",
  54101. value: function buildPath(ctx, style) {
  54102. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  54103. this.refOriginalPosition = [0, 0];
  54104. }
  54105. var __OP = this.refOriginalPosition;
  54106. var pointList = style.pointList;
  54107. if (pointList.length < 2) {
  54108. // 少于2个点就不画了~
  54109. return;
  54110. }
  54111. var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length));
  54112. if (style.smooth && style.smooth !== 'spline') {
  54113. var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, false, style.smoothConstraint, __OP);
  54114. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  54115. var cp1;
  54116. var cp2;
  54117. var p;
  54118. for (var _i = 0; _i < len - 1; _i++) {
  54119. cp1 = controlPoints[_i * 2];
  54120. cp2 = controlPoints[_i * 2 + 1];
  54121. p = [pointList[_i + 1][0] + __OP[0], pointList[_i + 1][1] + __OP[1]];
  54122. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  54123. }
  54124. } else {
  54125. if (style.smooth === 'spline') {
  54126. pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, null, null, __OP);
  54127. len = pointList.length;
  54128. }
  54129. if (!style.lineType || style.lineType === 'solid') {
  54130. // 默认为实线
  54131. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  54132. for (var _i2 = 1; _i2 < len; _i2++) {
  54133. ctx.lineTo(pointList[_i2][0] + __OP[0], pointList[_i2][1] + __OP[1]);
  54134. }
  54135. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  54136. var dashLength = style.lineWidth || 1;
  54137. var pattern1 = dashLength;
  54138. var pattern2 = dashLength; //dashed
  54139. if (style.lineType === 'dashed') {
  54140. pattern1 *= 5;
  54141. pattern2 *= 5;
  54142. if (style.lineCap && style.lineCap !== "butt") {
  54143. pattern1 -= dashLength;
  54144. pattern2 += dashLength;
  54145. }
  54146. } //dotted
  54147. if (style.lineType === 'dotted') {
  54148. if (style.lineCap && style.lineCap !== "butt") {
  54149. pattern1 = 1;
  54150. pattern2 += dashLength;
  54151. }
  54152. } //dot
  54153. if (style.lineType === 'dot') {
  54154. pattern2 *= 4;
  54155. if (style.lineCap && style.lineCap !== "butt") {
  54156. pattern1 = 1;
  54157. pattern2 += dashLength;
  54158. }
  54159. } //dash
  54160. if (style.lineType === 'dash') {
  54161. pattern1 *= 4;
  54162. pattern2 *= 4;
  54163. if (style.lineCap && style.lineCap !== "butt") {
  54164. pattern1 -= dashLength;
  54165. pattern2 += dashLength;
  54166. }
  54167. } //longdash
  54168. if (style.lineType === 'longdash') {
  54169. pattern1 *= 8;
  54170. pattern2 *= 4;
  54171. if (style.lineCap && style.lineCap !== "butt") {
  54172. pattern1 -= dashLength;
  54173. pattern2 += dashLength;
  54174. }
  54175. }
  54176. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  54177. for (var i = 1; i < len; i++) {
  54178. 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]);
  54179. }
  54180. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  54181. var _dashLength = style.lineWidth || 1;
  54182. var _pattern = _dashLength;
  54183. var _pattern2 = _dashLength;
  54184. var pattern3 = _dashLength;
  54185. var pattern4 = _dashLength; //dashdot
  54186. if (style.lineType === 'dashdot') {
  54187. _pattern *= 4;
  54188. _pattern2 *= 4;
  54189. pattern4 *= 4;
  54190. if (style.lineCap && style.lineCap !== "butt") {
  54191. _pattern -= _dashLength;
  54192. _pattern2 += _dashLength;
  54193. pattern3 = 1;
  54194. pattern4 += _dashLength;
  54195. }
  54196. } //longdashdot
  54197. if (style.lineType === 'longdashdot') {
  54198. _pattern *= 8;
  54199. _pattern2 *= 4;
  54200. pattern4 *= 4;
  54201. if (style.lineCap && style.lineCap !== "butt") {
  54202. _pattern -= _dashLength;
  54203. _pattern2 += _dashLength;
  54204. pattern3 = 1;
  54205. pattern4 += _dashLength;
  54206. }
  54207. }
  54208. _dashLength = (style.lineWidth || 1) * (style.lineType === 'dashed' ? 5 : 1);
  54209. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  54210. for (var _i3 = 1; _i3 < len; _i3++) {
  54211. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i3 - 1][0] + __OP[0], pointList[_i3 - 1][1] + __OP[1], pointList[_i3][0] + __OP[0], pointList[_i3][1] + __OP[1], _dashLength, [_pattern, _pattern2, pattern3, pattern4]);
  54212. }
  54213. }
  54214. }
  54215. return;
  54216. }
  54217. /**
  54218. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.getRect
  54219. * @description 计算返回折线包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  54220. *
  54221. * @param {Object} style - style
  54222. * @return {Object} 边框对象。包含属性:x,y,width,height。
  54223. */
  54224. }, {
  54225. key: "getRect",
  54226. value: function getRect(style) {
  54227. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  54228. this.refOriginalPosition = [0, 0];
  54229. }
  54230. var __OP = this.refOriginalPosition;
  54231. return SmicPolygon.prototype.getRect.apply(this, [style, __OP]);
  54232. }
  54233. }]);
  54234. return SmicBrokenLine;
  54235. }(Shape_Shape);
  54236. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicImage.js
  54237. function SmicImage_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicImage_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicImage_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicImage_typeof(obj); }
  54238. function SmicImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54239. 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); } }
  54240. function SmicImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicImage_defineProperties(Constructor, staticProps); return Constructor; }
  54241. function SmicImage_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicImage_get = Reflect.get; } else { SmicImage_get = function _get(target, property, receiver) { var base = SmicImage_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicImage_get(target, property, receiver || target); }
  54242. function SmicImage_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicImage_getPrototypeOf(object); if (object === null) break; } return object; }
  54243. function SmicImage_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicImage_setPrototypeOf(subClass, superClass); }
  54244. function SmicImage_setPrototypeOf(o, p) { SmicImage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicImage_setPrototypeOf(o, p); }
  54245. 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); }; }
  54246. function SmicImage_possibleConstructorReturn(self, call) { if (call && (SmicImage_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicImage_assertThisInitialized(self); }
  54247. function SmicImage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54248. function SmicImage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  54249. function SmicImage_getPrototypeOf(o) { SmicImage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicImage_getPrototypeOf(o); }
  54250. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  54251. * This program are made available under the terms of the Apache License, Version 2.0
  54252. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54253. /**
  54254. * @private
  54255. * @class SuperMap.LevelRenderer.Shape.SmicImage
  54256. * @category Visualization Theme
  54257. * @classdesc 图片绘制。
  54258. * @extends SuperMap.LevelRenderer.Shape
  54259. * @example
  54260. * var shape = new SuperMap.LevelRenderer.Shape.SmicImage({
  54261. * style: {
  54262. * image: 'test.jpg',
  54263. * x: 100,
  54264. * y: 100
  54265. * }
  54266. * });
  54267. * levelRenderer.addShape(shape);
  54268. *
  54269. *
  54270. */
  54271. var SmicImage = /*#__PURE__*/function (_Shape) {
  54272. SmicImage_inherits(SmicImage, _Shape);
  54273. var _super = SmicImage_createSuper(SmicImage);
  54274. /**
  54275. * @member {Object} SuperMap.LevelRenderer.Shape.SmicImage.prototype.style
  54276. * @description 绘制样式。
  54277. *
  54278. * @param {number} style.x - 左上角横坐标,必设参数。
  54279. * @param {number} style.y - 左上角纵坐标,必设参数。
  54280. * @param {(string/Cavans)} style.image - 图片地址或cavans对象,必设参数。
  54281. * @param {number} style.width - 绘制到画布上的宽度,默认为图片高度。
  54282. * @param {number} style.height - 绘制到画布上的高度,默认为图片高度。
  54283. * @param {number} style.sx - 从图片中裁剪的左上角横坐标。
  54284. * @param {number} style.sy - 从图片中裁剪的左上角纵坐标。
  54285. * @param {number} style.sWidth - 从图片中裁剪的宽度,默认为图片高度。
  54286. * @param {number} style.sHeight - 绘制到画布上的高度,默认为图片高度。
  54287. * @param {number} style.opacity - 绘制透明度。默认值:1。
  54288. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  54289. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  54290. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  54291. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  54292. * @param {string} style.text - 图形中的附加文本。默认值:""。
  54293. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  54294. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  54295. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  54296. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  54297. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  54298. */
  54299. //打开接口 style
  54300. /**
  54301. * @function SuperMap.LevelRenderer.Shape.SmicImage.constructor
  54302. * @description 构造函数。
  54303. *
  54304. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  54305. *
  54306. */
  54307. function SmicImage(options) {
  54308. var _this;
  54309. SmicImage_classCallCheck(this, SmicImage);
  54310. _this = _super.call(this, options);
  54311. /**
  54312. * @member {string} SuperMap.LevelRenderer.Shape.SmicImage.prototype.type
  54313. * @description 图形类型。
  54314. */
  54315. _this.type = 'smicimage';
  54316. /**
  54317. * @member {string} SuperMap.LevelRenderer.Shape.SmicImage.prototype._imageCache
  54318. * @description 图片缓存。
  54319. */
  54320. _this._imageCache = {};
  54321. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  54322. _this.refOriginalPosition = [0, 0];
  54323. }
  54324. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicImage";
  54325. return _this;
  54326. }
  54327. /**
  54328. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.destroy
  54329. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  54330. */
  54331. SmicImage_createClass(SmicImage, [{
  54332. key: "destroy",
  54333. value: function destroy() {
  54334. this.type = null;
  54335. this._imageCache = null;
  54336. SmicImage_get(SmicImage_getPrototypeOf(SmicImage.prototype), "destroy", this).call(this);
  54337. }
  54338. /**
  54339. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.buildPath
  54340. * @description 创建图片。
  54341. *
  54342. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  54343. * @param {Object} style - style。
  54344. *
  54345. */
  54346. }, {
  54347. key: "brush",
  54348. value: function brush(ctx, isHighlight, refresh) {
  54349. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  54350. this.refOriginalPosition = [0, 0];
  54351. }
  54352. var __OP = this.refOriginalPosition;
  54353. var style = this.style || {};
  54354. if (isHighlight) {
  54355. // 根据style扩展默认高亮样式
  54356. style = this.getHighlightStyle(style, this.highlightStyle || {});
  54357. }
  54358. var image = style.image;
  54359. var me = this;
  54360. if (typeof image === 'string') {
  54361. var src = image;
  54362. if (this._imageCache[src]) {
  54363. image = this._imageCache[src];
  54364. } else {
  54365. image = new Image();
  54366. image.onload = function () {
  54367. image.onload = null;
  54368. clearTimeout(SmicImage._refreshTimeout);
  54369. SmicImage._needsRefresh.push(me); // 防止因为缓存短时间内触发多次onload事件
  54370. SmicImage._refreshTimeout = setTimeout(function () {
  54371. refresh && refresh(SmicImage._needsRefresh); // 清空 needsRefresh
  54372. SmicImage._needsRefresh = [];
  54373. }, 10);
  54374. };
  54375. image.src = src;
  54376. this._imageCache[src] = image;
  54377. }
  54378. }
  54379. if (image) {
  54380. // 图片已经加载完成
  54381. if (image.nodeName.toUpperCase() == 'IMG') {
  54382. if (window.ActiveXObject) {
  54383. if (image.readyState != 'complete') {
  54384. return;
  54385. }
  54386. } else {
  54387. if (!image.complete) {
  54388. return;
  54389. }
  54390. }
  54391. } // Else is canvas
  54392. var width = style.width || image.width;
  54393. var height = style.height || image.height;
  54394. var x = style.x + __OP[0];
  54395. var y = style.y + __OP[1]; // 图片加载失败
  54396. if (!image.width || !image.height) {
  54397. return;
  54398. }
  54399. ctx.save();
  54400. this.doClip(ctx);
  54401. this.setContext(ctx, style); // 设置transform
  54402. this.setTransform(ctx);
  54403. if (style.sWidth && style.sHeight) {
  54404. var sx = style.sx + __OP[0] || 0;
  54405. var sy = style.sy + __OP[1] || 0;
  54406. ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);
  54407. } else if (style.sx && style.sy) {
  54408. var _sx = style.sx + __OP[0];
  54409. var _sy = style.sy + __OP[1];
  54410. var sWidth = width - _sx;
  54411. var sHeight = height - _sy;
  54412. ctx.drawImage(image, _sx, _sy, sWidth, sHeight, x, y, width, height);
  54413. } else {
  54414. ctx.drawImage(image, x, y, width, height);
  54415. } // 如果没设置宽和高的话自动根据图片宽高设置
  54416. if (!style.width) {
  54417. style.width = width;
  54418. }
  54419. if (!style.height) {
  54420. style.height = height;
  54421. }
  54422. if (!this.style.width) {
  54423. this.style.width = width;
  54424. }
  54425. if (!this.style.height) {
  54426. this.style.height = height;
  54427. }
  54428. this.drawText(ctx, style, this.style);
  54429. ctx.restore();
  54430. }
  54431. }
  54432. /**
  54433. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.getRect
  54434. * @description 计算返回图片的包围盒矩形。
  54435. *
  54436. * @param {Object} style - style
  54437. * @return {Object} 边框对象。包含属性:x,y,width,height。
  54438. */
  54439. }, {
  54440. key: "getRect",
  54441. value: function getRect(style) {
  54442. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  54443. this.refOriginalPosition = [0, 0];
  54444. }
  54445. var __OP = this.refOriginalPosition;
  54446. return {
  54447. x: style.x + __OP[0],
  54448. y: style.y + __OP[1],
  54449. width: style.width,
  54450. height: style.height
  54451. };
  54452. }
  54453. /**
  54454. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.clearCache
  54455. * @description 清除图片缓存。
  54456. *
  54457. * @param {Object} style - style
  54458. * @return {Object} 边框对象。包含属性:x,y,width,height。
  54459. *
  54460. */
  54461. }, {
  54462. key: "clearCache",
  54463. value: function clearCache() {
  54464. this._imageCache = {};
  54465. }
  54466. }]);
  54467. return SmicImage;
  54468. }(Shape_Shape);
  54469. SmicImage._needsRefresh = [];
  54470. SmicImage._refreshTimeout = null;
  54471. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRectangle.js
  54472. function SmicRectangle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicRectangle_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicRectangle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicRectangle_typeof(obj); }
  54473. function SmicRectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54474. 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); } }
  54475. function SmicRectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRectangle_defineProperties(Constructor, staticProps); return Constructor; }
  54476. function SmicRectangle_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicRectangle_get = Reflect.get; } else { SmicRectangle_get = function _get(target, property, receiver) { var base = SmicRectangle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicRectangle_get(target, property, receiver || target); }
  54477. function SmicRectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  54478. function SmicRectangle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicRectangle_setPrototypeOf(subClass, superClass); }
  54479. function SmicRectangle_setPrototypeOf(o, p) { SmicRectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRectangle_setPrototypeOf(o, p); }
  54480. 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); }; }
  54481. function SmicRectangle_possibleConstructorReturn(self, call) { if (call && (SmicRectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicRectangle_assertThisInitialized(self); }
  54482. function SmicRectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54483. function SmicRectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  54484. function SmicRectangle_getPrototypeOf(o) { SmicRectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRectangle_getPrototypeOf(o); }
  54485. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  54486. * This program are made available under the terms of the Apache License, Version 2.0
  54487. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54488. /**
  54489. * @private
  54490. * @class SuperMap.LevelRenderer.Shape.SmicRectangle
  54491. * @category Visualization Theme
  54492. * @classdesc 矩形。
  54493. * @extends SuperMap.LevelRenderer.Shape
  54494. * @example
  54495. * var shape = new SuperMap.LevelRenderer.Shape.SmicRectangle({
  54496. * style: {
  54497. * x: 0,
  54498. * y: 0,
  54499. * width: 100,
  54500. * height: 100,
  54501. * radius: 20
  54502. * }
  54503. * });
  54504. * levelRenderer.addShape(shape);
  54505. *
  54506. */
  54507. var SmicRectangle = /*#__PURE__*/function (_Shape) {
  54508. SmicRectangle_inherits(SmicRectangle, _Shape);
  54509. var _super = SmicRectangle_createSuper(SmicRectangle);
  54510. /**
  54511. * @member {Object} SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.style
  54512. * @description 绘制样式。
  54513. *
  54514. * @param {number} style.x - 左上角 x 坐标,必设参数。
  54515. * @param {number} style.y - 左上角 y 坐标,必设参数。
  54516. * @param {number} style.width - 宽度,必设参数。
  54517. * @param {number} style.height - 高度,必设参数。
  54518. * @param {Array} style.radius - 矩形圆角,可以用数组分别指定四个角的圆角,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 则 radius为 [r1、r2、r3、r4 ]。
  54519. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  54520. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  54521. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  54522. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  54523. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  54524. * @param {number} style.opacity - 绘制透明度。默认值:1。
  54525. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  54526. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  54527. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  54528. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  54529. * @param {string} style.text - 图形中的附加文本。默认值:""。
  54530. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  54531. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  54532. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  54533. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  54534. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  54535. */
  54536. //打开接口 style
  54537. /**
  54538. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.constructor
  54539. * @description 构造函数。
  54540. *
  54541. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  54542. *
  54543. */
  54544. function SmicRectangle(options) {
  54545. var _this;
  54546. SmicRectangle_classCallCheck(this, SmicRectangle);
  54547. _this = _super.call(this, options);
  54548. /**
  54549. * @member {string} SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.type
  54550. * @description 图形类型.
  54551. */
  54552. _this.type = 'smicrectangle';
  54553. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  54554. _this.refOriginalPosition = [0, 0];
  54555. }
  54556. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRectangle";
  54557. return _this;
  54558. }
  54559. /**
  54560. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.destroy
  54561. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  54562. */
  54563. SmicRectangle_createClass(SmicRectangle, [{
  54564. key: "destroy",
  54565. value: function destroy() {
  54566. this.type = null;
  54567. SmicRectangle_get(SmicRectangle_getPrototypeOf(SmicRectangle.prototype), "destroy", this).call(this);
  54568. }
  54569. /**
  54570. * APIMethod: _buildRadiusPath
  54571. * 创建矩形的圆角路径。
  54572. *
  54573. * Parameters:
  54574. * ctx - {CanvasRenderingContext2D} Context2D 上下文。
  54575. * style - {Object} style。
  54576. *
  54577. */
  54578. }, {
  54579. key: "_buildRadiusPath",
  54580. value: function _buildRadiusPath(ctx, style) {
  54581. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  54582. this.refOriginalPosition = [0, 0];
  54583. }
  54584. var __OP = this.refOriginalPosition; // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4
  54585. // r缩写为1 相当于 [1, 1, 1, 1]
  54586. // r缩写为[1] 相当于 [1, 1, 1, 1]
  54587. // r缩写为[1, 2] 相当于 [1, 2, 1, 2]
  54588. // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]
  54589. var x = style.x + __OP[0];
  54590. var y = style.y + __OP[1];
  54591. var width = style.width;
  54592. var height = style.height;
  54593. var r = style.radius;
  54594. var r1;
  54595. var r2;
  54596. var r3;
  54597. var r4;
  54598. if (typeof r === 'number') {
  54599. r1 = r2 = r3 = r4 = r;
  54600. } else if (r instanceof Array) {
  54601. if (r.length === 1) {
  54602. r1 = r2 = r3 = r4 = r[0];
  54603. } else if (r.length === 2) {
  54604. r1 = r3 = r[0];
  54605. r2 = r4 = r[1];
  54606. } else if (r.length === 3) {
  54607. r1 = r[0];
  54608. r2 = r4 = r[1];
  54609. r3 = r[2];
  54610. } else {
  54611. r1 = r[0];
  54612. r2 = r[1];
  54613. r3 = r[2];
  54614. r4 = r[3];
  54615. }
  54616. } else {
  54617. r1 = r2 = r3 = r4 = 0;
  54618. }
  54619. var total;
  54620. if (r1 + r2 > width) {
  54621. total = r1 + r2;
  54622. r1 *= width / total;
  54623. r2 *= width / total;
  54624. }
  54625. if (r3 + r4 > width) {
  54626. total = r3 + r4;
  54627. r3 *= width / total;
  54628. r4 *= width / total;
  54629. }
  54630. if (r2 + r3 > height) {
  54631. total = r2 + r3;
  54632. r2 *= height / total;
  54633. r3 *= height / total;
  54634. }
  54635. if (r1 + r4 > height) {
  54636. total = r1 + r4;
  54637. r1 *= height / total;
  54638. r4 *= height / total;
  54639. }
  54640. ctx.moveTo(x + r1, y);
  54641. ctx.lineTo(x + width - r2, y);
  54642. r2 !== 0 && ctx.quadraticCurveTo(x + width, y, x + width, y + r2);
  54643. ctx.lineTo(x + width, y + height - r3);
  54644. r3 !== 0 && ctx.quadraticCurveTo(x + width, y + height, x + width - r3, y + height);
  54645. ctx.lineTo(x + r4, y + height);
  54646. r4 !== 0 && ctx.quadraticCurveTo(x, y + height, x, y + height - r4);
  54647. ctx.lineTo(x, y + r1);
  54648. r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y);
  54649. }
  54650. /**
  54651. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.buildPath
  54652. * @description 创建矩形路径。
  54653. *
  54654. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  54655. * @param {Object} style - style。
  54656. *
  54657. */
  54658. }, {
  54659. key: "buildPath",
  54660. value: function buildPath(ctx, style) {
  54661. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  54662. this.refOriginalPosition = [0, 0];
  54663. }
  54664. var __OP = this.refOriginalPosition;
  54665. if (!style.radius) {
  54666. ctx.moveTo(style.x + __OP[0], style.y + __OP[1]);
  54667. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1]);
  54668. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1] + style.height);
  54669. ctx.lineTo(style.x + __OP[0], style.y + __OP[1] + style.height);
  54670. ctx.lineTo(style.x + __OP[0], style.y + __OP[1]); // ctx.rect(style.x, style.y, style.width, style.height);
  54671. } else {
  54672. this._buildRadiusPath(ctx, style);
  54673. }
  54674. ctx.closePath();
  54675. return;
  54676. }
  54677. /**
  54678. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.getRect
  54679. * @description 计算返回矩形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  54680. *
  54681. * @param {Object} style - style
  54682. * @return {Object} 边框对象。包含属性:x,y,width,height。
  54683. */
  54684. }, {
  54685. key: "getRect",
  54686. value: function getRect(style) {
  54687. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  54688. this.refOriginalPosition = [0, 0];
  54689. }
  54690. var __OP = this.refOriginalPosition;
  54691. if (style.__rect) {
  54692. return style.__rect;
  54693. }
  54694. var lineWidth;
  54695. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  54696. lineWidth = style.lineWidth || 1;
  54697. } else {
  54698. lineWidth = 0;
  54699. }
  54700. style.__rect = {
  54701. x: Math.round(style.x + __OP[0] - lineWidth / 2),
  54702. y: Math.round(style.y + __OP[1] - lineWidth / 2),
  54703. width: style.width + lineWidth,
  54704. height: style.height + lineWidth
  54705. };
  54706. return style.__rect;
  54707. }
  54708. }]);
  54709. return SmicRectangle;
  54710. }(Shape_Shape);
  54711. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicSector.js
  54712. function SmicSector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicSector_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicSector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicSector_typeof(obj); }
  54713. function SmicSector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54714. 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); } }
  54715. function SmicSector_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicSector_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicSector_defineProperties(Constructor, staticProps); return Constructor; }
  54716. function SmicSector_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicSector_get = Reflect.get; } else { SmicSector_get = function _get(target, property, receiver) { var base = SmicSector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicSector_get(target, property, receiver || target); }
  54717. function SmicSector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicSector_getPrototypeOf(object); if (object === null) break; } return object; }
  54718. function SmicSector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicSector_setPrototypeOf(subClass, superClass); }
  54719. function SmicSector_setPrototypeOf(o, p) { SmicSector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicSector_setPrototypeOf(o, p); }
  54720. 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); }; }
  54721. function SmicSector_possibleConstructorReturn(self, call) { if (call && (SmicSector_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicSector_assertThisInitialized(self); }
  54722. function SmicSector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54723. function SmicSector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  54724. function SmicSector_getPrototypeOf(o) { SmicSector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicSector_getPrototypeOf(o); }
  54725. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  54726. * This program are made available under the terms of the Apache License, Version 2.0
  54727. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54728. /**
  54729. * @private
  54730. * @class SuperMap.LevelRenderer.Shape.SmicSector
  54731. * @category Visualization Theme
  54732. * @classdesc 扇形。
  54733. * @extends SuperMap.LevelRenderer.Shape
  54734. * @example
  54735. * var shape = new SuperMap.LevelRenderer.Shape.SmicSector({
  54736. * style: {
  54737. * x: 100,
  54738. * y: 100,
  54739. * r: 60,
  54740. * r0: 30,
  54741. * startAngle: 0,
  54742. * endEngle: 180
  54743. * }
  54744. * });
  54745. * levelRenderer.addShape(shape);
  54746. *
  54747. *
  54748. */
  54749. var SmicSector = /*#__PURE__*/function (_Shape) {
  54750. SmicSector_inherits(SmicSector, _Shape);
  54751. var _super = SmicSector_createSuper(SmicSector);
  54752. /**
  54753. * @member {Object} SuperMap.LevelRenderer.Shape.SmicSector.prototype.style
  54754. * @description 绘制样式。
  54755. *
  54756. * @param {number} style.x - 圆心 x 坐标,必设参数。
  54757. * @param {number} style.y - 圆心 y 坐标,必设参数。
  54758. * @param {number} style.r - 外圆半径,必设参数。
  54759. * @param {number} style.r0 - 内圆半径,指定后将出现内弧,同时扇边长度为`r - r0`。取值范围[0, r),默认值:0。
  54760. * @param {number} style.startAngle - 起始角度,必设参数。取值范围[0, 360)。
  54761. * @param {number} style.endAngle - 结束角度,必设参数。取值范围(0, 360。
  54762. * @param {boolean} style.clockWise - 是否是顺时针。默认值:false。
  54763. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  54764. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  54765. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  54766. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  54767. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  54768. * @param {number} style.opacity - 绘制透明度。默认值:1。
  54769. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  54770. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  54771. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  54772. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  54773. * @param {string} style.text - 图形中的附加文本。默认值:""。
  54774. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  54775. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  54776. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  54777. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  54778. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  54779. */
  54780. //打开接口 style
  54781. /**
  54782. * @function SuperMap.LevelRenderer.Shape.SmicSector.constructor
  54783. * @description 构造函数。
  54784. *
  54785. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  54786. *
  54787. */
  54788. function SmicSector(options) {
  54789. var _this;
  54790. SmicSector_classCallCheck(this, SmicSector);
  54791. _this = _super.call(this, options);
  54792. /**
  54793. * @member {string} SuperMap.LevelRenderer.Shape.SmicSector.protptype.type
  54794. * @description 图形类型。
  54795. */
  54796. _this.type = 'smicsector';
  54797. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  54798. _this.refOriginalPosition = [0, 0];
  54799. }
  54800. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicSector";
  54801. return _this;
  54802. }
  54803. /**
  54804. * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.destroy
  54805. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  54806. */
  54807. SmicSector_createClass(SmicSector, [{
  54808. key: "destroy",
  54809. value: function destroy() {
  54810. this.type = null;
  54811. SmicSector_get(SmicSector_getPrototypeOf(SmicSector.prototype), "destroy", this).call(this);
  54812. }
  54813. /**
  54814. * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.buildPath
  54815. * @description 创建扇形路径。
  54816. *
  54817. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  54818. * @param {Object} style - style。
  54819. *
  54820. */
  54821. }, {
  54822. key: "buildPath",
  54823. value: function buildPath(ctx, style) {
  54824. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  54825. this.refOriginalPosition = [0, 0];
  54826. }
  54827. var __OP = this.refOriginalPosition;
  54828. var x = style.x + __OP[0]; // 圆心x
  54829. var y = style.y + __OP[1]; // 圆心y
  54830. var r0 = style.r0 || 0; // 形内半径[0,r)
  54831. var r = style.r; // 扇形外半径(0,r]
  54832. var startAngle = style.startAngle; // 起始角度[0,360)
  54833. var endAngle = style.endAngle; // 结束角度(0,360]
  54834. var clockWise = style.clockWise || false;
  54835. startAngle = SUtil_SUtil.Util_math.degreeToRadian(startAngle);
  54836. endAngle = SUtil_SUtil.Util_math.degreeToRadian(endAngle);
  54837. if (!clockWise) {
  54838. // 扇形默认是逆时针方向,Y轴向上
  54839. // 这个跟arc的标准不一样,为了兼容echarts
  54840. startAngle = -startAngle;
  54841. endAngle = -endAngle;
  54842. }
  54843. var unitX = SUtil_SUtil.Util_math.cos(startAngle);
  54844. var unitY = SUtil_SUtil.Util_math.sin(startAngle);
  54845. ctx.moveTo(unitX * r0 + x, unitY * r0 + y);
  54846. ctx.lineTo(unitX * r + x, unitY * r + y);
  54847. ctx.arc(x, y, r, startAngle, endAngle, !clockWise);
  54848. ctx.lineTo(SUtil_SUtil.Util_math.cos(endAngle) * r0 + x, SUtil_SUtil.Util_math.sin(endAngle) * r0 + y);
  54849. if (r0 !== 0) {
  54850. ctx.arc(x, y, r0, endAngle, startAngle, clockWise);
  54851. }
  54852. ctx.closePath();
  54853. return;
  54854. }
  54855. /**
  54856. * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.getRect
  54857. * @description 返回扇形包围盒矩形
  54858. *
  54859. * @param {Object} style - style
  54860. * @return {Object} 边框对象。包含属性:x,y,width,height。
  54861. *
  54862. */
  54863. }, {
  54864. key: "getRect",
  54865. value: function getRect(style) {
  54866. if (style.__rect) {
  54867. return style.__rect;
  54868. }
  54869. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  54870. this.refOriginalPosition = [0, 0];
  54871. }
  54872. var __OP = this.refOriginalPosition;
  54873. var min0 = SUtil_SUtil.Util_vector.create();
  54874. var min1 = SUtil_SUtil.Util_vector.create();
  54875. var max0 = SUtil_SUtil.Util_vector.create();
  54876. var max1 = SUtil_SUtil.Util_vector.create();
  54877. var x = style.x + __OP[0]; // 圆心x
  54878. var y = style.y + __OP[1]; // 圆心y
  54879. var r0 = style.r0 || 0; // 形内半径[0,r)
  54880. var r = style.r; // 扇形外半径(0,r]
  54881. var startAngle = SUtil_SUtil.Util_math.degreeToRadian(style.startAngle);
  54882. var endAngle = SUtil_SUtil.Util_math.degreeToRadian(style.endAngle);
  54883. var clockWise = style.clockWise;
  54884. if (!clockWise) {
  54885. startAngle = -startAngle;
  54886. endAngle = -endAngle;
  54887. }
  54888. if (r0 > 1) {
  54889. SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r0, startAngle, endAngle, !clockWise, min0, max0);
  54890. } else {
  54891. min0[0] = max0[0] = x;
  54892. min0[1] = max0[1] = y;
  54893. }
  54894. SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r, startAngle, endAngle, !clockWise, min1, max1);
  54895. SUtil_SUtil.Util_vector.min(min0, min0, min1);
  54896. SUtil_SUtil.Util_vector.max(max0, max0, max1);
  54897. style.__rect = {
  54898. x: min0[0],
  54899. y: min0[1],
  54900. width: max0[0] - min0[0],
  54901. height: max0[1] - min0[1]
  54902. };
  54903. return style.__rect;
  54904. }
  54905. }]);
  54906. return SmicSector;
  54907. }(Shape_Shape);
  54908. ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeFactory.js
  54909. function ShapeFactory_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54910. 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); } }
  54911. function ShapeFactory_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeFactory_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeFactory_defineProperties(Constructor, staticProps); return Constructor; }
  54912. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  54913. * This program are made available under the terms of the Apache License, Version 2.0
  54914. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54915. /**
  54916. * @class SuperMap.Feature.ShapeFactory
  54917. * @category Visualization Theme
  54918. * @classdesc 图形工厂类。
  54919. * 目前支持创建的图形有:<br>
  54920. * 用于统计专题图:<br>
  54921. * 点 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Point}> <br>
  54922. * 线 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Line}> <br>
  54923. * 面 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Polygon}> <br>
  54924. * 矩形 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Rectangle}> <br>
  54925. * 扇形 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Sector}> <br>
  54926. * 标签 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Label}> <br>
  54927. * 图片 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Image}> <br>
  54928. * 用于符号专题图:<br>
  54929. * 圆形 - 参数对象:<{@link SuperMap.Feature.ShapeParameters.Cilcle}>
  54930. */
  54931. var ShapeFactory = /*#__PURE__*/function () {
  54932. /**
  54933. * @function SuperMap.Feature.ShapeFactory.prototype.constructor
  54934. * @description 构建图形工厂对象。
  54935. * @param {Object} shapeParameters - 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象,可选参数。
  54936. * @returns {SuperMap.Feature.ShapeFactory} 返回图形工厂类对象。
  54937. */
  54938. function ShapeFactory(shapeParameters) {
  54939. ShapeFactory_classCallCheck(this, ShapeFactory);
  54940. /**
  54941. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.shapeParameters
  54942. * @description 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象。必设参数,默认值 null。
  54943. */
  54944. this.shapeParameters = shapeParameters;
  54945. this.CLASS_NAME = "SuperMap.Feature.ShapeFactory";
  54946. }
  54947. /**
  54948. * @function SuperMap.Feature.ShapeParameters.prototype.destroy
  54949. * @description 销毁图形工厂类对象。
  54950. */
  54951. ShapeFactory_createClass(ShapeFactory, [{
  54952. key: "destroy",
  54953. value: function destroy() {
  54954. this.shapeParameters = null;
  54955. }
  54956. /**
  54957. * @function SuperMap.Feature.ShapeParameters.prototype.createShape
  54958. * @description 创建一个图形。具体图形由 shapeParameters 决定。
  54959. * @param {Object} shapeParameters - 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象。
  54960. * 此参数可选,如果使用此参数(不为 null),shapeParameters 属性值将被修改为参数的值,然后再使用 shapeParameters 属性值创建图形;
  54961. * 如果不使用此参数,createShape 方法将直接使用 shapeParameters 属性创建图形。
  54962. * @returns {Object} 图形对象(或 null - 图形创建失败)。
  54963. */
  54964. }, {
  54965. key: "createShape",
  54966. value: function createShape(shapeParameters) {
  54967. if (shapeParameters) {
  54968. this.shapeParameters = shapeParameters;
  54969. }
  54970. if (!this.shapeParameters) {
  54971. return null;
  54972. }
  54973. var sps = this.shapeParameters;
  54974. if (sps instanceof Point_Point) {
  54975. // 点
  54976. //设置style
  54977. var style = new Object();
  54978. style["x"] = sps.x;
  54979. style["y"] = sps.y;
  54980. style["r"] = sps.r;
  54981. style = Util.copyAttributesWithClip(style, sps.style, ['x', 'y']); //创建图形
  54982. var shape = new SmicPoint();
  54983. shape.style = ShapeFactory.transformStyle(style);
  54984. shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  54985. Util.copyAttributesWithClip(shape, sps, ['x', 'y', 'style', 'highlightStyle']);
  54986. return shape;
  54987. } else if (sps instanceof Line_Line) {
  54988. // 线
  54989. //检查参数 pointList 是否存在
  54990. if (!sps.pointList) {
  54991. return null;
  54992. } // 设置style
  54993. var _style = new Object();
  54994. _style["pointList"] = sps.pointList;
  54995. _style = Util.copyAttributesWithClip(_style, sps.style, ['pointList']); // 创建图形
  54996. var _shape = new SmicBrokenLine();
  54997. _shape.style = ShapeFactory.transformStyle(_style);
  54998. _shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  54999. Util.copyAttributesWithClip(_shape, sps, ['pointList', 'style', 'highlightStyle']);
  55000. return _shape;
  55001. } else if (sps instanceof Polygon_Polygon) {
  55002. // 面
  55003. //检查参数 pointList 是否存在
  55004. if (!sps.pointList) {
  55005. return null;
  55006. } //设置style
  55007. var _style2 = new Object();
  55008. _style2["pointList"] = sps.pointList;
  55009. _style2 = Util.copyAttributesWithClip(_style2, sps.style, ['pointList']); //创建图形
  55010. var _shape2 = new SmicPolygon();
  55011. _shape2.style = ShapeFactory.transformStyle(_style2);
  55012. _shape2.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  55013. Util.copyAttributesWithClip(_shape2, sps, ['pointList', 'style', "highlightStyle"]);
  55014. return _shape2;
  55015. } else if (sps instanceof Rectangle_Rectangle) {
  55016. // 矩形
  55017. //检查参数 pointList 是否存在
  55018. if (!sps.x && !sps.y & !sps.width & !sps.height) {
  55019. return null;
  55020. } //设置style
  55021. var _style3 = new Object();
  55022. _style3["x"] = sps.x;
  55023. _style3["y"] = sps.y;
  55024. _style3["width"] = sps.width;
  55025. _style3["height"] = sps.height;
  55026. _style3 = Util.copyAttributesWithClip(_style3, sps.style, ['x', 'y', 'width', 'height']); //创建图形
  55027. var _shape3 = new SmicRectangle();
  55028. _shape3.style = ShapeFactory.transformStyle(_style3);
  55029. _shape3.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  55030. Util.copyAttributesWithClip(_shape3, sps, ['x', 'y', 'width', 'height', 'style', 'highlightStyle']);
  55031. return _shape3;
  55032. } else if (sps instanceof Sector) {
  55033. // 扇形
  55034. //设置style
  55035. var _style4 = new Object();
  55036. _style4["x"] = sps.x;
  55037. _style4["y"] = sps.y;
  55038. _style4["r"] = sps.r;
  55039. _style4["startAngle"] = sps.startAngle;
  55040. _style4["endAngle"] = sps.endAngle;
  55041. if (sps["r0"]) {
  55042. _style4["r0"] = sps.r0;
  55043. }
  55044. if (sps["clockWise"]) {
  55045. _style4["clockWise"] = sps.clockWise;
  55046. }
  55047. _style4 = Util.copyAttributesWithClip(_style4, sps.style, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle']); //创建图形
  55048. var _shape4 = new SmicSector();
  55049. _shape4.style = ShapeFactory.transformStyle(_style4);
  55050. _shape4.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  55051. Util.copyAttributesWithClip(_shape4, sps, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle', 'style', 'highlightStyle']);
  55052. return _shape4;
  55053. } else if (sps instanceof Label) {
  55054. // 标签
  55055. //设置style
  55056. var _style5 = new Object();
  55057. _style5["x"] = sps.x;
  55058. _style5["y"] = sps.y;
  55059. _style5["text"] = sps.text;
  55060. _style5 = Util.copyAttributesWithClip(_style5, sps.style, ['x', 'y', 'text']); //创建图形
  55061. var _shape5 = new SmicText();
  55062. _shape5.style = ShapeFactory.transformStyle(_style5);
  55063. _shape5.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  55064. Util.copyAttributesWithClip(_shape5, sps, ['x', 'y', 'text', 'style', 'highlightStyle']);
  55065. return _shape5;
  55066. } else if (sps instanceof Image_Image) {
  55067. // 图片
  55068. //设置style
  55069. var _style6 = new Object();
  55070. _style6["x"] = sps.x;
  55071. _style6["y"] = sps.y;
  55072. if (sps["image"]) {
  55073. _style6["image"] = sps.image;
  55074. }
  55075. if (sps["width"]) {
  55076. _style6["width"] = sps.width;
  55077. }
  55078. if (sps["height"]) {
  55079. _style6["height"] = sps.height;
  55080. }
  55081. if (sps["sx"]) {
  55082. _style6["sx"] = sps.sx;
  55083. }
  55084. if (sps["sy"]) {
  55085. _style6["sy"] = sps.sy;
  55086. }
  55087. if (sps["sWidth"]) {
  55088. _style6["sWidth"] = sps.sWidth;
  55089. }
  55090. if (sps["sHeight"]) {
  55091. _style6["sHeight"] = sps.sHeight;
  55092. }
  55093. _style6 = Util.copyAttributesWithClip(_style6, sps.style, ['x', 'y', 'image', 'width', 'height', 'sx', 'sy', 'sWidth', 'sHeight']); //创建图形
  55094. var _shape6 = new SmicImage();
  55095. _shape6.style = ShapeFactory.transformStyle(_style6);
  55096. _shape6.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  55097. Util.copyAttributesWithClip(_shape6, sps, ['x', 'y', 'image', 'width', 'height', 'style', 'highlightStyle']);
  55098. return _shape6;
  55099. } else if (sps instanceof Circle_Circle) {
  55100. //圆形 用于符号专题图
  55101. //设置stytle
  55102. var _style7 = new Object();
  55103. _style7["x"] = sps.x;
  55104. _style7["r"] = sps.r;
  55105. _style7["y"] = sps.y;
  55106. _style7 = Util.copyAttributesWithClip(_style7, sps.style, ['x', 'y', 'r']); //创建图形
  55107. var _shape7 = new SmicCircle();
  55108. _shape7.style = ShapeFactory.transformStyle(_style7);
  55109. _shape7.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  55110. Util.copyAttributesWithClip(_shape7, sps, ['x', 'y', 'r', 'style', 'highlightStyle', 'lineWidth', 'text', 'textPosition']);
  55111. return _shape7;
  55112. }
  55113. return null;
  55114. }
  55115. /**
  55116. * @function SuperMap.Feature.ShapeParameters.prototype.transformStyle
  55117. * @description 将用户 feature.style (类 Svg style 标准) 的样式,转换为 levelRenderer 的样式标准(类 CSS-Canvas 样式)
  55118. * @param {Object} style - 用户 style。
  55119. * @returns {Object} 符合 levelRenderer 的 style。
  55120. */
  55121. }], [{
  55122. key: "transformStyle",
  55123. value: function transformStyle(style) {
  55124. var newStyle = {}; //字体 ["font-style", "font-variant", "font-weight", "font-size / line-height", "font-family"];
  55125. var fontStr = ["normal", "normal", "normal", "12", "arial,sans-serif"]; //画笔类型 ["fill", "stroke"];
  55126. var brushType = [true, false];
  55127. for (var ss in style) {
  55128. switch (ss) {
  55129. case "fill":
  55130. brushType[0] = style[ss];
  55131. break;
  55132. case "fillColor":
  55133. newStyle["color"] = style[ss];
  55134. break;
  55135. case "stroke":
  55136. brushType[1] = style[ss];
  55137. break;
  55138. case "strokeWidth":
  55139. newStyle["lineWidth"] = style[ss];
  55140. break;
  55141. case "strokeLinecap":
  55142. newStyle["lineCap"] = style[ss];
  55143. break;
  55144. case "strokeLineJoin":
  55145. newStyle["lineJoin"] = style[ss];
  55146. break;
  55147. case "strokeDashstyle":
  55148. newStyle["lineType"] = style[ss];
  55149. break;
  55150. case "pointRadius":
  55151. newStyle["r"] = style[ss];
  55152. break;
  55153. case "label":
  55154. newStyle["text"] = style[ss];
  55155. break;
  55156. case "labelRect":
  55157. newStyle["labelRect"] = style[ss];
  55158. break;
  55159. case "fontColor":
  55160. newStyle["textColor"] = style[ss];
  55161. break;
  55162. case "fontStyle":
  55163. fontStr[0] = style[ss];
  55164. break;
  55165. case "fontVariant":
  55166. fontStr[1] = style[ss];
  55167. break;
  55168. case "fontWeight":
  55169. fontStr[2] = style[ss];
  55170. break;
  55171. case "fontSize":
  55172. var unit = "";
  55173. if (style[ss] && style[ss].toString().indexOf("px") < 0) {
  55174. unit = "px";
  55175. }
  55176. fontStr[3] = style[ss] + unit;
  55177. break;
  55178. case "fontFamily":
  55179. fontStr[4] = style[ss];
  55180. break;
  55181. case "fontOpacity":
  55182. newStyle["opacity"] = style[ss];
  55183. break;
  55184. case "labelPosition":
  55185. newStyle["textPosition"] = style[ss];
  55186. break;
  55187. case "labelAlign":
  55188. newStyle["textAlign"] = style[ss];
  55189. break;
  55190. case "labelBaseline":
  55191. newStyle["textBaseline"] = style[ss];
  55192. break;
  55193. case "labelRotation":
  55194. newStyle["textRotation"] = style[ss];
  55195. break;
  55196. default:
  55197. newStyle[ss] = style[ss];
  55198. break;
  55199. }
  55200. } //拼接字体字符串
  55201. newStyle["textFont"] = fontStr.join(" "); //画笔类型
  55202. if (brushType[0] === true && brushType[1] === false) {
  55203. newStyle["brushType"] = "fill";
  55204. } else if (brushType[0] === false && brushType[1] === true) {
  55205. newStyle["brushType"] = "stroke";
  55206. } else if (brushType[0] === true && brushType[1] === true) {
  55207. newStyle["brushType"] = "both";
  55208. } else {
  55209. newStyle["brushType"] = "fill";
  55210. } //默认线宽 1
  55211. if (newStyle["lineWidth"] == null) {
  55212. newStyle["lineWidth"] = 1;
  55213. }
  55214. return newStyle;
  55215. }
  55216. /**
  55217. * @function SuperMap.Feature.ShapeParameters.prototype.Background
  55218. * @description 创建一个矩形背景框图形对象。
  55219. * @param {SuperMap.Feature.ShapeFactory} shapeFactory - 图形工厂对象,必设参数。
  55220. * @param {Array.<number>} box - 框区域,长度为 4 的一维数组,像素坐标,[left, bottom, right, top],必设参数。
  55221. * @param {Object} setting - 图表配置参数,必设参数。本函数中图形配置对象 setting 可设属性:
  55222. * @param {Object} setting.backgroundStyle - 背景样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Rectangle#style>。
  55223. * @param {Array} [setting.backgroundRadius=[0,0,0,0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  55224. * @returns {Object} 背景框图形,一个可视化图形(矩形)对象。
  55225. */
  55226. }, {
  55227. key: "Background",
  55228. value: function Background(shapeFactory, box, setting) {
  55229. var sets = setting ? setting : {}; // 背景框图形参数对象
  55230. var bgSP = new Rectangle_Rectangle(box[0], box[3], Math.abs(box[2] - box[0]), Math.abs(box[3] - box[1])); // 默认样式
  55231. bgSP.style = {
  55232. fillColor: "#f3f3f3"
  55233. }; // 设置用户 style
  55234. if (sets.backgroundStyle) {
  55235. Util.copyAttributesWithClip(bgSP.style, sets.backgroundStyle);
  55236. } // 设置背景框圆角参数
  55237. if (sets.backgroundRadius) {
  55238. bgSP.style["radius"] = sets.backgroundRadius;
  55239. } // 禁止背景框响应事件
  55240. bgSP.clickable = false;
  55241. bgSP.hoverable = false;
  55242. return shapeFactory.createShape(bgSP);
  55243. }
  55244. /**
  55245. * @function SuperMap.Feature.ShapeParameters.prototype.GraphAxis
  55246. * @description 创建一个统计图表坐标轴图形对象组。
  55247. * @param {SuperMap.Feature.ShapeFactory} shapeFactory - 图形工厂对象,必设参数。
  55248. * @param {Array.<number>} dataViewBox - 统计图表模型的数据视图框,长度为 4 的一维数组,像素坐标,[left, bottom, right, top],必设参数。
  55249. * @param {Object} setting - 图表配置参数,必设参数。
  55250. * @param {Object} setting.axisStyle - 坐标轴样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Line#style>。
  55251. * @param {boolean} [setting.axisUseArrow=false] - 坐标轴是否使用箭头。
  55252. * @param {number} [setting.axisYTick=0] - y 轴刻度数量,0表示不使用箭头。
  55253. * @param {Array.<string>} setting.axisYLabels - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  55254. * @param {Object} setting.axisYLabelsStyle - y 轴上的标签组样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Label#style>。
  55255. * @param {Array.<number>} [setting.axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正,默认值:0。
  55256. * @param {Array.<string>} setting.axisXLabels - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  55257. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xPositions 数量相同(即标签个数与数据个数相等时), 按照 xPositions 提供的位置在水平方向上排布标签,否则沿数据视图框下面条边等距排布标签。
  55258. * @param {Object} setting.axisXLabelsStyle - x 轴上的标签组样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Label#style>。
  55259. * @param {Array.<number>} [setting.axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:0。
  55260. * @param {boolean} setting.useXReferenceLine - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  55261. * @param {Object} setting.xReferenceLineStyle - 水平参考线样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Line#style>。
  55262. * @param {number} [setting.axis3DParameter=0] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
  55263. * @param {Object} xShapeInfo - X 方向上的图形信息对象,包含两个属性。
  55264. * @param {Array.<number>} xShapeInfo.xPositions - 图形在 x 轴方向上的像素坐标值,是一个一维数组,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  55265. * @param {number} xShapeInfo.width - 图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  55266. * @returns {Array.<Object>} 统计图表坐标轴图形对象数组。
  55267. */
  55268. }, {
  55269. key: "GraphAxis",
  55270. value: function GraphAxis(shapeFactory, dataViewBox, setting, xShapeInfo) {
  55271. var dvb = dataViewBox;
  55272. var sets = setting ? setting : {}; // 参考线图形对象组
  55273. var refLines = []; //坐标轴箭头对象组
  55274. var arrows = []; // 是否使用参水平考线,默认不使用
  55275. var isAddRefLine = sets.useXReferenceLine ? sets.useXReferenceLine : false; // y 轴上的刻度
  55276. var axisytick = sets.axisYTick && !isNaN(sets.axisYTick) ? sets.axisYTick : 0; // 坐标轴节点数组
  55277. var pois = []; //z 轴箭头数组
  55278. var zArrowPois = []; // x,y 轴主干节点数组
  55279. var xMainPois = [];
  55280. if (axisytick == 0) {
  55281. xMainPois.push([dvb[0], dvb[3] - 5]);
  55282. xMainPois.push([dvb[0], dvb[1]]); // 3D 坐标轴 第三象限平分线
  55283. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  55284. var axis3DParameter = parseInt(sets.axis3DParameter);
  55285. var axis3DPoi = [dvb[0] - axis3DParameter, dvb[1] + axis3DParameter]; // 添加 3D 轴节点
  55286. if (sets.axisUseArrow) {
  55287. // 添加 3D 轴箭头节点坐标
  55288. //箭头坐标
  55289. zArrowPois.push([axis3DPoi[0] + 1.5, axis3DPoi[1] - 7.5]);
  55290. zArrowPois.push([axis3DPoi[0] - 1, axis3DPoi[1] + 1]);
  55291. zArrowPois.push([axis3DPoi[0] + 7.5, axis3DPoi[1] - 1.5]); //3D轴
  55292. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  55293. } else {
  55294. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  55295. }
  55296. xMainPois.push([dvb[0], dvb[1]]);
  55297. }
  55298. xMainPois.push([dvb[2] + 5, dvb[1]]);
  55299. } else {
  55300. // 单位刻度长度
  55301. var unitTick = Math.abs(dvb[1] - dvb[3]) / axisytick; // 刻度 y 坐标
  55302. var thckY = dvb[3];
  55303. xMainPois.push([dvb[0], thckY - 5]);
  55304. for (var i = 0; i < axisytick; i++) {
  55305. xMainPois.push([dvb[0], thckY]);
  55306. xMainPois.push([dvb[0] - 5, thckY]);
  55307. xMainPois.push([dvb[0], thckY]); // 参考线
  55308. if (isAddRefLine) {
  55309. // 参考线参数对象
  55310. var refLineSP = new Line_Line([[dvb[0], thckY], [dvb[2], thckY]]); // 参考线默认样式对象
  55311. refLineSP.style = {
  55312. strokeColor: "#cfcfcf",
  55313. strokeLinecap: "butt",
  55314. strokeLineJoin: "round",
  55315. strokeWidth: 1
  55316. }; // 禁止事件
  55317. refLineSP.clickable = false;
  55318. refLineSP.hoverable = false; // 用户style
  55319. if (sets.xReferenceLineStyle) {
  55320. Util.copyAttributesWithClip(refLineSP.style, sets.xReferenceLineStyle);
  55321. } // 生成参考线图形对象
  55322. refLines.push(shapeFactory.createShape(refLineSP));
  55323. } // y 刻度增量
  55324. thckY += unitTick;
  55325. }
  55326. xMainPois.push([dvb[0], dvb[1]]); // 3D 坐标轴 第三象限平分线
  55327. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  55328. var _axis3DParameter = parseInt(sets.axis3DParameter);
  55329. var _axis3DPoi = [dvb[0] - _axis3DParameter, dvb[1] + _axis3DParameter];
  55330. /*
  55331. // 箭头计算过程
  55332. var axis3DPoiRef = [axis3DPoi[0] + 7, axis3DPoi[1] - 7]; // 7 是 10 为斜边 cos(45度)时邻边的值
  55333. var axis3DPoiLT = [axis3DPoiRef[0] - 4, axis3DPoiRef[1] - 4];
  55334. var axis3DPoiRB = [axis3DPoiRef[0] + 4, axis3DPoiRef[1] + 4];
  55335. if(sets.axisUseArrow){
  55336. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  55337. xMainPois.push([axis3DPoiLT[0], axis3DPoiLT[1]]);
  55338. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  55339. xMainPois.push([axis3DPoiRB[0], axis3DPoiRB[1]]);
  55340. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  55341. }
  55342. else{
  55343. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  55344. }
  55345. */
  55346. // 添加 3D 轴节点
  55347. if (sets.axisUseArrow) {
  55348. // 添加 3D 轴和箭头坐标
  55349. //箭头坐标
  55350. zArrowPois.push([_axis3DPoi[0] + 1.5, _axis3DPoi[1] - 7.5]);
  55351. zArrowPois.push([_axis3DPoi[0] - 1, _axis3DPoi[1] + 1]);
  55352. zArrowPois.push([_axis3DPoi[0] + 7.5, _axis3DPoi[1] - 1.5]); //3D轴
  55353. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  55354. } else {
  55355. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  55356. }
  55357. xMainPois.push([dvb[0], dvb[1]]);
  55358. }
  55359. xMainPois.push([dvb[2] + 5, dvb[1]]);
  55360. } // 坐标轴箭头
  55361. if (sets.axisUseArrow) {
  55362. // x 轴箭头节点数组
  55363. var xArrowPois = [[dvb[2] + 5, dvb[1] + 4], [dvb[2] + 13, dvb[1]], [dvb[2] + 5, dvb[1] - 4]]; // y 轴箭头节点数组
  55364. var yArrowPois = [[dvb[0] - 4, dvb[3] - 5], [dvb[0], dvb[3] - 13], [dvb[0] + 4, dvb[3] - 5]]; //x轴箭头
  55365. var xSP = new Polygon_Polygon(xArrowPois);
  55366. xSP.style = {
  55367. fillColor: "#008acd"
  55368. };
  55369. Util.copyAttributesWithClip(xSP.style, sets.axisStyle);
  55370. arrows.push(shapeFactory.createShape(xSP)); //y轴箭头
  55371. var ySP = new Polygon_Polygon(yArrowPois);
  55372. ySP.style = {
  55373. fillColor: "#008acd"
  55374. };
  55375. Util.copyAttributesWithClip(ySP.style, sets.axisStyle);
  55376. arrows.push(shapeFactory.createShape(ySP)); // z轴箭头 坐标轴箭头是否要使用
  55377. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  55378. var zSP = new Polygon_Polygon(zArrowPois);
  55379. zSP.style = {
  55380. fillColor: "#008acd"
  55381. };
  55382. Util.copyAttributesWithClip(zSP.style, sets.axisStyle);
  55383. arrows.push(shapeFactory.createShape(zSP));
  55384. }
  55385. } //不带箭头的坐标轴
  55386. pois = xMainPois; // 坐标轴参数对象
  55387. var axisSP = new Line_Line(pois); // 坐标轴默认style
  55388. axisSP.style = {
  55389. strokeLinecap: "butt",
  55390. strokeLineJoin: "round",
  55391. strokeColor: "#008acd",
  55392. strokeWidth: 1
  55393. }; // 用户 style
  55394. if (sets.axisStyle) {
  55395. Util.copyAttributesWithClip(axisSP.style, sets.axisStyle);
  55396. } // 禁止事件
  55397. axisSP.clickable = false;
  55398. axisSP.hoverable = false; // 创建坐标轴图形对象
  55399. var axisMain = [shapeFactory.createShape(axisSP)]; // Y 轴标签
  55400. var yLabels = [];
  55401. if (sets.axisYLabels && sets.axisYLabels.length && sets.axisYLabels.length > 0) {
  55402. var axisYLabels = sets.axisYLabels;
  55403. var len = axisYLabels.length; // 标签偏移量
  55404. var ylOffset = [0, 0];
  55405. if (sets.axisYLabelsOffset && sets.axisYLabelsOffset.length) {
  55406. ylOffset = sets.axisYLabelsOffset;
  55407. }
  55408. if (len == 1) {
  55409. // 标签参数对象
  55410. var labelYSP = new Label(dvb[0] - 5 + ylOffset[0], dvb[3] + ylOffset[1], axisYLabels[0]);
  55411. labelYSP.style = {
  55412. labelAlign: "right"
  55413. }; // 用户 style
  55414. if (sets.axisYLabelsStyle) {
  55415. Util.copyAttributesWithClip(labelYSP.style, sets.axisYLabelsStyle);
  55416. } // 禁止事件
  55417. labelYSP.clickable = false;
  55418. labelYSP.hoverable = false; // 制作标签
  55419. yLabels.push(shapeFactory.createShape(labelYSP));
  55420. } else {
  55421. var labelY = dvb[3]; // y 轴标签单位距离
  55422. var yUnit = Math.abs(dvb[1] - dvb[3]) / (len - 1);
  55423. for (var j = 0; j < len; j++) {
  55424. // 标签参数对象
  55425. var _labelYSP = new Label(dvb[0] - 5 + ylOffset[0], labelY + ylOffset[1], axisYLabels[j]);
  55426. _labelYSP.style = {
  55427. labelAlign: "right"
  55428. }; // 用户 style
  55429. if (sets.axisYLabelsStyle) {
  55430. Util.copyAttributesWithClip(_labelYSP.style, sets.axisYLabelsStyle);
  55431. } // 禁止事件
  55432. _labelYSP.clickable = false;
  55433. _labelYSP.hoverable = false; // 制作标签
  55434. yLabels.push(shapeFactory.createShape(_labelYSP)); // y 轴标签 y 方向增量
  55435. labelY += yUnit;
  55436. }
  55437. }
  55438. } // X 轴标签
  55439. var xLabels = [];
  55440. if (sets.axisXLabels && sets.axisXLabels.length && sets.axisXLabels.length > 0) {
  55441. var axisXLabels = sets.axisXLabels;
  55442. var _len = axisXLabels.length; // 标签偏移量
  55443. var xlOffset = [0, 0];
  55444. if (sets.axisXLabelsOffset && sets.axisXLabelsOffset.length) {
  55445. xlOffset = sets.axisXLabelsOffset;
  55446. } // 标签个数与数据字段个数相等等时,标签在 x 轴均匀排列
  55447. if (xShapeInfo && xShapeInfo.xPositions && xShapeInfo.xPositions.length && xShapeInfo.xPositions.length == _len) {
  55448. var xsCenter = xShapeInfo.xPositions;
  55449. for (var K = 0; K < _len; K++) {
  55450. // 标签参数对象
  55451. var labelXSP = new Label(xsCenter[K] + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[K]); // 默认 style
  55452. labelXSP.style = {
  55453. labelAlign: "center",
  55454. labelBaseline: "top"
  55455. }; // 用户 style
  55456. if (sets.axisXLabelsStyle) {
  55457. Util.copyAttributesWithClip(labelXSP.style, sets.axisXLabelsStyle);
  55458. } // 禁止事件
  55459. labelXSP.clickable = false;
  55460. labelXSP.hoverable = false; // 创建标签对象
  55461. xLabels.push(shapeFactory.createShape(labelXSP));
  55462. }
  55463. } else {
  55464. if (_len == 1) {
  55465. // 标签参数对象
  55466. var _labelXSP = new Label(dvb[0] - 5 + xlOffset[0], dvb[1] + xlOffset[0], axisXLabels[0]); // 默认 style
  55467. _labelXSP.style = {
  55468. labelAlign: "center",
  55469. labelBaseline: "top"
  55470. }; // 用户 style
  55471. if (sets.axisXLabelsStyle) {
  55472. Util.copyAttributesWithClip(_labelXSP.style, sets.axisXLabelsStyle);
  55473. } // 禁止事件
  55474. _labelXSP.clickable = false;
  55475. _labelXSP.hoverable = false; // 创建标签对象
  55476. xLabels.push(shapeFactory.createShape(_labelXSP));
  55477. } else {
  55478. var labelX = dvb[0]; // x 轴标签单位距离
  55479. var xUnit = Math.abs(dvb[2] - dvb[0]) / (_len - 1);
  55480. for (var m = 0; m < _len; m++) {
  55481. // 标签参数对象
  55482. var _labelXSP2 = new Label(labelX + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[m]); // 默认 style
  55483. _labelXSP2.style = {
  55484. labelAlign: "center",
  55485. labelBaseline: "top"
  55486. }; // 用户 style
  55487. if (sets.axisXLabelsStyle) {
  55488. Util.copyAttributesWithClip(_labelXSP2.style, sets.axisXLabelsStyle);
  55489. } // 禁止事件
  55490. _labelXSP2.clickable = false;
  55491. _labelXSP2.hoverable = false; // 创建标签对象
  55492. xLabels.push(shapeFactory.createShape(_labelXSP2)); // x 轴标签 x 方向增量
  55493. labelX += xUnit;
  55494. }
  55495. }
  55496. }
  55497. } // 组装并返回构成坐标轴的图形
  55498. return refLines.concat(axisMain).concat(yLabels).concat(xLabels).concat(arrows);
  55499. }
  55500. /**
  55501. * @function SuperMap.Feature.ShapeParameters.prototype.ShapeStyleTool
  55502. * @description 一个图形 style 处理工具。此工具将指定的默认 style,通用 style,按 styleGroup 取得的 style 和按数据值 value 范围取得的 style 进行合并,得到图形最终的 style。
  55503. * @param {Object} defaultStyle - 默认style,此样式对象可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。
  55504. * @param {Object} style - 图形对象基础 style,此参数控制图形的基础样式,可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。优先级低于 styleGroup,styleByCodomain。
  55505. * @param {Array.<Object>} styleGroup - 一个 style 数组,优先级低于 styleByCodomain,高于 style。此数组每个元素是样式对象,
  55506. * 其可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。通过 index 参数从 styleGroup 中取 style。
  55507. * @param {Array.<Object>} styleByCodomain - 按数据(参数 value)所在值域范围控制数据的可视化对象样式。
  55508. * (start code)
  55509. * // styleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  55510. * // start: 值域值下限(包含);
  55511. * // end: 值域值上限(不包含);
  55512. * // style: 数据可视化图形的 style,其可设属性根据图形类型参考 <SuperMap.Feature.ShapeParameters> 子类对象的 style 属性。。
  55513. * // dataStyleByCodomain 数组形如:
  55514. * [
  55515. * {
  55516. * start:0,
  55517. * end:250,
  55518. * style:{
  55519. * fillColor:"#00CD00"
  55520. * }
  55521. * },
  55522. * {
  55523. * start:250,
  55524. * end:500,
  55525. * style:{
  55526. * fillColor:"#00EE00"
  55527. * }
  55528. * },
  55529. * {
  55530. * start:500,
  55531. * end:750,
  55532. * style:{
  55533. * fillColor:"#00FF7F"
  55534. * }
  55535. * },
  55536. * {
  55537. * start:750,
  55538. * end:1500,
  55539. * style:{
  55540. * fillColor:"#00FF00"
  55541. * }
  55542. * }
  55543. * ]
  55544. * (end)
  55545. * @param {number} index - styleGroup 的索引值,用于取出 styleGroup 指定的 style。
  55546. * @param {number} value - 数据值,用于取出 styleByCodomain 指定的 style。
  55547. * @returns {Object} 合并后的样式 (style) 对象。
  55548. */
  55549. }, {
  55550. key: "ShapeStyleTool",
  55551. value: function ShapeStyleTool(defaultStyle, style, styleGroup, styleByCodomain, index, value) {
  55552. // 用 defaultStyle 初始化 style 对象
  55553. var finalStyle = defaultStyle ? defaultStyle : {}; // 基础 style
  55554. if (style) {
  55555. Util.copyAttributesWithClip(finalStyle, style);
  55556. } // 按索引赋 style
  55557. if (styleGroup && styleGroup.length && typeof index !== "undefined" && !isNaN(index) && index >= 0) {
  55558. if (styleGroup[index]) {
  55559. Util.copyAttributesWithClip(finalStyle, styleGroup[index]);
  55560. }
  55561. } // 按值域赋 style
  55562. if (styleByCodomain && styleByCodomain.length && typeof value !== "undefined") {
  55563. var dsc = styleByCodomain;
  55564. var dscLen = dsc.length;
  55565. var v = parseFloat(value);
  55566. for (var i = 0; i < dscLen; i++) {
  55567. if (dsc[i].start <= v && v < dsc[i].end) {
  55568. Util.copyAttributesWithClip(finalStyle, dsc[i].style);
  55569. break;
  55570. }
  55571. }
  55572. }
  55573. return finalStyle;
  55574. }
  55575. }]);
  55576. return ShapeFactory;
  55577. }();
  55578. SuperMap.Feature = SuperMap.Feature || {};
  55579. SuperMap.Feature.ShapeFactory = ShapeFactory;
  55580. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Theme.js
  55581. function feature_Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55582. 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); } }
  55583. function feature_Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Theme_defineProperties(Constructor, staticProps); return Constructor; }
  55584. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  55585. * This program are made available under the terms of the Apache License, Version 2.0
  55586. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55587. /**
  55588. * @class SuperMap.Feature.Theme
  55589. * @category Visualization Theme
  55590. * @classdesc 专题要素基类,此类不可实例化。
  55591. */
  55592. var Theme_Theme = /*#__PURE__*/function () {
  55593. /**
  55594. * @function SuperMap.Feature.Theme.prototype.constructor
  55595. * @description 构造函数。
  55596. * @param {Object} data - 用户数据,用于生成可视化 shape,必设参数。
  55597. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层,必设参数。
  55598. * @returns {SuperMap.Feature.Theme} 返回一个专题要素。
  55599. */
  55600. function Theme(data, layer) {
  55601. feature_Theme_classCallCheck(this, Theme);
  55602. if (!data) {
  55603. return;
  55604. } // layer 必须已经添加到地图, 且已初始化渲染器
  55605. if (!layer || !layer.map || !layer.renderer) {
  55606. return;
  55607. }
  55608. /**
  55609. * @member {string} SuperMap.Feature.Theme.prototype.id
  55610. * @description 专题要素唯一标识。
  55611. */
  55612. this.id = Util.createUniqueID(this.CLASS_NAME + "_");
  55613. /**
  55614. * @member {SuperMap.LonLat} SuperMap.Feature.Theme.prototype.lonlat
  55615. * @description 专题要素地理参考位置。子类中必须根据用户数据(或地理位置参数)对其赋值。
  55616. */
  55617. this.lonlat = null;
  55618. /**
  55619. * @member {Array} SuperMap.Feature.Theme.prototype.location
  55620. * @description 专题要素像素参考位置。通常由地理参考位置决定。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  55621. */
  55622. this.location = [];
  55623. /**
  55624. * @readonly
  55625. * @member {Object} SuperMap.Feature.Theme.prototype.data
  55626. * @description 用户数据,用于生成可视化 shape,可在子类中规定数据格式或类型,如:<SuperMap.Feature.Vector>。
  55627. */
  55628. this.data = data;
  55629. /**
  55630. * @readonly
  55631. * @member {Array} SuperMap.Feature.Theme.prototype.shapes
  55632. * @description 构成此专题要素的可视化图形对象数组,数组顺序控制渲染。
  55633. */
  55634. this.shapes = [];
  55635. /**
  55636. * @readonly
  55637. * @member {SuperMap.Layer.Theme} SuperMap.Feature.Theme.prototype.layer
  55638. * @description 此专题要素所在专题图层。
  55639. */
  55640. this.layer = layer;
  55641. this.CLASS_NAME = "SuperMap.Feature.Theme";
  55642. }
  55643. /**
  55644. * @function SuperMap.Feature.Theme.prototype.destroy
  55645. * @description 销毁专题要素。
  55646. */
  55647. feature_Theme_createClass(Theme, [{
  55648. key: "destroy",
  55649. value: function destroy() {
  55650. this.data = null;
  55651. this.id = null;
  55652. this.lonlat = null;
  55653. this.location = null;
  55654. this.shapes = null;
  55655. this.layer = null;
  55656. }
  55657. /**
  55658. * @function SuperMap.Feature.Theme.prototype.getLocalXY
  55659. * @description 地理坐标转为像素坐标。
  55660. * @param {(SuperMap.Geometry.Point|SuperMap.Geometry.GeoText|SuperMap.LonLat)} coordinate - 地理坐标点。
  55661. * @returns {Array} 长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  55662. */
  55663. }, {
  55664. key: "getLocalXY",
  55665. value: function getLocalXY(coordinate) {
  55666. var resolution = this.layer.map.getResolution();
  55667. var extent = this.layer.map.getExtent();
  55668. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  55669. var x = coordinate.x / resolution + -extent.left / resolution;
  55670. var y = extent.top / resolution - coordinate.y / resolution;
  55671. return [x, y];
  55672. } else if (coordinate instanceof LonLat) {
  55673. var _x = coordinate.lon / resolution + -extent.left / resolution;
  55674. var _y = extent.top / resolution - coordinate.lat / resolution;
  55675. return [_x, _y];
  55676. } else {
  55677. return null;
  55678. }
  55679. }
  55680. }]);
  55681. return Theme;
  55682. }();
  55683. SuperMap.Feature = SuperMap.Feature || {};
  55684. SuperMap.Feature.Theme = Theme_Theme;
  55685. ;// CONCATENATED MODULE: ./src/common/overlay/Graph.js
  55686. function Graph_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Graph_typeof = function _typeof(obj) { return typeof obj; }; } else { Graph_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Graph_typeof(obj); }
  55687. function Graph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55688. 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); } }
  55689. function Graph_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graph_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graph_defineProperties(Constructor, staticProps); return Constructor; }
  55690. function Graph_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Graph_get = Reflect.get; } else { Graph_get = function _get(target, property, receiver) { var base = Graph_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Graph_get(target, property, receiver || target); }
  55691. function Graph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Graph_getPrototypeOf(object); if (object === null) break; } return object; }
  55692. function Graph_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Graph_setPrototypeOf(subClass, superClass); }
  55693. function Graph_setPrototypeOf(o, p) { Graph_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Graph_setPrototypeOf(o, p); }
  55694. 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); }; }
  55695. function Graph_possibleConstructorReturn(self, call) { if (call && (Graph_typeof(call) === "object" || typeof call === "function")) { return call; } return Graph_assertThisInitialized(self); }
  55696. function Graph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55697. function Graph_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  55698. function Graph_getPrototypeOf(o) { Graph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Graph_getPrototypeOf(o); }
  55699. /* Copyright© 2000 - 2021 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 SuperMap.Feature.Theme.Graph
  55704. * @classdesc 统计专题要素基类。
  55705. * @category Visualization Theme
  55706. * @description 此类定义了统计专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  55707. * 统计专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <SuperMap.Feature.Theme.Graph.setting> 的基础属性只有 7 个,
  55708. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  55709. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  55710. * @extends SuperMap.Feature.Theme
  55711. * @param {SuperMap.Feature.Vector} data - 用户数据。
  55712. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层。
  55713. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  55714. * @param {Object} setting - 图表配置对象。
  55715. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  55716. */
  55717. var Graph = /*#__PURE__*/function (_Theme) {
  55718. Graph_inherits(Graph, _Theme);
  55719. var _super = Graph_createSuper(Graph);
  55720. function Graph(data, layer, fields, setting, lonlat, options) {
  55721. var _this;
  55722. Graph_classCallCheck(this, Graph);
  55723. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  55724. /**
  55725. * @member {SuperMap.Feature.ShapeFactory} SuperMap.Feature.Theme.Graph.prototype.shapeFactory
  55726. * @description 内置的图形工厂对象,调用其 createShape 方法创建图形。
  55727. */
  55728. _this.shapeFactory = new ShapeFactory();
  55729. /**
  55730. * @member {Object} SuperMap.Feature.Theme.Graph.prototype.shapeParameters
  55731. * @description 当前图形参数对象,<SuperMap.Feature.ShapeParameters> 的子类对象。
  55732. */
  55733. _this.shapeParameters = null;
  55734. /**
  55735. * @member {boolean} [SuperMap.Feature.Theme.Graph.prototype.RelativeCoordinate]
  55736. * @description 图形是否已经计算了相对坐标。
  55737. */
  55738. _this.RelativeCoordinate = false;
  55739. /**
  55740. * @member {Object} SuperMap.Feature.Theme.Graph.prototype.setting
  55741. * @description 图表配置对象,该对象控制着图表的可视化显示。
  55742. * @param {number} width - 专题要素(图表)宽度。
  55743. * @param {number} height - 专题要素(图表)高度。
  55744. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  55745. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  55746. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  55747. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox
  55748. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  55749. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。
  55750. * 如果不设置此参数,在取数据值时不对数据做小数位处理。
  55751. *
  55752. */
  55753. _this.setting = null;
  55754. /**
  55755. * @readonly
  55756. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.origonPoint
  55757. * @description 专题要素(图表)原点,图表左上角点像素坐标,是长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  55758. */
  55759. _this.origonPoint = null;
  55760. /**
  55761. * @readonly
  55762. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.chartBox
  55763. * @description 专题要素(图表)区域,即图表框,长度为 4 的一维数组,数组的 4 个元素依次表示图表框左端 x 坐标值、
  55764. * 下端 y坐标值、 右端 x坐标值、 上端 y 坐标值;[left, bottom, right, top]。
  55765. */
  55766. _this.chartBox = null;
  55767. /**
  55768. * @readonly
  55769. * @member {SuperMap.Bounds} SuperMap.Feature.Theme.Graph.prototype.chartBounds
  55770. * @description 图表 Bounds 随着 lonlat、XOffset、YOffset 更新,注意 chartBounds 是图表像素范围,不是地理范围。
  55771. */
  55772. _this.chartBounds = null;
  55773. /**
  55774. * @readonly
  55775. * @member {number} SuperMap.Feature.Theme.Graph.prototype.width
  55776. * @description 专题要素(图表)宽度 。
  55777. */
  55778. _this.width = null;
  55779. /**
  55780. * @readonly
  55781. * @member {number} SuperMap.Feature.Theme.Graph.prototype.height
  55782. * @description 专题要素(图表)高度 。
  55783. */
  55784. _this.height = null;
  55785. /**
  55786. * @readonly
  55787. * @member {number} SuperMap.Feature.Theme.Graph.prototype.XOffset
  55788. * @description 专题要素(图表)在 X 方向上的偏移值,单位像素。
  55789. */
  55790. _this.XOffset = 0;
  55791. /**
  55792. * @readonly
  55793. * @member {number} SuperMap.Feature.Theme.Graph.prototype.YOffset
  55794. * @description 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  55795. */
  55796. _this.YOffset = 0;
  55797. /**
  55798. * @readonly
  55799. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBParameter
  55800. * @description 数据视图框参数,长度为 4 的一维数组(数组元素值 >= 0),[leftOffset, bottomOffset, rightOffset, topOffset],chartBox 内偏距值。
  55801. * 此属性用于指定数据视图框 dataViewBox 的范围。
  55802. */
  55803. _this.DVBParameter = null;
  55804. /**
  55805. * @readonly
  55806. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.dataViewBox
  55807. * @description 数据视图框,长度为 4 的一维数组,[left, bottom, right, top]。
  55808. * dataViewBox 是统计专题要素最核心的内容,它负责解释数据在一个像素区域里的数据可视化含义,
  55809. * 这种含义用可视化图形表达出来,这些表示数据的图形和一些辅助图形组合在一起构成统计专题图表。
  55810. */
  55811. _this.dataViewBox = null;
  55812. /**
  55813. * @readonly
  55814. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBCodomain
  55815. * @description 数据视图框的内允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  55816. * dataViewBox 中允许的数据范围,对数据溢出值域范围情况的处理需要在 assembleShapes 中进行。
  55817. */
  55818. _this.DVBCodomain = null;
  55819. /**
  55820. * @readonly
  55821. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBCenterPoint
  55822. * @description 数据视图框中心点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  55823. */
  55824. _this.DVBCenterPoint = null;
  55825. /**
  55826. * @readonly
  55827. * @member {string} SuperMap.Feature.Theme.Graph.prototype.DVBUnitValue
  55828. * @description 单位值。在 assembleShapes() 中初始化其具体意义,例如:饼图的 DVBUnitValue 可以定义为"360/数据总和",
  55829. * 折线图的 DVBUnitValue 可以定义为 "DVBCodomain/DVBHeight"。
  55830. */
  55831. _this.DVBUnitValue = null;
  55832. /**
  55833. * @readonly
  55834. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBOrigonPoint
  55835. * @description 数据视图框原点,数据视图框左上角点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  55836. */
  55837. _this.DVBOrigonPoint = null;
  55838. /**
  55839. * @readonly
  55840. * @member {number} SuperMap.Feature.Theme.Graph.prototype.DVBWidth
  55841. * @description 数据视图框宽度。
  55842. */
  55843. _this.DVBWidth = null;
  55844. /**
  55845. * @readonly
  55846. * @member {number} SuperMap.Feature.Theme.Graph.prototype.DVBHeight
  55847. * @description 数据视图框高度。
  55848. */
  55849. _this.DVBHeight = null;
  55850. /**
  55851. * @readonly
  55852. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.origonPointOffset
  55853. * @description 数据视图框原点相对于图表框的原点偏移量,长度为 2 的一维数组,第一个元素表示 x 偏移量,第二个元素表示 y 偏移量。
  55854. */
  55855. _this.origonPointOffset = null;
  55856. /**
  55857. * @readonly
  55858. * @member {Array.<string>} SuperMap.Feature.Theme.Graph.prototype.fields
  55859. * @description 数据{SuperMap.Feature.Vector}属性字段。
  55860. */
  55861. _this.fields = fields || [];
  55862. /**
  55863. * @readonly
  55864. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.dataValues
  55865. * @description 图表展示的数据值,通过 fields 从数据 feature 属性中获得。
  55866. */
  55867. _this.dataValues = null; // 图表位置
  55868. if (lonlat) {
  55869. _this.lonlat = lonlat;
  55870. } else {
  55871. // 默认使用 bounds 中心
  55872. _this.lonlat = _this.data.geometry.getBounds().getCenterLonLat();
  55873. } // 配置项检测与赋值
  55874. if (setting && setting.width && setting.height && setting.codomain) {
  55875. _this.setting = setting;
  55876. }
  55877. _this.CLASS_NAME = "SuperMap.Feature.Theme.Graph";
  55878. return _this;
  55879. }
  55880. /**
  55881. * @function SuperMap.Feature.Theme.Graph.prototype.destroy
  55882. * @description 销毁专题要素。
  55883. */
  55884. Graph_createClass(Graph, [{
  55885. key: "destroy",
  55886. value: function destroy() {
  55887. this.shapeFactory = null;
  55888. this.shapeParameters = null;
  55889. this.width = null;
  55890. this.height = null;
  55891. this.origonPoint = null;
  55892. this.chartBox = null;
  55893. this.dataViewBox = null;
  55894. this.chartBounds = null;
  55895. this.DVBParameter = null;
  55896. this.DVBOrigonPoint = null;
  55897. this.DVBCenterPoint = null;
  55898. this.DVBWidth = null;
  55899. this.DVBHeight = null;
  55900. this.DVBCodomain = null;
  55901. this.DVBUnitValue = null;
  55902. this.origonPointOffset = null;
  55903. this.XOffset = null;
  55904. this.YOffset = null;
  55905. this.fields = null;
  55906. this.dataValues = null;
  55907. this.setting = null;
  55908. Graph_get(Graph_getPrototypeOf(Graph.prototype), "destroy", this).call(this);
  55909. }
  55910. /**
  55911. * @function SuperMap.Feature.Theme.Graph.prototype.initBaseParameter
  55912. * @description 初始化专题要素(图表)基础参数。在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  55913. * 调用此函数关系到 setting 对象的以下属性。
  55914. * @param {number} width - 专题要素(图表)宽度。
  55915. * @param {number} height - 专题要素(图表)高度。
  55916. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  55917. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  55918. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  55919. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox。
  55920. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  55921. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  55922. * @returns {boolean} 初始化参数是否成功。
  55923. */
  55924. }, {
  55925. key: "initBaseParameter",
  55926. value: function initBaseParameter() {
  55927. // 参数初始化是否成功
  55928. var isSuccess = true; // setting 属性是否已成功赋值
  55929. if (!this.setting) {
  55930. return false;
  55931. }
  55932. var sets = this.setting; // 检测 setting 的必设参数
  55933. if (!(sets.width && sets.height && sets.codomain)) {
  55934. return false;
  55935. } // 数据
  55936. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  55937. var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  55938. this.dataValues = dataEffective ? dataEffective : []; // 基础参数 width, height, codomain
  55939. this.width = parseFloat(sets.width);
  55940. this.height = parseFloat(sets.height);
  55941. this.DVBCodomain = sets.codomain; // 图表偏移
  55942. // if(sets.XOffset) {this.XOffset = sets.XOffset};
  55943. // if(sets.YOffset) {this.YOffset = sets.YOffset};
  55944. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  55945. this.YOffset = sets.YOffset ? sets.YOffset : 0; // 其他默认值
  55946. this.origonPoint = [];
  55947. this.chartBox = [];
  55948. this.dataViewBox = [];
  55949. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  55950. this.DVBOrigonPoint = [];
  55951. this.DVBCenterPoint = [];
  55952. this.origonPointOffset = []; // 图表位置
  55953. this.resetLocation(); // 专题要素宽度 w
  55954. var w = this.width; // 专题要素高度 h
  55955. var h = this.height; // 专题要素像素位置 loc
  55956. var loc = this.location; // 专题要素像素位置 loc
  55957. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2]; // 专题要素原点(左上角)
  55958. var op = this.origonPoint; // 图表框([left, bottom, right, top])
  55959. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]]; // 图表框
  55960. var cb = this.chartBox; // 数据视图框参数,它是图表框各方向对应的内偏距
  55961. var dbbP = this.DVBParameter; // 数据视图框 ([left, bottom, right, top])
  55962. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]]; // 数据视图框
  55963. var dvb = this.dataViewBox; //检查数据视图框是否合法
  55964. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  55965. return false;
  55966. } // 数据视图框原点
  55967. this.DVBOrigonPoint = [dvb[0], dvb[3]]; // 数据视图框宽度
  55968. this.DVBWidth = Math.abs(dvb[2] - dvb[0]); // 数据视图框高度
  55969. this.DVBHeight = Math.abs(dvb[1] - dvb[3]); // 数据视图框中心点
  55970. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2]; // 数据视图框原点与图表框的原点偏移量
  55971. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  55972. return isSuccess;
  55973. }
  55974. /**
  55975. * @function SuperMap.Feature.Theme.Graph.prototype.resetLocation
  55976. * @description 根据地理位置 lonlat 重置专题要素(图表)位置。
  55977. * @param {SuperMap.LonLat} lonlat - 专题要素新的像素中心位置。
  55978. * @returns {Array.<number>} - 新专题要素像素参考位置。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  55979. */
  55980. }, {
  55981. key: "resetLocation",
  55982. value: function resetLocation(lonlat) {
  55983. if (lonlat) {
  55984. this.lonlat = lonlat;
  55985. } // 获取地理位置对应的像素坐标 newLocalLX
  55986. var newLocalLX = this.getLocalXY(this.lonlat); // 处理偏移量 XOffset, YOffset
  55987. newLocalLX[0] += this.XOffset;
  55988. newLocalLX[1] += this.YOffset; // 将图形位置赋予 location 属性(注意 location 属性表示的是专题要素中心位置)
  55989. this.location = newLocalLX; // 更新图表像素 Bounds
  55990. var w = this.width;
  55991. var h = this.height;
  55992. var loc = this.location;
  55993. this.chartBounds = new Bounds(loc[0] - w / 2, loc[1] + h / 2, loc[0] + w / 2, loc[1] - h / 2); //重新计算当前渐变色
  55994. this.resetLinearGradient();
  55995. return loc;
  55996. }
  55997. /**
  55998. * @function SuperMap.Feature.Theme.Graph.prototype.resetLinearGradient
  55999. * @description resetLocation 中调用 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图渐变色 所以子类实现此方法)。
  56000. */
  56001. }, {
  56002. key: "resetLinearGradient",
  56003. value: function resetLinearGradient() {//子类实现此方法
  56004. }
  56005. /**
  56006. * @function SuperMap.Feature.Theme.Graph.prototype.shapesConvertToRelativeCoordinate
  56007. * @description 将(构成图表)图形的节点转为相对坐标表示,此函数必须且只能在 assembleShapes() 结束时调用。
  56008. */
  56009. }, {
  56010. key: "shapesConvertToRelativeCoordinate",
  56011. value: function shapesConvertToRelativeCoordinate() {
  56012. var shapes = this.shapes;
  56013. var shapeROP = this.location;
  56014. for (var i = 0, len = shapes.length; i < len; i++) {
  56015. shapes[i].refOriginalPosition = shapeROP;
  56016. var style = shapes[i].style;
  56017. for (var sty in style) {
  56018. switch (sty) {
  56019. case "pointList":
  56020. var pl = style[sty];
  56021. for (var j = 0, len2 = pl.length; j < len2; j++) {
  56022. pl[j][0] -= shapeROP[0];
  56023. pl[j][1] -= shapeROP[1];
  56024. }
  56025. break;
  56026. case "x":
  56027. style[sty] -= shapeROP[0];
  56028. break;
  56029. case "y":
  56030. style[sty] -= shapeROP[1];
  56031. break;
  56032. default:
  56033. break;
  56034. }
  56035. }
  56036. }
  56037. this.RelativeCoordinate = true;
  56038. }
  56039. /**
  56040. * @function SuperMap.Feature.Theme.Graph.prototype.assembleShapes
  56041. * @description 图形装配函数。抽象方法,可视化子类必须实现此方法。<br>
  56042. * 重写此方法的步骤:<br>
  56043. * 1. 图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。<br>
  56044. * 2. 调用 initBaseParameter() 方法初始化模型属性值,此步骤必须执行,只有当 initBaseParameter 返回 true 时才可以允许进行后续步骤。<br>
  56045. * 3. 计算图形参数,制作图形,图形组合。在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。<br>
  56046. * 4. 调用 shapesConvertToRelativeCoordinate() 方法,将图形的坐标值转为相对坐标,此步骤必须执行。
  56047. * @example
  56048. * //子类实现 assembleShapes() 接口的步骤示例:
  56049. * assembleShapes: function(){
  56050. * // 第一步:图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。此步骤是非必须过程。
  56051. *
  56052. * // 图表配置对象
  56053. * var sets = this.setting;
  56054. * // 默认数据视图框,这里展示在使用坐标轴和不使用坐标轴情况下对数据视图框参数赋予不同的默认值
  56055. * if(!sets.dataViewBoxParameter){
  56056. * if(typeof(sets.useAxis) === "undefined" || sets.useAxis){
  56057. * sets.dataViewBoxParameter = [45, 15, 15, 15];
  56058. * }
  56059. * else{
  56060. * sets.dataViewBoxParameter = [5, 5, 5, 5];
  56061. * }
  56062. * }
  56063. *
  56064. * // 第二步:初始化图表模型基本参数,只有在图表模型基本参数初始化成功时才可模型相关属性,如 this.dataViewBox、 this.DVBCodomain等。此步骤是必须过程。
  56065. * if(!this.initBaseParameter()) return;
  56066. *
  56067. * // 第三步:用图形组装图表,在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。
  56068. * // 定义图表数据视图框中单位值的含义,下面行代码表示将数据视图框单位值定义为数据视图框高度上每像素代表的数据值
  56069. * this.DVBUnitValue = (this.codomain[1] - this.codomain[0])/this.DVBHeight;
  56070. * var uv = this.DVBUnitValue;
  56071. *
  56072. * // 图形参数计算代码......
  56073. *
  56074. * // 关于图形装配,实际上就是利用图形工程对象 this.shapeFactory 的 createShape() 方法通过图形参数对象创建可视化的图形对象,并把这些图形对象按序添加到模型的图形库(his.shapes)中。下面的代码演示创建一个面图形参数对象,并允许通过图形配置对象设置图形的 style 和 highlightStyle,
  56075. * var barParams = new SuperMap.Feature.ShapeParameters.Polygon(poiLists);
  56076. * barParams.style = sets.barStyle? sets.barStyle:{fillColor: "lightblue"};
  56077. * barParams.highlightStyle = sets.barHoverStyle? sets.barHoverStyle:{fillColor: "blue"};
  56078. * // 图形携带数据ID信息
  56079. * barParams.refDataID = this.data.id;
  56080. * // 创建图形并添加到图表图形数组中
  56081. * this.shapes.push(this.shapeFactory.createShape(barParams));
  56082. *
  56083. * // 第四步:调用 shapesConvertToRelativeCoordinate() 方法,将图形库(his.shapes)中的图形转为由相对坐标表示的图形,客户端统计专题图模块从结构上要求可视化图形使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数。此步骤是必须过程。
  56084. * this.shapesConvertToRelativeCoordinate();
  56085. * },
  56086. */
  56087. }, {
  56088. key: "assembleShapes",
  56089. value: function assembleShapes() {//子类必须实现此方法
  56090. }
  56091. /**
  56092. * @function SuperMap.Feature.Theme.Graph.prototype.getLocalXY
  56093. * @description 地理坐标转为像素坐标。
  56094. * @param {SuperMap.Lonlat} lonlat - 带转换的地理坐标。
  56095. * @returns 屏幕像素坐标。
  56096. */
  56097. }, {
  56098. key: "getLocalXY",
  56099. value: function getLocalXY(lonlat) {
  56100. return this.layer.getLocalXY(lonlat);
  56101. }
  56102. }]);
  56103. return Graph;
  56104. }(Theme_Theme);
  56105. /**
  56106. * @function SuperMap.Feature.Theme.getDataValues
  56107. * @description 根据字段名数组获取指定数据(feature)的属性值数组。属性值类型必须为 Number。
  56108. * @param {SuperMap.Feature.Vector} data - 数据。
  56109. * @param {Array.<string>} [fields] - 字段名数组。
  56110. * @param {number} [decimalNumber] - 小数位处理参数,对获取到的属性数据值进行小数位处理。
  56111. * @returns {Array.<string>} 字段名数组对应的属性数据值数组。
  56112. */
  56113. Theme_Theme.getDataValues = function (data, fields, decimalNumber) {
  56114. if (!data.attributes) {
  56115. return false;
  56116. }
  56117. var fieldsValue = [];
  56118. var attrs = data.attributes;
  56119. for (var i = 0; i < fields.length; i++) {
  56120. for (var field in attrs) {
  56121. if (field !== fields[i]) {
  56122. continue;
  56123. } // 数字转换判断
  56124. try {
  56125. if (!isNaN(decimalNumber) && decimalNumber >= 0) {
  56126. fieldsValue.push(parseFloat(attrs[field].toString()).toFixed(decimalNumber));
  56127. } else {
  56128. fieldsValue.push(parseFloat(attrs[field].toString()));
  56129. }
  56130. } catch (e) {
  56131. throw new Error("not a number");
  56132. }
  56133. }
  56134. }
  56135. if (fieldsValue.length === fields.length) {
  56136. return fieldsValue;
  56137. } else {
  56138. return false;
  56139. }
  56140. };
  56141. SuperMap.Feature.Theme.Graph = Graph;
  56142. ;// CONCATENATED MODULE: ./src/common/overlay/Bar.js
  56143. function Bar_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Bar_typeof = function _typeof(obj) { return typeof obj; }; } else { Bar_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Bar_typeof(obj); }
  56144. function Bar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56145. 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); } }
  56146. function Bar_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar_defineProperties(Constructor, staticProps); return Constructor; }
  56147. function Bar_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Bar_get = Reflect.get; } else { Bar_get = function _get(target, property, receiver) { var base = Bar_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Bar_get(target, property, receiver || target); }
  56148. function Bar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar_getPrototypeOf(object); if (object === null) break; } return object; }
  56149. function Bar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Bar_setPrototypeOf(subClass, superClass); }
  56150. function Bar_setPrototypeOf(o, p) { Bar_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar_setPrototypeOf(o, p); }
  56151. 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); }; }
  56152. function Bar_possibleConstructorReturn(self, call) { if (call && (Bar_typeof(call) === "object" || typeof call === "function")) { return call; } return Bar_assertThisInitialized(self); }
  56153. function Bar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  56154. function Bar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  56155. function Bar_getPrototypeOf(o) { Bar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar_getPrototypeOf(o); }
  56156. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  56157. * This program are made available under the terms of the Apache License, Version 2.0
  56158. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56159. /**
  56160. * @class SuperMap.Feature.Theme.Bar
  56161. * @classdesc 柱状图 。
  56162. * @category Visualization Theme
  56163. * @example
  56164. * // barStyleByCodomain参数用法如下:
  56165. * // barStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  56166. * // start: 值域值下限(包含);
  56167. * // end: 值域值上限(不包含);
  56168. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
  56169. * // barStyleByCodomain 数组形如:
  56170. * [
  56171. * {
  56172. * start:0,
  56173. * end:250,
  56174. * style:{
  56175. * fillColor:"#00CD00"
  56176. * }
  56177. * },
  56178. * {
  56179. * start:250,
  56180. * end:500,
  56181. * style:{
  56182. * fillColor:"#00EE00"
  56183. * }
  56184. * },
  56185. * {
  56186. * start:500,
  56187. * end:750,
  56188. * style:{
  56189. * fillColor:"#00FF7F"
  56190. * }
  56191. * },
  56192. * {
  56193. * start:750,
  56194. * end:1500,
  56195. * style:{
  56196. * fillColor:"#00FF00"
  56197. * }
  56198. * }
  56199. * ]
  56200. * @extends SuperMap.Feature.Theme.Graph
  56201. * @param {SuperMap.Feature.Vector} data - 用户数据。
  56202. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  56203. * @param {Array.<string>} fields - data 属性中的参与此图表生成的属性字段名称。
  56204. * @param {SuperMap.Feature.Theme.Bar.setting} setting - 图表配置对象。
  56205. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  56206. */
  56207. var Bar = /*#__PURE__*/function (_Graph) {
  56208. Bar_inherits(Bar, _Graph);
  56209. var _super = Bar_createSuper(Bar);
  56210. function Bar(data, layer, fields, setting, lonlat) {
  56211. var _this;
  56212. Bar_classCallCheck(this, Bar);
  56213. _this = _super.call(this, data, layer, fields, setting, lonlat);
  56214. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar";
  56215. return _this;
  56216. }
  56217. /**
  56218. * @function SuperMap.Feature.Theme.Bar.prototype.destroy
  56219. * @override
  56220. */
  56221. Bar_createClass(Bar, [{
  56222. key: "destroy",
  56223. value: function destroy() {
  56224. Bar_get(Bar_getPrototypeOf(Bar.prototype), "destroy", this).call(this);
  56225. }
  56226. /**
  56227. * @function SuperMap.Feature.Theme.Bar.prototype.assembleShapes
  56228. * @description 图表图形装配函数。
  56229. */
  56230. }, {
  56231. key: "assembleShapes",
  56232. value: function assembleShapes() {
  56233. //默认渐变颜色数组
  56234. var deafaultColors = [["#00FF00", "#00CD00"], ["#00CCFF", "#5E87A2"], ["#00FF66", "#669985"], ["#CCFF00", "#94A25E"], ["#FF9900", "#A2945E"]]; //默认阴影
  56235. var deafaultShawdow = {
  56236. showShadow: true,
  56237. shadowBlur: 8,
  56238. shadowColor: "rgba(100,100,100,0.8)",
  56239. shadowOffsetX: 2,
  56240. shadowOffsetY: 2
  56241. }; // 图表配置对象
  56242. var sets = this.setting;
  56243. if (!sets.barLinearGradient) {
  56244. sets.barLinearGradient = deafaultColors;
  56245. } // 默认数据视图框
  56246. if (!sets.dataViewBoxParameter) {
  56247. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  56248. sets.dataViewBoxParameter = [45, 15, 15, 15];
  56249. } else {
  56250. sets.dataViewBoxParameter = [5, 5, 5, 5];
  56251. }
  56252. } // 重要步骤:初始化参数
  56253. if (!this.initBaseParameter()) {
  56254. return;
  56255. } // 值域
  56256. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  56257. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight; // 数据视图域
  56258. var dvb = this.dataViewBox; // 用户数据值
  56259. var fv = this.dataValues;
  56260. if (fv.length < 1) {
  56261. return;
  56262. } // 没有数据
  56263. // 数据溢出值域范围处理
  56264. for (var _i = 0, fvLen = fv.length; _i < fvLen; _i++) {
  56265. if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
  56266. return;
  56267. }
  56268. } // 获取 x 轴上的图形信息
  56269. var xShapeInfo = this.calculateXShapeInfo();
  56270. if (!xShapeInfo) {
  56271. return;
  56272. } // 每个柱条 x 位置
  56273. var xsLoc = xShapeInfo.xPositions; // 柱条宽度
  56274. var xsWdith = xShapeInfo.width; // 背景框,默认启用
  56275. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  56276. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  56277. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  56278. } // 坐标轴, 默认启用
  56279. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  56280. // 添加坐标轴图形数组
  56281. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  56282. }
  56283. for (var i = 0; i < fv.length; i++) {
  56284. // 计算柱条 top 边的 y 轴坐标值
  56285. var yPx = dvb[1] - (fv[i] - codomain[0]) / this.DVBUnitValue; // 柱条节点数组
  56286. 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]]; // 柱条参数对象(一个面参数对象)
  56287. var barParams = new Polygon_Polygon(poiLists); // 柱条 阴影 style
  56288. if (typeof sets.showShadow === "undefined" || sets.showShadow) {
  56289. if (sets.barShadowStyle) {
  56290. var sss = sets.barShadowStyle;
  56291. if (sss.shadowBlur) {
  56292. deafaultShawdow.shadowBlur = sss.shadowBlur;
  56293. }
  56294. if (sss.shadowColor) {
  56295. deafaultShawdow.shadowColor = sss.shadowColor;
  56296. }
  56297. if (sss.shadowOffsetX) {
  56298. deafaultShawdow.shadowOffsetX = sss.shadowOffsetX;
  56299. }
  56300. if (sss.shadowOffsetY) {
  56301. deafaultShawdow.shadowOffsetY = sss.shadowOffsetY;
  56302. }
  56303. }
  56304. barParams.style = {};
  56305. Util.copyAttributesWithClip(barParams.style, deafaultShawdow);
  56306. } // 图形携带的数据信息
  56307. barParams.refDataID = this.data.id;
  56308. barParams.dataInfo = {
  56309. field: this.fields[i],
  56310. value: fv[i]
  56311. }; // 柱条 hover click
  56312. if (typeof sets.barHoverAble !== "undefined") {
  56313. barParams.hoverable = sets.barHoverAble;
  56314. }
  56315. if (typeof sets.barClickAble !== "undefined") {
  56316. barParams.clickable = sets.barClickAble;
  56317. } // 创建柱条并添加到图表图形数组中
  56318. this.shapes.push(this.shapeFactory.createShape(barParams));
  56319. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  56320. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  56321. this.shapesConvertToRelativeCoordinate();
  56322. }
  56323. /**
  56324. * @function SuperMap.Feature.Theme.Bar.prototype.calculateXShapeInfo
  56325. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  56326. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  56327. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  56328. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  56329. * 本函数中图形配置对象 setting 可设属性:
  56330. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  56331. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  56332. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  56333. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  56334. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  56335. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  56336. *
  56337. */
  56338. }, {
  56339. key: "calculateXShapeInfo",
  56340. value: function calculateXShapeInfo() {
  56341. var dvb = this.dataViewBox; // 数据视图框
  56342. var sets = this.setting; // 图表配置对象
  56343. var fvc = this.dataValues.length; // 数组值个数
  56344. if (fvc < 1) {
  56345. return null;
  56346. }
  56347. var xBlank; // x 轴空白间隔参数
  56348. var xShapePositions = []; // x 轴上图形的位置
  56349. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  56350. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  56351. // x 轴空白间隔参数处理
  56352. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  56353. xBlank = sets.xShapeBlank;
  56354. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  56355. if (xsLen <= fvc) {
  56356. return null;
  56357. }
  56358. xShapeWidth = xsLen / fvc;
  56359. } else {
  56360. // 默认使用等距离空白间隔,空白间隔为图形宽度
  56361. xShapeWidth = dvbWidth / (2 * fvc + 1);
  56362. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  56363. } // 图形 x 轴上的位置计算
  56364. var xOffset = 0;
  56365. for (var i = 0; i < fvc; i++) {
  56366. if (i == 0) {
  56367. xOffset = xBlank[0] + xShapeWidth / 2;
  56368. } else {
  56369. xOffset += xShapeWidth + xBlank[1];
  56370. }
  56371. xShapePositions.push(dvb[0] + xOffset);
  56372. }
  56373. return {
  56374. "xPositions": xShapePositions,
  56375. "width": xShapeWidth
  56376. };
  56377. }
  56378. /**
  56379. * @function SuperMap.Feature.Theme.Bar.prototype.resetLinearGradient
  56380. * @description 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图 所以子类实现此方法)。
  56381. */
  56382. }, {
  56383. key: "resetLinearGradient",
  56384. value: function resetLinearGradient() {
  56385. if (this.RelativeCoordinate) {
  56386. var shpelength = this.shapes.length;
  56387. var barLinearGradient = this.setting.barLinearGradient;
  56388. var index = -1;
  56389. for (var i = 0; i < shpelength; i++) {
  56390. var shape = this.shapes[i];
  56391. if (shape.CLASS_NAME === "SuperMap.LevelRenderer.Shape.SmicPolygon") {
  56392. var style = shape.style; //计算出当前的绝对 x y
  56393. var x1 = this.location[0] + style.pointList[0][0];
  56394. var x2 = this.location[0] + style.pointList[1][0]; //渐变颜色
  56395. index++; //以防定义的颜色数组不够用
  56396. if (index >= barLinearGradient.length) {
  56397. index = index % barLinearGradient.length;
  56398. }
  56399. var color1 = barLinearGradient[index][0];
  56400. var color2 = barLinearGradient[index][1]; //颜色
  56401. var zcolor = new Color();
  56402. var linearGradient = zcolor.getLinearGradient(x1, 0, x2, 0, [[0, color1], [1, color2]]); //赋值
  56403. shape.style.color = linearGradient;
  56404. }
  56405. }
  56406. }
  56407. }
  56408. }]);
  56409. return Bar;
  56410. }(Graph);
  56411. /**
  56412. * @typedef {Object} SuperMap.Feature.Theme.Bar.setting
  56413. * @property {number} width - 专题要素(图表)宽度。
  56414. * @property {number} height - 专题要素(图表)高度。
  56415. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  56416. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  56417. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  56418. * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)
  56419. * 在左、下,右,上四个方向上的内偏距值。当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];
  56420. * 不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  56421. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  56422. * @property {boolean} [useBackground=true] - 是否使用图表背景框。
  56423. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式。
  56424. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
  56425. * 则 backgroundRadius 为 [r1、r2、r3、r4]。
  56426. * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  56427. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  56428. * @property {boolean} [showShadow=true] - 阴影开关。
  56429. * @property {Object} [barShadowStyle] - 阴影样式,如:{shadowBlur : 8, shadowOffsetX: 2 , shadowOffsetY : 2,shadowColor : "rgba(100,100,100,0.8)"}
  56430. * @property {Array.<string>} [barLinearGradient] - 按字段设置柱条样式[渐变开始颜色,渐变终止颜色] 与 themeLayer.themeFields 中的字段一一对应),
  56431. * 如:[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]
  56432. * @property {boolean} [useAxis=true] - 是否使用坐标轴。</br>
  56433. * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
  56434. * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
  56435. * @property {number} [axisYTick=0] - y 轴刻度数量。
  56436. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  56437. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  56438. * @property {Array.<number>} [axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  56439. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,否则沿数据视图框下面条边等距排布标签。
  56440. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
  56441. * @property {Array.<number>} [axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正。
  56442. * @property {boolean} [useXReferenceLine] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  56443. * @property {SuperMap.Feature.ShapeParameters.Line.style} xReferenceLineStyle - 水平参考线样式。
  56444. * @property {Object} barStyle - 柱状图柱条基础 style,此参数控制柱条基础样式,优先级低于 barStyleByFields 和 barStyleByCodomain。
  56445. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} barStyleByFields - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields|L.supermap.graphThemeLayer.themeFields|ol.source.Graph.themeFields|mapboxgl.supermap.GraphThemeLayer.themeFields>)为柱条赋 style,此参数按字段控制柱条样式,优先级低于 barStyleByCodomain,高于 barStyle。此数组中的元素是样式对象。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],barStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的柱条使用 style1,字段 POP_1995 对应的柱条使用 style2 ,字段 POP_1999 对应的柱条使用 style3。
  56446. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} barStyleByCodomain - 按柱条代表的数据值所在值域范围控制柱条样式,优先级高于 barStyle 和 barStyleByFields。
  56447. * @property {Object} [barHoverStyle] - 柱条 hover 状态时的样式,barHoverAble 为 true 时有效。
  56448. * @property {Object} [barHoverAble] - 是否允许柱条使用 hover 状态,默认允许。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  56449. * @property {Object} [barClickAble] - 是否允许柱条被点击,默认允许。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  56450. */
  56451. SuperMap.Feature.Theme.Bar = Bar;
  56452. ;// CONCATENATED MODULE: ./src/common/overlay/Bar3D.js
  56453. function Bar3D_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Bar3D_typeof = function _typeof(obj) { return typeof obj; }; } else { Bar3D_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Bar3D_typeof(obj); }
  56454. function Bar3D_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56455. 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); } }
  56456. function Bar3D_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar3D_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar3D_defineProperties(Constructor, staticProps); return Constructor; }
  56457. function Bar3D_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Bar3D_get = Reflect.get; } else { Bar3D_get = function _get(target, property, receiver) { var base = Bar3D_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Bar3D_get(target, property, receiver || target); }
  56458. function Bar3D_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar3D_getPrototypeOf(object); if (object === null) break; } return object; }
  56459. function Bar3D_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Bar3D_setPrototypeOf(subClass, superClass); }
  56460. function Bar3D_setPrototypeOf(o, p) { Bar3D_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar3D_setPrototypeOf(o, p); }
  56461. 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); }; }
  56462. function Bar3D_possibleConstructorReturn(self, call) { if (call && (Bar3D_typeof(call) === "object" || typeof call === "function")) { return call; } return Bar3D_assertThisInitialized(self); }
  56463. function Bar3D_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  56464. function Bar3D_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  56465. function Bar3D_getPrototypeOf(o) { Bar3D_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar3D_getPrototypeOf(o); }
  56466. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  56467. * This program are made available under the terms of the Apache License, Version 2.0
  56468. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56469. /**
  56470. * @class SuperMap.Feature.Theme.Bar3D
  56471. * @classdesc 三维柱状图 。
  56472. * @category Visualization Theme
  56473. * @extends SuperMap.Feature.Theme.Graph
  56474. * @param {SuperMap.Feature.Vector} data - 用户数据。
  56475. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  56476. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  56477. * @param {SuperMap.Feature.Theme.Bar3D.setting} setting - 图表配置对象。
  56478. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  56479. *
  56480. *
  56481. * @example
  56482. * // barFaceStyleByCodomain 用法示例如下:
  56483. * // barFaceStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  56484. * // start: 值域值下限(包含);
  56485. * // end: 值域值上限(不包含);
  56486. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
  56487. * // barFaceStyleByCodomain 数组形如:
  56488. * [
  56489. * {
  56490. * start:0,
  56491. * end:250,
  56492. * style:{
  56493. * fillColor:"#00CD00"
  56494. * }
  56495. * },
  56496. * {
  56497. * start:250,
  56498. * end:500,
  56499. * style:{
  56500. * fillColor:"#00EE00"
  56501. * }
  56502. * },
  56503. * {
  56504. * start:500,
  56505. * end:750,
  56506. * style:{
  56507. * fillColor:"#00FF7F"
  56508. * }
  56509. * },
  56510. * {
  56511. * start:750,
  56512. * end:1500,
  56513. * style:{
  56514. * fillColor:"#00FF00"
  56515. * }
  56516. * }
  56517. * ]
  56518. *
  56519. * @example
  56520. * // barSideStyleByCodomain 用法示例如下:
  56521. * // barSideStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  56522. * // start: 值域值下限(包含);
  56523. * // end: 值域值上限(不包含);
  56524. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
  56525. * // barSideStyleByCodomain 数组形如:
  56526. * [
  56527. * {
  56528. * start:0,
  56529. * end:250,
  56530. * style:{
  56531. * fillColor:"#00CD00"
  56532. * }
  56533. * },
  56534. * {
  56535. * start:250,
  56536. * end:500,
  56537. * style:{
  56538. * fillColor:"#00EE00"
  56539. * }
  56540. * },
  56541. * {
  56542. * start:500,
  56543. * end:750,
  56544. * style:{
  56545. * fillColor:"#00FF7F"
  56546. * }
  56547. * },
  56548. * {
  56549. * start:750,
  56550. * end:1500,
  56551. * style:{
  56552. * fillColor:"#00FF00"
  56553. * }
  56554. * }
  56555. * ]
  56556. *
  56557. * @example
  56558. * // barTopStyleByCodomain 用法示例如下:
  56559. * // barTopStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  56560. * // start: 值域值下限(包含);
  56561. * // end: 值域值上限(不包含);
  56562. * // style: 数据可视化图形的 style,这个样式对象的可设属性:<SuperMap.Feature.ShapeParameters.Polygon.style> 。
  56563. * // barTopStyleByCodomain 数组形如:
  56564. * [
  56565. * {
  56566. * start:0,
  56567. * end:250,
  56568. * style:{
  56569. * fillColor:"#00CD00"
  56570. * }
  56571. * },
  56572. * {
  56573. * start:250,
  56574. * end:500,
  56575. * style:{
  56576. * fillColor:"#00EE00"
  56577. * }
  56578. * },
  56579. * {
  56580. * start:500,
  56581. * end:750,
  56582. * style:{
  56583. * fillColor:"#00FF7F"
  56584. * }
  56585. * },
  56586. * {
  56587. * start:750,
  56588. * end:1500,
  56589. * style:{
  56590. * fillColor:"#00FF00"
  56591. * }
  56592. * }
  56593. * ]
  56594. */
  56595. var Bar3D = /*#__PURE__*/function (_Graph) {
  56596. Bar3D_inherits(Bar3D, _Graph);
  56597. var _super = Bar3D_createSuper(Bar3D);
  56598. function Bar3D(data, layer, fields, setting, lonlat) {
  56599. var _this;
  56600. Bar3D_classCallCheck(this, Bar3D);
  56601. _this = _super.call(this, data, layer, fields, setting, lonlat);
  56602. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar3D";
  56603. return _this;
  56604. }
  56605. /**
  56606. * @function SuperMap.Feature.Theme.Bar3D.prototype.destroy
  56607. * @override
  56608. */
  56609. Bar3D_createClass(Bar3D, [{
  56610. key: "destroy",
  56611. value: function destroy() {
  56612. Bar3D_get(Bar3D_getPrototypeOf(Bar3D.prototype), "destroy", this).call(this);
  56613. }
  56614. /**
  56615. * @function SuperMap.Feature.Theme.Bar3D.prototype.assembleShapes
  56616. * @description 图形装配实现(扩展接口)。
  56617. */
  56618. }, {
  56619. key: "assembleShapes",
  56620. value: function assembleShapes() {
  56621. // 图表配置对象
  56622. var sets = this.setting; // 默认数据视图框
  56623. if (!sets.dataViewBoxParameter) {
  56624. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  56625. sets.dataViewBoxParameter = [45, 25, 20, 20];
  56626. } else {
  56627. sets.dataViewBoxParameter = [5, 5, 5, 5];
  56628. }
  56629. } // 3d 柱图的坐标轴默认使用坐标轴箭头
  56630. sets.axisUseArrow = typeof sets.axisUseArrow !== "undefined" ? sets.axisUseArrow : true;
  56631. sets.axisXLabelsOffset = typeof sets.axisXLabelsOffset !== "undefined" ? sets.axisXLabelsOffset : [-10, 10]; // 重要步骤:初始化参数
  56632. if (!this.initBaseParameter()) {
  56633. return;
  56634. } // 值域
  56635. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  56636. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight; // 数据视图域
  56637. var dvb = this.dataViewBox; // 用户数据值
  56638. var fv = this.dataValues;
  56639. if (fv.length < 1) {
  56640. return;
  56641. } // 没有数据
  56642. // 数据溢出值域范围处理
  56643. for (var i = 0, fvLen = fv.length; i < fvLen; i++) {
  56644. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  56645. return;
  56646. }
  56647. } // 获取 x 轴上的图形信息
  56648. var xShapeInfo = this.calculateXShapeInfo();
  56649. if (!xShapeInfo) {
  56650. return;
  56651. } // 每个柱条 x 位置
  56652. var xsLoc = xShapeInfo.xPositions; // 柱条宽度
  56653. var xsWdith = xShapeInfo.width; // 坐标轴, 默认启用
  56654. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  56655. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  56656. } // 坐标轴
  56657. if (!sets.axis3DParameter || isNaN(sets.axis3DParameter) || sets.axis3DParameter < 15) {
  56658. sets.axis3DParameter = 20;
  56659. }
  56660. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  56661. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  56662. } // 3d 偏移量, 默认值 10;
  56663. var offset3d = sets.bar3DParameter && !isNaN(sets.bar3DParameter) ? sets.bar3DParameter : 10;
  56664. for (var _i = 0; _i < fv.length; _i++) {
  56665. // 无 3d 偏移量时的柱面顶部 y 坐标
  56666. var yPx = dvb[1] - (fv[_i] - codomain[0]) / this.DVBUnitValue; // 无 3d 偏移量时的柱面的左、右端 x 坐标
  56667. var iPoiL = xsLoc[_i] - xsWdith / 2;
  56668. var iPoiR = xsLoc[_i] + xsWdith / 2; // 3d 柱顶面节点
  56669. var bar3DTopPois = [[iPoiL, yPx], [iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]]; // 3d 柱侧面节点
  56670. var bar3DSidePois = [[iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR, dvb[1]]]; // 3d 柱正面节点
  56671. var bar3DFacePois = [[iPoiL - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]];
  56672. if (offset3d <= 0) {
  56673. // offset3d <= 0 时正面不偏移
  56674. bar3DFacePois = [[iPoiL, dvb[1]], [iPoiR, dvb[1]], [iPoiR, yPx], [iPoiL, yPx]];
  56675. } // 新建 3d 柱面顶面、侧面、正面图形参数对象
  56676. var polyTopSP = new Polygon_Polygon(bar3DTopPois);
  56677. var polySideSP = new Polygon_Polygon(bar3DSidePois);
  56678. var polyFaceSP = new Polygon_Polygon(bar3DFacePois); // 侧面、正面图形 style 默认值
  56679. sets.barSideStyle = sets.barSideStyle ? sets.barSideStyle : sets.barFaceStyle;
  56680. sets.barSideStyleByFields = sets.barSideStyleByFields ? sets.barSideStyleByFields : sets.barFaceStyleByFields;
  56681. sets.barSideStyleByCodomain = sets.barSideStyleByCodomain ? sets.barSideStyleByCodomain : sets.barFaceStyleByCodomain;
  56682. sets.barTopStyle = sets.barTopStyle ? sets.barTopStyle : sets.barFaceStyle;
  56683. sets.barTopStyleByFields = sets.barTopStyleByFields ? sets.barTopStyleByFields : sets.barFaceStyleByFields;
  56684. sets.barTopStyleByCodomain = sets.barTopStyleByCodomain ? sets.barTopStyleByCodomain : sets.barFaceStyleByCodomain; // 顶面、侧面、正面图形 style
  56685. polyFaceSP.style = ShapeFactory.ShapeStyleTool({
  56686. stroke: true,
  56687. strokeColor: "#ffffff",
  56688. fillColor: "#ee9900"
  56689. }, sets.barFaceStyle, sets.barFaceStyleByFields, sets.barFaceStyleByCodomain, _i, fv[_i]);
  56690. polySideSP.style = ShapeFactory.ShapeStyleTool({
  56691. stroke: true,
  56692. strokeColor: "#ffffff",
  56693. fillColor: "#ee9900"
  56694. }, sets.barSideStyle, sets.barSideStyleByFields, sets.barSideStyleByCodomain, _i, fv[_i]);
  56695. polyTopSP.style = ShapeFactory.ShapeStyleTool({
  56696. stroke: true,
  56697. strokeColor: "#ffffff",
  56698. fillColor: "#ee9900"
  56699. }, sets.barTopStyle, sets.barTopStyleByFields, sets.barTopStyleByCodomain, _i, fv[_i]); // 3d 柱条高亮样式
  56700. sets.barSideHoverStyle = sets.barSideHoverStyle ? sets.barSideHoverStyle : sets.barFaceHoverStyle;
  56701. sets.barTopHoverStyle = sets.barTopHoverStyle ? sets.barTopHoverStyle : sets.barFaceHoverStyle;
  56702. polyFaceSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  56703. stroke: true
  56704. }, sets.barFaceHoverStyle);
  56705. polySideSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  56706. stroke: true
  56707. }, sets.barSideHoverStyle);
  56708. polyTopSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  56709. stroke: true
  56710. }, sets.barTopHoverStyle); // 图形携带的数据 id 信息 & 高亮模式
  56711. polyTopSP.refDataID = polySideSP.refDataID = polyFaceSP.refDataID = this.data.id; // hover 模式(组合)
  56712. polyTopSP.isHoverByRefDataID = polySideSP.isHoverByRefDataID = polyFaceSP.isHoverByRefDataID = true; // 高亮组(当鼠标 hover 到组内任何一个图形,整个组的图形都会高亮。refDataHoverGroup 在 isHoverByRefDataID 为 true 时有效)
  56713. polyTopSP.refDataHoverGroup = polySideSP.refDataHoverGroup = polyFaceSP.refDataHoverGroup = Util.createUniqueID("lr_shg"); // 图形携带的数据信息
  56714. polyTopSP.dataInfo = polySideSP.dataInfo = polyFaceSP.dataInfo = {
  56715. field: this.fields[_i],
  56716. value: fv[_i]
  56717. }; // 3d 柱条顶面、侧面、正面图形 hover click 设置
  56718. if (typeof sets.barHoverAble !== "undefined") {
  56719. polyTopSP.hoverable = polySideSP.hoverable = polyFaceSP.hoverable = sets.barHoverAble;
  56720. }
  56721. if (typeof sets.barClickAble !== "undefined") {
  56722. polyTopSP.clickable = polySideSP.clickable = polyFaceSP.clickable = sets.barClickAble;
  56723. } // 创建3d 柱条的顶面、侧面、正面图形并添加到图表的图形列表数组
  56724. this.shapes.push(this.shapeFactory.createShape(polySideSP));
  56725. this.shapes.push(this.shapeFactory.createShape(polyTopSP));
  56726. this.shapes.push(this.shapeFactory.createShape(polyFaceSP));
  56727. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  56728. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  56729. this.shapesConvertToRelativeCoordinate();
  56730. }
  56731. /**
  56732. * @function SuperMap.Feature.Theme.Bar3D.prototype.calculateXShapeInfo
  56733. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  56734. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  56735. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  56736. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  56737. * 本函数中图形配置对象 setting 可设属性:
  56738. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  56739. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  56740. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  56741. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  56742. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  56743. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  56744. */
  56745. }, {
  56746. key: "calculateXShapeInfo",
  56747. value: function calculateXShapeInfo() {
  56748. var dvb = this.dataViewBox; // 数据视图框
  56749. var sets = this.setting; // 图表配置对象
  56750. var fvc = this.dataValues.length; // 数组值个数
  56751. if (fvc < 1) {
  56752. return null;
  56753. }
  56754. var xBlank; // x 轴空白间隔参数
  56755. var xShapePositions = []; // x 轴上图形的位置
  56756. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  56757. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  56758. // x 轴空白间隔参数处理
  56759. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  56760. xBlank = sets.xShapeBlank;
  56761. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  56762. if (xsLen <= fvc) {
  56763. return null;
  56764. }
  56765. xShapeWidth = xsLen / fvc;
  56766. } else {
  56767. // 默认使用等距离空白间隔,空白间隔为图形宽度
  56768. xShapeWidth = dvbWidth / (2 * fvc + 1);
  56769. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  56770. } // 图形 x 轴上的位置计算
  56771. var xOffset = 0;
  56772. for (var i = 0; i < fvc; i++) {
  56773. if (i == 0) {
  56774. xOffset = xBlank[0] + xShapeWidth / 2;
  56775. } else {
  56776. xOffset += xShapeWidth + xBlank[1];
  56777. }
  56778. xShapePositions.push(dvb[0] + xOffset);
  56779. }
  56780. return {
  56781. "xPositions": xShapePositions,
  56782. "width": xShapeWidth
  56783. };
  56784. }
  56785. }]);
  56786. return Bar3D;
  56787. }(Graph);
  56788. /**
  56789. * @typedef {Object} SuperMap.Feature.Theme.Bar3D.setting
  56790. * @property {number} width - 专题要素(图表)宽度。
  56791. * @property {number} height - 专题要素(图表)高度。
  56792. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  56793. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  56794. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  56795. * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 25, 20, 20];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  56796. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  56797. * @property {boolean} [useBackground=true] - 是否使用图表背景框。
  56798. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式。
  56799. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  56800. * @property {Array.<number>} [xShapeBlank] - 水平方向上的图形空白间隔参数。长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  56801. * @property {number} [bar3DParameter=10] - 3D 柱状参数,3d柱形正面相对于背面向 x 轴和 y 轴负方向偏移的绝对值。
  56802. * @property {boolean} [useAxis=true] - 是否使用坐标轴。
  56803. * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
  56804. * @property {boolean} [axisUseArrow=true] -坐标轴是否使用箭头。
  56805. * @property {number} [axisYTick=0] - y 轴刻度数量。
  56806. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  56807. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  56808. * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  56809. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,否则沿数据视图框下面条边等距排布标签。
  56810. * @property {SuperMap.Feature.ShapeParameters.Label.style} axisXLabelsStyle - x 轴上的标签组样式。
  56811. * @property {Array.<number>} axisXLabelsOffset - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:-10;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:10。
  56812. * @property {boolean} [useXReferenceLine] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  56813. * @property {SuperMap.Feature.ShapeParameters.Line.style} [xReferenceLineStyle] - 水平参考线样式。
  56814. * @property {number} [axis3DParameter=20] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
  56815. * @property {SuperMap.Feature.ShapeParameters.Polygon.style} barFaceStyle - 3d 柱状图柱条正面基础 style,此参数控制柱条正面基础样式,优先级低于 barFaceStyleByFields 和 barFaceStyleByCodomain。
  56816. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} [barFaceStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为柱条正面赋 style,此参数按字段控制柱条正面样式,优先级低于 barFaceStyleByCodomain,高于 barFaceStyle。此数组中的元素是样式对象。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],barFaceStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的柱条正面使用 style1,字段 POP_1995 对应的柱条正面使用 style2 ,字段 POP_1999 对应的柱条正面使用 style3。
  56817. * @property {Array.<Object>} [barFaceStyleByCodomain] - 按柱条正面代表的数据值所在值域范围控制柱条正面样式,优先级高于 barFaceStyle 和 barFaceStyleByFields。
  56818. * @property {SuperMap.Feature.ShapeParameters.Polygon.style} [barSideStyle=barFaceStyle] - 3d 柱状图柱条侧面基础 style,此参数控制柱条侧面基础样式,优先级低于 barSideStyleByFields 和 barSideStyleByCodomain。
  56819. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} [barSideStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为柱条侧面赋style,此数按字段控制柱条侧面样式,优先级低于 barSideStyleByCodomain,高于 barSideStyle。此数组中的元素是样式对象。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],barSideStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的柱条侧面使用 style1,字段 POP_1995对应的柱条侧面使用style2,字段POP_1999对应的柱条侧面使用style3。默认值:barFaceStyleByFields。
  56820. * @property {Array.<Object>} [barSideStyleByCodomain=barFaceStyleByCodomain] - 按柱条侧面代表的数据值所在值域范围控制柱条侧面样式,优先级高于 barSideStyle 和 barSideStyleByFields。
  56821. * @property {Object} [barFaceHoverStyle] - 3d 柱条正面 hover 状态时的样式,barHoverAble 为 true 时有效。
  56822. * @property {Object} [barSideHoverStyle=barFaceHoverStyle] - 3d 柱条侧面 hover 状态时的样式,barHoverAble 为 true 时有效。
  56823. * @property {Object} [barTopHoverStyle=barFaceHoverStyle] - 3d 柱条顶面 hover 状态时的样式,barHoverAble 为 true 时有效。
  56824. * @property {boolean} [barHoverAble=true] - 是否允许柱条使用 hover 状态。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  56825. * @property {boolean} [barClickAble=true] - 是否允许柱条被点击。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  56826. * @property {SuperMap.Feature.ShapeParameters.Polygon.style} [barTopStyle=barFaceStyle] - 3d 柱状图柱条顶面基础 style,此参数控制柱条顶面基础样式,优先级低于 barTopStyleByFields 和 barTopStyleByCodomain。
  56827. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} [barTopStyleByFields=barFaceStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为柱条顶面赋 style,此参数按字段控制柱条顶面样式,优先级低于 barTopStyleByCodomain,高于 barTopStyle。此数组中的元素是样式对象。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],barTopStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的柱条顶面使用 style1,字段 POP_1995 对应的柱条顶面使用 style2 ,字段 POP_1999 对应的柱条顶面使用 style3。
  56828. * @property {Array.<Object>} [barTopStyleByCodomain=barFaceStyleByCodomain] - 按柱条顶面代表的数据值所在值域范围控制柱条顶面样式,优先级高于 barTopStyle 和 barTopStyleByFields。
  56829. */
  56830. SuperMap.Feature.Theme.Bar3D = Bar3D;
  56831. ;// CONCATENATED MODULE: ./src/common/overlay/RankSymbol.js
  56832. function RankSymbol_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RankSymbol_typeof = function _typeof(obj) { return typeof obj; }; } else { RankSymbol_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RankSymbol_typeof(obj); }
  56833. function RankSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56834. 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); } }
  56835. function RankSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) RankSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) RankSymbol_defineProperties(Constructor, staticProps); return Constructor; }
  56836. function RankSymbol_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { RankSymbol_get = Reflect.get; } else { RankSymbol_get = function _get(target, property, receiver) { var base = RankSymbol_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return RankSymbol_get(target, property, receiver || target); }
  56837. function RankSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RankSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  56838. function RankSymbol_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) RankSymbol_setPrototypeOf(subClass, superClass); }
  56839. function RankSymbol_setPrototypeOf(o, p) { RankSymbol_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RankSymbol_setPrototypeOf(o, p); }
  56840. 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); }; }
  56841. function RankSymbol_possibleConstructorReturn(self, call) { if (call && (RankSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } return RankSymbol_assertThisInitialized(self); }
  56842. function RankSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  56843. function RankSymbol_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  56844. function RankSymbol_getPrototypeOf(o) { RankSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RankSymbol_getPrototypeOf(o); }
  56845. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  56846. * This program are made available under the terms of the Apache License, Version 2.0
  56847. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56848. /**
  56849. * @class SuperMap.Feature.Theme.RankSymbol
  56850. * @classdesc 符号专题要素基类。
  56851. * @category Visualization Theme
  56852. * @description 此类定义了符号专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  56853. * 符号专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <SuperMap.Feature.Theme.RankSymbol.setting> 的基础属性只有 5 个,
  56854. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  56855. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  56856. * @param {SuperMap.Feature.Vector} data - 用户数据。
  56857. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  56858. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  56859. * @param {Object} setting - 图表配置对象。
  56860. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  56861. *
  56862. * @extends SuperMap.Feature.Theme.Graph
  56863. *
  56864. */
  56865. var RankSymbol = /*#__PURE__*/function (_Graph) {
  56866. RankSymbol_inherits(RankSymbol, _Graph);
  56867. var _super = RankSymbol_createSuper(RankSymbol);
  56868. function RankSymbol(data, layer, fields, setting, lonlat, options) {
  56869. var _this;
  56870. RankSymbol_classCallCheck(this, RankSymbol);
  56871. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  56872. /**
  56873. * @member SuperMap.Feature.Theme.RankSymbol.prototype.setting -{Object}
  56874. * @description 符号配置对象,该对象控制着图表的可视化显示。
  56875. * 下面是此配置对象的 5 个基础可设属性:<br>
  56876. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  56877. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  56878. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  56879. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  56880. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  56881. * 除了以上 5 个基础属性,此对象的可设属性在不同子类中有较大差异,不同子类中对同一属性的解释也可能不同。
  56882. * 请在此类的子类中查看 setting 对象的可设属性和属性含义。
  56883. */
  56884. _this.setting = null; // 配置项检测与赋值
  56885. if (setting && setting.codomain) {
  56886. _this.setting = setting;
  56887. _this.DVBCodomain = _this.setting.codomain;
  56888. }
  56889. _this.CLASS_NAME = "SuperMap.Feature.Theme.RankSymbol";
  56890. return _this;
  56891. }
  56892. /**
  56893. * @function SuperMap.Feature.Theme.RankSymbol.prototype.destroy
  56894. * @description 销毁专题要素。
  56895. */
  56896. RankSymbol_createClass(RankSymbol, [{
  56897. key: "destroy",
  56898. value: function destroy() {
  56899. this.setting = null;
  56900. RankSymbol_get(RankSymbol_getPrototypeOf(RankSymbol.prototype), "destroy", this).call(this);
  56901. }
  56902. /**
  56903. * @function SuperMap.Feature.Theme.RankSymbol.prototype.initBaseParameter
  56904. * @description 初始化专题要素(图形)基础参数。
  56905. * 在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  56906. * 调用此函数关系到 setting 对象的以下属性。
  56907. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  56908. * @param {number} [XOffset] - 专题要素(图形)在 X 方向上的偏移值,单位像素。
  56909. * @param {number} [YOffset] - 专题要素(图形)在 Y 方向上的偏移值,单位像素。
  56910. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图形框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  56911. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  56912. * @returns {boolean} 初始化参数是否成功。
  56913. */
  56914. }, {
  56915. key: "initBaseParameter",
  56916. value: function initBaseParameter() {
  56917. // 参数初始化是否成功
  56918. var isSuccess = true; // setting 属性是否已成功赋值
  56919. if (!this.setting) {
  56920. return false;
  56921. }
  56922. var sets = this.setting; // 图表偏移
  56923. if (sets.XOffset) {
  56924. this.XOffset = sets.XOffset;
  56925. }
  56926. if (sets.YOffset) {
  56927. this.YOffset = sets.YOffset;
  56928. }
  56929. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  56930. this.YOffset = sets.YOffset ? sets.YOffset : 0; // 其他默认值
  56931. this.origonPoint = [];
  56932. this.chartBox = [];
  56933. this.dataViewBox = [];
  56934. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  56935. this.DVBOrigonPoint = [];
  56936. this.DVBCenterPoint = [];
  56937. this.origonPointOffset = []; // 图表位置
  56938. this.resetLocation(); // 专题要素宽度 w
  56939. var w = this.width; // 专题要素高度 h
  56940. var h = this.height; // 专题要素像素位置 loc
  56941. var loc = this.location; // 专题要素像素位置 loc
  56942. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2]; // 专题要素原点(左上角)
  56943. var op = this.origonPoint; // 图表框([left, bottom, right, top])
  56944. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]]; // 图表框
  56945. var cb = this.chartBox; // 数据视图框参数,它是图表框各方向对应的内偏距
  56946. var dbbP = this.DVBParameter; // 数据视图框 ([left, bottom, right, top])
  56947. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]]; // 数据视图框
  56948. var dvb = this.dataViewBox; //检查数据视图框是否合法
  56949. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  56950. return false;
  56951. } // 数据视图框原点
  56952. this.DVBOrigonPoint = [dvb[0], dvb[3]]; // 数据视图框宽度
  56953. this.DVBWidth = Math.abs(dvb[2] - dvb[0]); // 数据视图框高度
  56954. this.DVBHeight = Math.abs(dvb[1] - dvb[3]); // 数据视图框中心点
  56955. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2]; // 数据视图框原点与图表框的原点偏移量
  56956. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  56957. return isSuccess;
  56958. }
  56959. }]);
  56960. return RankSymbol;
  56961. }(Graph);
  56962. SuperMap.Feature.Theme.RankSymbol = RankSymbol;
  56963. ;// CONCATENATED MODULE: ./src/common/overlay/Circle.js
  56964. function overlay_Circle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { overlay_Circle_typeof = function _typeof(obj) { return typeof obj; }; } else { overlay_Circle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return overlay_Circle_typeof(obj); }
  56965. function overlay_Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56966. 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); } }
  56967. function overlay_Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Circle_defineProperties(Constructor, staticProps); return Constructor; }
  56968. function overlay_Circle_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Circle_get = Reflect.get; } else { overlay_Circle_get = function _get(target, property, receiver) { var base = overlay_Circle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return overlay_Circle_get(target, property, receiver || target); }
  56969. function overlay_Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  56970. function overlay_Circle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) overlay_Circle_setPrototypeOf(subClass, superClass); }
  56971. function overlay_Circle_setPrototypeOf(o, p) { overlay_Circle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Circle_setPrototypeOf(o, p); }
  56972. 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); }; }
  56973. function overlay_Circle_possibleConstructorReturn(self, call) { if (call && (overlay_Circle_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Circle_assertThisInitialized(self); }
  56974. function overlay_Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  56975. function overlay_Circle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  56976. function overlay_Circle_getPrototypeOf(o) { overlay_Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Circle_getPrototypeOf(o); }
  56977. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  56978. * This program are made available under the terms of the Apache License, Version 2.0
  56979. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56980. /**
  56981. * @class SuperMap.Feature.Theme.Circle
  56982. * @classdesc 圆类。
  56983. * @category Visualization Theme
  56984. * @extends SuperMap.Feature.Theme.RankSymbol
  56985. * @param {SuperMap.Feature.Vector} data - 用户数据。
  56986. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  56987. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  56988. * @param {SuperMap.Feature.Theme.Circle.setting} setting - 图表配置对象。
  56989. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  56990. */
  56991. var Circle = /*#__PURE__*/function (_RankSymbol) {
  56992. overlay_Circle_inherits(Circle, _RankSymbol);
  56993. var _super = overlay_Circle_createSuper(Circle);
  56994. function Circle(data, layer, fields, setting, lonlat) {
  56995. var _this;
  56996. overlay_Circle_classCallCheck(this, Circle);
  56997. _this = _super.call(this, data, layer, fields, setting, lonlat);
  56998. _this.CLASS_NAME = "SuperMap.Feature.Theme.Circle";
  56999. return _this;
  57000. }
  57001. /**
  57002. * @function SuperMap.Feature.Theme.Circle.prototype.destroy
  57003. * @override
  57004. */
  57005. overlay_Circle_createClass(Circle, [{
  57006. key: "destroy",
  57007. value: function destroy() {
  57008. overlay_Circle_get(overlay_Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  57009. }
  57010. /**
  57011. * @function SuperMap.Feature.Theme.Circle.prototype.assembleShapes
  57012. * @description 装配图形(扩展接口)。
  57013. */
  57014. }, {
  57015. key: "assembleShapes",
  57016. value: function assembleShapes() {
  57017. //默认填充颜色
  57018. var defaultFillColor = "#ff9277"; // setting 属性是否已成功赋值
  57019. if (!this.setting) {
  57020. return false;
  57021. }
  57022. var sets = this.setting; // 检测 setting 的必设参数
  57023. if (!sets.codomain) {
  57024. return false;
  57025. } // 数据
  57026. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  57027. var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  57028. this.dataValues = dataEffective ? dataEffective : []; // 数据值数组
  57029. var fv = this.dataValues; //if(fv.length != 1) return; // 没有数据 或者数据不唯一
  57030. //if(fv[0] < 0) return; //数据为负值
  57031. //用户应该定义最大 最小半径 默认最大半径MaxR:100 最小半径MinR:0;
  57032. if (!sets.maxR) {
  57033. sets.maxR = 100;
  57034. }
  57035. if (!sets.minR) {
  57036. sets.minR = 0;
  57037. } // 值域范围
  57038. var codomain = this.DVBCodomain; // 重要步骤:定义Circle数据视图框中单位值的含义,单位值:1所代表的长度
  57039. // 用户定义了值域范围
  57040. if (codomain && codomain[1] - codomain[0] > 0) {
  57041. this.DVBUnitValue = sets.maxR / (codomain[1] - codomain[0]);
  57042. } else {
  57043. //this.DVBUnitValue = sets.maxR / maxValue;
  57044. this.DVBUnitValue = sets.maxR;
  57045. }
  57046. var uv = this.DVBUnitValue; //圆半径
  57047. var r = fv[0] * uv + sets.minR;
  57048. this.width = 2 * r;
  57049. this.height = 2 * r; // 重要步骤:初始化参数
  57050. if (!this.initBaseParameter()) {
  57051. return;
  57052. } //假如用户设置了值域范围 没有在值域范围直接返回
  57053. if (codomain) {
  57054. if (fv[0] < codomain[0] || fv[0] > codomain[1]) {
  57055. return;
  57056. }
  57057. }
  57058. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为圆心
  57059. //圆形对象参数
  57060. var circleSP = new Circle_Circle(dvbCenter[0], dvbCenter[1], r); //circleSP.sytle 初始化
  57061. circleSP.style = ShapeFactory.ShapeStyleTool(null, sets.circleStyle, null, null, 0); //图形的填充颜色
  57062. if (typeof sets.fillColor !== "undefined") {
  57063. //用户自定义
  57064. circleSP.style.fillColor = sets.fillColor;
  57065. } else {
  57066. //当前默认
  57067. circleSP.style.fillColor = defaultFillColor;
  57068. } //圆形 Hover样式
  57069. circleSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.circleHoverStyle); //圆形 Hover 与 click 设置
  57070. if (typeof sets.circleHoverAble !== "undefined") {
  57071. circleSP.hoverable = sets.circleHoverAble;
  57072. }
  57073. if (typeof sets.circleClickAble !== "undefined") {
  57074. circleSP.clickable = sets.circleClickAble;
  57075. } //图形携带的数据信息
  57076. circleSP.refDataID = this.data.id;
  57077. circleSP.dataInfo = {
  57078. field: this.fields[0],
  57079. r: r,
  57080. value: fv[0]
  57081. }; // 创建扇形并把此扇形添加到图表图形数组
  57082. this.shapes.push(this.shapeFactory.createShape(circleSP)); // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  57083. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  57084. this.shapesConvertToRelativeCoordinate();
  57085. }
  57086. }]);
  57087. return Circle;
  57088. }(RankSymbol);
  57089. /**
  57090. * @typedef {Object} SuperMap.Feature.Theme.Circle.setting
  57091. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  57092. * @property {number} [maxR] - 圆形的最大半径。
  57093. * @property {number} [minR] - 圆形的最小半径。
  57094. * @property {string} [fillColor] - 圆形的填充色,如:fillColor: "#FFB980"。
  57095. * @property {Object} [circleStyle] - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
  57096. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  57097. * @property {Object} [circleHoverStyle] - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
  57098. * @property {boolean} [circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  57099. * @property {boolean} [circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  57100. *
  57101. */
  57102. SuperMap.Feature.Theme.Circle = Circle;
  57103. ;// CONCATENATED MODULE: ./src/common/overlay/Line.js
  57104. function overlay_Line_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { overlay_Line_typeof = function _typeof(obj) { return typeof obj; }; } else { overlay_Line_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return overlay_Line_typeof(obj); }
  57105. function overlay_Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57106. 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); } }
  57107. function overlay_Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Line_defineProperties(Constructor, staticProps); return Constructor; }
  57108. function overlay_Line_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Line_get = Reflect.get; } else { overlay_Line_get = function _get(target, property, receiver) { var base = overlay_Line_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return overlay_Line_get(target, property, receiver || target); }
  57109. function overlay_Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Line_getPrototypeOf(object); if (object === null) break; } return object; }
  57110. function overlay_Line_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) overlay_Line_setPrototypeOf(subClass, superClass); }
  57111. function overlay_Line_setPrototypeOf(o, p) { overlay_Line_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Line_setPrototypeOf(o, p); }
  57112. 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); }; }
  57113. function overlay_Line_possibleConstructorReturn(self, call) { if (call && (overlay_Line_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Line_assertThisInitialized(self); }
  57114. function overlay_Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  57115. function overlay_Line_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  57116. function overlay_Line_getPrototypeOf(o) { overlay_Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Line_getPrototypeOf(o); }
  57117. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  57118. * This program are made available under the terms of the Apache License, Version 2.0
  57119. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57120. /**
  57121. * @class SuperMap.Feature.Theme.Line
  57122. * @classdesc 折线图。
  57123. * @category Visualization Theme
  57124. * @example
  57125. * // pointStyleByCodomain 参数用法示例
  57126. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  57127. * // start: 值域值下限(包含);
  57128. * // end: 值域值上限(不包含);
  57129. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Point.style> 。
  57130. * // pointStyleByCodomain 数组形如:
  57131. * [
  57132. * {
  57133. * start:0,
  57134. * end:250,
  57135. * style:{
  57136. * fillColor:"#00CD00"
  57137. * }
  57138. * },
  57139. * {
  57140. * start:250,
  57141. * end:500,
  57142. * style:{
  57143. * fillColor:"#00EE00"
  57144. * }
  57145. * },
  57146. * {
  57147. * start:500,
  57148. * end:750,
  57149. * style:{
  57150. * fillColor:"#00FF7F"
  57151. * }
  57152. * },
  57153. * {
  57154. * start:750,
  57155. * end:1500,
  57156. * style:{
  57157. * fillColor:"#00FF00"
  57158. * }
  57159. * }
  57160. * ]
  57161. *
  57162. * @extends SuperMap.Feature.Theme.Graph
  57163. * @param {SuperMap.Feature.Vector} data - 用户数据。
  57164. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  57165. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  57166. * @param {SuperMap.Feature.Theme.Line.setting} setting - 图表配置对象。
  57167. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  57168. */
  57169. var Line = /*#__PURE__*/function (_Graph) {
  57170. overlay_Line_inherits(Line, _Graph);
  57171. var _super = overlay_Line_createSuper(Line);
  57172. function Line(data, layer, fields, setting, lonlat, options) {
  57173. var _this;
  57174. overlay_Line_classCallCheck(this, Line);
  57175. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  57176. _this.CLASS_NAME = "SuperMap.Feature.Theme.Line";
  57177. return _this;
  57178. }
  57179. /**
  57180. * @function SuperMap.Feature.Theme.Line.prototype.destroy
  57181. * @override
  57182. */
  57183. overlay_Line_createClass(Line, [{
  57184. key: "destroy",
  57185. value: function destroy() {
  57186. overlay_Line_get(overlay_Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  57187. }
  57188. /**
  57189. * @function SuperMap.Feature.Theme.Line.prototype.assembleShapes
  57190. * @description 装配图形(扩展接口)。
  57191. */
  57192. }, {
  57193. key: "assembleShapes",
  57194. value: function assembleShapes() {
  57195. // 图表配置对象
  57196. var sets = this.setting; // 默认数据视图框
  57197. if (!sets.dataViewBoxParameter) {
  57198. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  57199. sets.dataViewBoxParameter = [45, 15, 15, 15];
  57200. } else {
  57201. sets.dataViewBoxParameter = [5, 5, 5, 5];
  57202. }
  57203. } // 重要步骤:初始化参数
  57204. if (!this.initBaseParameter()) {
  57205. return;
  57206. }
  57207. var dvb = this.dataViewBox; // 值域
  57208. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  57209. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  57210. var uv = this.DVBUnitValue; // 数据值数组
  57211. var fv = this.dataValues;
  57212. if (fv.length < 1) {
  57213. return;
  57214. } // 没有数据
  57215. // 获取 x 轴上的图形信息
  57216. var xShapeInfo = this.calculateXShapeInfo();
  57217. if (!xShapeInfo) {
  57218. return;
  57219. } // 折线每个节点的 x 位置
  57220. var xsLoc = xShapeInfo.xPositions; // 背景框,默认启用
  57221. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  57222. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  57223. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  57224. } // 折线图必须使用坐标轴
  57225. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo)); // var isDataEffective = true;
  57226. var xPx; // 折线节点 x 坐标
  57227. var yPx; // 折线节点 y 坐标
  57228. var poiLists = []; // 折线节点数组
  57229. var shapePois = []; // 折线节点图形数组
  57230. for (var i = 0, len = fv.length; i < len; i++) {
  57231. // 数据溢出值域检查
  57232. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  57233. // isDataEffective = false;
  57234. return null;
  57235. }
  57236. xPx = xsLoc[i];
  57237. yPx = dvb[1] - (fv[i] - codomain[0]) / uv; // 折线节点参数对象
  57238. var poiSP = new Point_Point(xPx, yPx); // 折线节点 style
  57239. poiSP.style = ShapeFactory.ShapeStyleTool({
  57240. fillColor: "#ee9900"
  57241. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]); // 折线节点 hover 样式
  57242. poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle); // 折线节点 hover click
  57243. if (typeof sets.pointHoverAble !== "undefined") {
  57244. poiSP.hoverable = sets.pointHoverAble;
  57245. }
  57246. if (typeof sets.pointClickAble !== "undefined") {
  57247. poiSP.clickable = sets.pointClickAble;
  57248. } // 图形携带的数据信息
  57249. poiSP.refDataID = this.data.id;
  57250. poiSP.dataInfo = {
  57251. field: this.fields[i],
  57252. value: fv[i]
  57253. }; // 创建图形并把此图形添加到折线节点图形数组
  57254. shapePois.push(this.shapeFactory.createShape(poiSP)); // 添加折线节点到折线节点数组
  57255. var poi = [xPx, yPx];
  57256. poiLists.push(poi);
  57257. } // 折线参数对象
  57258. var lineSP = new Line_Line(poiLists);
  57259. lineSP.style = ShapeFactory.ShapeStyleTool({
  57260. strokeColor: "#ee9900"
  57261. }, sets.lineStyle); // 禁止事件响应
  57262. lineSP.clickable = false;
  57263. lineSP.hoverable = false;
  57264. var shapeLine = this.shapeFactory.createShape(lineSP);
  57265. this.shapes.push(shapeLine); // 添加节点到图表图形数组
  57266. this.shapes = this.shapes.concat(shapePois); // // 数据范围检测未通过,清空图形
  57267. // if (isDataEffective === false) {
  57268. // this.shapes = [];
  57269. // }
  57270. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  57271. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  57272. this.shapesConvertToRelativeCoordinate();
  57273. }
  57274. /**
  57275. * @function SuperMap.Feature.Theme.Line.prototype.calculateXShapeInfo
  57276. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  57277. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  57278. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  57279. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  57280. * 本函数中图形配置对象 setting 可设属性:<br>
  57281. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  57282. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  57283. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  57284. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。<br>
  57285. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  57286. */
  57287. }, {
  57288. key: "calculateXShapeInfo",
  57289. value: function calculateXShapeInfo() {
  57290. var dvb = this.dataViewBox; // 数据视图框
  57291. var sets = this.setting; // 图表配置对象
  57292. var fvc = this.dataValues.length; // 数组值个数
  57293. if (fvc < 1) {
  57294. return null;
  57295. }
  57296. var xBlank; // x 轴空白间隔参数
  57297. var xShapePositions = []; // x 轴上图形的位置
  57298. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  57299. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  57300. var unitOffset = 0; // 单位偏移量
  57301. // x 轴空白间隔参数处理
  57302. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  57303. xBlank = sets.xShapeBlank;
  57304. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  57305. if (xsLen <= fvc) {
  57306. return null;
  57307. }
  57308. unitOffset = xsLen / (fvc - 1);
  57309. } else {
  57310. // 默认使用等距离空白间隔,空白间隔为图形宽度
  57311. unitOffset = dvbWidth / (fvc + 1);
  57312. xBlank = [unitOffset, unitOffset, unitOffset];
  57313. } // 图形 x 轴上的位置计算
  57314. var xOffset = 0;
  57315. for (var i = 0; i < fvc; i++) {
  57316. if (i == 0) {
  57317. xOffset = xBlank[0];
  57318. } else {
  57319. xOffset += unitOffset;
  57320. }
  57321. xShapePositions.push(dvb[0] + xOffset);
  57322. }
  57323. return {
  57324. "xPositions": xShapePositions,
  57325. "width": xShapeWidth
  57326. };
  57327. }
  57328. }]);
  57329. return Line;
  57330. }(Graph);
  57331. /**
  57332. * @typedef {Object} SuperMap.Feature.Theme.Line.setting
  57333. * @property {number} width - 专题要素(图表)宽度。
  57334. * @property {number} height - 专题要素(图表)高度。
  57335. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  57336. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  57337. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  57338. * @property {Array.<number>} [dataViewBoxParameter] - {Array.<number>} 数据视图框 dataViewBox 参数,
  57339. * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  57340. * 当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  57341. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  57342. * @property {boolean} [useBackground] - 是否使用图表背景框。
  57343. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
  57344. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
  57345. * 则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  57346. * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。长度为 2 的数组,第一元素表示折线左端点与数据视图框左端的空白间距,
  57347. * 第二个元素表示折线右端点右端与数据视图框右端端的空白间距。
  57348. * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
  57349. * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
  57350. * @property {number} [axisYTick=0] - y 轴刻度数量。
  57351. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  57352. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  57353. * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正。
  57354. * 数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  57355. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  57356. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,
  57357. * 否则沿数据视图框下面条边等距排布标签。
  57358. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
  57359. * @property {Array.<number>} [axisXLabelsOffset=0] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正;
  57360. * 数组第二项表示 x 轴标签组纵向上的偏移量,向下为正;
  57361. * @property {boolean} [useXReferenceLine=true] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  57362. * @property {SuperMap.Feature.ShapeParameters.Line.style} ]xReferenceLineStyle] - 水平参考线样式。
  57363. * @property {SuperMap.Feature.ShapeParameters.Line.style} [lineStyle] - 折线图中折线 style。
  57364. * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyle] - 折线图中折线节点基础 style,此参数控制折线节点基础样式,优先级低于 pointStyleByFields 和 pointStyleByCodomain。
  57365. * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为折线节点赋 style,此参数按字段控制折线节点样式,
  57366. * 优先级低于 pointStyleByCodomain,高于 pointStyle。此数组中的元素是样式对象。
  57367. * 此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields|L.supermap.graphThemeLayer.themeFields|ol.source.Graph.themeFields|mapboxgl.supermap.GraphThemeLayer.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],
  57368. * pointStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的折线节点使用 style1,字段 POP_1995 对应的折线节点使用 style2 ,字段 POP_1999 对应的折线节点使用 style3。
  57369. * @property {Array.<Object>} pointStyleByCodomain - 按折线节点代表的数据值所在值域范围控制折线节点样式,优先级高于 pointStyle 和 pointStyleByFields。
  57370. * @property {Object} [pointHoverStyle=true] - 折线节点 hover 状态时的样式,pointHoverAble 为 true 时有效。
  57371. * @property {boolean} [pointHoverAble=true] - 是否允许折线节点使用 hover 状态。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽折线节点对专题图层事件的响应。
  57372. * @property {boolean} [pointClickAble=true] - 是否允许折线节点被点击。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽折线节点对专题图层事件的响应。
  57373. */
  57374. SuperMap.Feature.Theme.Line = Line;
  57375. ;// CONCATENATED MODULE: ./src/common/overlay/Pie.js
  57376. function Pie_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Pie_typeof = function _typeof(obj) { return typeof obj; }; } else { Pie_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Pie_typeof(obj); }
  57377. function Pie_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57378. 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); } }
  57379. function Pie_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pie_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pie_defineProperties(Constructor, staticProps); return Constructor; }
  57380. function Pie_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Pie_get = Reflect.get; } else { Pie_get = function _get(target, property, receiver) { var base = Pie_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Pie_get(target, property, receiver || target); }
  57381. function Pie_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Pie_getPrototypeOf(object); if (object === null) break; } return object; }
  57382. function Pie_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Pie_setPrototypeOf(subClass, superClass); }
  57383. function Pie_setPrototypeOf(o, p) { Pie_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Pie_setPrototypeOf(o, p); }
  57384. 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); }; }
  57385. function Pie_possibleConstructorReturn(self, call) { if (call && (Pie_typeof(call) === "object" || typeof call === "function")) { return call; } return Pie_assertThisInitialized(self); }
  57386. function Pie_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  57387. function Pie_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  57388. function Pie_getPrototypeOf(o) { Pie_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Pie_getPrototypeOf(o); }
  57389. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  57390. * This program are made available under the terms of the Apache License, Version 2.0
  57391. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57392. /**
  57393. * @class SuperMap.Feature.Theme.Pie
  57394. * @classdesc 饼图。
  57395. * @category Visualization Theme
  57396. * @param {SuperMap.Feature.Vector} data - 用户数据。
  57397. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  57398. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  57399. * @param {SuperMap.Feature.Theme.Point.setting} setting - 图表配置对象。
  57400. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  57401. * @extends SuperMap.Feature.Theme.Graph
  57402. * @example
  57403. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  57404. * // start: 值域值下限(包含);
  57405. * // end: 值域值上限(不包含);
  57406. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Sector.style> 。
  57407. * // sectorStyleByCodomain 数组形如:
  57408. * [
  57409. * {
  57410. * start:0,
  57411. * end:250,
  57412. * style:{
  57413. * fillColor:"#00CD00"
  57414. * }
  57415. * },
  57416. * {
  57417. * start:250,
  57418. * end:500,
  57419. * style:{
  57420. * fillColor:"#00EE00"
  57421. * }
  57422. * },
  57423. * {
  57424. * start:500,
  57425. * end:750,
  57426. * style:{
  57427. * fillColor:"#00FF7F"
  57428. * }
  57429. * },
  57430. * {
  57431. * start:750,
  57432. * end:1500,
  57433. * style:{
  57434. * fillColor:"#00FF00"
  57435. * }
  57436. * }
  57437. * ]
  57438. * @extends {SuperMap.Feature.Theme.Graph}
  57439. */
  57440. var Pie = /*#__PURE__*/function (_Graph) {
  57441. Pie_inherits(Pie, _Graph);
  57442. var _super = Pie_createSuper(Pie);
  57443. function Pie(data, layer, fields, setting, lonlat) {
  57444. var _this;
  57445. Pie_classCallCheck(this, Pie);
  57446. _this = _super.call(this, data, layer, fields, setting, lonlat);
  57447. _this.CLASS_NAME = "SuperMap.Feature.Theme.Pie";
  57448. return _this;
  57449. }
  57450. /**
  57451. * @function SuperMap.Feature.Theme.Pie.prototype.destroy
  57452. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  57453. */
  57454. Pie_createClass(Pie, [{
  57455. key: "destroy",
  57456. value: function destroy() {
  57457. Pie_get(Pie_getPrototypeOf(Pie.prototype), "destroy", this).call(this);
  57458. }
  57459. /**
  57460. * @function SuperMap.Feature.Theme.Pie.prototype.assembleShapes
  57461. * @description 装配图形(扩展接口)。
  57462. */
  57463. }, {
  57464. key: "assembleShapes",
  57465. value: function assembleShapes() {
  57466. // 图表配置对象
  57467. var sets = this.setting; // 一个默认 style 组
  57468. var defaultStyleGroup = [{
  57469. fillColor: "#ff9277"
  57470. }, {
  57471. fillColor: "#dddd00"
  57472. }, {
  57473. fillColor: "#ffc877"
  57474. }, {
  57475. fillColor: "#bbe3ff"
  57476. }, {
  57477. fillColor: "#d5ffbb"
  57478. }, {
  57479. fillColor: "#bbbbff"
  57480. }, {
  57481. fillColor: "#ddb000"
  57482. }, {
  57483. fillColor: "#b0dd00"
  57484. }, {
  57485. fillColor: "#e2bbff"
  57486. }, {
  57487. fillColor: "#ffbbe3"
  57488. }, {
  57489. fillColor: "#ff7777"
  57490. }, {
  57491. fillColor: "#ff9900"
  57492. }, {
  57493. fillColor: "#83dd00"
  57494. }, {
  57495. fillColor: "#77e3ff"
  57496. }, {
  57497. fillColor: "#778fff"
  57498. }, {
  57499. fillColor: "#c877ff"
  57500. }, {
  57501. fillColor: "#ff77ab"
  57502. }, {
  57503. fillColor: "#ff6600"
  57504. }, {
  57505. fillColor: "#aa8800"
  57506. }, {
  57507. fillColor: "#77c7ff"
  57508. }, {
  57509. fillColor: "#ad77ff"
  57510. }, {
  57511. fillColor: "#ff77ff"
  57512. }, {
  57513. fillColor: "#dd0083"
  57514. }, {
  57515. fillColor: "#777700"
  57516. }, {
  57517. fillColor: "#00aa00"
  57518. }, {
  57519. fillColor: "#0088aa"
  57520. }, {
  57521. fillColor: "#8400dd"
  57522. }, {
  57523. fillColor: "#aa0088"
  57524. }, {
  57525. fillColor: "#dd0000"
  57526. }, {
  57527. fillColor: "#772e00"
  57528. }]; // 重要步骤:初始化参数
  57529. if (!this.initBaseParameter()) {
  57530. return;
  57531. } // 背景框,默认不启用
  57532. if (sets.useBackground) {
  57533. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  57534. } // 数据值数组
  57535. var fv = this.dataValues;
  57536. if (fv.length < 1) {
  57537. return;
  57538. } // 没有数据
  57539. // 值域范围
  57540. var codomain = this.DVBCodomain; // 值域范围检测
  57541. for (var _i = 0; _i < fv.length; _i++) {
  57542. if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
  57543. return;
  57544. }
  57545. } // 值的绝对值总和
  57546. var valueSum = 0;
  57547. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  57548. valueSum += Math.abs(fv[_i2]);
  57549. } // 重要步骤:定义图表 Pie 数据视图框中单位值的含义,单位值:每度代表的数值
  57550. this.DVBUnitValue = 360 / valueSum;
  57551. var uv = this.DVBUnitValue;
  57552. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  57553. var startAngle = 0; // 扇形起始边角度
  57554. var endAngle = 0; // 扇形终止边角度
  57555. var startAngleTmp = startAngle; // 扇形临时起始边角度
  57556. // 扇形(自适应)半径
  57557. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2;
  57558. for (var i = 0; i < fv.length; i++) {
  57559. var fvi = Math.abs(fv[i]); //计算终止角
  57560. if (i === 0) {
  57561. endAngle = startAngle + fvi * uv;
  57562. } else if (i === fvi.length - 1) {
  57563. endAngle = startAngleTmp;
  57564. } else {
  57565. endAngle = startAngle + fvi * uv;
  57566. } //矫正误差计算
  57567. if (endAngle - startAngle >= 360) {
  57568. endAngle = 359.9999999;
  57569. } // 扇形参数对象
  57570. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle); // 扇形样式
  57571. if (typeof sets.sectorStyleByFields === "undefined") {
  57572. // 使用默认 style 组
  57573. var colorIndex = i % defaultStyleGroup.length;
  57574. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  57575. } else {
  57576. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  57577. } // 扇形 hover 样式
  57578. sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle); // 扇形 hover 与 click 设置
  57579. if (typeof sets.sectorHoverAble !== "undefined") {
  57580. sectorSP.hoverable = sets.sectorHoverAble;
  57581. }
  57582. if (typeof sets.sectorClickAble !== "undefined") {
  57583. sectorSP.clickable = sets.sectorClickAble;
  57584. } // 图形携带的数据信息
  57585. sectorSP.refDataID = this.data.id;
  57586. sectorSP.dataInfo = {
  57587. field: this.fields[i],
  57588. value: fv[i]
  57589. }; // 创建扇形并把此扇形添加到图表图形数组
  57590. this.shapes.push(this.shapeFactory.createShape(sectorSP)); // 把上一次的结束角度作为下一次的起始角度
  57591. startAngle = endAngle;
  57592. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  57593. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  57594. this.shapesConvertToRelativeCoordinate();
  57595. }
  57596. }]);
  57597. return Pie;
  57598. }(Graph);
  57599. /**
  57600. * @typedef {Object} SuperMap.Feature.Theme.Pie.setting
  57601. * @property {number} width - 专题要素(图表)宽度。
  57602. * @property {number} height - 专题要素(图表)高度。
  57603. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  57604. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  57605. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  57606. * @property {Array.<number>} [dataViewBoxParameter=[0, 0, 0, 0]] - 数据视图框 dataViewBox 参数,
  57607. * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  57608. * @property {Array.<number>} decimalNumber - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  57609. * @property {boolean} [useBackground=false] - 是否使用图表背景框。
  57610. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
  57611. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  57612. * @property {SuperMap.Feature.ShapeParameters.Sector.style} sectorStyle - 饼图中扇形的基础 style,此参数控制饼图扇形基础样式,优先级低于 sectorStyleByFields 和 sectorStyleByCodomain。
  57613. * @property {Array.<SuperMap.Feature.ShapeParameters.Sector.style>} sectorStyleByFields - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为饼图扇形赋 style,此参数按字段控制饼图扇形样式,优先级低于 sectorStyleByCodomain,高于 sectorStyle。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],
  57614. * sectorStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的饼图扇形使用 style1,字段 POP_1995 对应的饼图扇形使用 style2 ,字段 POP_1999 对应的饼图扇形使用 style3。
  57615. * @property {Array.<Object>} sectorStyleByCodomain - 按饼图扇形代表的数据值所在值域范围控制饼图扇形样式,优先级高于 sectorStyle 和 sectorStyleByFields。
  57616. * @property {Object} [sectorHoverStyle] 饼图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
  57617. * @property {boolean} [sectorHoverAble=true] 是否允许饼图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽饼图扇形对专题图层事件的响应。
  57618. * @property {boolean} [sectorClickAble=true] 是否允许饼图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽饼图扇形对专题图层事件的响应。
  57619. */
  57620. SuperMap.Feature.Theme.Pie = Pie;
  57621. ;// CONCATENATED MODULE: ./src/common/overlay/Point.js
  57622. function overlay_Point_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { overlay_Point_typeof = function _typeof(obj) { return typeof obj; }; } else { overlay_Point_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return overlay_Point_typeof(obj); }
  57623. function overlay_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57624. 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); } }
  57625. function overlay_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Point_defineProperties(Constructor, staticProps); return Constructor; }
  57626. function overlay_Point_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Point_get = Reflect.get; } else { overlay_Point_get = function _get(target, property, receiver) { var base = overlay_Point_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return overlay_Point_get(target, property, receiver || target); }
  57627. function overlay_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  57628. function overlay_Point_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) overlay_Point_setPrototypeOf(subClass, superClass); }
  57629. function overlay_Point_setPrototypeOf(o, p) { overlay_Point_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Point_setPrototypeOf(o, p); }
  57630. 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); }; }
  57631. function overlay_Point_possibleConstructorReturn(self, call) { if (call && (overlay_Point_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Point_assertThisInitialized(self); }
  57632. function overlay_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  57633. function overlay_Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  57634. function overlay_Point_getPrototypeOf(o) { overlay_Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Point_getPrototypeOf(o); }
  57635. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  57636. * This program are made available under the terms of the Apache License, Version 2.0
  57637. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57638. /**
  57639. * @class SuperMap.Feature.Theme.Point
  57640. * @classdesc 点状图。
  57641. * @category Visualization Theme
  57642. * @param {SuperMap.Feature.Vector} data - 用户数据。
  57643. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  57644. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  57645. * @param {SuperMap.Feature.Theme.Point.setting} setting - 图表配置对象。
  57646. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  57647. * @example
  57648. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  57649. * // start: 值域值下限(包含);
  57650. * // end: 值域值上限(不包含);
  57651. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Point.style> 。
  57652. * // pointStyleByCodomain 数组形如:
  57653. * [
  57654. * {
  57655. * start:0,
  57656. * end:250,
  57657. * style:{
  57658. * fillColor:"#00CD00"
  57659. * }
  57660. * },
  57661. * {
  57662. * start:250,
  57663. * end:500,
  57664. * style:{
  57665. * fillColor:"#00EE00"
  57666. * }
  57667. * },
  57668. * {
  57669. * start:500,
  57670. * end:750,
  57671. * style:{
  57672. * fillColor:"#00FF7F"
  57673. * }
  57674. * },
  57675. * {
  57676. * start:750,
  57677. * end:1500,
  57678. * style:{
  57679. * fillColor:"#00FF00"
  57680. * }
  57681. * }
  57682. * ]
  57683. *@extends {SuperMap.Feature.Theme.Graph}
  57684. */
  57685. var overlay_Point_Point = /*#__PURE__*/function (_Graph) {
  57686. overlay_Point_inherits(Point, _Graph);
  57687. var _super = overlay_Point_createSuper(Point);
  57688. function Point(data, layer, fields, setting, lonlat, options) {
  57689. var _this;
  57690. overlay_Point_classCallCheck(this, Point);
  57691. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  57692. _this.CLASS_NAME = "SuperMap.Feature.Theme.Point";
  57693. return _this;
  57694. }
  57695. /**
  57696. * @function SuperMap.Feature.Theme.Point.prototype.destroy
  57697. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  57698. */
  57699. overlay_Point_createClass(Point, [{
  57700. key: "destroy",
  57701. value: function destroy() {
  57702. overlay_Point_get(overlay_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  57703. }
  57704. /**
  57705. * @function SuperMap.Feature.Theme.prototype.Point.assembleShapes
  57706. * @description 装配图形(扩展接口)。
  57707. */
  57708. }, {
  57709. key: "assembleShapes",
  57710. value: function assembleShapes() {
  57711. // 图表配置对象
  57712. var sets = this.setting; // 默认数据视图框
  57713. if (!sets.dataViewBoxParameter) {
  57714. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  57715. sets.dataViewBoxParameter = [45, 15, 15, 15];
  57716. } else {
  57717. sets.dataViewBoxParameter = [5, 5, 5, 5];
  57718. }
  57719. } // 重要步骤:初始化参数
  57720. if (!this.initBaseParameter()) {
  57721. return;
  57722. }
  57723. var dvb = this.dataViewBox; // 值域
  57724. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  57725. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  57726. var uv = this.DVBUnitValue;
  57727. var fv = this.dataValues; // 获取 x 轴上的图形信息
  57728. var xShapeInfo = this.calculateXShapeInfo();
  57729. if (!xShapeInfo) {
  57730. return;
  57731. } // 折线每个节点的 x 位置
  57732. var xsLoc = xShapeInfo.xPositions; // 背景框,默认启用
  57733. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  57734. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  57735. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  57736. } // 点状图必须使用坐标轴
  57737. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  57738. var xPx; // 图形点 x 坐标
  57739. var yPx; // 图形点 y 坐标
  57740. for (var i = 0, len = fv.length; i < len; i++) {
  57741. // 数据溢出值域检查
  57742. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  57743. //isDataEffective = false;
  57744. return null;
  57745. }
  57746. xPx = xsLoc[i];
  57747. yPx = dvb[1] - (fv[i] - codomain[0]) / uv; // 图形点参数对象
  57748. var poiSP = new Point_Point(xPx, yPx); // 图形点 style
  57749. poiSP.style = ShapeFactory.ShapeStyleTool({
  57750. fillColor: "#ee9900"
  57751. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]); // 图形点 hover 样式
  57752. poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle); // 图形点 hover click
  57753. if (typeof sets.pointHoverAble !== "undefined") {
  57754. poiSP.hoverable = sets.pointHoverAble;
  57755. }
  57756. if (typeof sets.pointClickAble !== "undefined") {
  57757. poiSP.clickable = sets.pointClickAble;
  57758. } // 图形携带的数据信息
  57759. poiSP.refDataID = this.data.id;
  57760. poiSP.dataInfo = {
  57761. field: this.fields[i],
  57762. value: fv[i]
  57763. }; // 创建图形点并把此图形添加到图表图形数组
  57764. this.shapes.push(this.shapeFactory.createShape(poiSP));
  57765. } // 数据范围检测未通过,清空图形
  57766. // if (isDataEffective === false) {
  57767. // this.shapes = [];
  57768. // }
  57769. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  57770. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  57771. this.shapesConvertToRelativeCoordinate();
  57772. }
  57773. /**
  57774. * @function SuperMap.Feature.Theme.Point.prototype.calculateXShapeInfo
  57775. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  57776. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  57777. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  57778. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  57779. * 本函数中图形配置对象 setting 可设属性:<br>
  57780. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  57781. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  57782. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  57783. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  57784. * width - {number}表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  57785. */
  57786. }, {
  57787. key: "calculateXShapeInfo",
  57788. value: function calculateXShapeInfo() {
  57789. var dvb = this.dataViewBox; // 数据视图框
  57790. var sets = this.setting; // 图表配置对象
  57791. var fvc = this.dataValues.length; // 数组值个数
  57792. if (fvc < 1) {
  57793. return null;
  57794. }
  57795. var xBlank; // x 轴空白间隔参数
  57796. var xShapePositions = []; // x 轴上图形的位置
  57797. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  57798. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  57799. var unitOffset = 0; // 单位偏移量
  57800. // x 轴空白间隔参数处理
  57801. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  57802. xBlank = sets.xShapeBlank;
  57803. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  57804. if (xsLen <= fvc) {
  57805. return null;
  57806. }
  57807. unitOffset = xsLen / (fvc - 1);
  57808. } else {
  57809. // 默认使用等距离空白间隔,空白间隔为图形宽度
  57810. unitOffset = dvbWidth / (fvc + 1);
  57811. xBlank = [unitOffset, unitOffset, unitOffset];
  57812. } // 图形 x 轴上的位置计算
  57813. var xOffset = 0;
  57814. for (var i = 0; i < fvc; i++) {
  57815. if (i == 0) {
  57816. xOffset = xBlank[0];
  57817. } else {
  57818. xOffset += unitOffset;
  57819. }
  57820. xShapePositions.push(dvb[0] + xOffset);
  57821. }
  57822. return {
  57823. "xPositions": xShapePositions,
  57824. "width": xShapeWidth
  57825. };
  57826. }
  57827. }]);
  57828. return Point;
  57829. }(Graph);
  57830. /**
  57831. * @typedef {Object} SuperMap.Feature.Theme.Point.setting
  57832. * @property {number} width - 专题要素(图表)宽度。
  57833. * @property {number} height - 专题要素(图表)高度。
  57834. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  57835. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  57836. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  57837. * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,
  57838. * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  57839. * 当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  57840. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  57841. * @property {boolean} [useBackground] - 是否使用图表背景框。
  57842. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
  57843. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
  57844. * 则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  57845. * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。
  57846. * 长度为 2 的数组,第一个元素表示第一个(沿 x 轴方向)图形点与数据视图框左端的空白间距,第二个元素表示最后一个(沿 x 轴方向)图形点与数据视图框右端端的空白间距 。
  57847. * @property {Object} axisStyle - 坐标轴样式。
  57848. * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
  57849. * @property {number} [axisYTick=0] - y 轴刻度数量。
  57850. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  57851. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  57852. * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正;
  57853. * 数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  57854. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  57855. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,
  57856. * 否则沿数据视图框下面条边等距排布标签。
  57857. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
  57858. * @property {Array.<number>} [axisXLabelsOffset=0] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,
  57859. * 数组第二项表示 x 轴标签组纵向上的偏移量,向下为正。
  57860. * @property {boolean} [useXReferenceLine=true] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  57861. * @property {SuperMap.Feature.ShapeParameters.Line.style} [xReferenceLineStyle] - 水平参考线样式。
  57862. * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyle] - 点状图中图形点基础 style,此参数控制图形点基础样式,优先级低于 pointStyleByFields 和 pointStyleByCodomain。
  57863. * @property {Array.<SuperMap.Feature.ShapeParameters.Point.style>} [pointStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为图形点赋 style,此参数按字段控制图形点样式,
  57864. * 优先级低于 pointStyleByCodomain,高于 pointStyle。此数组中的元素是样式对象。
  57865. * 此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],
  57866. * pointStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的图形点使用 style1,字段 POP_1995 对应的图形点使用 style2 ,字段 POP_1999 对应的图形点使用 style3。
  57867. * @property {Array.<Object>} pointStyleByCodomain - 按图形点代表的数据值所在值域范围控制图形点样式,优先级高于 pointStyle 和 pointStyleByFields。
  57868. * @property {Object} [pointHoverStyle] - 图形点 hover 状态时的样式,pointHoverAble 为 true 时有效。
  57869. * @property {Object} [pointHoverAble=true] - 是否允许图形点使用 hover 状态。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽图形点对专题图层事件的响应。
  57870. * @property {Object} [pointClickAble=true] - 是否允许图形点被点击。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽图形点对专题图层事件的响应。
  57871. */
  57872. SuperMap.Feature.Theme.Point = overlay_Point_Point;
  57873. ;// CONCATENATED MODULE: ./src/common/overlay/Ring.js
  57874. function Ring_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Ring_typeof = function _typeof(obj) { return typeof obj; }; } else { Ring_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Ring_typeof(obj); }
  57875. function Ring_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57876. 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); } }
  57877. function Ring_createClass(Constructor, protoProps, staticProps) { if (protoProps) Ring_defineProperties(Constructor.prototype, protoProps); if (staticProps) Ring_defineProperties(Constructor, staticProps); return Constructor; }
  57878. function Ring_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Ring_get = Reflect.get; } else { Ring_get = function _get(target, property, receiver) { var base = Ring_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Ring_get(target, property, receiver || target); }
  57879. function Ring_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Ring_getPrototypeOf(object); if (object === null) break; } return object; }
  57880. function Ring_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Ring_setPrototypeOf(subClass, superClass); }
  57881. function Ring_setPrototypeOf(o, p) { Ring_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Ring_setPrototypeOf(o, p); }
  57882. 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); }; }
  57883. function Ring_possibleConstructorReturn(self, call) { if (call && (Ring_typeof(call) === "object" || typeof call === "function")) { return call; } return Ring_assertThisInitialized(self); }
  57884. function Ring_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  57885. function Ring_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  57886. function Ring_getPrototypeOf(o) { Ring_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Ring_getPrototypeOf(o); }
  57887. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  57888. * This program are made available under the terms of the Apache License, Version 2.0
  57889. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57890. /**
  57891. * @class SuperMap.Feature.Theme.Ring
  57892. * @classdesc 环状图。
  57893. * @category Visualization Theme
  57894. * @description 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  57895. * @param {SuperMap.Feature.Vector} data - 用户数据。
  57896. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  57897. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  57898. * @param {SuperMap.Feature.Theme.Ring.setting} setting - 图表配置对象。
  57899. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  57900. * @example
  57901. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  57902. * // start: 值域值下限(包含);
  57903. * // end: 值域值上限(不包含);
  57904. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Sector.style> 。
  57905. * // sectorStyleByCodomain 数组形如:
  57906. * [
  57907. * {
  57908. * start:0,
  57909. * end:250,
  57910. * style:{
  57911. * fillColor:"#00CD00"
  57912. * }
  57913. * },
  57914. * {
  57915. * start:250,
  57916. * end:500,
  57917. * style:{
  57918. * fillColor:"#00EE00"
  57919. * }
  57920. * },
  57921. * {
  57922. * start:500,
  57923. * end:750,
  57924. * style:{
  57925. * fillColor:"#00FF7F"
  57926. * }
  57927. * },
  57928. * {
  57929. * start:750,
  57930. * end:1500,
  57931. * style:{
  57932. * fillColor:"#00FF00"
  57933. * }
  57934. * }
  57935. * ]
  57936. * @param {Object} [sectorHoverStyle=true] - 环状图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
  57937. * @param {boolean} [sectorHoverAble=true] - 是否允许环状图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  57938. * @param {boolean} [sectorClickAble=true] - 是否允许环状图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  57939. *
  57940. * @extends {SuperMap.Feature.Theme.Graph}
  57941. */
  57942. var Ring = /*#__PURE__*/function (_Graph) {
  57943. Ring_inherits(Ring, _Graph);
  57944. var _super = Ring_createSuper(Ring);
  57945. function Ring(data, layer, fields, setting, lonlat) {
  57946. var _this;
  57947. Ring_classCallCheck(this, Ring);
  57948. _this = _super.call(this, data, layer, fields, setting, lonlat);
  57949. _this.CLASS_NAME = "SuperMap.Feature.Theme.Ring";
  57950. return _this;
  57951. }
  57952. /**
  57953. * @function SuperMap.Feature.Theme.Ring.prototype.destroy
  57954. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  57955. */
  57956. Ring_createClass(Ring, [{
  57957. key: "destroy",
  57958. value: function destroy() {
  57959. Ring_get(Ring_getPrototypeOf(Ring.prototype), "destroy", this).call(this);
  57960. }
  57961. /**
  57962. * @function SuperMap.Feature.Theme.Ring.prototype.assembleShapes
  57963. * @description 装配图形(扩展接口)。
  57964. */
  57965. }, {
  57966. key: "assembleShapes",
  57967. value: function assembleShapes() {
  57968. // 重要步骤:初始化参数
  57969. if (!this.initBaseParameter()) {
  57970. return;
  57971. } // 一个默认 style 组
  57972. var defaultStyleGroup = [{
  57973. fillColor: "#ff9277"
  57974. }, {
  57975. fillColor: "#dddd00"
  57976. }, {
  57977. fillColor: "#ffc877"
  57978. }, {
  57979. fillColor: "#bbe3ff"
  57980. }, {
  57981. fillColor: "#d5ffbb"
  57982. }, {
  57983. fillColor: "#bbbbff"
  57984. }, {
  57985. fillColor: "#ddb000"
  57986. }, {
  57987. fillColor: "#b0dd00"
  57988. }, {
  57989. fillColor: "#e2bbff"
  57990. }, {
  57991. fillColor: "#ffbbe3"
  57992. }, {
  57993. fillColor: "#ff7777"
  57994. }, {
  57995. fillColor: "#ff9900"
  57996. }, {
  57997. fillColor: "#83dd00"
  57998. }, {
  57999. fillColor: "#77e3ff"
  58000. }, {
  58001. fillColor: "#778fff"
  58002. }, {
  58003. fillColor: "#c877ff"
  58004. }, {
  58005. fillColor: "#ff77ab"
  58006. }, {
  58007. fillColor: "#ff6600"
  58008. }, {
  58009. fillColor: "#aa8800"
  58010. }, {
  58011. fillColor: "#77c7ff"
  58012. }, {
  58013. fillColor: "#ad77ff"
  58014. }, {
  58015. fillColor: "#ff77ff"
  58016. }, {
  58017. fillColor: "#dd0083"
  58018. }, {
  58019. fillColor: "#777700"
  58020. }, {
  58021. fillColor: "#00aa00"
  58022. }, {
  58023. fillColor: "#0088aa"
  58024. }, {
  58025. fillColor: "#8400dd"
  58026. }, {
  58027. fillColor: "#aa0088"
  58028. }, {
  58029. fillColor: "#dd0000"
  58030. }, {
  58031. fillColor: "#772e00"
  58032. }]; // 图表配置对象
  58033. var sets = this.setting; // 背景框,默认不启用
  58034. if (sets.useBackground) {
  58035. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  58036. } // 数据值数组
  58037. var fv = this.dataValues;
  58038. if (fv.length < 1) {
  58039. return;
  58040. } // 没有数据
  58041. // 值域范围
  58042. var codomain = this.DVBCodomain; // 值域范围检测
  58043. for (var _i = 0; _i < fv.length; _i++) {
  58044. if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
  58045. return;
  58046. }
  58047. } // 值的绝对值总和
  58048. var valueSum = 0;
  58049. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  58050. valueSum += Math.abs(fv[_i2]);
  58051. } // 重要步骤:定义图表 Ring 数据视图框中单位值的含义,单位值:每度代表的数值
  58052. this.DVBUnitValue = 360 / valueSum;
  58053. var uv = this.DVBUnitValue;
  58054. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  58055. var startAngle = 0; // 扇形起始边角度
  58056. var endAngle = 0; // 扇形终止边角度
  58057. var startAngleTmp = startAngle; // 扇形临时起始边角度
  58058. // 扇形外环(自适应)半径
  58059. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2; // 扇形内环(自适应)半径
  58060. var isInRange = sets.innerRingRadius >= 0 && sets.innerRingRadius < r;
  58061. var r0 = typeof sets.innerRingRadius !== "undefined" && !isNaN(sets.innerRingRadius) && isInRange ? sets.innerRingRadius : 0;
  58062. for (var i = 0; i < fv.length; i++) {
  58063. var fvi = Math.abs(fv[i]); // 计算结束角度
  58064. if (i === 0) {
  58065. endAngle = startAngle + fvi * uv;
  58066. } else if (i === fvi.length - 1) {
  58067. endAngle = startAngleTmp;
  58068. } else {
  58069. endAngle = startAngle + fvi * uv;
  58070. } // 扇形参数对象
  58071. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle, r0); // 扇形样式
  58072. if (typeof sets.sectorStyleByFields === "undefined") {
  58073. // 使用默认 style 组
  58074. var colorIndex = i % defaultStyleGroup.length;
  58075. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  58076. } else {
  58077. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  58078. } // 扇形 hover 样式
  58079. sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle); // 扇形 hover 与 click 设置
  58080. if (typeof sets.sectorHoverAble !== "undefined") {
  58081. sectorSP.hoverable = sets.sectorHoverAble;
  58082. }
  58083. if (typeof sets.sectorClickAble !== "undefined") {
  58084. sectorSP.clickable = sets.sectorClickAble;
  58085. } // 图形携带的数据信息
  58086. sectorSP.refDataID = this.data.id;
  58087. sectorSP.dataInfo = {
  58088. field: this.fields[i],
  58089. value: fv[i]
  58090. }; // 创建扇形并把此扇形添加到图表图形数组
  58091. this.shapes.push(this.shapeFactory.createShape(sectorSP)); // 把上一次的结束角度作为下一次的起始角度
  58092. startAngle = endAngle;
  58093. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  58094. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  58095. this.shapesConvertToRelativeCoordinate();
  58096. }
  58097. }]);
  58098. return Ring;
  58099. }(Graph);
  58100. /**
  58101. * @typedef {Object} SuperMap.Feature.Theme.Ring.setting
  58102. * @property {number} width - 专题要素(图表)宽度。
  58103. * @property {number} height - 专题要素(图表)高度。
  58104. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  58105. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  58106. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  58107. * @property {Array.<number>} [dataViewBoxParameter=[0, 0, 0, 0]] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  58108. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  58109. * @property {boolean} [useBackground=false] - 是否使用图表背景框。
  58110. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式,此样式对象对象可设属性。
  58111. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  58112. * @property {number} [innerRingRadius=0] - 环状图内环半径,取值范围大于 0,小于外环半径(外环半径:数据视图框长和宽中较小值的二分之一)。
  58113. * @property {SuperMap.Feature.ShapeParameters.Sector.style} [sectorStyle] - 环状图中扇形的基础 style,此参数控制环状图扇形基础样式,优先级低于 sectorStyleByFields 和 sectorStyleByCodomain。
  58114. * @property {Array.<SuperMap.Feature.ShapeParameters.Sector.style>} [sectorStyleByFields] - 按专题字段 themeFields({@link SuperMap.Layer.Graph.themeFields}|{@link L.supermap.graphThemeLayer.themeFields}|{@link ol.source.Graph.themeFields}|{@link mapboxgl.supermap.GraphThemeLayer.themeFields})为环状图扇形赋 style,此参数按字段控制环状图扇形样式,优先级低于 sectorStyleByCodomain,高于 sectorStyle。此数组中的元素是样式对象。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],sectorStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的环状图扇形使用 style1,字段 POP_1995 对应的环状图扇形使用 style2 ,字段 POP_1999 对应的环状图扇形使用 style3。
  58115. * @property {Array.<SuperMap.Feature.ShapeParameters.Sector.style>} [sectorStyleByCodomain] - 按环状图扇形代表的数据值所在值域范围控制环状图扇形样式,优先级高于 sectorStyle 和 sectorStyleByFields。
  58116. */
  58117. SuperMap.Feature.Theme.Ring = Ring;
  58118. ;// CONCATENATED MODULE: ./src/common/overlay/ThemeVector.js
  58119. function ThemeVector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeVector_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeVector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeVector_typeof(obj); }
  58120. function ThemeVector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58121. 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); } }
  58122. function ThemeVector_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeVector_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeVector_defineProperties(Constructor, staticProps); return Constructor; }
  58123. function ThemeVector_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeVector_get = Reflect.get; } else { ThemeVector_get = function _get(target, property, receiver) { var base = ThemeVector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return ThemeVector_get(target, property, receiver || target); }
  58124. function ThemeVector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeVector_getPrototypeOf(object); if (object === null) break; } return object; }
  58125. function ThemeVector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ThemeVector_setPrototypeOf(subClass, superClass); }
  58126. function ThemeVector_setPrototypeOf(o, p) { ThemeVector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeVector_setPrototypeOf(o, p); }
  58127. 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); }; }
  58128. function ThemeVector_possibleConstructorReturn(self, call) { if (call && (ThemeVector_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeVector_assertThisInitialized(self); }
  58129. function ThemeVector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  58130. function ThemeVector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  58131. function ThemeVector_getPrototypeOf(o) { ThemeVector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeVector_getPrototypeOf(o); }
  58132. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  58133. * This program are made available under the terms of the Apache License, Version 2.0
  58134. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58135. /**
  58136. * @class SuperMap.Feature.Theme.Vector
  58137. * @classdesc 矢量专题要素类。
  58138. * @category Visualization Theme
  58139. * @extends SuperMap.Feature.Theme
  58140. * @param {SuperMap.Feature.Vector} data - 用户数据,的类型为矢量数据 feature。
  58141. * @param {SuperMap.Layer} layer - 此专题要素所在图层。
  58142. * @param {Object} style - 样式。
  58143. * @param {Object} options - 创建专题要素时的可选参数。
  58144. * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离, 单位:像素。
  58145. * @param {boolean} [options.isHoverAble=true] - 图形是否可 hover。
  58146. * @param {boolean} [options.isMultiHover=true] - 是否使用多图形高亮,isHoverAble 为 true 时生效。
  58147. * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
  58148. * @param {Object} [options.highlightStyle] - 高亮样式。
  58149. */
  58150. var ThemeVector = /*#__PURE__*/function (_Theme) {
  58151. ThemeVector_inherits(ThemeVector, _Theme);
  58152. var _super = ThemeVector_createSuper(ThemeVector);
  58153. function ThemeVector(data, layer, style, options, shapeOptions) {
  58154. var _this;
  58155. ThemeVector_classCallCheck(this, ThemeVector);
  58156. _this = _super.call(this, data, layer); //数据的 geometry 属性必须存在且类型是 SuperMap.Geometry 或其子类的类型
  58157. if (!data.geometry) {
  58158. return ThemeVector_possibleConstructorReturn(_this);
  58159. }
  58160. if (!(data.geometry instanceof Geometry)) {
  58161. return ThemeVector_possibleConstructorReturn(_this);
  58162. }
  58163. /**
  58164. * @member {SuperMap.Bounds} [SuperMap.Feature.Theme.Vector.prototype.dataBounds]
  58165. * @description 用户数据的(feature.geometry)地理范围。
  58166. */
  58167. _this.dataBounds = data.geometry.getBounds();
  58168. /**
  58169. * @member {number} [SuperMap.Feature.Theme.Vector.prototype.nodesClipPixel=2]
  58170. * @description 节点抽稀像素距离。
  58171. */
  58172. _this.nodesClipPixel = 2;
  58173. /**
  58174. * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isHoverAble=true]
  58175. * @description 图形是否可 hover。
  58176. */
  58177. _this.isHoverAble = true;
  58178. /**
  58179. * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isMultiHover=true]
  58180. * @description 是否使用多图形高亮,isHoverAble 为 true 时生效。
  58181. */
  58182. _this.isMultiHover = true;
  58183. /**
  58184. * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isClickAble=true]
  58185. * @description 图形是否可点击。
  58186. */
  58187. _this.isClickAble = true;
  58188. /**
  58189. * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.highlightStyle]
  58190. * @description 高亮样式。
  58191. */
  58192. _this.highlightStyle = null;
  58193. /**
  58194. * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.shapeOptions]
  58195. * @description 添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做。
  58196. */
  58197. _this.shapeOptions = {};
  58198. /**
  58199. * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.style]
  58200. * @description 可视化图形的 style。在子类中规定其对象结构和默认属性值。
  58201. */
  58202. _this.style = style || {};
  58203. _this.CLASS_NAME = "SuperMap.Feature.Theme.Vector";
  58204. _this.style = style ? style : {};
  58205. if (options) {
  58206. Util.copyAttributesWithClip(ThemeVector_assertThisInitialized(_this), options, ["shapeOptions", "dataBounds"]);
  58207. }
  58208. if (shapeOptions) {
  58209. Util.copyAttributesWithClip(_this.shapeOptions, shapeOptions);
  58210. } //设置基础参数 dataBounds、lonlat、location
  58211. var geometry = data.geometry;
  58212. _this.lonlat = _this.dataBounds.getCenterLonLat();
  58213. _this.location = _this.getLocalXY(_this.lonlat); //将地理要素转为专题要素
  58214. if (geometry instanceof LinearRing) {
  58215. _this.lineToTF(geometry);
  58216. } else if (geometry instanceof LineString) {
  58217. _this.lineToTF(geometry);
  58218. } else if (geometry instanceof Curve) {//独立几何体
  58219. } else if (geometry instanceof MultiPoint) {
  58220. _this.multiPointToTF(geometry);
  58221. } else if (geometry instanceof MultiLineString) {
  58222. _this.multiLineStringToTF(geometry);
  58223. } else if (geometry instanceof MultiPolygon) {
  58224. _this.multiPolygonToTF(geometry);
  58225. } else if (geometry instanceof Polygon) {
  58226. _this.polygonToTF(geometry);
  58227. } else if (geometry instanceof Collection) {//独立几何体
  58228. } else if (geometry instanceof Point) {
  58229. _this.pointToTF(geometry);
  58230. } else if (geometry instanceof Rectangle) {
  58231. _this.rectangleToTF(geometry);
  58232. } else if (geometry instanceof GeoText) {
  58233. _this.geoTextToTF(geometry);
  58234. }
  58235. return _this;
  58236. }
  58237. /**
  58238. * @function SuperMap.Feature.Theme.Vector.prototype.destroy
  58239. * @override
  58240. */
  58241. ThemeVector_createClass(ThemeVector, [{
  58242. key: "destroy",
  58243. value: function destroy() {
  58244. this.style = null;
  58245. this.dataBounds = null;
  58246. this.nodesClipPixel = null;
  58247. this.isHoverAble = null;
  58248. this.isMultiHover = null;
  58249. this.isClickAble = null;
  58250. this.highlightStyle = null;
  58251. this.shapeOptions = null;
  58252. ThemeVector_get(ThemeVector_getPrototypeOf(ThemeVector.prototype), "destroy", this).call(this);
  58253. }
  58254. /**
  58255. * @function SuperMap.Feature.Theme.Vector.prototype.lineToTF
  58256. * @description 转换线和线环要素。
  58257. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 LineString 或 LineRing。
  58258. */
  58259. }, {
  58260. key: "lineToTF",
  58261. value: function lineToTF(geometry) {
  58262. var components = geometry.components; //节点像素坐标
  58263. var localLX = []; //参考位置,参考中心为
  58264. var refLocal = [];
  58265. var location = this.location;
  58266. var pointList = []; //节点抽稀距离
  58267. var nCPx = this.nodesClipPixel;
  58268. for (var i = 0; i < components.length; i++) {
  58269. var components_i = components[i];
  58270. refLocal = [];
  58271. localLX = this.getLocalXY(components_i);
  58272. refLocal[0] = localLX[0] - location[0];
  58273. refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
  58274. if (pointList.length > 0) {
  58275. var lastLocalXY = pointList[pointList.length - 1];
  58276. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  58277. continue;
  58278. }
  58279. } //使用参考点
  58280. pointList.push(refLocal);
  58281. }
  58282. if (pointList.length < 2) {
  58283. return null;
  58284. } //赋 style
  58285. var style = new Object();
  58286. style = Util.copyAttributesWithClip(style, this.style, ['pointList']);
  58287. style.pointList = pointList; //创建图形
  58288. var shape = new SmicBrokenLine({
  58289. style: style,
  58290. clickable: this.isClickAble,
  58291. hoverable: this.isHoverAble
  58292. }); //设置高亮样式
  58293. if (this.highlightStyle) {
  58294. shape.highlightStyle = this.highlightStyle;
  58295. } //设置参考中心,指定图形位置
  58296. shape.refOriginalPosition = this.location; //储存数据 id 属性,用于事件
  58297. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  58298. shape.isHoverByRefDataID = this.isMultiHover; //添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做
  58299. if (this.shapeOptions) {
  58300. Util.copyAttributesWithClip(shape, this.shapeOptions);
  58301. }
  58302. this.shapes.push(shape);
  58303. }
  58304. /**
  58305. * @function SuperMap.Feature.Theme.Vector.prototype.multiPointToTF
  58306. * @description 转多点要素。
  58307. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPoint。
  58308. */
  58309. }, {
  58310. key: "multiPointToTF",
  58311. value: function multiPointToTF(geometry) {
  58312. /* //-- 不抽稀
  58313. var components = geometry.components;
  58314. for(var i = 0; i < components.length; i++){
  58315. var components_i = components[i];
  58316. this.pointToTF(components_i);
  58317. }
  58318. */
  58319. var components = geometry.components; //节点像素坐标
  58320. var localLX = []; //参考位置,参考中心为
  58321. var refLocal = [];
  58322. var location = this.location;
  58323. var pointList = []; //节点抽稀距离
  58324. var nCPx = this.nodesClipPixel;
  58325. for (var i = 0; i < components.length; i++) {
  58326. var components_i = components[i];
  58327. refLocal = [];
  58328. localLX = this.getLocalXY(components_i);
  58329. refLocal[0] = localLX[0] - location[0];
  58330. refLocal[1] = localLX[1] - location[1]; //抽稀
  58331. if (pointList.length > 0) {
  58332. var lastLocalXY = pointList[pointList.length - 1];
  58333. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  58334. continue;
  58335. }
  58336. } //使用参考点
  58337. pointList.push(refLocal); //赋 style
  58338. var style = new Object();
  58339. style.r = 6; //防止漏设此参数,默认 6 像素
  58340. style = Util.copyAttributesWithClip(style, this.style);
  58341. style.x = refLocal[0];
  58342. style.y = refLocal[1]; //创建图形
  58343. var shape = new SmicPoint({
  58344. style: style,
  58345. clickable: this.isClickAble,
  58346. hoverable: this.isHoverAble
  58347. }); //设置高亮样式
  58348. if (this.highlightStyle) {
  58349. shape.highlightStyle = this.highlightStyle;
  58350. } //设置参考中心,指定图形位置
  58351. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  58352. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  58353. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  58354. if (this.shapeOptions) {
  58355. Util.copyAttributesWithClip(shape, this.shapeOptions);
  58356. }
  58357. this.shapes.push(shape);
  58358. }
  58359. }
  58360. /**
  58361. * @function SuperMap.Feature.Theme.Vector.prototype.multiLineStringToTF
  58362. * @description 转换多线要素。
  58363. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiLineString。
  58364. */
  58365. }, {
  58366. key: "multiLineStringToTF",
  58367. value: function multiLineStringToTF(geometry) {
  58368. var components = geometry.components;
  58369. for (var i = 0; i < components.length; i++) {
  58370. var components_i = components[i];
  58371. this.lineToTF(components_i);
  58372. }
  58373. }
  58374. /**
  58375. * @function SuperMap.Feature.Theme.Vector.prototype.multiPolygonToTF
  58376. * @description 转换多面要素。
  58377. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPolygon。
  58378. */
  58379. }, {
  58380. key: "multiPolygonToTF",
  58381. value: function multiPolygonToTF(geometry) {
  58382. var components = geometry.components;
  58383. for (var i = 0; i < components.length; i++) {
  58384. var components_i = components[i];
  58385. this.polygonToTF(components_i);
  58386. }
  58387. }
  58388. /**
  58389. * @function SuperMap.Feature.Theme.Vector.prototype.pointToTF
  58390. * @description 转换点要素。
  58391. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Point。
  58392. */
  58393. }, {
  58394. key: "pointToTF",
  58395. value: function pointToTF(geometry) {
  58396. //参考位置,参考中心为
  58397. var location = this.location; //geometry 像素坐标
  58398. var localLX = this.getLocalXY(geometry); //赋 style
  58399. var style = new Object();
  58400. style.r = 6; //防止漏设此参数,默认 6 像素
  58401. style = Util.copyAttributesWithClip(style, this.style);
  58402. style.x = localLX[0] - location[0];
  58403. style.y = localLX[1] - location[1]; //创建图形
  58404. var shape = new SmicPoint({
  58405. style: style,
  58406. clickable: this.isClickAble,
  58407. hoverable: this.isHoverAble
  58408. }); //设置高亮样式
  58409. if (this.highlightStyle) {
  58410. shape.highlightStyle = this.highlightStyle;
  58411. } //设置参考中心,指定图形位置
  58412. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  58413. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  58414. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  58415. if (this.shapeOptions) {
  58416. Util.copyAttributesWithClip(shape, this.shapeOptions);
  58417. }
  58418. this.shapes.push(shape);
  58419. }
  58420. /**
  58421. * @function SuperMap.Feature.Theme.Vector.prototype.polygonToThemeFeature
  58422. * @description 转换面要素。
  58423. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Polygon。
  58424. */
  58425. }, {
  58426. key: "polygonToTF",
  58427. value: function polygonToTF(geometry) {
  58428. var components = geometry.components; //节点像素坐标
  58429. var localLX = []; //参考位置,参考中心为
  58430. var refLocal = [];
  58431. var location = this.location;
  58432. var pointList = []; //岛洞
  58433. var holePolygonPointList = [];
  58434. var holePolygonPointLists = []; //节点抽稀距离
  58435. var nCPx = this.nodesClipPixel;
  58436. for (var i = 0; i < components.length; i++) {
  58437. var components_i = components[i].components;
  58438. if (i === 0) {
  58439. // 第一个 component 正常绘制
  58440. pointList = [];
  58441. for (var j = 0; j < components_i.length; j++) {
  58442. refLocal = [];
  58443. localLX = this.getLocalXY(components_i[j]);
  58444. refLocal[0] = localLX[0] - location[0];
  58445. refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
  58446. if (pointList.length > 0) {
  58447. var lastLocalXY = pointList[pointList.length - 1];
  58448. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  58449. continue;
  58450. }
  58451. } //使用参考点
  58452. pointList.push(refLocal);
  58453. }
  58454. } else {
  58455. // 其它 component 作为岛洞
  58456. holePolygonPointList = [];
  58457. for (var k = 0; k < components_i.length; k++) {
  58458. refLocal = [];
  58459. localLX = this.getLocalXY(components_i[k]);
  58460. refLocal[0] = localLX[0] - location[0];
  58461. refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
  58462. if (holePolygonPointList.length > 0) {
  58463. var lastXY = holePolygonPointList[holePolygonPointList.length - 1];
  58464. if (Math.abs(lastXY[0] - refLocal[0]) <= nCPx && Math.abs(lastXY[1] - refLocal[1]) <= nCPx) {
  58465. continue;
  58466. }
  58467. } //使用参考点
  58468. holePolygonPointList.push(refLocal);
  58469. }
  58470. }
  58471. if (holePolygonPointList.length < 2) {
  58472. continue;
  58473. }
  58474. holePolygonPointLists.push(holePolygonPointList);
  58475. }
  58476. if (pointList.length < 2) {
  58477. return;
  58478. } //赋 style
  58479. var style = {};
  58480. style = Util.copyAttributesWithClip(style, this.style, ['pointList']);
  58481. style.pointList = pointList; //创建图形
  58482. var shape = new SmicPolygon({
  58483. style: style,
  58484. clickable: this.isClickAble,
  58485. hoverable: this.isHoverAble
  58486. }); //设置高亮样式
  58487. if (this.highlightStyle) {
  58488. shape.highlightStyle = this.highlightStyle;
  58489. } //设置参考中心,指定图形位置
  58490. shape.refOriginalPosition = this.location; //储存数据 id 属性,用于事件
  58491. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  58492. shape.isHoverByRefDataID = this.isMultiHover; //岛洞面
  58493. if (holePolygonPointLists.length > 0) {
  58494. shape.holePolygonPointLists = holePolygonPointLists;
  58495. } //修改一些 shape 可选属性,通常不需要这么做
  58496. if (this.shapeOptions) {
  58497. Util.copyAttributesWithClip(shape, this.shapeOptions);
  58498. }
  58499. this.shapes.push(shape);
  58500. }
  58501. /**
  58502. * @function SuperMap.Feature.Theme.Vector.prototype.rectangleToTF
  58503. * @description 转换矩形要素。
  58504. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Rectangle。
  58505. */
  58506. }, {
  58507. key: "rectangleToTF",
  58508. value: function rectangleToTF(geometry) {
  58509. //参考位置,参考中心为
  58510. var location = this.location;
  58511. var ll = new LonLat(geometry.x, geometry.y); //地图分辨率
  58512. var res = this.layer.map.getResolution(); //geometry 像素坐标
  58513. var localLX = this.getLocalXY(ll); //赋 style
  58514. var style = new Object();
  58515. style.r = 6; //防止漏设此参数,默认 6 像素
  58516. style = Util.copyAttributesWithClip(style, this.style);
  58517. style.x = localLX[0] - location[0]; // SuperMap.Geometry.Rectangle 使用左下角定位, SmicRectangle 使用左上角定位,需要转换
  58518. style.y = localLX[1] - location[1] - 2 * geometry.width / res;
  58519. style.width = geometry.width / res;
  58520. style.height = geometry.height / res; //创建图形
  58521. var shape = new SmicRectangle({
  58522. style: style,
  58523. clickable: this.isClickAble,
  58524. hoverable: this.isHoverAble
  58525. }); //设置高亮样式
  58526. if (this.highlightStyle) {
  58527. shape.highlightStyle = this.highlightStyle;
  58528. } //设置参考中心,指定图形位置
  58529. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  58530. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  58531. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  58532. if (this.shapeOptions) {
  58533. Util.copyAttributesWithClip(shape, this.shapeOptions);
  58534. }
  58535. this.shapes.push(shape);
  58536. }
  58537. /**
  58538. * @function SuperMap.Feature.Theme.Vector.prototype.geoTextToTF
  58539. * @description 转换文本要素。
  58540. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 GeoText。
  58541. */
  58542. }, {
  58543. key: "geoTextToTF",
  58544. value: function geoTextToTF(geometry) {
  58545. //参考位置,参考中心为
  58546. var location = this.location; //geometry 像素坐标
  58547. var localLX = this.getLocalXY(geometry); //赋 style
  58548. var style = new Object();
  58549. style.r = 6; //防止漏设此参数,默认 6 像素
  58550. style = Util.copyAttributesWithClip(style, this.style, ["x", "y", "text"]);
  58551. style.x = localLX[0] - location[0];
  58552. style.y = localLX[1] - location[1];
  58553. style.text = geometry.text; //创建图形
  58554. var shape = new SmicText({
  58555. style: style,
  58556. clickable: this.isClickAble,
  58557. hoverable: this.isHoverAble
  58558. }); //设置高亮样式
  58559. if (this.highlightStyle) {
  58560. shape.highlightStyle = this.highlightStyle;
  58561. } //设置参考中心,指定图形位置
  58562. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  58563. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  58564. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  58565. if (this.shapeOptions) {
  58566. Util.copyAttributesWithClip(shape, this.shapeOptions);
  58567. }
  58568. this.shapes.push(shape);
  58569. }
  58570. /**
  58571. * @function SuperMap.Feature.Theme.Vector.prototype.updateAndAddShapes
  58572. * @description 修改位置,针对地图平移操作,地图漫游操作后调用此函数。
  58573. */
  58574. }, {
  58575. key: "updateAndAddShapes",
  58576. value: function updateAndAddShapes() {
  58577. var newLocalLX = this.getLocalXY(this.lonlat);
  58578. this.location = newLocalLX;
  58579. var render = this.layer.renderer;
  58580. for (var i = 0, len = this.shapes.length; i < len; i++) {
  58581. var shape = this.shapes[i]; //设置参考中心,指定图形位置
  58582. shape.refOriginalPosition = newLocalLX;
  58583. render.addShape(shape);
  58584. }
  58585. }
  58586. /**
  58587. * @function SuperMap.Feature.Theme.Vector.prototype.getShapesCount
  58588. * @description 获得专题要素中可视化图形的数量。
  58589. * @returns {number} 可视化图形的数量。
  58590. */
  58591. }, {
  58592. key: "getShapesCount",
  58593. value: function getShapesCount() {
  58594. return this.shapes.length;
  58595. }
  58596. /**
  58597. * @function SuperMap.Feature.Theme.Vector.prototype.getLocalXY
  58598. * @description 地理坐标转为像素坐标。
  58599. * @param {SuperMap.LonLat} lonlat - 专题要素地理位置。
  58600. */
  58601. }, {
  58602. key: "getLocalXY",
  58603. value: function getLocalXY(lonlat) {
  58604. return this.layer.getLocalXY(lonlat);
  58605. }
  58606. }]);
  58607. return ThemeVector;
  58608. }(Theme_Theme);
  58609. SuperMap.Feature.Theme.ThemeVector = ThemeVector;
  58610. ;// CONCATENATED MODULE: ./src/common/overlay/feature/index.js
  58611. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  58612. * This program are made available under the terms of the Apache License, Version 2.0
  58613. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58614. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Group.js
  58615. function Group_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Group_typeof = function _typeof(obj) { return typeof obj; }; } else { Group_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Group_typeof(obj); }
  58616. function Group_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58617. 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); } }
  58618. function Group_createClass(Constructor, protoProps, staticProps) { if (protoProps) Group_defineProperties(Constructor.prototype, protoProps); if (staticProps) Group_defineProperties(Constructor, staticProps); return Constructor; }
  58619. function Group_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Group_get = Reflect.get; } else { Group_get = function _get(target, property, receiver) { var base = Group_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return Group_get(target, property, receiver || target); }
  58620. function Group_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Group_getPrototypeOf(object); if (object === null) break; } return object; }
  58621. function Group_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Group_setPrototypeOf(subClass, superClass); }
  58622. function Group_setPrototypeOf(o, p) { Group_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Group_setPrototypeOf(o, p); }
  58623. 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); }; }
  58624. function Group_possibleConstructorReturn(self, call) { if (call && (Group_typeof(call) === "object" || typeof call === "function")) { return call; } return Group_assertThisInitialized(self); }
  58625. function Group_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  58626. function Group_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  58627. function Group_getPrototypeOf(o) { Group_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Group_getPrototypeOf(o); }
  58628. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  58629. * This program are made available under the terms of the Apache License, Version 2.0
  58630. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58631. /**
  58632. * @class SuperMap.LevelRenderer.Group
  58633. * @category Visualization Theme
  58634. * @private
  58635. * @classdesc Group 是一个容器,可以插入子节点,Group 的变换也会被应用到子节点上。
  58636. * @extends {SuperMap.LevelRenderer.Transformable}
  58637. * (code)
  58638. * var g = new SuperMap.LevelRenderer.Group();
  58639. * var Circle = new SuperMap.LevelRenderer.Shape.Circle();
  58640. * g.position[0] = 100;
  58641. * g.position[1] = 100;
  58642. * g.addChild(new Circle({
  58643. * style: {
  58644. * x: 100,
  58645. * y: 100,
  58646. * r: 20,
  58647. * brushType: 'fill'
  58648. * }
  58649. * }));
  58650. * LR.addGroup(g);
  58651. * (end)
  58652. */
  58653. var Group = /*#__PURE__*/function (_SuperMap$mixin) {
  58654. Group_inherits(Group, _SuperMap$mixin);
  58655. var _super = Group_createSuper(Group);
  58656. /**
  58657. * @function SuperMap.LevelRenderer.Group.prototype.constructor
  58658. * @description 构造函数。
  58659. * @param {Array} options - Group 的配置(options)项,可以是 Group 的自有属性,也可以是自定义的属性。
  58660. */
  58661. function Group(options) {
  58662. var _this;
  58663. Group_classCallCheck(this, Group);
  58664. _this = _super.call(this, options);
  58665. options = options || {};
  58666. /**
  58667. * @member {string} SuperMap.LevelRenderer.Group.prototype.id
  58668. * @description Group 的唯一标识。
  58669. */
  58670. _this.id = null;
  58671. /**
  58672. * @readonly
  58673. * @member {string} [SuperMap.LevelRenderer.Group.prototype.type='group']
  58674. * @description 类型。
  58675. */
  58676. _this.type = 'group'; //http://www.w3.org/TR/2dcontext/#clipping-region
  58677. /**
  58678. * @member {string} SuperMap.LevelRenderer.Group.prototype.clipShape
  58679. * @description 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪,该图形会继承 Group 的变换。
  58680. */
  58681. _this.clipShape = null;
  58682. /**
  58683. * @member {Array} SuperMap.LevelRenderer.Group.prototype._children
  58684. * @description _children。
  58685. */
  58686. _this._children = [];
  58687. /**
  58688. * @member {Array} SuperMap.LevelRenderer.Group.prototype._storage
  58689. * @description _storage。
  58690. */
  58691. _this._storage = null;
  58692. /**
  58693. * @member {boolean} [SuperMap.LevelRenderer.Group.prototype.__dirty=true]
  58694. * @description __dirty。
  58695. */
  58696. _this.__dirty = true;
  58697. /**
  58698. * @member {boolean} [SuperMap.LevelRenderer.Group.prototype.ignore=false]
  58699. * @description 是否忽略该 Group 及其所有子节点。
  58700. */
  58701. _this.ignore = false;
  58702. Util.extend(Group_assertThisInitialized(_this), options);
  58703. _this.id = _this.id || Util.createUniqueID("smShapeGroup_");
  58704. _this.CLASS_NAME = "SuperMap.LevelRenderer.Group";
  58705. return _this;
  58706. }
  58707. /**
  58708. * @function SuperMap.LevelRenderer.Group.prototype.destroy
  58709. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  58710. */
  58711. Group_createClass(Group, [{
  58712. key: "destroy",
  58713. value: function destroy() {
  58714. this.id = null;
  58715. this.type = null;
  58716. this.clipShape = null;
  58717. this._children = null;
  58718. this._storage = null;
  58719. this.__dirty = null;
  58720. this.ignore = null;
  58721. Group_get(Group_getPrototypeOf(Group.prototype), "destroy", this).call(this);
  58722. }
  58723. /**
  58724. * @function SuperMap.LevelRenderer.Group.prototype.children
  58725. * @description 复制并返回一份新的包含所有儿子节点的数组。
  58726. * @returns {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
  58727. */
  58728. }, {
  58729. key: "children",
  58730. value: function children() {
  58731. return this._children.slice();
  58732. }
  58733. /**
  58734. * @function SuperMap.LevelRenderer.Group.prototype.childAt
  58735. * @description 获取指定 index 的儿子节点
  58736. * @param {number} idx - 节点索引。
  58737. * @returns {SuperMap.LevelRenderer.Shape} 图形。
  58738. */
  58739. }, {
  58740. key: "childAt",
  58741. value: function childAt(idx) {
  58742. return this._children[idx];
  58743. }
  58744. /**
  58745. * @function SuperMap.LevelRenderer.Group.prototype.addChild
  58746. * @description 添加子节点,可以是 Shape 或者 Group。
  58747. * @param {(SuperMap.LevelRenderer.Shape|SuperMap.LevelRenderer.Group)} child - 节点图形。
  58748. */
  58749. // TODO Type Check
  58750. }, {
  58751. key: "addChild",
  58752. value: function addChild(child) {
  58753. if (child == this) {
  58754. return;
  58755. }
  58756. if (child.parent == this) {
  58757. return;
  58758. }
  58759. if (child.parent) {
  58760. child.parent.removeChild(child);
  58761. }
  58762. this._children.push(child);
  58763. child.parent = this;
  58764. if (this._storage && this._storage !== child._storage) {
  58765. this._storage.addToMap(child);
  58766. if (child instanceof Group) {
  58767. child.addChildrenToStorage(this._storage);
  58768. }
  58769. }
  58770. }
  58771. /**
  58772. * @function SuperMap.LevelRenderer.Group.prototype.removeChild
  58773. * @description 移除子节点。
  58774. * @param {SuperMap.LevelRenderer.Shape} child - 需要移除的子节点图形。
  58775. */
  58776. }, {
  58777. key: "removeChild",
  58778. value: function removeChild(child) {
  58779. var idx = Util.indexOf(this._children, child);
  58780. this._children.splice(idx, 1);
  58781. child.parent = null;
  58782. if (this._storage) {
  58783. this._storage.delFromMap(child.id);
  58784. if (child instanceof Group) {
  58785. child.delChildrenFromStorage(this._storage);
  58786. }
  58787. }
  58788. }
  58789. /**
  58790. * @function SuperMap.LevelRenderer.Group.prototype.eachChild
  58791. * @description 遍历所有子节点。
  58792. * @param {function} cb - 回调函数。
  58793. * @param {Object} context - 上下文。
  58794. */
  58795. }, {
  58796. key: "eachChild",
  58797. value: function eachChild(cb, context) {
  58798. var haveContext = !!context;
  58799. for (var i = 0; i < this._children.length; i++) {
  58800. var child = this._children[i];
  58801. if (haveContext) {
  58802. cb.call(context, child);
  58803. } else {
  58804. cb(child);
  58805. }
  58806. }
  58807. }
  58808. /**
  58809. * @function SuperMap.LevelRenderer.Group.prototype.traverse
  58810. * @description 深度优先遍历所有子孙节点。
  58811. * @param {function} cb - 回调函数。
  58812. * @param {Object} context - 上下文。
  58813. */
  58814. }, {
  58815. key: "traverse",
  58816. value: function traverse(cb, context) {
  58817. var haveContext = !!context;
  58818. for (var i = 0; i < this._children.length; i++) {
  58819. var child = this._children[i];
  58820. if (haveContext) {
  58821. cb.call(context, child);
  58822. } else {
  58823. cb(child);
  58824. }
  58825. if (child.type === 'group') {
  58826. child.traverse(cb, context);
  58827. }
  58828. }
  58829. }
  58830. /**
  58831. * @function SuperMap.LevelRenderer.Group.prototype.addChildrenToStorage
  58832. * @description 把子图形添加到仓库。
  58833. * @param {SuperMap.LevelRenderer.Storage} storage - 图形仓库。
  58834. */
  58835. }, {
  58836. key: "addChildrenToStorage",
  58837. value: function addChildrenToStorage(storage) {
  58838. for (var i = 0; i < this._children.length; i++) {
  58839. var child = this._children[i];
  58840. storage.addToMap(child);
  58841. if (child.type === 'group') {
  58842. child.addChildrenToStorage(storage);
  58843. }
  58844. }
  58845. }
  58846. /**
  58847. * @function SuperMap.LevelRenderer.Group.prototype.delChildrenFromStorage
  58848. * @description 从仓库把子图形删除。
  58849. * @param {SuperMap.LevelRenderer.Storage} storage - 图形仓库。
  58850. */
  58851. }, {
  58852. key: "delChildrenFromStorage",
  58853. value: function delChildrenFromStorage(storage) {
  58854. for (var i = 0; i < this._children.length; i++) {
  58855. var child = this._children[i];
  58856. storage.delFromMap(child.id);
  58857. if (child.type === 'group') {
  58858. child.delChildrenFromStorage(storage);
  58859. }
  58860. }
  58861. }
  58862. /**
  58863. * @function SuperMap.LevelRenderer.Group.prototype.modSelf
  58864. * @description 是否修改。
  58865. */
  58866. }, {
  58867. key: "modSelf",
  58868. value: function modSelf() {
  58869. this.__dirty = true;
  58870. }
  58871. }]);
  58872. return Group;
  58873. }(SuperMap.mixin(Eventful, Transformable));
  58874. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Storage.js
  58875. function Storage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58876. 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); } }
  58877. function Storage_createClass(Constructor, protoProps, staticProps) { if (protoProps) Storage_defineProperties(Constructor.prototype, protoProps); if (staticProps) Storage_defineProperties(Constructor, staticProps); return Constructor; }
  58878. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  58879. * This program are made available under the terms of the Apache License, Version 2.0
  58880. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58881. /**
  58882. * @private
  58883. * @class SuperMap.LevelRenderer.Storage
  58884. * @category Visualization Theme
  58885. * @classdesc 内容(图像)仓库 (M) 。
  58886. */
  58887. var Storage = /*#__PURE__*/function () {
  58888. /**
  58889. * @function SuperMap.LevelRenderer.Storage.constructor
  58890. * @description 构造函数。
  58891. */
  58892. function Storage() {
  58893. Storage_classCallCheck(this, Storage);
  58894. /**
  58895. * @member {Object} SuperMap.LevelRenderer.Storage.prototype._elements
  58896. * @description 所有常规形状,id 索引的 map。
  58897. */
  58898. this._elements = {};
  58899. /**
  58900. * @member {Array} SuperMap.LevelRenderer.Storage.prototype._hoverElements
  58901. * @description 高亮层形状,不稳定,动态增删,数组位置也是 z 轴方向,靠前显示在下方。
  58902. *
  58903. */
  58904. this._hoverElements = [];
  58905. /**
  58906. * @member {Array} SuperMap.LevelRenderer.Storage.prototype._roots
  58907. * @description _roots。
  58908. *
  58909. */
  58910. this._roots = [];
  58911. /**
  58912. * @member {Array} SuperMap.LevelRenderer.Storage.prototype._shapeList
  58913. * @description _shapeList。
  58914. *
  58915. */
  58916. this._shapeList = [];
  58917. /**
  58918. * @member {number} SuperMap.LevelRenderer.Storage.prototype._shapeListOffset
  58919. * @description _shapeListOffset。默认值:0。
  58920. *
  58921. */
  58922. this._shapeListOffset = 0;
  58923. this.CLASS_NAME = "SuperMap.LevelRenderer.Storage";
  58924. }
  58925. /**
  58926. * @function SuperMap.LevelRenderer.Storage.prototype.destroy
  58927. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  58928. */
  58929. Storage_createClass(Storage, [{
  58930. key: "destroy",
  58931. value: function destroy() {
  58932. this.dispose();
  58933. this._shapeList = null;
  58934. this._shapeListOffset = null;
  58935. }
  58936. /**
  58937. * @function SuperMap.LevelRenderer.Storage.prototype.iterShape
  58938. * @description 遍历迭代器。
  58939. *
  58940. * @param {Function} fun - 迭代回调函数,return true终止迭代。
  58941. * @param {Object} option - 迭代参数,缺省为仅降序遍历普通层图形。
  58942. * @param {boolean} [hover=true] - 是否是高亮层图形。
  58943. * @param {string} [normal='down'] - 是否是普通层图形,迭代时是否指定及z轴顺序。可设值:'down' ,'up'。
  58944. * @param {boolean} [update=false] - 是否在迭代前更新形状列表。
  58945. * @return {SuperMap.LevelRenderer.Storage} this。
  58946. */
  58947. }, {
  58948. key: "iterShape",
  58949. value: function iterShape(fun, option) {
  58950. if (!option) {
  58951. var defaultIterateOption = {
  58952. hover: false,
  58953. normal: 'down',
  58954. update: false
  58955. };
  58956. option = defaultIterateOption;
  58957. }
  58958. if (option.hover) {
  58959. // 高亮层数据遍历
  58960. for (var i = 0, l = this._hoverElements.length; i < l; i++) {
  58961. var el = this._hoverElements[i];
  58962. el.updateTransform();
  58963. if (fun(el)) {
  58964. return this;
  58965. }
  58966. }
  58967. }
  58968. if (option.update) {
  58969. this.updateShapeList();
  58970. } // 遍历: 'down' | 'up'
  58971. switch (option.normal) {
  58972. case 'down':
  58973. {
  58974. // 降序遍历,高层优先
  58975. var _l = this._shapeList.length;
  58976. while (_l--) {
  58977. if (fun(this._shapeList[_l])) {
  58978. return this;
  58979. }
  58980. }
  58981. break;
  58982. }
  58983. // case 'up':
  58984. default:
  58985. {
  58986. // 升序遍历,底层优先
  58987. for (var _i = 0, _l2 = this._shapeList.length; _i < _l2; _i++) {
  58988. if (fun(this._shapeList[_i])) {
  58989. return this;
  58990. }
  58991. }
  58992. break;
  58993. }
  58994. }
  58995. return this;
  58996. }
  58997. /**
  58998. * @function SuperMap.LevelRenderer.Storage.prototype.getHoverShapes
  58999. * @param {boolean} [update=false] - 是否在返回前更新图形的变换。
  59000. * @return {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
  59001. */
  59002. }, {
  59003. key: "getHoverShapes",
  59004. value: function getHoverShapes(update) {
  59005. // hoverConnect
  59006. var hoverElements = [],
  59007. len = this._hoverElements.length;
  59008. for (var i = 0; i < len; i++) {
  59009. hoverElements.push(this._hoverElements[i]);
  59010. var target = this._hoverElements[i].hoverConnect;
  59011. if (target) {
  59012. var shape;
  59013. target = target instanceof Array ? target : [target];
  59014. for (var j = 0, k = target.length; j < k; j++) {
  59015. shape = target[j].id ? target[j] : this.get(target[j]);
  59016. if (shape) {
  59017. hoverElements.push(shape);
  59018. }
  59019. }
  59020. }
  59021. }
  59022. hoverElements.sort(Storage.shapeCompareFunc);
  59023. if (update) {
  59024. for (var _i2 = 0, l = hoverElements.length; _i2 < l; _i2++) {
  59025. hoverElements[_i2].updateTransform();
  59026. }
  59027. }
  59028. return hoverElements;
  59029. }
  59030. /**
  59031. * @function SuperMap.LevelRenderer.Storage.prototype.getShapeList
  59032. * @description 返回所有图形的绘制队列。
  59033. *
  59034. * @param {boolean} [update=false] - 是否在返回前更新该数组。 详见:<SuperMap.LevelRenderer.Shape> updateShapeList。
  59035. * @return {SuperMap.LevelRenderer.Shape} 图形。
  59036. */
  59037. }, {
  59038. key: "getShapeList",
  59039. value: function getShapeList(update) {
  59040. if (update) {
  59041. this.updateShapeList();
  59042. }
  59043. return this._shapeList;
  59044. }
  59045. /**
  59046. * @function SuperMap.LevelRenderer.Storage.prototype.updateShapeList
  59047. * @description 更新图形的绘制队列。每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中,最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列。
  59048. */
  59049. }, {
  59050. key: "updateShapeList",
  59051. value: function updateShapeList() {
  59052. this._shapeListOffset = 0;
  59053. var rootsLen = this._roots.length;
  59054. for (var i = 0; i < rootsLen; i++) {
  59055. var root = this._roots[i];
  59056. this._updateAndAddShape(root);
  59057. }
  59058. this._shapeList.length = this._shapeListOffset;
  59059. var shapeListLen = this._shapeList.length;
  59060. for (var _i3 = 0; _i3 < shapeListLen; _i3++) {
  59061. this._shapeList[_i3].__renderidx = _i3;
  59062. }
  59063. this._shapeList.sort(Storage.shapeCompareFunc);
  59064. }
  59065. /**
  59066. * @function SuperMap.LevelRenderer.Storage.prototype._updateAndAddShape
  59067. * @description 更新并添加图形。
  59068. *
  59069. */
  59070. }, {
  59071. key: "_updateAndAddShape",
  59072. value: function _updateAndAddShape(el, clipShapes) {
  59073. if (el.ignore) {
  59074. return;
  59075. }
  59076. el.updateTransform();
  59077. if (el.type == 'group') {
  59078. if (el.clipShape) {
  59079. // clipShape 的变换是基于 group 的变换
  59080. el.clipShape.parent = el;
  59081. el.clipShape.updateTransform(); // PENDING 效率影响
  59082. if (clipShapes) {
  59083. clipShapes = clipShapes.slice();
  59084. clipShapes.push(el.clipShape);
  59085. } else {
  59086. clipShapes = [el.clipShape];
  59087. }
  59088. }
  59089. for (var i = 0; i < el._children.length; i++) {
  59090. var child = el._children[i]; // Force to mark as dirty if group is dirty
  59091. child.__dirty = el.__dirty || child.__dirty;
  59092. this._updateAndAddShape(child, clipShapes);
  59093. } // Mark group clean here
  59094. el.__dirty = false;
  59095. } else {
  59096. el.__clipShapes = clipShapes;
  59097. this._shapeList[this._shapeListOffset++] = el;
  59098. }
  59099. }
  59100. /**
  59101. * @function SuperMap.LevelRenderer.Storage.prototype.mod
  59102. * @description 修改图形(Shape)或者组(Group)。
  59103. *
  59104. * @param {string} elId - 唯一标识。
  59105. * @param {Object} params - 参数。
  59106. * @return {SuperMap.LevelRenderer.Storage} this。
  59107. */
  59108. }, {
  59109. key: "mod",
  59110. value: function mod(elId, params) {
  59111. var el = this._elements[elId];
  59112. if (el) {
  59113. el.modSelf();
  59114. if (params) {
  59115. // 如果第二个参数直接使用 shape
  59116. // parent, _storage, __startClip 三个属性会有循环引用
  59117. // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数
  59118. if (params.parent || params._storage || params.__startClip) {
  59119. var target = {};
  59120. for (var name in params) {
  59121. if (name == 'parent' || name == '_storage' || name == '__startClip') {
  59122. continue;
  59123. }
  59124. if (params.hasOwnProperty(name)) {
  59125. target[name] = params[name];
  59126. }
  59127. }
  59128. new Util_Util().merge(el, target, true);
  59129. } else {
  59130. new Util_Util().merge(el, params, true);
  59131. }
  59132. }
  59133. }
  59134. return this;
  59135. }
  59136. /**
  59137. * @function SuperMap.LevelRenderer.Storage.prototype.drift
  59138. * @description 移动指定的图形(Shape)的位置。
  59139. * @param {string} shapeId - 唯一标识。
  59140. * @param {number} dx
  59141. * @param {number} dy
  59142. * @return {SuperMap.LevelRenderer.Storage} this。
  59143. */
  59144. }, {
  59145. key: "drift",
  59146. value: function drift(shapeId, dx, dy) {
  59147. var shape = this._elements[shapeId];
  59148. if (shape) {
  59149. shape.needTransform = true;
  59150. if (shape.draggable === 'horizontal') {
  59151. dy = 0;
  59152. } else if (shape.draggable === 'vertical') {
  59153. dx = 0;
  59154. }
  59155. if (!shape.ondrift // ondrift
  59156. // 有onbrush并且调用执行返回false或undefined则继续
  59157. || shape.ondrift && !shape.ondrift(dx, dy)) {
  59158. shape.drift(dx, dy);
  59159. }
  59160. }
  59161. return this;
  59162. }
  59163. /**
  59164. * @function SuperMap.LevelRenderer.Storage.prototype.addHover
  59165. * @description 添加高亮层数据。
  59166. * @param {SuperMap.LevelRenderer.Shape} shape - 图形。
  59167. * @return {SuperMap.LevelRenderer.Storage} this。
  59168. */
  59169. }, {
  59170. key: "addHover",
  59171. value: function addHover(shape) {
  59172. shape.updateNeedTransform();
  59173. this._hoverElements.push(shape);
  59174. return this;
  59175. }
  59176. /**
  59177. * @function SuperMap.LevelRenderer.Storage.prototype.delHover
  59178. * @description 清空高亮层数据。
  59179. * @return {SuperMap.LevelRenderer.Storage} this。
  59180. */
  59181. }, {
  59182. key: "delHover",
  59183. value: function delHover() {
  59184. this._hoverElements = [];
  59185. return this;
  59186. }
  59187. /**
  59188. * @function SuperMap.LevelRenderer.Storage.prototype.hasHoverShape
  59189. * @description 是否有图形在高亮层里。
  59190. * @return {boolean} 是否有图形在高亮层里。
  59191. */
  59192. }, {
  59193. key: "hasHoverShape",
  59194. value: function hasHoverShape() {
  59195. return this._hoverElements.length > 0;
  59196. }
  59197. /**
  59198. * @function SuperMap.LevelRenderer.Storage.prototype.addRoot
  59199. * @description 添加图形(Shape)或者组(Group)到根节点。
  59200. *
  59201. * @param {(SuperMap.LevelRenderer.Shape/SuperMap.LevelRenderer.Group)} el - 图形。
  59202. *
  59203. */
  59204. }, {
  59205. key: "addRoot",
  59206. value: function addRoot(el) {
  59207. if (el instanceof Group) {
  59208. el.addChildrenToStorage(this);
  59209. }
  59210. this.addToMap(el);
  59211. this._roots.push(el);
  59212. }
  59213. /**
  59214. * @function SuperMap.LevelRenderer.Storage.prototype.delRoot
  59215. * @description 删除指定的图形(Shape)或者组(Group)。
  59216. *
  59217. * @param {Array.<string>} elId - 删除图形(Shape)或者组(Group)的 id 数组。如果为空清空整个Storage。
  59218. *
  59219. */
  59220. }, {
  59221. key: "delRoot",
  59222. value: function delRoot(elId) {
  59223. if (typeof elId == 'undefined') {
  59224. // 不指定elId清空
  59225. for (var i = 0; i < this._roots.length; i++) {
  59226. var root = this._roots[i];
  59227. if (root instanceof Group) {
  59228. root.delChildrenFromStorage(this);
  59229. }
  59230. }
  59231. this._elements = {};
  59232. this._hoverElements = [];
  59233. this._roots = [];
  59234. return;
  59235. }
  59236. if (elId instanceof Array) {
  59237. var elIdLen = elId.length;
  59238. for (var _i4 = 0; _i4 < elIdLen; _i4++) {
  59239. this.delRoot(elId[_i4]);
  59240. }
  59241. return;
  59242. }
  59243. var el;
  59244. if (typeof elId == 'string') {
  59245. el = this._elements[elId];
  59246. } else {
  59247. el = elId;
  59248. }
  59249. var idx = new Util_Util().indexOf(this._roots, el);
  59250. if (idx >= 0) {
  59251. this.delFromMap(el.id);
  59252. this._roots.splice(idx, 1);
  59253. if (el instanceof Group) {
  59254. el.delChildrenFromStorage(this);
  59255. }
  59256. }
  59257. }
  59258. /**
  59259. * @function SuperMap.LevelRenderer.Storage.prototype.addToMap
  59260. * @description 添加图形到 map。
  59261. *
  59262. * @param {SuperMap.LevelRenderer.Shape} el - 图形。
  59263. * @return {SuperMap.LevelRenderer.Storage} this。
  59264. */
  59265. }, {
  59266. key: "addToMap",
  59267. value: function addToMap(el) {
  59268. if (el instanceof Group) {
  59269. el._storage = this;
  59270. }
  59271. el.modSelf();
  59272. this._elements[el.id] = el;
  59273. return this;
  59274. }
  59275. /**
  59276. * @function SuperMap.LevelRenderer.Storage.prototype.get
  59277. * @description 获取指定图形。
  59278. *
  59279. * @param {string} elId - 图形 id。
  59280. * @return {SuperMap.LevelRenderer.Shape} 图形。
  59281. */
  59282. }, {
  59283. key: "get",
  59284. value: function get(elId) {
  59285. return this._elements[elId];
  59286. }
  59287. /**
  59288. * @function SuperMap.LevelRenderer.Storage.prototype.delFromMap
  59289. * @description 从 map 中删除指定图形。
  59290. *
  59291. * @param {string} elId - 图形id。
  59292. * @return {SuperMap.LevelRenderer.Storage} this。
  59293. */
  59294. }, {
  59295. key: "delFromMap",
  59296. value: function delFromMap(elId) {
  59297. var el = this._elements[elId];
  59298. if (el) {
  59299. delete this._elements[elId];
  59300. if (el instanceof Group) {
  59301. el._storage = null;
  59302. }
  59303. }
  59304. return this;
  59305. }
  59306. /**
  59307. * @function SuperMap.LevelRenderer.Storage.prototype.dispose
  59308. * @description 清空并且释放 Storage。
  59309. */
  59310. }, {
  59311. key: "dispose",
  59312. value: function dispose() {
  59313. this._elements = null; // this._renderList = null;
  59314. this._roots = null;
  59315. this._hoverElements = null;
  59316. }
  59317. }], [{
  59318. key: "shapeCompareFunc",
  59319. value: function shapeCompareFunc(a, b) {
  59320. if (a.zlevel == b.zlevel) {
  59321. if (a.z == b.z) {
  59322. return a.__renderidx - b.__renderidx;
  59323. }
  59324. return a.z - b.z;
  59325. }
  59326. return a.zlevel - b.zlevel;
  59327. }
  59328. }]);
  59329. return Storage;
  59330. }();
  59331. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Painter.js
  59332. function Painter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Painter_typeof = function _typeof(obj) { return typeof obj; }; } else { Painter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Painter_typeof(obj); }
  59333. function Painter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Painter_setPrototypeOf(subClass, superClass); }
  59334. function Painter_setPrototypeOf(o, p) { Painter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Painter_setPrototypeOf(o, p); }
  59335. 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); }; }
  59336. function Painter_possibleConstructorReturn(self, call) { if (call && (Painter_typeof(call) === "object" || typeof call === "function")) { return call; } return Painter_assertThisInitialized(self); }
  59337. function Painter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  59338. function Painter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  59339. function Painter_getPrototypeOf(o) { Painter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Painter_getPrototypeOf(o); }
  59340. function Painter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59341. 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); } }
  59342. function Painter_createClass(Constructor, protoProps, staticProps) { if (protoProps) Painter_defineProperties(Constructor.prototype, protoProps); if (staticProps) Painter_defineProperties(Constructor, staticProps); return Constructor; }
  59343. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  59344. * This program are made available under the terms of the Apache License, Version 2.0
  59345. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59346. /**
  59347. * @private
  59348. * @class SuperMap.LevelRenderer.Painter
  59349. * @category Visualization Theme
  59350. * @classdesc Painter 绘图模块。
  59351. */
  59352. var Painter = /*#__PURE__*/function () {
  59353. /**
  59354. * @function SuperMap.LevelRenderer.Painter.constructor
  59355. * @description 构造函数。
  59356. *
  59357. * @param {HTMLElement} root - 绘图区域(DIV)。
  59358. * @param {SuperMap.LevelRenderer.Storage} storage - Storage 实例。
  59359. *
  59360. */
  59361. function Painter(root, storage) {
  59362. Painter_classCallCheck(this, Painter);
  59363. /**
  59364. * @member {HTMLElement} SuperMap.LevelRenderer.Painter.prototype.root
  59365. * @description 绘图容器。
  59366. *
  59367. */
  59368. this.root = root;
  59369. /**
  59370. * @member {Array} SuperMap.LevelRenderer.Painter.prototype.storage
  59371. * @description 图形仓库。
  59372. *
  59373. */
  59374. this.storage = storage;
  59375. /**
  59376. * @member {HTMLElement} SuperMap.LevelRenderer.Painter.prototype._domRoot
  59377. * @description 容器根 dom 对象。
  59378. *
  59379. */
  59380. this._domRoot = null;
  59381. /**
  59382. * @member {Object} SuperMap.LevelRenderer.Painter.prototype._layers
  59383. * @description 绘制层对象。
  59384. *
  59385. */
  59386. this._layers = {};
  59387. /**
  59388. * @member {Array} SuperMap.LevelRenderer.Painter.prototype._zlevelList
  59389. * @description 层列表。
  59390. *
  59391. */
  59392. this._zlevelList = [];
  59393. /**
  59394. * @member {Object} SuperMap.LevelRenderer.Painter.prototype._layerConfig
  59395. * @description 绘制层配置对象。
  59396. *
  59397. */
  59398. this._layerConfig = {};
  59399. /**
  59400. * @member {Object} SuperMap.LevelRenderer.Painter.prototype._bgDom
  59401. * @description 背景层 Canvas (Dom)。
  59402. *
  59403. */
  59404. this._bgDom = null;
  59405. /**
  59406. * @member {Function} SuperMap.LevelRenderer.Painter.prototype.shapeToImage
  59407. * @description 形状转图像函数。
  59408. *
  59409. */
  59410. this.shapeToImage = null; // retina 屏幕优化
  59411. Painter.devicePixelRatio = Math.max(window.devicePixelRatio || 1, 1);
  59412. this.CLASS_NAME = "SuperMap.LevelRenderer.Painter";
  59413. this.root.innerHTML = '';
  59414. this._width = this._getWidth(); // 宽,缓存记录
  59415. this._height = this._getHeight(); // 高,缓存记录
  59416. var domRoot = document.createElement('div');
  59417. this._domRoot = domRoot; // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬
  59418. domRoot.style.position = 'relative';
  59419. domRoot.style.overflow = 'hidden';
  59420. domRoot.style.width = this._width + 'px';
  59421. domRoot.style.height = this._height + 'px';
  59422. this.root.appendChild(domRoot);
  59423. this.shapeToImage = this._createShapeToImageProcessor(); // 创建各层canvas
  59424. // 背景
  59425. //this._bgDom = Painter.createDom('bg', 'div', this);
  59426. this._bgDom = Painter.createDom(Util.createUniqueID("SuperMap.Theme_background_"), 'div', this);
  59427. domRoot.appendChild(this._bgDom);
  59428. this._bgDom.onselectstart = returnFalse;
  59429. this._bgDom.style['-webkit-user-select'] = 'none';
  59430. this._bgDom.style['user-select'] = 'none';
  59431. this._bgDom.style['-webkit-touch-callout'] = 'none'; // 高亮
  59432. //var hoverLayer = new PaintLayer('_hoverLayer_', this);
  59433. var hoverLayer = new PaintLayer(Util.createUniqueID("_highLightLayer_"), this);
  59434. this._layers['hover'] = hoverLayer;
  59435. domRoot.appendChild(hoverLayer.dom);
  59436. hoverLayer.initContext();
  59437. hoverLayer.dom.onselectstart = returnFalse;
  59438. hoverLayer.dom.style['-webkit-user-select'] = 'none';
  59439. hoverLayer.dom.style['user-select'] = 'none';
  59440. hoverLayer.dom.style['-webkit-touch-callout'] = 'none';
  59441. var me = this;
  59442. this.updatePainter = function (shapeList, callback) {
  59443. me.refreshShapes(shapeList, callback);
  59444. }; // 返回false的方法,用于避免页面被选中
  59445. function returnFalse() {
  59446. return false;
  59447. }
  59448. /* eslint-disable */
  59449. // 什么都不干的空方法
  59450. function doNothing() {//NOSONAR
  59451. }
  59452. /* eslint-enable */
  59453. }
  59454. /**
  59455. * @function SuperMap.LevelRenderer.Painter.prototype.destroy
  59456. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  59457. */
  59458. Painter_createClass(Painter, [{
  59459. key: "destroy",
  59460. value: function destroy() {
  59461. this.dispose();
  59462. this._zlevelList = null;
  59463. this._layerConfig = null;
  59464. this._bgDom = null;
  59465. this.shapeToImage = null;
  59466. }
  59467. /**
  59468. * @function SuperMap.LevelRenderer.Painter.prototype.render
  59469. * @description 渲染。首次绘图,创建各种 dom 和 context。
  59470. *
  59471. * @param {Function} callback - 绘画结束后的回调函数。
  59472. * @return {SuperMap.LevelRenderer.Painter} this。
  59473. */
  59474. }, {
  59475. key: "render",
  59476. value: function render(callback) {
  59477. // TODO
  59478. this.refresh(callback, true);
  59479. return this;
  59480. }
  59481. /**
  59482. * @function SuperMap.LevelRenderer.Painter.prototype.refresh
  59483. * @description 刷新。
  59484. *
  59485. * @param {Function} callback - 刷新结束后的回调函数。
  59486. * @param {boolean} paintAll - 强制绘制所有 shape。
  59487. * @return {SuperMap.LevelRenderer.Painter} this。
  59488. */
  59489. }, {
  59490. key: "refresh",
  59491. value: function refresh(callback, paintAll) {
  59492. var list = this.storage.getShapeList(true);
  59493. this._paintList(list, paintAll);
  59494. if (typeof callback == 'function') {
  59495. callback();
  59496. }
  59497. return this;
  59498. }
  59499. /**
  59500. * Method: _paintList
  59501. * 按列表绘制图形。
  59502. */
  59503. }, {
  59504. key: "_paintList",
  59505. value: function _paintList(list, paintAll) {
  59506. if (typeof paintAll == 'undefined') {
  59507. paintAll = false;
  59508. }
  59509. this._updateLayerStatus(list);
  59510. var currentLayer;
  59511. var currentZLevel;
  59512. var ctx;
  59513. for (var id in this._layers) {
  59514. if (id !== 'hover') {
  59515. this._layers[id].unusedCount++;
  59516. this._layers[id].updateTransform();
  59517. }
  59518. }
  59519. var invTransform = [];
  59520. for (var i = 0, l = list.length; i < l; i++) {
  59521. var shape = list[i];
  59522. if (currentZLevel !== shape.zlevel) {
  59523. if (currentLayer && currentLayer.needTransform) {
  59524. ctx.restore();
  59525. }
  59526. currentLayer = this.getLayer(shape.zlevel);
  59527. ctx = currentLayer.ctx;
  59528. currentZLevel = shape.zlevel; // Reset the count
  59529. currentLayer.unusedCount = 0;
  59530. if (currentLayer.dirty || paintAll) {
  59531. currentLayer.clear();
  59532. }
  59533. if (currentLayer.needTransform) {
  59534. ctx.save();
  59535. currentLayer.setTransform(ctx);
  59536. }
  59537. } // Start group clipping
  59538. if (ctx && shape.__startClip) {
  59539. var clipShape = shape.__startClip;
  59540. ctx.save(); // Set transform
  59541. if (clipShape.needTransform) {
  59542. var m = clipShape.transform;
  59543. SUtil_SUtil.Util_matrix.invert(invTransform, m);
  59544. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  59545. }
  59546. ctx.beginPath();
  59547. clipShape.buildPath(ctx, clipShape.style);
  59548. ctx.clip(); // Transform back
  59549. if (clipShape.needTransform) {
  59550. var _m = invTransform;
  59551. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  59552. }
  59553. }
  59554. if ((currentLayer && currentLayer.dirty || paintAll) && !shape.invisible) {
  59555. if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) {
  59556. if (Config.catchBrushException) {
  59557. try {
  59558. shape.brush(ctx, false, this.updatePainter);
  59559. } catch (error) {
  59560. SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  59561. }
  59562. } else {
  59563. shape.brush(ctx, false, this.updatePainter);
  59564. }
  59565. }
  59566. } // Stop group clipping
  59567. if (ctx && shape.__stopClip) {
  59568. ctx.restore();
  59569. }
  59570. shape.__dirty = false;
  59571. }
  59572. if (ctx && currentLayer && currentLayer.needTransform) {
  59573. ctx.restore();
  59574. }
  59575. for (var _id in this._layers) {
  59576. if (_id !== 'hover') {
  59577. var layer = this._layers[_id];
  59578. layer.dirty = false; // 删除过期的层
  59579. // PENDING
  59580. // if (layer.unusedCount >= 500) {
  59581. // this.delLayer(id);
  59582. // }
  59583. if (layer.unusedCount == 1) {
  59584. layer.clear();
  59585. }
  59586. }
  59587. }
  59588. }
  59589. /**
  59590. * @function SuperMap.LevelRenderer.Painter.prototype.getLayer
  59591. * @description 获取 zlevel 所在层,如果不存在则会创建一个新的层。
  59592. *
  59593. * @param {number} zlevel - zlevel。
  59594. * @return {SuperMap.LevelRenderer.Painter} this。
  59595. */
  59596. }, {
  59597. key: "getLayer",
  59598. value: function getLayer(zlevel) {
  59599. // Change draw layer
  59600. var currentLayer = this._layers[zlevel];
  59601. if (!currentLayer) {
  59602. var len = this._zlevelList.length;
  59603. var prevLayer = null;
  59604. var i = -1;
  59605. if (len > 0 && zlevel > this._zlevelList[0]) {
  59606. for (i = 0; i < len - 1; i++) {
  59607. if (this._zlevelList[i] < zlevel && this._zlevelList[i + 1] > zlevel) {
  59608. break;
  59609. }
  59610. }
  59611. prevLayer = this._layers[this._zlevelList[i]];
  59612. }
  59613. this._zlevelList.splice(i + 1, 0, zlevel); // Create a new layer
  59614. //currentLayer = new PaintLayer(zlevel, this);
  59615. currentLayer = new PaintLayer(Util.createUniqueID("_levelLayer_" + zlevel), this);
  59616. var prevDom = prevLayer ? prevLayer.dom : this._bgDom;
  59617. if (prevDom.nextSibling) {
  59618. prevDom.parentNode.insertBefore(currentLayer.dom, prevDom.nextSibling);
  59619. } else {
  59620. prevDom.parentNode.appendChild(currentLayer.dom);
  59621. }
  59622. currentLayer.initContext();
  59623. this._layers[zlevel] = currentLayer;
  59624. if (this._layerConfig[zlevel]) {
  59625. new Util_Util().merge(currentLayer, this._layerConfig[zlevel], true);
  59626. }
  59627. currentLayer.updateTransform();
  59628. }
  59629. return currentLayer;
  59630. }
  59631. /**
  59632. * @function SuperMap.LevelRenderer.Painter.prototype.getLayers
  59633. * @description 获取所有已创建的层。
  59634. * @return {Array.<Painter.Layer>} 已创建的层
  59635. */
  59636. }, {
  59637. key: "getLayers",
  59638. value: function getLayers() {
  59639. return this._layers;
  59640. }
  59641. /**
  59642. * Method: _updateLayerStatus
  59643. * 更新绘制层状态。
  59644. */
  59645. }, {
  59646. key: "_updateLayerStatus",
  59647. value: function _updateLayerStatus(list) {
  59648. var layers = this._layers;
  59649. var elCounts = {};
  59650. for (var z in layers) {
  59651. if (z !== 'hover') {
  59652. elCounts[z] = layers[z].elCount;
  59653. layers[z].elCount = 0;
  59654. }
  59655. }
  59656. for (var i = 0; i < list.length; i++) {
  59657. var shape = list[i];
  59658. var zlevel = shape.zlevel;
  59659. var layer = layers[zlevel];
  59660. if (layer) {
  59661. layer.elCount++; // 已经被标记为需要刷新
  59662. if (layer.dirty) {
  59663. continue;
  59664. }
  59665. layer.dirty = shape.__dirty;
  59666. }
  59667. } // 层中的元素数量有发生变化
  59668. for (var _z in layers) {
  59669. if (_z !== 'hover') {
  59670. if (elCounts[_z] !== layers[_z].elCount) {
  59671. layers[_z].dirty = true;
  59672. }
  59673. }
  59674. }
  59675. }
  59676. /**
  59677. * @function SuperMap.LevelRenderer.Painter.prototype.refreshShapes
  59678. * @description 更新的图形元素列表。
  59679. *
  59680. * @param {number} shapeList - 需要更新的图形元素列表。
  59681. * @param {number} callback - 视图更新后回调函数。
  59682. * @return {SuperMap.LevelRenderer.Painter} this。
  59683. */
  59684. }, {
  59685. key: "refreshShapes",
  59686. value: function refreshShapes(shapeList, callback) {
  59687. for (var i = 0, l = shapeList.length; i < l; i++) {
  59688. var shape = shapeList[i];
  59689. this.storage.mod(shape.id);
  59690. }
  59691. this.refresh(callback);
  59692. return this;
  59693. }
  59694. /**
  59695. * @function SuperMap.LevelRenderer.Painter.prototype.clear
  59696. * @description 清除 hover 层外所有内容。
  59697. * @return {SuperMap.LevelRenderer.Painter} this。
  59698. */
  59699. }, {
  59700. key: "clear",
  59701. value: function clear() {
  59702. for (var k in this._layers) {
  59703. if (k == 'hover') {
  59704. continue;
  59705. }
  59706. this._layers[k].clear();
  59707. }
  59708. return this;
  59709. }
  59710. /**
  59711. * @function SuperMap.LevelRenderer.Painter.prototype.modLayer
  59712. * @description 修改指定 zlevel 的绘制参数。
  59713. *
  59714. * @param {string} zlevel - zlevel。
  59715. * @param {Object} config - 配置对象。
  59716. * @param {string} [config.clearColor=0] - 每次清空画布的颜色。
  59717. * @param {boolean} [config.motionBlur=false] - 是否开启动态模糊。
  59718. * @param {number} [config.lastFrameAlpha=0.7] - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  59719. * @param {Array.<number>} config.position - 层的平移。
  59720. * @param {Array.<number>} config.rotation - 层的旋转。
  59721. * @param {Array.<number>} config.scale - 层的缩放。
  59722. * @param {boolean} config.zoomable - 层是否支持鼠标缩放操作。默认值:false。
  59723. * @param {boolean} config.panable - 层是否支持鼠标平移操作。默认值:false。
  59724. *
  59725. */
  59726. }, {
  59727. key: "modLayer",
  59728. value: function modLayer(zlevel, config) {
  59729. if (config) {
  59730. if (!this._layerConfig[zlevel]) {
  59731. this._layerConfig[zlevel] = config;
  59732. } else {
  59733. new Util_Util().merge(this._layerConfig[zlevel], config, true);
  59734. }
  59735. var layer = this._layers[zlevel];
  59736. if (layer) {
  59737. new Util_Util().merge(layer, this._layerConfig[zlevel], true);
  59738. }
  59739. }
  59740. }
  59741. /**
  59742. * @function SuperMap.LevelRenderer.Painter.prototype.delLayer
  59743. * @description 删除指定层。
  59744. *
  59745. * @param {string} zlevel - 层所在的 zlevel。
  59746. */
  59747. }, {
  59748. key: "delLayer",
  59749. value: function delLayer(zlevel) {
  59750. var layer = this._layers[zlevel];
  59751. if (!layer) {
  59752. return;
  59753. } // Save config
  59754. this.modLayer(zlevel, {
  59755. position: layer.position,
  59756. rotation: layer.rotation,
  59757. scale: layer.scale
  59758. });
  59759. layer.dom.parentNode.removeChild(layer.dom);
  59760. delete this._layers[zlevel];
  59761. this._zlevelList.splice(new Util_Util().indexOf(this._zlevelList, zlevel), 1);
  59762. }
  59763. /**
  59764. * @function SuperMap.LevelRenderer.Painter.prototype.refreshHover
  59765. * @description 刷新 hover 层。
  59766. * @return {SuperMap.LevelRenderer.Painter} this。
  59767. */
  59768. }, {
  59769. key: "refreshHover",
  59770. value: function refreshHover() {
  59771. this.clearHover();
  59772. var list = this.storage.getHoverShapes(true);
  59773. for (var i = 0, l = list.length; i < l; i++) {
  59774. this._brushHover(list[i]);
  59775. }
  59776. this.storage.delHover();
  59777. return this;
  59778. }
  59779. /**
  59780. * @function SuperMap.LevelRenderer.Painter.prototype.clearHover
  59781. * @description 清除 hover 层所有内容。
  59782. * @return {SuperMap.LevelRenderer.Painter} this。
  59783. */
  59784. }, {
  59785. key: "clearHover",
  59786. value: function clearHover() {
  59787. var hover = this._layers.hover;
  59788. hover && hover.clear();
  59789. return this;
  59790. }
  59791. /**
  59792. * @function SuperMap.LevelRenderer.Painter.prototype.resize
  59793. * @description 区域大小变化后重绘。
  59794. * @return {SuperMap.LevelRenderer.Painter} this。
  59795. */
  59796. }, {
  59797. key: "resize",
  59798. value: function resize() {
  59799. var domRoot = this._domRoot;
  59800. domRoot.style.display = 'none';
  59801. var width = this._getWidth();
  59802. var height = this._getHeight();
  59803. domRoot.style.display = ''; // 优化没有实际改变的resize
  59804. if (this._width != width || height != this._height) {
  59805. this._width = width;
  59806. this._height = height;
  59807. domRoot.style.width = width + 'px';
  59808. domRoot.style.height = height + 'px';
  59809. for (var id in this._layers) {
  59810. this._layers[id].resize(width, height);
  59811. }
  59812. this.refresh(null, true);
  59813. }
  59814. return this;
  59815. }
  59816. /**
  59817. * @function SuperMap.LevelRenderer.Painter.prototype.clearLayer
  59818. * @description 清除指定的一个层。
  59819. * @param {number} zLevel - 层。
  59820. */
  59821. }, {
  59822. key: "clearLayer",
  59823. value: function clearLayer(zLevel) {
  59824. var layer = this._layers[zLevel];
  59825. if (layer) {
  59826. layer.clear();
  59827. }
  59828. }
  59829. /**
  59830. * @function SuperMap.LevelRenderer.Painter.prototype.dispose
  59831. * @description 释放。
  59832. *
  59833. */
  59834. }, {
  59835. key: "dispose",
  59836. value: function dispose() {
  59837. this.root.innerHTML = '';
  59838. this.root = null;
  59839. this.storage = null;
  59840. this._domRoot = null;
  59841. this._layers = null;
  59842. }
  59843. /**
  59844. * @function SuperMap.LevelRenderer.Painter.prototype.getDomHover
  59845. * @description 获取 Hover 层的 Dom。
  59846. */
  59847. }, {
  59848. key: "getDomHover",
  59849. value: function getDomHover() {
  59850. return this._layers.hover.dom;
  59851. }
  59852. /**
  59853. * @function SuperMap.LevelRenderer.Painter.prototype.toDataURL
  59854. * @description 图像导出。
  59855. * @param {string} type - 图片类型。
  59856. * @param {string} backgroundColor - 背景色。默认值:'#fff'。
  59857. * @param {Object} args
  59858. * @return {string} 图片的Base64 url。
  59859. */
  59860. }, {
  59861. key: "toDataURL",
  59862. value: function toDataURL(type, backgroundColor, args) {
  59863. //var imageDom = Painter.createDom('image', 'canvas', this);
  59864. var imageDom = Painter.createDom(Util.createUniqueID("SuperMap.Theme.image_"), 'canvas', this);
  59865. this._bgDom.appendChild(imageDom);
  59866. var ctx = imageDom.getContext('2d');
  59867. Painter.devicePixelRatio != 1 && ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  59868. ctx.fillStyle = backgroundColor || '#fff';
  59869. ctx.rect(0, 0, this._width * Painter.devicePixelRatio, this._height * Painter.devicePixelRatio);
  59870. ctx.fill();
  59871. var self = this; // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠
  59872. this.storage.iterShape(function (shape) {
  59873. if (!shape.invisible) {
  59874. if (!shape.onbrush // 没有onbrush
  59875. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  59876. || shape.onbrush && !shape.onbrush(ctx, false)) {
  59877. if (Config.catchBrushException) {
  59878. try {
  59879. shape.brush(ctx, false, self.updatePainter);
  59880. } catch (error) {
  59881. SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  59882. }
  59883. } else {
  59884. shape.brush(ctx, false, self.updatePainter);
  59885. }
  59886. }
  59887. }
  59888. }, {
  59889. normal: 'up',
  59890. update: true
  59891. });
  59892. var image = imageDom.toDataURL(type, args);
  59893. ctx = null;
  59894. this._bgDom.removeChild(imageDom);
  59895. return image;
  59896. }
  59897. /**
  59898. * @function SuperMap.LevelRenderer.Painter.prototype.getWidth
  59899. * @description 获取绘图区域宽度。
  59900. * @return {number} 绘图区域宽度。
  59901. */
  59902. }, {
  59903. key: "getWidth",
  59904. value: function getWidth() {
  59905. return this._width;
  59906. }
  59907. /**
  59908. * @function SuperMap.LevelRenderer.Painter.prototype.getHeight
  59909. * @description 获取绘图区域高度。
  59910. * @return {number} 绘图区域高度。
  59911. */
  59912. }, {
  59913. key: "getHeight",
  59914. value: function getHeight() {
  59915. return this._height;
  59916. }
  59917. /**
  59918. * Method: _getWidth
  59919. *
  59920. */
  59921. }, {
  59922. key: "_getWidth",
  59923. value: function _getWidth() {
  59924. var root = this.root;
  59925. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  59926. return ((root.clientWidth || parseInt(stl.width, 10)) - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴
  59927. - parseInt(stl.paddingRight, 10)).toFixed(0) - 0;
  59928. }
  59929. /**
  59930. * Method: _getHeight
  59931. *
  59932. */
  59933. }, {
  59934. key: "_getHeight",
  59935. value: function _getHeight() {
  59936. var root = this.root;
  59937. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  59938. return ((root.clientHeight || parseInt(stl.height, 10)) - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴
  59939. - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0;
  59940. }
  59941. /**
  59942. * Method: _brushHover
  59943. *
  59944. */
  59945. }, {
  59946. key: "_brushHover",
  59947. value: function _brushHover(shape) {
  59948. var ctx = this._layers.hover.ctx;
  59949. if (!shape.onbrush // 没有onbrush
  59950. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  59951. || shape.onbrush && !shape.onbrush(ctx, true)) {
  59952. var layer = this.getLayer(shape.zlevel);
  59953. if (layer.needTransform) {
  59954. ctx.save();
  59955. layer.setTransform(ctx);
  59956. } // Retina 优化
  59957. if (Config.catchBrushException) {
  59958. try {
  59959. shape.brush(ctx, true, this.updatePainter);
  59960. } catch (error) {
  59961. SUtil_SUtil.Util_log(error, 'hoverBrush error of ' + shape.type, shape);
  59962. }
  59963. } else {
  59964. shape.brush(ctx, true, this.updatePainter);
  59965. }
  59966. if (layer.needTransform) {
  59967. ctx.restore();
  59968. }
  59969. }
  59970. }
  59971. /**
  59972. * Method: _shapeToImage
  59973. *
  59974. */
  59975. }, {
  59976. key: "_shapeToImage",
  59977. value: function _shapeToImage(id, shape, width, height, devicePixelRatio) {
  59978. var canvas = document.createElement('canvas');
  59979. var ctx = canvas.getContext('2d');
  59980. var _devicePixelRatio = devicePixelRatio || window.devicePixelRatio || 1;
  59981. canvas.style.width = width + 'px';
  59982. canvas.style.height = height + 'px';
  59983. canvas.setAttribute('width', width * _devicePixelRatio);
  59984. canvas.setAttribute('height', height * _devicePixelRatio);
  59985. ctx.clearRect(0, 0, width * _devicePixelRatio, height * _devicePixelRatio);
  59986. var shapeTransform = {
  59987. position: shape.position,
  59988. rotation: shape.rotation,
  59989. scale: shape.scale
  59990. };
  59991. shape.position = [0, 0, 0];
  59992. shape.rotation = 0;
  59993. shape.scale = [1, 1];
  59994. if (shape) {
  59995. shape.brush(ctx, false);
  59996. }
  59997. var imgShape = new SmicImage({
  59998. id: id,
  59999. style: {
  60000. x: 0,
  60001. y: 0,
  60002. image: canvas
  60003. }
  60004. });
  60005. if (shapeTransform.position != null) {
  60006. imgShape.position = shape.position = shapeTransform.position;
  60007. }
  60008. if (shapeTransform.rotation != null) {
  60009. imgShape.rotation = shape.rotation = shapeTransform.rotation;
  60010. }
  60011. if (shapeTransform.scale != null) {
  60012. imgShape.scale = shape.scale = shapeTransform.scale;
  60013. }
  60014. return imgShape;
  60015. }
  60016. /**
  60017. * Method: _createShapeToImageProcessor
  60018. *
  60019. */
  60020. }, {
  60021. key: "_createShapeToImageProcessor",
  60022. value: function _createShapeToImageProcessor() {
  60023. var me = this;
  60024. return function (id, e, width, height) {
  60025. return me._shapeToImage(id, e, width, height, Painter.devicePixelRatio);
  60026. };
  60027. } // SMIC-方法扩展 - start
  60028. /**
  60029. * @function SuperMap.LevelRenderer.Painter.prototype.updateHoverLayer
  60030. * @description 更新设置显示高亮图层。
  60031. * @param {Array} shapes - 图形数组。
  60032. */
  60033. }, {
  60034. key: "updateHoverLayer",
  60035. value: function updateHoverLayer(shapes) {
  60036. if (!(shapes instanceof Array)) {
  60037. return this;
  60038. } //清除高亮
  60039. this.clearHover();
  60040. this.storage.delHover();
  60041. for (var i = 0; i < shapes.length; i++) {
  60042. this.storage.addHover(shapes[i]);
  60043. this._brushHover(shapes[i]);
  60044. }
  60045. }
  60046. /**
  60047. * @function SuperMap.LevelRenderer.Painter.prototype.createDom
  60048. * @description 创建 Dom。
  60049. *
  60050. * @param {string} id - Dom id
  60051. * @param {string} type - Dom type
  60052. * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
  60053. * @return {Object} Dom
  60054. */
  60055. }], [{
  60056. key: "createDom",
  60057. value: function createDom(id, type, painter) {
  60058. var newDom = document.createElement(type);
  60059. var width = painter._width;
  60060. var height = painter._height; // 没append呢,请原谅我这样写,清晰~
  60061. newDom.style.position = 'absolute';
  60062. newDom.style.left = 0;
  60063. newDom.style.top = 0;
  60064. newDom.style.width = width + 'px';
  60065. newDom.style.height = height + 'px';
  60066. newDom.setAttribute('width', width * Painter.devicePixelRatio);
  60067. newDom.setAttribute('height', height * Painter.devicePixelRatio); // id不作为索引用,避免可能造成的重名,定义为私有属性
  60068. //newDom.setAttribute('data-zr-dom-id', id);
  60069. newDom.setAttribute('id', id);
  60070. return newDom;
  60071. }
  60072. }]);
  60073. return Painter;
  60074. }();
  60075. /**
  60076. * @private
  60077. * @class Painter.Layer
  60078. * @classdesc 绘制层类。
  60079. * @extends SuperMap.LevelRenderer.Transformable
  60080. */
  60081. var PaintLayer = /*#__PURE__*/function (_Transformable) {
  60082. Painter_inherits(PaintLayer, _Transformable);
  60083. var _super = Painter_createSuper(PaintLayer);
  60084. /**
  60085. * @function Painter.Layer.constructor
  60086. * @description 构造函数。
  60087. *
  60088. * @param {string} id - id。
  60089. * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
  60090. *
  60091. */
  60092. function PaintLayer(id, painter) {
  60093. var _this;
  60094. Painter_classCallCheck(this, PaintLayer);
  60095. _this = _super.call(this, id, painter);
  60096. /**
  60097. * @member {Object} Painter.Layer.prototype.dom
  60098. * @description dom。
  60099. */
  60100. _this.dom = null;
  60101. /**
  60102. * @member {Object} Painter.Layer.prototype.domBack
  60103. * @description domBack。
  60104. */
  60105. _this.domBack = null;
  60106. /**
  60107. * @member {Object} Painter.Layer.prototype.ctxBack
  60108. * @description ctxBack。
  60109. */
  60110. _this.ctxBack = null;
  60111. /**
  60112. * @member {SuperMap.LevelRenderer.Painter} Painter.Layer.prototype.painter
  60113. * @description painter。
  60114. */
  60115. _this.painter = painter;
  60116. /**
  60117. * @member {number} Painter.Layer.prototype.unusedCount
  60118. * @description unusedCount。
  60119. */
  60120. _this.unusedCount = 0;
  60121. /**
  60122. * @member {Object} Painter.Layer.prototype.config
  60123. * @description config。
  60124. */
  60125. _this.config = null;
  60126. /**
  60127. * @member {boolean} Painter.Layer.prototype.dirty
  60128. * @description dirty。
  60129. */
  60130. _this.dirty = true;
  60131. /**
  60132. * @member {number} Painter.Layer.prototype.elCount
  60133. * @description elCount。
  60134. */
  60135. _this.elCount = 0; // Configs
  60136. /**
  60137. * @member {string} Painter.Layer.prototype.clearColor
  60138. * @description 每次清空画布的颜色。默认值:0;
  60139. */
  60140. _this.clearColor = 0;
  60141. /**
  60142. * @member {boolean} Painter.Layer.prototype.motionBlur
  60143. * @description 是否开启动态模糊。默认值:false;
  60144. */
  60145. _this.motionBlur = false;
  60146. /**
  60147. * @member {number} Painter.Layer.prototype.lastFrameAlpha
  60148. * @description 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
  60149. */
  60150. _this.lastFrameAlpha = 0.7;
  60151. /**
  60152. * @member {boolean} Painter.Layer.prototype.zoomable
  60153. * @description 层是否支持鼠标平移操作。默认值:false;
  60154. */
  60155. _this.zoomable = false;
  60156. /**
  60157. * @member {boolean} Painter.Layer.prototype.panable
  60158. * @description 层是否支持鼠标缩放操作。默认值:false;
  60159. */
  60160. _this.panable = false;
  60161. /**
  60162. * @member {number} Painter.Layer.prototype.maxZoom
  60163. * @description maxZoom。默认值:Infinity。
  60164. */
  60165. _this.maxZoom = Infinity;
  60166. /**
  60167. * @member {number} Painter.Layer.prototype.minZoom
  60168. * @description minZoom。默认值:0。
  60169. */
  60170. _this.minZoom = 0;
  60171. /**
  60172. * @member {number} Painter.Layer.prototype.ctx
  60173. * @description Canvas 上下文。
  60174. */
  60175. _this.ctx = null;
  60176. _this.dom = Painter.createDom(Util.createUniqueID("SuperMap.Theme" + id), 'canvas', painter);
  60177. _this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬
  60178. _this.dom.style['-webkit-user-select'] = 'none';
  60179. _this.dom.style['user-select'] = 'none';
  60180. _this.dom.style['-webkit-touch-callout'] = 'none'; // Function
  60181. // 返回false的方法,用于避免页面被选中
  60182. function returnFalse() {
  60183. return false;
  60184. }
  60185. _this.CLASS_NAME = "SuperMap.LevelRenderer.Painter.Layer";
  60186. return _this;
  60187. }
  60188. /**
  60189. * @function Painter.Layer.prototype.destroy
  60190. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  60191. */
  60192. Painter_createClass(PaintLayer, [{
  60193. key: "destroy",
  60194. value: function destroy() {
  60195. this.dom = null;
  60196. this.domBack = null;
  60197. this.ctxBack = null;
  60198. this.painter = null;
  60199. this.unusedCount = null;
  60200. this.config = null;
  60201. this.dirty = null;
  60202. this.elCount = null;
  60203. this.clearColor = null;
  60204. this.motionBlur = null;
  60205. this.lastFrameAlpha = null;
  60206. this.zoomable = null;
  60207. this.panable = null;
  60208. this.maxZoom = null;
  60209. this.minZoom = null;
  60210. this.ctx = null;
  60211. Transformable.destroy.apply(this, arguments);
  60212. }
  60213. /**
  60214. * @function Painter.Layer.prototype.initContext
  60215. * @description 初始化 Canvan 2D 上下文。
  60216. */
  60217. }, {
  60218. key: "initContext",
  60219. value: function initContext() {
  60220. this.ctx = this.dom.getContext('2d');
  60221. if (Painter.devicePixelRatio != 1) {
  60222. this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  60223. }
  60224. }
  60225. /**
  60226. * @function Painter.Layer.prototype.createBackBuffer
  60227. * @description 创建备份缓冲。
  60228. */
  60229. }, {
  60230. key: "createBackBuffer",
  60231. value: function createBackBuffer() {
  60232. this.domBack = Painter.createDom(Util.createUniqueID("SuperMap.Theme.back-" + this.id), 'canvas', this.painter);
  60233. this.ctxBack = this.domBack.getContext('2d');
  60234. if (Painter.devicePixelRatio != 1) {
  60235. this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  60236. }
  60237. }
  60238. /**
  60239. * @function Painter.Layer.prototype.resize
  60240. * @description 改变大小。
  60241. *
  60242. * @param {number} width - 宽。
  60243. * @param {number} height - 高。
  60244. */
  60245. }, {
  60246. key: "resize",
  60247. value: function resize(width, height) {
  60248. this.dom.style.width = width + 'px';
  60249. this.dom.style.height = height + 'px';
  60250. this.dom.setAttribute('width', width * Painter.devicePixelRatio);
  60251. this.dom.setAttribute('height', height * Painter.devicePixelRatio);
  60252. if (Painter.devicePixelRatio != 1) {
  60253. this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  60254. }
  60255. if (this.domBack) {
  60256. this.domBack.setAttribute('width', width * Painter.devicePixelRatio);
  60257. this.domBack.setAttribute('height', height * Painter.devicePixelRatio);
  60258. if (Painter.devicePixelRatio != 1) {
  60259. this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  60260. }
  60261. }
  60262. }
  60263. /**
  60264. * @function Painter.Layer.prototype.clear
  60265. * @description 清空该层画布。
  60266. */
  60267. }, {
  60268. key: "clear",
  60269. value: function clear() {
  60270. var dom = this.dom;
  60271. var ctx = this.ctx;
  60272. var width = dom.width;
  60273. var height = dom.height;
  60274. var haveClearColor = this.clearColor;
  60275. var haveMotionBLur = this.motionBlur;
  60276. var lastFrameAlpha = this.lastFrameAlpha;
  60277. if (haveMotionBLur) {
  60278. if (!this.domBack) {
  60279. this.createBackBuffer();
  60280. }
  60281. this.ctxBack.globalCompositeOperation = 'copy';
  60282. this.ctxBack.drawImage(dom, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  60283. }
  60284. if (haveClearColor) {
  60285. ctx.save();
  60286. ctx.fillStyle = this.config.clearColor;
  60287. ctx.fillRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  60288. ctx.restore();
  60289. } else {
  60290. ctx.clearRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  60291. }
  60292. if (haveMotionBLur) {
  60293. var domBack = this.domBack;
  60294. ctx.save();
  60295. ctx.globalAlpha = lastFrameAlpha;
  60296. ctx.drawImage(domBack, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  60297. ctx.restore();
  60298. }
  60299. }
  60300. }]);
  60301. return PaintLayer;
  60302. }(Transformable);
  60303. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Handler.js
  60304. function Handler_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Handler_typeof = function _typeof(obj) { return typeof obj; }; } else { Handler_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Handler_typeof(obj); }
  60305. function Handler_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60306. 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); } }
  60307. function Handler_createClass(Constructor, protoProps, staticProps) { if (protoProps) Handler_defineProperties(Constructor.prototype, protoProps); if (staticProps) Handler_defineProperties(Constructor, staticProps); return Constructor; }
  60308. function Handler_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Handler_setPrototypeOf(subClass, superClass); }
  60309. function Handler_setPrototypeOf(o, p) { Handler_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Handler_setPrototypeOf(o, p); }
  60310. 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); }; }
  60311. function Handler_possibleConstructorReturn(self, call) { if (call && (Handler_typeof(call) === "object" || typeof call === "function")) { return call; } return Handler_assertThisInitialized(self); }
  60312. function Handler_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  60313. function Handler_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  60314. function Handler_getPrototypeOf(o) { Handler_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Handler_getPrototypeOf(o); }
  60315. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  60316. * This program are made available under the terms of the Apache License, Version 2.0
  60317. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60318. /**
  60319. * @private
  60320. * @class SuperMap.LevelRenderer.Handler
  60321. * @category Visualization Theme
  60322. * @classdesc Handler控制模块。
  60323. * @extends {SuperMap.LevelRenderer.Eventful}
  60324. */
  60325. var Handler = /*#__PURE__*/function (_Eventful) {
  60326. Handler_inherits(Handler, _Eventful);
  60327. var _super = Handler_createSuper(Handler);
  60328. /**
  60329. * @function SuperMap.LevelRenderer.Handler.constructor
  60330. * @description 构造函数。
  60331. * @param {HTMLElement} root - 绘图区域。
  60332. * @param {SuperMap.LevelRenderer.Storage} storage - Storage 实例。
  60333. * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
  60334. */
  60335. function Handler(root, storage, painter) {
  60336. var _this;
  60337. Handler_classCallCheck(this, Handler);
  60338. _this = _super.call(this, root, storage, painter);
  60339. /**
  60340. * @member {HTMLElement} SuperMap.LevelRenderer.Handler.prototype.root
  60341. * @description 绘图区域
  60342. */
  60343. _this.root = root;
  60344. /**
  60345. * @member {SuperMap.LevelRenderer.Storage} SuperMap.LevelRenderer.Handler.prototype.storage
  60346. * @description Storage 实例
  60347. */
  60348. _this.storage = storage;
  60349. /**
  60350. * @member {SuperMap.LevelRenderer.Painter} SuperMap.LevelRenderer.Handler.prototype.Painter
  60351. * @description Painter 实例
  60352. */
  60353. _this.painter = painter;
  60354. /**
  60355. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._lastX=0]
  60356. * @description 上一次鼠标位置x坐标值
  60357. */
  60358. _this._lastX = 0;
  60359. /**
  60360. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._lastY=0]
  60361. * @description 上一次鼠标位置y坐标值
  60362. */
  60363. _this._lastY = 0;
  60364. /**
  60365. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._mouseX=0]
  60366. * @description 当前鼠标位置x坐标值
  60367. */
  60368. _this._mouseX = 0;
  60369. /**
  60370. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._mouseY=0]
  60371. * @description 当前鼠标位置y坐标值
  60372. */
  60373. _this._mouseY = 0;
  60374. /**
  60375. * @member {Function} SuperMap.LevelRenderer.Handler.prototype._findHover
  60376. * @description 查找 Hover 图形
  60377. */
  60378. _this._findHover = null;
  60379. /**
  60380. * @member {Object} SuperMap.LevelRenderer.Handler.prototype._domHover
  60381. * @description 高亮 DOM
  60382. */
  60383. _this._domHover = null; // 各种事件标识的私有变量
  60384. // this._hasfound = false; // 是否找到 hover 图形元素
  60385. // this._lastHover = null; // 最后一个 hover 图形元素
  60386. // this._mouseDownTarget = null;
  60387. // this._draggingTarget = null; // 当前被拖拽的图形元素
  60388. // this._isMouseDown = false;
  60389. // this._isDragging = false;
  60390. // this._lastMouseDownMoment;
  60391. // this._lastTouchMoment;
  60392. // this._lastDownButton;
  60393. _this._findHover = bind3Arg(findHover, Handler_assertThisInitialized(_this));
  60394. _this._domHover = painter.getDomHover();
  60395. _this.CLASS_NAME = "SuperMap.LevelRenderer.Handler";
  60396. var domHandlers = {
  60397. /**
  60398. * Method: resize
  60399. * 窗口大小改变响应函数。
  60400. *
  60401. * Parameters:
  60402. * event - {Event} event。
  60403. *
  60404. */
  60405. resize: function resize(event) {
  60406. event = event || window.event;
  60407. this._lastHover = null;
  60408. this._isMouseDown = 0; // 分发SuperMap.LevelRenderer.Config.EVENT.RESIZE事件,global
  60409. this.dispatch(Config.EVENT.RESIZE, event);
  60410. },
  60411. /**
  60412. * Method: click
  60413. * 点击响应函数。
  60414. *
  60415. * Parameters:
  60416. * event - {Event} event。
  60417. *
  60418. */
  60419. click: function click(event) {
  60420. event = this._zrenderEventFixed(event); // 分发SuperMap.LevelRenderer.Config.EVENT.CLICK事件
  60421. var _lastHover = this._lastHover;
  60422. if (_lastHover && _lastHover.clickable || !_lastHover) {
  60423. // 判断没有发生拖拽才触发click事件
  60424. if (this._clickThreshold < 10) {
  60425. this._dispatchAgency(_lastHover, Config.EVENT.CLICK, event);
  60426. }
  60427. }
  60428. this._mousemoveHandler(event);
  60429. },
  60430. /**
  60431. * Method: dblclick
  60432. * 双击响应函数。
  60433. *
  60434. * Parameters:
  60435. * event - {Event} event。
  60436. *
  60437. */
  60438. dblclick: function dblclick(event) {
  60439. event = event || window.event;
  60440. event = this._zrenderEventFixed(event); // 分发SuperMap.LevelRenderer.Config.EVENT.DBLCLICK事件
  60441. var _lastHover = this._lastHover;
  60442. if (_lastHover && _lastHover.clickable || !_lastHover) {
  60443. // 判断没有发生拖拽才触发dblclick事件
  60444. if (this._clickThreshold < 5) {
  60445. this._dispatchAgency(_lastHover, Config.EVENT.DBLCLICK, event);
  60446. }
  60447. }
  60448. this._mousemoveHandler(event);
  60449. },
  60450. /**
  60451. * Method: mousewheel
  60452. * 鼠标滚轮响应函数。
  60453. *
  60454. * Parameters:
  60455. * event - {Event} event。
  60456. *
  60457. */
  60458. mousewheel: function mousewheel(event) {
  60459. event = this._zrenderEventFixed(event); // http://www.sitepoint.com/html5-javascript-mouse-wheel/
  60460. // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel
  60461. var delta = event.wheelDelta // Webkit
  60462. || -event.detail; // Firefox
  60463. var scale = delta > 0 ? 1.1 : 1 / 1.1;
  60464. var layers = this.painter.getLayers();
  60465. var needsRefresh = false;
  60466. for (var z in layers) {
  60467. if (z !== 'hover') {
  60468. var layer = layers[z];
  60469. var pos = layer.position;
  60470. if (layer.zoomable) {
  60471. layer.__zoom = layer.__zoom || 1;
  60472. var newZoom = layer.__zoom;
  60473. newZoom *= scale;
  60474. newZoom = Math.max(Math.min(layer.maxZoom, newZoom), layer.minZoom);
  60475. scale = newZoom / layer.__zoom;
  60476. layer.__zoom = newZoom; // Keep the mouse center when scaling
  60477. pos[0] -= (this._mouseX - pos[0]) * (scale - 1);
  60478. pos[1] -= (this._mouseY - pos[1]) * (scale - 1);
  60479. layer.scale[0] *= scale;
  60480. layer.scale[1] *= scale;
  60481. layer.dirty = true;
  60482. needsRefresh = true;
  60483. }
  60484. }
  60485. }
  60486. if (needsRefresh) {
  60487. this.painter.refresh();
  60488. } // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEWHEEL事件
  60489. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEWHEEL, event);
  60490. this._mousemoveHandler(event);
  60491. },
  60492. /**
  60493. * Method: mousemove
  60494. * 鼠标(手指)移动响应函数。
  60495. *
  60496. * Parameters:
  60497. * event - {Event} event。
  60498. *
  60499. */
  60500. mousemove: function mousemove(event) {
  60501. // 拖拽不触发click事件
  60502. this._clickThreshold++;
  60503. event = this._zrenderEventFixed(event);
  60504. this._lastX = this._mouseX;
  60505. this._lastY = this._mouseY;
  60506. this._mouseX = SUtil_SUtil.Util_event.getX(event);
  60507. this._mouseY = SUtil_SUtil.Util_event.getY(event);
  60508. var dx = this._mouseX - this._lastX;
  60509. var dy = this._mouseY - this._lastY; // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGSTART事件
  60510. // 避免手抖点击误认为拖拽
  60511. // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) {
  60512. this._processDragStart(event); // }
  60513. this._hasfound = 0;
  60514. this._event = event;
  60515. this._iterateAndFindHover(); // 找到的在迭代函数里做了处理,没找到得在迭代完后处理
  60516. if (!this._hasfound) {
  60517. // 过滤首次拖拽产生的mouseout和dragLeave
  60518. if (!this._draggingTarget || this._lastHover && this._lastHover != this._draggingTarget) {
  60519. // 可能出现SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  60520. this._processOutShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  60521. this._processDragLeave(event);
  60522. }
  60523. this._lastHover = null;
  60524. this.storage.delHover();
  60525. this.painter.clearHover();
  60526. } // set cursor for root element
  60527. var cursor = ''; // 如果存在拖拽中元素,被拖拽的图形元素最后addHover
  60528. if (this._draggingTarget) {
  60529. this.storage.drift(this._draggingTarget.id, dx, dy);
  60530. this._draggingTarget.modSelf();
  60531. this.storage.addHover(this._draggingTarget);
  60532. } else if (this._isMouseDown) {
  60533. // Layer dragging
  60534. var layers = this.painter.getLayers();
  60535. var needsRefresh = false;
  60536. for (var z in layers) {
  60537. if (z !== 'hover') {
  60538. var layer = layers[z];
  60539. if (layer.panable) {
  60540. // PENDING
  60541. cursor = 'move'; // Keep the mouse center when scaling
  60542. layer.position[0] += dx;
  60543. layer.position[1] += dy;
  60544. needsRefresh = true;
  60545. layer.dirty = true;
  60546. }
  60547. }
  60548. }
  60549. if (needsRefresh) {
  60550. this.painter.refresh();
  60551. }
  60552. }
  60553. if (this._draggingTarget || this._hasfound && this._lastHover.draggable) {
  60554. cursor = 'move';
  60555. } else if (this._hasfound && this._lastHover.clickable) {
  60556. cursor = 'pointer';
  60557. }
  60558. this.root.style.cursor = cursor; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEMOVE事件
  60559. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEMOVE, event);
  60560. if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) {
  60561. this.painter.refreshHover();
  60562. }
  60563. },
  60564. /**
  60565. * Method: mouseout
  60566. * 鼠标(手指)离开响应函数。
  60567. *
  60568. * Parameters:
  60569. * event - {Event} event。
  60570. *
  60571. */
  60572. mouseout: function mouseout(event) {
  60573. event = this._zrenderEventFixed(event);
  60574. var element = event.toElement || event.relatedTarget;
  60575. if (element != this.root) {
  60576. while (element && element.nodeType != 9) {
  60577. // 忽略包含在root中的dom引起的mouseOut
  60578. if (element == this.root) {
  60579. this._mousemoveHandler(event);
  60580. return;
  60581. }
  60582. element = element.parentNode;
  60583. }
  60584. }
  60585. event.zrenderX = this._lastX;
  60586. event.zrenderY = this._lastY;
  60587. this.root.style.cursor = '';
  60588. this._isMouseDown = 0;
  60589. this._processOutShape(event);
  60590. this._processDrop(event);
  60591. this._processDragEnd(event);
  60592. this.painter.refreshHover();
  60593. this.dispatch(Config.EVENT.GLOBALOUT, event);
  60594. },
  60595. /**
  60596. * Method: mousedown
  60597. * 鼠标(手指)按下响应函数。
  60598. *
  60599. * Parameters:
  60600. * event - {Event} event。
  60601. *
  60602. */
  60603. mousedown: function mousedown(event) {
  60604. // 重置 clickThreshold
  60605. this._clickThreshold = 0;
  60606. if (this._lastDownButton == 2) {
  60607. this._lastDownButton = event.button;
  60608. this._mouseDownTarget = null; // 仅作为关闭右键菜单使用
  60609. return;
  60610. }
  60611. this._lastMouseDownMoment = new Date();
  60612. event = this._zrenderEventFixed(event);
  60613. this._isMouseDown = 1; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEDOWN事件
  60614. this._mouseDownTarget = this._lastHover;
  60615. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEDOWN, event);
  60616. this._lastDownButton = event.button;
  60617. },
  60618. /**
  60619. * Method: mouseup
  60620. * 鼠标(手指)抬起响应函数。
  60621. *
  60622. * Parameters:
  60623. * event - {Event} event。
  60624. *
  60625. */
  60626. mouseup: function mouseup(event) {
  60627. event = this._zrenderEventFixed(event);
  60628. this.root.style.cursor = '';
  60629. this._isMouseDown = 0;
  60630. this._mouseDownTarget = null; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEUP事件
  60631. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEUP, event);
  60632. this._processDrop(event);
  60633. this._processDragEnd(event);
  60634. },
  60635. /**
  60636. * Method: touchstart
  60637. * Touch 开始响应函数。
  60638. *
  60639. * Parameters:
  60640. * event - {Event} event。
  60641. *
  60642. */
  60643. touchstart: function touchstart(event) {
  60644. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  60645. event = this._zrenderEventFixed(event, true);
  60646. this._lastTouchMoment = new Date(); // 平板补充一次findHover
  60647. this._mobildFindFixed(event);
  60648. this._mousedownHandler(event);
  60649. },
  60650. /**
  60651. * Method: touchmove
  60652. * Touch 移动响应函数。
  60653. *
  60654. * Parameters:
  60655. * event - {Event} event。
  60656. *
  60657. */
  60658. touchmove: function touchmove(event) {
  60659. event = this._zrenderEventFixed(event, true);
  60660. this._mousemoveHandler(event);
  60661. if (this._isDragging) {
  60662. SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  60663. }
  60664. },
  60665. /**
  60666. * Method: touchend
  60667. * Touch 结束响应函数。
  60668. *
  60669. * Parameters:
  60670. * event - {Event} event。
  60671. *
  60672. */
  60673. touchend: function touchend(event) {
  60674. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  60675. event = this._zrenderEventFixed(event, true);
  60676. this._mouseupHandler(event);
  60677. var now = new Date();
  60678. if (now - this._lastTouchMoment < Config.EVENT.touchClickDelay) {
  60679. this._mobildFindFixed(event);
  60680. this._clickHandler(event);
  60681. if (now - this._lastClickMoment < Config.EVENT.touchClickDelay / 2) {
  60682. this._dblclickHandler(event);
  60683. if (this._lastHover && this._lastHover.clickable) {
  60684. SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  60685. }
  60686. }
  60687. this._lastClickMoment = now;
  60688. }
  60689. this.painter.clearHover();
  60690. }
  60691. };
  60692. initDomHandler(Handler_assertThisInitialized(_this)); // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来
  60693. if (window.addEventListener) {
  60694. window.addEventListener('resize', _this._resizeHandler);
  60695. if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
  60696. // mobile支持
  60697. root.addEventListener('touchstart', _this._touchstartHandler);
  60698. root.addEventListener('touchmove', _this._touchmoveHandler);
  60699. root.addEventListener('touchend', _this._touchendHandler);
  60700. } else {
  60701. // mobile的click/move/up/down自己模拟
  60702. root.addEventListener('click', _this._clickHandler);
  60703. root.addEventListener('dblclick', _this._dblclickHandler);
  60704. root.addEventListener('mousewheel', _this._mousewheelHandler);
  60705. root.addEventListener('mousemove', _this._mousemoveHandler);
  60706. root.addEventListener('mousedown', _this._mousedownHandler);
  60707. root.addEventListener('mouseup', _this._mouseupHandler);
  60708. }
  60709. root.addEventListener('DOMMouseScroll', _this._mousewheelHandler);
  60710. root.addEventListener('mouseout', _this._mouseoutHandler);
  60711. } else {
  60712. window.attachEvent('onresize', _this._resizeHandler);
  60713. root.attachEvent('onclick', _this._clickHandler); //root.attachEvent('ondblclick ', this._dblclickHandler);
  60714. root.ondblclick = _this._dblclickHandler;
  60715. root.attachEvent('onmousewheel', _this._mousewheelHandler);
  60716. root.attachEvent('onmousemove', _this._mousemoveHandler);
  60717. root.attachEvent('onmouseout', _this._mouseoutHandler);
  60718. root.attachEvent('onmousedown', _this._mousedownHandler);
  60719. root.attachEvent('onmouseup', _this._mouseupHandler);
  60720. } // 辅助函数 start
  60721. /**
  60722. * Method: bind1Arg
  60723. * bind 一个参数的 function。
  60724. *
  60725. * Parameters:
  60726. * handler - {Function} 要 bind 的 function。
  60727. * context - {Object} 运行时 this 环境。
  60728. *
  60729. * Returns:
  60730. * {Function}
  60731. */
  60732. function bind1Arg(handler, context) {
  60733. return function (e) {
  60734. return handler.call(context, e);
  60735. };
  60736. }
  60737. /*
  60738. // bind 两个参数的 function
  60739. function bind2Arg(handler, context) {
  60740. return function (arg1, arg2) {
  60741. return handler.call(context, arg1, arg2);
  60742. };
  60743. }
  60744. */
  60745. // bind 三个参数的 function
  60746. function bind3Arg(handler, context) {
  60747. return function (arg1, arg2, arg3) {
  60748. return handler.call(context, arg1, arg2, arg3);
  60749. };
  60750. }
  60751. /**
  60752. * Method: initDomHandler
  60753. * 为控制类实例初始化 dom 事件处理函数。
  60754. *
  60755. * Parameters:
  60756. * instance - {<SuperMap.LevelRenderer.Handler>} 控制类实例 。
  60757. *
  60758. * Returns:
  60759. * {Function}
  60760. */
  60761. function initDomHandler(instance) {
  60762. var domHandlerNames = ['resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove'];
  60763. var len = domHandlerNames.length;
  60764. while (len--) {
  60765. var name = domHandlerNames[len];
  60766. instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance);
  60767. }
  60768. }
  60769. /**
  60770. * Method: findHover
  60771. * 迭代函数,查找 hover 到的图形元素并即时做些事件分发。
  60772. *
  60773. * Parameters:
  60774. * shape - {Object} 图形。
  60775. * x - {number} 鼠标 x。
  60776. * y - {number} 鼠标 y。
  60777. *
  60778. * Returns:
  60779. * {boolean} 是否找到图形。
  60780. *
  60781. */
  60782. function findHover(shape, x, y) {
  60783. var me = this;
  60784. if (me._draggingTarget && me._draggingTarget.id == shape.id || // 迭代到当前拖拽的图形上
  60785. shape.isSilent() // 打酱油的路过,啥都不响应的shape~
  60786. ) {
  60787. return false;
  60788. }
  60789. var event = me._event;
  60790. if (shape.isCover(x, y)) {
  60791. if (shape.hoverable) {
  60792. // SMIC-修改 - start
  60793. if (shape.isHoverByRefDataID && shape.isHoverByRefDataID === true) {
  60794. if (shape.refDataID) {
  60795. var fid = shape.refDataID; //me.painter.clearHover();
  60796. //me.storage.delHover();
  60797. var hoverGroup = null;
  60798. if (shape.refDataHoverGroup) {
  60799. hoverGroup = shape.refDataHoverGroup;
  60800. } //查找同一个用户数据 feature 的所有图形
  60801. var shapeList = me.storage._shapeList;
  60802. for (var i = 0, len = shapeList.length; i < len; i++) {
  60803. var si = shapeList[i];
  60804. if (si.refDataID && fid === si.refDataID) {
  60805. if (hoverGroup) {
  60806. if (si.refDataHoverGroup && hoverGroup === si.refDataHoverGroup) {
  60807. me.storage.addHover(si);
  60808. }
  60809. } else {
  60810. me.storage.addHover(si);
  60811. }
  60812. }
  60813. }
  60814. }
  60815. } else {
  60816. me.storage.addHover(shape);
  60817. } //初始代码:
  60818. // me.storage.addHover(shape);
  60819. // SMIC-修改 - end
  60820. } // 查找是否在 clipShape 中
  60821. var p = shape.parent;
  60822. while (p) {
  60823. if (p.clipShape && !p.clipShape.isCover(me._mouseX, me._mouseY)) {
  60824. // 已经被祖先 clip 掉了
  60825. return false;
  60826. }
  60827. p = p.parent;
  60828. }
  60829. if (me._lastHover != shape) {
  60830. me._processOutShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  60831. me._processDragLeave(event);
  60832. me._lastHover = shape; // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  60833. me._processDragEnter(event);
  60834. }
  60835. me._processOverShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGOVER
  60836. me._processDragOver(event);
  60837. me._hasfound = 1;
  60838. return true; // 找到则中断迭代查找
  60839. }
  60840. return false;
  60841. } // 辅助函数 end
  60842. return _this;
  60843. }
  60844. /**
  60845. * @function SuperMap.LevelRenderer.Handler.prototype.destroy
  60846. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  60847. */
  60848. Handler_createClass(Handler, [{
  60849. key: "destroy",
  60850. value: function destroy() {
  60851. this.dispose();
  60852. this._lastX = null;
  60853. this._lastY = null;
  60854. this._mouseX = null;
  60855. this._mouseY = null;
  60856. this._findHover = null;
  60857. Eventful.prototype.destroy.apply(this, arguments);
  60858. }
  60859. /**
  60860. * @function SuperMap.LevelRenderer.Handler.prototype.on
  60861. * @description 自定义事件绑定。
  60862. * @param {string} eventName - 事件名称,resize、hover、drag等。
  60863. * @param {function} handler - 响应函数。
  60864. * @returns {SuperMap.LevelRenderer.Handler} this。
  60865. */
  60866. }, {
  60867. key: "on",
  60868. value: function on(eventName, handler) {
  60869. this.bind(eventName, handler);
  60870. return this;
  60871. }
  60872. /**
  60873. * @function SuperMap.LevelRenderer.Handler.prototype.un
  60874. * @description 自定义事件解除绑定。
  60875. * @param {string} eventName - 事件名称,resize、hover、drag等。
  60876. * @param {function} handler - 响应函数。
  60877. * @returns {SuperMap.LevelRenderer.Handler} this。
  60878. */
  60879. }, {
  60880. key: "un",
  60881. value: function un(eventName, handler) {
  60882. this.unbind(eventName, handler);
  60883. return this;
  60884. }
  60885. /**
  60886. * @function SuperMap.LevelRenderer.Handler.prototype.trigger
  60887. * @description 事件触发。
  60888. * @param {string} eventName - 事件名称,resize、hover、drag等。
  60889. * @param {event} eventArgs - dom事件对象。
  60890. */
  60891. }, {
  60892. key: "trigger",
  60893. value: function trigger(eventName, eventArgs) {
  60894. var EVENT = Config.EVENT;
  60895. switch (eventName) {
  60896. case EVENT.RESIZE:
  60897. case EVENT.CLICK:
  60898. case EVENT.DBLCLICK:
  60899. case EVENT.MOUSEWHEEL:
  60900. case EVENT.MOUSEMOVE:
  60901. case EVENT.MOUSEDOWN:
  60902. case EVENT.MOUSEUP:
  60903. case EVENT.MOUSEOUT:
  60904. this['_' + eventName + 'Handler'](eventArgs);
  60905. break;
  60906. }
  60907. }
  60908. /**
  60909. * @function SuperMap.LevelRenderer.Handler.prototype.dispose
  60910. * @description 释放,解绑所有事件。
  60911. */
  60912. }, {
  60913. key: "dispose",
  60914. value: function dispose() {
  60915. var root = this.root;
  60916. if (window.removeEventListener) {
  60917. window.removeEventListener('resize', this._resizeHandler);
  60918. if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
  60919. // mobile支持
  60920. root.removeEventListener('touchstart', this._touchstartHandler);
  60921. root.removeEventListener('touchmove', this._touchmoveHandler);
  60922. root.removeEventListener('touchend', this._touchendHandler);
  60923. } else {
  60924. // mobile的click自己模拟
  60925. root.removeEventListener('click', this._clickHandler);
  60926. root.removeEventListener('dblclick', this._dblclickHandler);
  60927. root.removeEventListener('mousewheel', this._mousewheelHandler);
  60928. root.removeEventListener('mousemove', this._mousemoveHandler);
  60929. root.removeEventListener('mousedown', this._mousedownHandler);
  60930. root.removeEventListener('mouseup', this._mouseupHandler);
  60931. }
  60932. root.removeEventListener('DOMMouseScroll', this._mousewheelHandler);
  60933. root.removeEventListener('mouseout', this._mouseoutHandler);
  60934. } else {
  60935. window.detachEvent('onresize', this._resizeHandler);
  60936. root.detachEvent('onclick', this._clickHandler);
  60937. root.detachEvent('dblclick', this._dblclickHandler);
  60938. root.detachEvent('onmousewheel', this._mousewheelHandler);
  60939. root.detachEvent('onmousemove', this._mousemoveHandler);
  60940. root.detachEvent('onmouseout', this._mouseoutHandler);
  60941. root.detachEvent('onmousedown', this._mousedownHandler);
  60942. root.detachEvent('onmouseup', this._mouseupHandler);
  60943. }
  60944. this.root = null;
  60945. this._domHover = null;
  60946. this.storage = null;
  60947. this.painter = null;
  60948. this.un();
  60949. }
  60950. /**
  60951. * Method: _processDragStart
  60952. * 拖拽开始。
  60953. *
  60954. * Parameters:
  60955. * event - {Object} 事件对象。
  60956. *
  60957. */
  60958. }, {
  60959. key: "_processDragStart",
  60960. value: function _processDragStart(event) {
  60961. var _lastHover = this._lastHover;
  60962. if (this._isMouseDown && _lastHover && _lastHover.draggable && !this._draggingTarget && this._mouseDownTarget == _lastHover) {
  60963. // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度
  60964. if (_lastHover.dragEnableTime && new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime) {
  60965. return;
  60966. }
  60967. var _draggingTarget = _lastHover;
  60968. this._draggingTarget = _draggingTarget;
  60969. this._isDragging = 1;
  60970. _draggingTarget.invisible = true;
  60971. this.storage.mod(_draggingTarget.id); // 分发 Config.EVENT.DRAGSTART事件
  60972. this._dispatchAgency(_draggingTarget, Config.EVENT.DRAGSTART, event);
  60973. this.painter.refresh();
  60974. }
  60975. }
  60976. /**
  60977. * Method: _processDragEnter
  60978. * 拖拽进入目标元素。
  60979. *
  60980. * Parameters:
  60981. * event - {Object} 事件对象。
  60982. *
  60983. */
  60984. }, {
  60985. key: "_processDragEnter",
  60986. value: function _processDragEnter(event) {
  60987. if (this._draggingTarget) {
  60988. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  60989. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGENTER, event, this._draggingTarget);
  60990. }
  60991. }
  60992. /**
  60993. * Method: _processDragOver
  60994. * 拖拽在目标元素上移动。
  60995. *
  60996. * Parameters:
  60997. * event - {Object} 事件对象。
  60998. *
  60999. */
  61000. }, {
  61001. key: "_processDragOver",
  61002. value: function _processDragOver(event) {
  61003. if (this._draggingTarget) {
  61004. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGOVER事件
  61005. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGOVER, event, this._draggingTarget);
  61006. }
  61007. }
  61008. /**
  61009. * Method: _processDragLeave
  61010. * 拖拽离开目标元素。
  61011. *
  61012. * Parameters:
  61013. * event - {Object} 事件对象。
  61014. *
  61015. */
  61016. }, {
  61017. key: "_processDragLeave",
  61018. value: function _processDragLeave(event) {
  61019. if (this._draggingTarget) {
  61020. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  61021. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGLEAVE, event, this._draggingTarget);
  61022. }
  61023. }
  61024. /**
  61025. * Method: _processDrop
  61026. * 拖拽在目标元素上完成。
  61027. *
  61028. * Parameters:
  61029. * event - {Object} 事件对象。
  61030. *
  61031. */
  61032. }, {
  61033. key: "_processDrop",
  61034. value: function _processDrop(event) {
  61035. if (this._draggingTarget) {
  61036. this._draggingTarget.invisible = false;
  61037. this.storage.mod(this._draggingTarget.id);
  61038. this.painter.refresh(); // 分发SuperMap.LevelRenderer.Config.EVENT.DROP事件
  61039. this._dispatchAgency(this._lastHover, Config.EVENT.DROP, event, this._draggingTarget);
  61040. }
  61041. }
  61042. /**
  61043. * Method: _processDragEnd
  61044. * 拖拽结束。
  61045. *
  61046. * Parameters:
  61047. * event - {Object} 事件对象。
  61048. *
  61049. */
  61050. }, {
  61051. key: "_processDragEnd",
  61052. value: function _processDragEnd(event) {
  61053. if (this._draggingTarget) {
  61054. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGEND事件
  61055. this._dispatchAgency(this._draggingTarget, Config.EVENT.DRAGEND, event);
  61056. this._lastHover = null;
  61057. }
  61058. this._isDragging = 0;
  61059. this._draggingTarget = null;
  61060. }
  61061. /**
  61062. * Method: _processOverShape
  61063. * 鼠标在某个图形元素上移动。
  61064. *
  61065. * Parameters:
  61066. * event - {Object} 事件对象。
  61067. *
  61068. */
  61069. }, {
  61070. key: "_processOverShape",
  61071. value: function _processOverShape(event) {
  61072. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOVER事件
  61073. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOVER, event);
  61074. }
  61075. /**
  61076. * Method: _processOutShape
  61077. * 鼠标离开某个图形元素。
  61078. *
  61079. * Parameters:
  61080. * event - {Object} 事件对象。
  61081. *
  61082. */
  61083. }, {
  61084. key: "_processOutShape",
  61085. value: function _processOutShape(event) {
  61086. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  61087. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOUT, event);
  61088. }
  61089. /**
  61090. * Method: _dispatchAgency
  61091. * 鼠标离开某个图形元素。
  61092. *
  61093. * Parameters:
  61094. * targetShape - {Object} 目标图形元素。
  61095. * eventName - {Object} 事件名称。
  61096. * event - {Object} 事件对象。
  61097. * draggedShape - {Object} 拖拽事件特有,当前被拖拽图形元素。
  61098. *
  61099. */
  61100. }, {
  61101. key: "_dispatchAgency",
  61102. value: function _dispatchAgency(targetShape, eventName, event, draggedShape) {
  61103. var eventHandler = 'on' + eventName;
  61104. var eventPacket = {
  61105. type: eventName,
  61106. event: event,
  61107. target: targetShape,
  61108. cancelBubble: false
  61109. };
  61110. var el = targetShape;
  61111. if (draggedShape) {
  61112. eventPacket.dragged = draggedShape;
  61113. }
  61114. while (el) {
  61115. el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler](eventPacket));
  61116. el.dispatch(eventName, eventPacket);
  61117. el = el.parent;
  61118. if (eventPacket.cancelBubble) {
  61119. break;
  61120. }
  61121. }
  61122. if (targetShape) {
  61123. // 冒泡到顶级 zrender 对象
  61124. if (!eventPacket.cancelBubble) {
  61125. this.dispatch(eventName, eventPacket);
  61126. }
  61127. } else if (!draggedShape) {
  61128. // 无hover目标,无拖拽对象,原生事件分发
  61129. this.dispatch(eventName, {
  61130. type: eventName,
  61131. event: event
  61132. });
  61133. }
  61134. }
  61135. /**
  61136. * Method: _iterateAndFindHover
  61137. * 迭代寻找 hover shape。
  61138. *
  61139. */
  61140. }, {
  61141. key: "_iterateAndFindHover",
  61142. value: function _iterateAndFindHover() {
  61143. var invTransform = SUtil_SUtil.Util_matrix.create();
  61144. var list = this.storage.getShapeList();
  61145. var currentZLevel;
  61146. var currentLayer;
  61147. var tmp = [0, 0];
  61148. for (var i = list.length - 1; i >= 0; i--) {
  61149. var shape = list[i];
  61150. if (currentZLevel !== shape.zlevel) {
  61151. currentLayer = this.painter.getLayer(shape.zlevel, currentLayer);
  61152. tmp[0] = this._mouseX;
  61153. tmp[1] = this._mouseY;
  61154. if (currentLayer.needTransform) {
  61155. SUtil_SUtil.Util_matrix.invert(invTransform, currentLayer.transform);
  61156. SUtil_SUtil.Util_vector.applyTransform(tmp, tmp, invTransform);
  61157. }
  61158. }
  61159. if (this._findHover(shape, tmp[0], tmp[1])) {
  61160. break;
  61161. }
  61162. }
  61163. }
  61164. /**
  61165. * Method: _mobildFindFixed
  61166. * touch 有指尖错觉,四向尝试,让touch上的点击更好触发事件。
  61167. *
  61168. * Parameters:
  61169. * event - {Object} 事件对象。
  61170. *
  61171. */
  61172. }, {
  61173. key: "_mobildFindFixed",
  61174. value: function _mobildFindFixed(event) {
  61175. // touch指尖错觉的尝试偏移量配置
  61176. var MOBILE_TOUCH_OFFSETS = [{
  61177. x: 10
  61178. }, {
  61179. x: -20
  61180. }, {
  61181. x: 10,
  61182. y: 10
  61183. }, {
  61184. y: -20
  61185. }];
  61186. this._lastHover = null;
  61187. this._mouseX = event.zrenderX;
  61188. this._mouseY = event.zrenderY;
  61189. this._event = event;
  61190. this._iterateAndFindHover();
  61191. for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length; i++) {
  61192. var offset = MOBILE_TOUCH_OFFSETS[i];
  61193. offset.x && (this._mouseX += offset.x);
  61194. offset.y && (this._mouseX += offset.y);
  61195. this._iterateAndFindHover();
  61196. }
  61197. if (this._lastHover) {
  61198. event.zrenderX = this._mouseX;
  61199. event.zrenderY = this._mouseY;
  61200. }
  61201. }
  61202. /**
  61203. * Method: _zrenderEventFixed
  61204. * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 。
  61205. *
  61206. * Parameters:
  61207. * event - {Object} 事件。
  61208. * isTouch - {boolean} 是否触摸。
  61209. *
  61210. */
  61211. }, {
  61212. key: "_zrenderEventFixed",
  61213. value: function _zrenderEventFixed(event, isTouch) {
  61214. if (event.zrenderFixed) {
  61215. return event;
  61216. }
  61217. if (!isTouch) {
  61218. event = event || window.event; // 进入对象优先~
  61219. var target = event.toElement || event.relatedTarget || event.srcElement || event.target;
  61220. if (target && target != this._domHover) {
  61221. event.zrenderX = (typeof event.offsetX != 'undefined' ? event.offsetX : event.layerX) + target.offsetLeft;
  61222. event.zrenderY = (typeof event.offsetY != 'undefined' ? event.offsetY : event.layerY) + target.offsetTop;
  61223. }
  61224. } else {
  61225. var touch = event.type != 'touchend' ? event.targetTouches[0] : event.changedTouches[0];
  61226. if (touch) {
  61227. var rBounding = this.root.getBoundingClientRect(); // touch事件坐标是全屏的~
  61228. event.zrenderX = touch.clientX - rBounding.left;
  61229. event.zrenderY = touch.clientY - rBounding.top;
  61230. }
  61231. }
  61232. event.zrenderFixed = 1;
  61233. return event;
  61234. } // SMIC-方法扩展 - start
  61235. /**
  61236. * @function SuperMap.LevelRenderer.Handler.prototype.getLastHoverOne
  61237. * @description 获取单个高亮图形
  61238. */
  61239. }, {
  61240. key: "getLastHoverOne",
  61241. value: function getLastHoverOne() {
  61242. if (this._lastHover) {
  61243. return this._lastHover;
  61244. }
  61245. return null;
  61246. } // SMIC-方法扩展 - end
  61247. }]);
  61248. return Handler;
  61249. }(Eventful);
  61250. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Easing.js
  61251. function Easing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61252. 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); } }
  61253. function Easing_createClass(Constructor, protoProps, staticProps) { if (protoProps) Easing_defineProperties(Constructor.prototype, protoProps); if (staticProps) Easing_defineProperties(Constructor, staticProps); return Constructor; }
  61254. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61255. * This program are made available under the terms of the Apache License, Version 2.0
  61256. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61257. /**
  61258. * @class SuperMap.LevelRenderer.Animation.easing
  61259. * @category Visualization Theme
  61260. * @classdesc 缓动
  61261. * @private
  61262. */
  61263. // 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js
  61264. // http://sole.github.io/tween.js/examples/03_graphs.html
  61265. var Easing = /*#__PURE__*/function () {
  61266. /**
  61267. * @function SuperMap.LevelRenderer.Animation.easing.constructor
  61268. * @description 构造函数。
  61269. */
  61270. function Easing() {
  61271. Easing_classCallCheck(this, Easing);
  61272. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.easing";
  61273. }
  61274. /**
  61275. * @function SuperMap.LevelRenderer.Animation.easing.destroy
  61276. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  61277. */
  61278. Easing_createClass(Easing, [{
  61279. key: "destroy",
  61280. value: function destroy() {}
  61281. /**
  61282. * @function SuperMap.LevelRenderer.Animation.easing.Linear
  61283. * @description 线性缓动
  61284. * @param {number} k - 参数
  61285. * @return {number} 输入值
  61286. */
  61287. }, {
  61288. key: "Linear",
  61289. value: function Linear(k) {
  61290. return k;
  61291. }
  61292. /**
  61293. * @function SuperMap.LevelRenderer.Animation.easing.QuadraticIn
  61294. * @description 二次方的缓动(t^2)
  61295. * @param {number} k - 参数
  61296. * @return {number} 二次方的缓动的值
  61297. */
  61298. }, {
  61299. key: "QuadraticIn",
  61300. value: function QuadraticIn(k) {
  61301. return k * k;
  61302. }
  61303. /**
  61304. * @function SuperMap.LevelRenderer.Animation.easing.QuadraticOut
  61305. * @description 返回按二次方缓动退出的值
  61306. * @param {number} k - 参数
  61307. * @return {number} 按二次方缓动退出的值
  61308. */
  61309. }, {
  61310. key: "QuadraticOut",
  61311. value: function QuadraticOut(k) {
  61312. return k * (2 - k);
  61313. }
  61314. /**
  61315. * @function SuperMap.LevelRenderer.Animation.easing.QuadraticInOut
  61316. * @description 返回按二次方缓动进入和退出的值
  61317. * @param {number} k - 参数
  61318. * @return {number} 按二次方缓动进入和退出的值
  61319. */
  61320. }, {
  61321. key: "QuadraticInOut",
  61322. value: function QuadraticInOut(k) {
  61323. if ((k *= 2) < 1) {
  61324. return 0.5 * k * k;
  61325. }
  61326. return -0.5 * (--k * (k - 2) - 1);
  61327. }
  61328. /**
  61329. * @function SuperMap.LevelRenderer.Animation.easing.CubicIn
  61330. * @description 三次方的缓动(t^3)
  61331. * @param {number} k - 参数
  61332. * @return {number} 按三次方缓动的值
  61333. */
  61334. }, {
  61335. key: "CubicIn",
  61336. value: function CubicIn(k) {
  61337. return k * k * k;
  61338. }
  61339. /**
  61340. * @function SuperMap.LevelRenderer.Animation.easing.CubicOut
  61341. * @description 返回按三次方缓动退出的值
  61342. * @param {number} k - 参数
  61343. * @return {number} 按三次方缓动退出的值
  61344. */
  61345. }, {
  61346. key: "CubicOut",
  61347. value: function CubicOut(k) {
  61348. return --k * k * k + 1;
  61349. }
  61350. /**
  61351. * @function SuperMap.LevelRenderer.Animation.easing.CubicInOut
  61352. * @description 返回按三次方缓动进入退出的值
  61353. * @param {number} k - 参数
  61354. * @return {number} 按三次方缓动进入退出的值
  61355. */
  61356. }, {
  61357. key: "CubicInOut",
  61358. value: function CubicInOut(k) {
  61359. if ((k *= 2) < 1) {
  61360. return 0.5 * k * k * k;
  61361. }
  61362. return 0.5 * ((k -= 2) * k * k + 2);
  61363. }
  61364. /**
  61365. * @function SuperMap.LevelRenderer.Animation.easing.QuarticIn
  61366. * @description 返回按四次方缓动进入的值
  61367. * @param {number} k - 参数
  61368. * @return {number} 按四次方缓动进入的值
  61369. */
  61370. }, {
  61371. key: "QuarticIn",
  61372. value: function QuarticIn(k) {
  61373. return k * k * k * k;
  61374. }
  61375. /**
  61376. * @function SuperMap.LevelRenderer.Animation.easing.QuarticOut
  61377. * @description 返回按四次方缓动退出的值
  61378. * @param {number} k - 参数
  61379. * @return {number} 按四次方缓动退出的值
  61380. */
  61381. }, {
  61382. key: "QuarticOut",
  61383. value: function QuarticOut(k) {
  61384. return 1 - --k * k * k * k;
  61385. }
  61386. /**
  61387. * @function SuperMap.LevelRenderer.Animation.easing.QuarticInOut
  61388. * @description 返回按四次方缓动进入退出的值
  61389. * @param {number} k - 参数
  61390. * @return {number} 按四次方缓动进入退出的值
  61391. */
  61392. }, {
  61393. key: "QuarticInOut",
  61394. value: function QuarticInOut(k) {
  61395. if ((k *= 2) < 1) {
  61396. return 0.5 * k * k * k * k;
  61397. }
  61398. return -0.5 * ((k -= 2) * k * k * k - 2);
  61399. } // 五次方的缓动(t^5)
  61400. /**
  61401. * @function SuperMap.LevelRenderer.Animation.easing.QuinticIn
  61402. * @description 返回按五次方缓动的值
  61403. * @param {number} k - 参数
  61404. * @return {number} 按五次方缓动的值
  61405. */
  61406. }, {
  61407. key: "QuinticIn",
  61408. value: function QuinticIn(k) {
  61409. return k * k * k * k * k;
  61410. }
  61411. /**
  61412. * @function SuperMap.LevelRenderer.Animation.easing.QuinticOut
  61413. * @description 返回按五次方缓动退出的值
  61414. * @param {number} k - 参数
  61415. * @return {number} 按五次方缓动退出的值
  61416. */
  61417. }, {
  61418. key: "QuinticOut",
  61419. value: function QuinticOut(k) {
  61420. return --k * k * k * k * k + 1;
  61421. }
  61422. /**
  61423. * @function SuperMap.LevelRenderer.Animation.easing.QuinticInOut
  61424. * @description 返回按五次方缓动进入退出的值
  61425. * @param {number} k - 参数
  61426. * @return {number} 按五次方缓动进入退出的值
  61427. */
  61428. }, {
  61429. key: "QuinticInOut",
  61430. value: function QuinticInOut(k) {
  61431. if ((k *= 2) < 1) {
  61432. return 0.5 * k * k * k * k * k;
  61433. }
  61434. return 0.5 * ((k -= 2) * k * k * k * k + 2);
  61435. } // 正弦曲线的缓动(sin(t))
  61436. /**
  61437. * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalIn
  61438. * @description 返回按正弦曲线的缓动进入的值
  61439. * @param {number} k - 参数
  61440. * @return {number} 按正弦曲线的缓动进入的值
  61441. */
  61442. }, {
  61443. key: "SinusoidalIn",
  61444. value: function SinusoidalIn(k) {
  61445. return 1 - Math.cos(k * Math.PI / 2);
  61446. }
  61447. /**
  61448. * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalOut
  61449. * @description 返回按正弦曲线的缓动退出的值
  61450. * @param {number} k - 参数
  61451. * @return {number} 按正弦曲线的缓动退出的值
  61452. */
  61453. }, {
  61454. key: "SinusoidalOut",
  61455. value: function SinusoidalOut(k) {
  61456. return Math.sin(k * Math.PI / 2);
  61457. }
  61458. /**
  61459. * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalInOut
  61460. * @description 返回按正弦曲线的缓动进入退出的值
  61461. * @param {number} k - 参数
  61462. * @return {number} 按正弦曲线的缓动进入退出的值
  61463. */
  61464. }, {
  61465. key: "SinusoidalInOut",
  61466. value: function SinusoidalInOut(k) {
  61467. return 0.5 * (1 - Math.cos(Math.PI * k));
  61468. } // 指数曲线的缓动(2^t)
  61469. /**
  61470. * @function SuperMap.LevelRenderer.Animation.easing.ExponentialIn
  61471. * @description 返回按指数曲线的缓动进入的值
  61472. * @param {number} k - 参数
  61473. * @return {number} 按指数曲线的缓动进入的值
  61474. */
  61475. }, {
  61476. key: "ExponentialIn",
  61477. value: function ExponentialIn(k) {
  61478. return k === 0 ? 0 : Math.pow(1024, k - 1);
  61479. }
  61480. /**
  61481. * @function SuperMap.LevelRenderer.Animation.easing.ExponentialOut
  61482. * @description 返回按指数曲线的缓动退出的值
  61483. * @param {number} k - 参数
  61484. * @return {number} 按指数曲线的缓动退出的值
  61485. */
  61486. }, {
  61487. key: "ExponentialOut",
  61488. value: function ExponentialOut(k) {
  61489. return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
  61490. }
  61491. /**
  61492. * @function SuperMap.LevelRenderer.Animation.easing.ExponentialInOut
  61493. * @description 返回按指数曲线的缓动进入退出的值
  61494. * @param {number} k - 参数
  61495. * @return {number} 按指数曲线的缓动进入退出的值
  61496. */
  61497. }, {
  61498. key: "ExponentialInOut",
  61499. value: function ExponentialInOut(k) {
  61500. if (k === 0) {
  61501. return 0;
  61502. }
  61503. if (k === 1) {
  61504. return 1;
  61505. }
  61506. if ((k *= 2) < 1) {
  61507. return 0.5 * Math.pow(1024, k - 1);
  61508. }
  61509. return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
  61510. } // 圆形曲线的缓动(sqrt(1-t^2))
  61511. /**
  61512. * @function SuperMap.LevelRenderer.Animation.easing.CircularIn
  61513. * @description 返回按圆形曲线的缓动进入的值
  61514. * @param {number} k - 参数
  61515. * @return {number} 按圆形曲线的缓动进入的值
  61516. */
  61517. }, {
  61518. key: "CircularIn",
  61519. value: function CircularIn(k) {
  61520. return 1 - Math.sqrt(1 - k * k);
  61521. }
  61522. /**
  61523. * @function SuperMap.LevelRenderer.Animation.easing.CircularOut
  61524. * @description 返回按圆形曲线的缓动退出的值
  61525. * @param {number} k - 参数
  61526. * @return {number} 按圆形曲线的缓动退出的值
  61527. */
  61528. }, {
  61529. key: "CircularOut",
  61530. value: function CircularOut(k) {
  61531. return Math.sqrt(1 - --k * k);
  61532. }
  61533. /**
  61534. * @function SuperMap.LevelRenderer.Animation.easing.CircularInOut
  61535. * @description 返回按圆形曲线的缓动进入退出的值
  61536. * @param {number} k - 参数
  61537. * @return {number} 按圆形曲线的缓动进入退出的值
  61538. */
  61539. }, {
  61540. key: "CircularInOut",
  61541. value: function CircularInOut(k) {
  61542. if ((k *= 2) < 1) {
  61543. return -0.5 * (Math.sqrt(1 - k * k) - 1);
  61544. }
  61545. return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
  61546. } // 创建类似于弹簧在停止前来回振荡的动画
  61547. /**
  61548. * @function SuperMap.LevelRenderer.Animation.easing.ElasticIn
  61549. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  61550. * @param {number} k - 参数
  61551. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  61552. */
  61553. }, {
  61554. key: "ElasticIn",
  61555. value: function ElasticIn(k) {
  61556. var s;
  61557. var a = 0.1;
  61558. var p = 0.4;
  61559. if (k === 0) {
  61560. return 0;
  61561. }
  61562. if (k === 1) {
  61563. return 1;
  61564. }
  61565. if (a < 1) {
  61566. a = 1;
  61567. s = p / 4;
  61568. } else {
  61569. s = p * Math.asin(1 / a) / (2 * Math.PI);
  61570. }
  61571. return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  61572. }
  61573. /**
  61574. * @function SuperMap.LevelRenderer.Animation.easing.ElasticOut
  61575. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  61576. * @param {number} k - 参数
  61577. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  61578. */
  61579. }, {
  61580. key: "ElasticOut",
  61581. value: function ElasticOut(k) {
  61582. var s;
  61583. var a = 0.1;
  61584. var p = 0.4;
  61585. if (k === 0) {
  61586. return 0;
  61587. }
  61588. if (k === 1) {
  61589. return 1;
  61590. }
  61591. if (a < 1) {
  61592. a = 1;
  61593. s = p / 4;
  61594. } else {
  61595. s = p * Math.asin(1 / a) / (2 * Math.PI);
  61596. }
  61597. return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;
  61598. }
  61599. /**
  61600. * @function SuperMap.LevelRenderer.Animation.easing.ElasticInOut
  61601. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  61602. * @param {number} k - 参数
  61603. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  61604. */
  61605. }, {
  61606. key: "ElasticInOut",
  61607. value: function ElasticInOut(k) {
  61608. var s;
  61609. var a = 0.1;
  61610. var p = 0.4;
  61611. if (k === 0) {
  61612. return 0;
  61613. }
  61614. if (k === 1) {
  61615. return 1;
  61616. }
  61617. if (a < 1) {
  61618. a = 1;
  61619. s = p / 4;
  61620. } else {
  61621. s = p * Math.asin(1 / a) / (2 * Math.PI);
  61622. }
  61623. if ((k *= 2) < 1) {
  61624. return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  61625. }
  61626. return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
  61627. } // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动
  61628. /**
  61629. * @function SuperMap.LevelRenderer.Animation.easing.BackIn
  61630. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  61631. * @param {number} k - 参数
  61632. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  61633. */
  61634. }, {
  61635. key: "BackIn",
  61636. value: function BackIn(k) {
  61637. var s = 1.70158;
  61638. return k * k * ((s + 1) * k - s);
  61639. }
  61640. /**
  61641. * @function SuperMap.LevelRenderer.Animation.easing.BackOut
  61642. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  61643. * @param {number} k - 参数
  61644. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  61645. */
  61646. }, {
  61647. key: "BackOut",
  61648. value: function BackOut(k) {
  61649. var s = 1.70158;
  61650. return --k * k * ((s + 1) * k + s) + 1;
  61651. }
  61652. /**
  61653. * @function SuperMap.LevelRenderer.Animation.easing.BackInOut
  61654. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  61655. * @param {number} k - 参数
  61656. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  61657. */
  61658. }, {
  61659. key: "BackInOut",
  61660. value: function BackInOut(k) {
  61661. var s = 1.70158 * 1.525;
  61662. if ((k *= 2) < 1) {
  61663. return 0.5 * (k * k * ((s + 1) * k - s));
  61664. }
  61665. return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
  61666. } // 创建弹跳效果
  61667. /**
  61668. * @function SuperMap.LevelRenderer.Animation.easing.BounceIn
  61669. * @description 返回按弹跳效果的缓动进入的值
  61670. * @param {number} k - 参数
  61671. * @return {number} 按弹跳效果的缓动进入的值
  61672. */
  61673. }, {
  61674. key: "BounceIn",
  61675. value: function BounceIn(k) {
  61676. return 1 - this.BounceOut(1 - k);
  61677. }
  61678. /**
  61679. * @function SuperMap.LevelRenderer.Animation.easing.BounceOut
  61680. * @description 返回按弹跳效果的缓动退出的值
  61681. * @param {number} k - 参数
  61682. * @return {number} 按弹跳效果的缓动退出的值
  61683. */
  61684. }, {
  61685. key: "BounceOut",
  61686. value: function BounceOut(k) {
  61687. if (k < 1 / 2.75) {
  61688. return 7.5625 * k * k;
  61689. } else if (k < 2 / 2.75) {
  61690. return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;
  61691. } else if (k < 2.5 / 2.75) {
  61692. return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;
  61693. } else {
  61694. return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;
  61695. }
  61696. }
  61697. /**
  61698. * @function SuperMap.LevelRenderer.Animation.easing.BounceInOut
  61699. * @description 返回按弹跳效果的缓动进入退出的值
  61700. * @param {number} k - 参数
  61701. * @return {number} 按弹跳效果的缓动进入退出的值
  61702. */
  61703. }, {
  61704. key: "BounceInOut",
  61705. value: function BounceInOut(k) {
  61706. if (k < 0.5) {
  61707. return this.BounceIn(k * 2) * 0.5;
  61708. }
  61709. return this.BounceOut(k * 2 - 1) * 0.5 + 0.5;
  61710. }
  61711. }]);
  61712. return Easing;
  61713. }();
  61714. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Clip.js
  61715. function Clip_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61716. 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); } }
  61717. function Clip_createClass(Constructor, protoProps, staticProps) { if (protoProps) Clip_defineProperties(Constructor.prototype, protoProps); if (staticProps) Clip_defineProperties(Constructor, staticProps); return Constructor; }
  61718. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61719. * This program are made available under the terms of the Apache License, Version 2.0
  61720. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61721. /**
  61722. * @class SuperMap.LevelRenderer.Animation.Clip
  61723. * @category Visualization Theme
  61724. * @classdec 动画片段
  61725. * @private
  61726. */
  61727. var Clip = /*#__PURE__*/function () {
  61728. /**
  61729. * @function SuperMap.LevelRenderer.Animation.Clip.prototype.constructor
  61730. * @description 构造函数。
  61731. * @param {Object} options - 参数。
  61732. * @param {Object} options.target - 动画对象,可以是数组,如果是数组的话会批量分发 onframe 等事件。
  61733. * @param {number} [options.life=1000] - 动画时长。
  61734. * @param {number} [options.delay=0] - 动画延迟时间。
  61735. * @param {boolean} [options.loop=true] - 是否循环。
  61736. * @param {number} [options.gap=0] - 循环的间隔时间。
  61737. * @param {Object} options.onframe - 帧。
  61738. * @param {boolean} options.easing - 是否消除。
  61739. * @param {boolean} options.ondestroy - 是否销毁。
  61740. * @param {boolean} options.onrestart - 是否重播。
  61741. */
  61742. function Clip(options) {
  61743. Clip_classCallCheck(this, Clip);
  61744. this._targetPool = options.target || {};
  61745. if (!(this._targetPool instanceof Array)) {
  61746. this._targetPool = [this._targetPool];
  61747. } // 生命周期
  61748. this._life = options.life || 1000; // 延时
  61749. this._delay = options.delay || 0; // 开始时间
  61750. this._startTime = new Date().getTime() + this._delay; // 单位毫秒
  61751. // 结束时间
  61752. this._endTime = this._startTime + this._life * 1000; // 是否循环
  61753. this.loop = typeof options.loop == 'undefined' ? false : options.loop;
  61754. this.gap = options.gap || 0;
  61755. this.easing = options.easing || 'Linear';
  61756. this.onframe = options.onframe;
  61757. this.ondestroy = options.ondestroy;
  61758. this.onrestart = options.onrestart;
  61759. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Clip";
  61760. }
  61761. /**
  61762. * @function SuperMap.LevelRenderer.Animation.Clip.prototype.destroy
  61763. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  61764. */
  61765. Clip_createClass(Clip, [{
  61766. key: "destroy",
  61767. value: function destroy() {}
  61768. }, {
  61769. key: "step",
  61770. value: function step(time) {
  61771. var easing = new Easing();
  61772. var percent = (time - this._startTime) / this._life; // 还没开始
  61773. if (percent < 0) {
  61774. return;
  61775. }
  61776. percent = Math.min(percent, 1);
  61777. var easingFunc = typeof this.easing == 'string' ? easing[this.easing] : this.easing;
  61778. var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent;
  61779. this.fire('frame', schedule); // 结束
  61780. if (percent == 1) {
  61781. if (this.loop) {
  61782. this.restart(); // 重新开始周期
  61783. // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件
  61784. return 'restart';
  61785. } // 动画完成将这个控制器标识为待删除
  61786. // 在Animation.update中进行批量删除
  61787. this._needsRemove = true;
  61788. return 'destroy';
  61789. }
  61790. return null;
  61791. }
  61792. }, {
  61793. key: "restart",
  61794. value: function restart() {
  61795. var time = new Date().getTime();
  61796. var remainder = (time - this._startTime) % this._life;
  61797. this._startTime = new Date().getTime() - remainder + this.gap;
  61798. }
  61799. }, {
  61800. key: "fire",
  61801. value: function fire(eventType, arg) {
  61802. for (var i = 0, len = this._targetPool.length; i < len; i++) {
  61803. if (this['on' + eventType]) {
  61804. this['on' + eventType](this._targetPool[i], arg);
  61805. }
  61806. }
  61807. }
  61808. }]);
  61809. return Clip;
  61810. }();
  61811. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Animation.js
  61812. function Animation_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Animation_typeof = function _typeof(obj) { return typeof obj; }; } else { Animation_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Animation_typeof(obj); }
  61813. function Animation_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61814. 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); } }
  61815. function Animation_createClass(Constructor, protoProps, staticProps) { if (protoProps) Animation_defineProperties(Constructor.prototype, protoProps); if (staticProps) Animation_defineProperties(Constructor, staticProps); return Constructor; }
  61816. function Animation_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Animation_setPrototypeOf(subClass, superClass); }
  61817. function Animation_setPrototypeOf(o, p) { Animation_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Animation_setPrototypeOf(o, p); }
  61818. 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); }; }
  61819. function Animation_possibleConstructorReturn(self, call) { if (call && (Animation_typeof(call) === "object" || typeof call === "function")) { return call; } return Animation_assertThisInitialized(self); }
  61820. function Animation_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  61821. function Animation_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  61822. function Animation_getPrototypeOf(o) { Animation_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Animation_getPrototypeOf(o); }
  61823. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61824. * This program are made available under the terms of the Apache License, Version 2.0
  61825. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61826. /**
  61827. * @class SuperMap.LevelRenderer.Animation
  61828. * @classdesc 动画主类, 调度和管理所有动画控制器
  61829. * @category Visualization Theme
  61830. * @extends {SuperMap.LevelRenderer.Eventful}
  61831. * @private
  61832. */
  61833. var Animation = /*#__PURE__*/function (_Eventful) {
  61834. Animation_inherits(Animation, _Eventful);
  61835. var _super = Animation_createSuper(Animation);
  61836. /**
  61837. * @function SuperMap.LevelRenderer.Animation.prototype.constructor
  61838. * @description 构造函数。
  61839. * @param {Object} options - 动画参数。
  61840. * @param {Object} options.onframe - onframe。
  61841. * @param {Object} options.stage - stage。
  61842. * (start code)
  61843. * var animation = new SuperMap.LevelRenderer.Animation();
  61844. * var obj = {
  61845. * x: 100,
  61846. * y: 100
  61847. * };
  61848. * animation.animate(node.position)
  61849. * .when(1000, {
  61850. * x: 500,
  61851. * y: 500
  61852. * })
  61853. * .when(2000, {
  61854. * x: 100,
  61855. * y: 100
  61856. * })
  61857. * .start('spline');
  61858. * (end)
  61859. */
  61860. function Animation(options) {
  61861. var _this;
  61862. Animation_classCallCheck(this, Animation);
  61863. _this = _super.call(this, options);
  61864. options = options || {};
  61865. /**
  61866. * @member {Object} SuperMap.LevelRenderer.Animation.prototype.stage
  61867. * @description stage。
  61868. */
  61869. _this.stage = {};
  61870. /**
  61871. * @member {Object} SuperMap.LevelRenderer.Animation.prototype.onframe
  61872. * @description onframe。
  61873. */
  61874. _this.onframe = function () {};
  61875. /**
  61876. * @member {Array} SuperMap.LevelRenderer.Animation.prototype._clips
  61877. * @description _clips。
  61878. */
  61879. _this._clips = [];
  61880. /**
  61881. * @member {boolean} SuperMap.LevelRenderer.Animation.prototype._running
  61882. * @description _running。
  61883. */
  61884. _this._running = false;
  61885. /**
  61886. * @member {number} SuperMap.LevelRenderer.Animation.prototype._time
  61887. * @description _time。
  61888. */
  61889. _this._time = 0;
  61890. Util.extend(Animation_assertThisInitialized(_this), options);
  61891. _this.CLASS_NAME = "SuperMap.LevelRenderer.Animation";
  61892. return _this;
  61893. }
  61894. /**
  61895. * @function SuperMap.LevelRenderer.Animation.prototype.add
  61896. * @description 添加动画片段。
  61897. * @param {SuperMap.LevelRenderer.Animation.Clip} clip - 动画片段。
  61898. */
  61899. Animation_createClass(Animation, [{
  61900. key: "add",
  61901. value: function add(clip) {
  61902. this._clips.push(clip);
  61903. }
  61904. /**
  61905. * @function SuperMap.LevelRenderer.Animation.prototype.remove
  61906. * @description 删除动画片段。
  61907. * @param {SuperMap.LevelRenderer.Animation.Clip} clip - 动画片段。
  61908. */
  61909. }, {
  61910. key: "remove",
  61911. value: function remove(clip) {
  61912. var idx = new Util_Util().indexOf(this._clips, clip);
  61913. if (idx >= 0) {
  61914. this._clips.splice(idx, 1);
  61915. }
  61916. }
  61917. /**
  61918. * @function SuperMap.LevelRenderer.Animation.prototype.update
  61919. * @description 更新动画片段。
  61920. */
  61921. }, {
  61922. key: "_update",
  61923. value: function _update() {
  61924. var time = new Date().getTime();
  61925. var delta = time - this._time;
  61926. var clips = this._clips;
  61927. var len = clips.length;
  61928. var deferredEvents = [];
  61929. var deferredClips = [];
  61930. for (var i = 0; i < len; i++) {
  61931. var clip = clips[i];
  61932. var e = clip.step(time); // Throw out the events need to be called after
  61933. // stage.update, like destroy
  61934. if (e) {
  61935. deferredEvents.push(e);
  61936. deferredClips.push(clip);
  61937. }
  61938. }
  61939. if (this.stage.update) {
  61940. this.stage.update();
  61941. } // Remove the finished clip
  61942. for (var _i = 0; _i < len;) {
  61943. if (clips[_i]._needsRemove) {
  61944. clips[_i] = clips[len - 1];
  61945. clips.pop();
  61946. len--;
  61947. } else {
  61948. _i++;
  61949. }
  61950. }
  61951. len = deferredEvents.length;
  61952. for (var _i2 = 0; _i2 < len; _i2++) {
  61953. deferredClips[_i2].fire(deferredEvents[_i2]);
  61954. }
  61955. this._time = time;
  61956. this.onframe(delta);
  61957. this.dispatch('frame', delta);
  61958. }
  61959. /**
  61960. * @function SuperMap.LevelRenderer.Animation.prototype.start
  61961. * @description 开始运行动画。
  61962. */
  61963. }, {
  61964. key: "start",
  61965. value: function start() {
  61966. var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) {
  61967. setTimeout(func, 16);
  61968. };
  61969. var self = this;
  61970. this._running = true;
  61971. function step() {
  61972. if (self._running) {
  61973. self._update();
  61974. requestAnimationFrame(step);
  61975. }
  61976. }
  61977. this._time = new Date().getTime();
  61978. requestAnimationFrame(step);
  61979. }
  61980. /**
  61981. * @function SuperMap.LevelRenderer.Animation.prototype.stop
  61982. * @description 停止运行动画。
  61983. */
  61984. }, {
  61985. key: "stop",
  61986. value: function stop() {
  61987. this._running = false;
  61988. }
  61989. /**
  61990. * @function SuperMap.LevelRenderer.Animation.prototype.clear
  61991. * @description 清除所有动画片段。
  61992. */
  61993. }, {
  61994. key: "clear",
  61995. value: function clear() {
  61996. this._clips = [];
  61997. }
  61998. /**
  61999. * @function SuperMap.LevelRenderer.Animation.prototype.animate
  62000. * @description 对一个目标创建一个animator对象,可以指定目标中的属性使用动画。
  62001. * @param {Object} target - 目标对象。
  62002. * @param {Object} options - 动画参数选项。
  62003. * @param {boolean} [options.loop=false] - 是否循环播放动画。
  62004. * @param {function} [options.getter] - 如果指定getter函数,会通过getter函数取属性值。
  62005. * @param {function} [options.setter] - 如果指定setter函数,会通过setter函数设置属性值。
  62006. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator。
  62007. */
  62008. }, {
  62009. key: "animate",
  62010. value: function animate(target, options) {
  62011. options = options || {};
  62012. var deferred = new Animator(target, options.loop, options.getter, options.setter);
  62013. deferred.animation = this;
  62014. return deferred;
  62015. }
  62016. }], [{
  62017. key: "_interpolateNumber",
  62018. value: function _interpolateNumber(p0, p1, percent) {
  62019. return (p1 - p0) * percent + p0;
  62020. }
  62021. }, {
  62022. key: "_interpolateArray",
  62023. value: function _interpolateArray(p0, p1, percent, out, arrDim) {
  62024. var len = p0.length;
  62025. if (arrDim == 1) {
  62026. for (var i = 0; i < len; i++) {
  62027. out[i] = Animation._interpolateNumber(p0[i], p1[i], percent);
  62028. }
  62029. } else {
  62030. var len2 = p0[0].length;
  62031. for (var _i3 = 0; _i3 < len; _i3++) {
  62032. for (var j = 0; j < len2; j++) {
  62033. out[_i3][j] = Animation._interpolateNumber(p0[_i3][j], p1[_i3][j], percent);
  62034. }
  62035. }
  62036. }
  62037. }
  62038. }, {
  62039. key: "_isArrayLike",
  62040. value: function _isArrayLike(data) {
  62041. switch (Animation_typeof(data)) {
  62042. case 'undefined':
  62043. case 'string':
  62044. return false;
  62045. }
  62046. return typeof data.length !== 'undefined';
  62047. }
  62048. }, {
  62049. key: "_catmullRomInterpolateArray",
  62050. value: function _catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {
  62051. var len = p0.length;
  62052. if (arrDim == 1) {
  62053. for (var i = 0; i < len; i++) {
  62054. out[i] = Animation._catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);
  62055. }
  62056. } else {
  62057. var len2 = p0[0].length;
  62058. for (var _i4 = 0; _i4 < len; _i4++) {
  62059. for (var j = 0; j < len2; j++) {
  62060. out[_i4][j] = Animation._catmullRomInterpolate(p0[_i4][j], p1[_i4][j], p2[_i4][j], p3[_i4][j], t, t2, t3);
  62061. }
  62062. }
  62063. }
  62064. }
  62065. }, {
  62066. key: "_catmullRomInterpolate",
  62067. value: function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {
  62068. var v0 = (p2 - p0) * 0.5;
  62069. var v1 = (p3 - p1) * 0.5;
  62070. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  62071. }
  62072. }, {
  62073. key: "_cloneValue",
  62074. value: function _cloneValue(value) {
  62075. var arraySlice = Array.prototype.slice;
  62076. if (Animation._isArrayLike(value)) {
  62077. var len = value.length;
  62078. if (Animation._isArrayLike(value[0])) {
  62079. var ret = [];
  62080. for (var i = 0; i < len; i++) {
  62081. ret.push(arraySlice.call(value[i]));
  62082. }
  62083. return ret;
  62084. } else {
  62085. return arraySlice.call(value);
  62086. }
  62087. } else {
  62088. return value;
  62089. }
  62090. }
  62091. }, {
  62092. key: "rgba2String",
  62093. value: function rgba2String(rgba) {
  62094. rgba[0] = Math.floor(rgba[0]);
  62095. rgba[1] = Math.floor(rgba[1]);
  62096. rgba[2] = Math.floor(rgba[2]);
  62097. return 'rgba(' + rgba.join(',') + ')';
  62098. }
  62099. }]);
  62100. return Animation;
  62101. }(Eventful);
  62102. /**
  62103. * @class SuperMap.LevelRenderer.Animation.Animator
  62104. */
  62105. var Animator = /*#__PURE__*/function () {
  62106. /**
  62107. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.animate
  62108. * @description 构造函数
  62109. * @param {Object} target - 目标对象。
  62110. * @param {Object} options - 动画参数选项。
  62111. * @param {boolean} [loop=false] - 是否循环播放动画。
  62112. * @param {function} [getterl] - 如果指定getter函数,会通过getter函数取属性值。
  62113. * @param {function} [setter] - 如果指定setter函数,会通过setter函数设置属性值。
  62114. */
  62115. function Animator(target, loop, getter, setter) {
  62116. Animation_classCallCheck(this, Animator);
  62117. /**
  62118. * @member {Object} SuperMap.LevelRenderer.Animation.Animator.prototype._tracks
  62119. * @description _tracks。
  62120. */
  62121. this._tracks = {};
  62122. /**
  62123. * @member {Object} SuperMap.LevelRenderer.Animation.Animator.prototype._target
  62124. * @description _target。
  62125. */
  62126. this._target = target;
  62127. /**
  62128. * @member {boolean} SuperMap.LevelRenderer.Animation.Animator.prototype._loop
  62129. * @description _loop。
  62130. */
  62131. this._loop = loop || false;
  62132. /**
  62133. * @member {function} SuperMap.LevelRenderer.Animation.Animator.prototype._getter
  62134. * @description _getter。
  62135. */
  62136. this._getter = getter || _defaultGetter;
  62137. /**
  62138. * @member {function} SuperMap.LevelRenderer.Animation.Animator.prototype._setter
  62139. * @description _setter。
  62140. */
  62141. this._setter = setter || _defaultSetter;
  62142. /**
  62143. * @member {number} SuperMap.LevelRenderer.Animation.Animator.prototype._clipCount
  62144. * @description _clipCount。
  62145. */
  62146. this._clipCount = 0;
  62147. /**
  62148. * @member {number} SuperMap.LevelRenderer.Animation.Animator.prototype._delay
  62149. * @description _delay。
  62150. */
  62151. this._delay = 0;
  62152. /**
  62153. * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._doneList
  62154. * @description _doneList。
  62155. */
  62156. this._doneList = [];
  62157. /**
  62158. * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._onframeList
  62159. * @description _onframeList。
  62160. */
  62161. this._onframeList = [];
  62162. /**
  62163. * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._clipList
  62164. * @description _clipList。
  62165. */
  62166. this._clipList = [];
  62167. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Animator"; //Function
  62168. function _defaultGetter(target, key) {
  62169. return target[key];
  62170. }
  62171. function _defaultSetter(target, key, value) {
  62172. target[key] = value;
  62173. }
  62174. }
  62175. /**
  62176. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.when
  62177. * @description 设置动画关键帧
  62178. * @param {number} time - 关键帧时间,单位是ms
  62179. * @param {Object} props - 关键帧的属性值,key-value表示
  62180. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  62181. */
  62182. Animation_createClass(Animator, [{
  62183. key: "when",
  62184. value: function when(time
  62185. /* ms */
  62186. , props) {
  62187. for (var propName in props) {
  62188. if (!this._tracks[propName]) {
  62189. this._tracks[propName] = []; // If time is 0
  62190. // Then props is given initialize value
  62191. // Else
  62192. // Initialize value from current prop value
  62193. if (time !== 0) {
  62194. this._tracks[propName].push({
  62195. time: 0,
  62196. value: Animation._cloneValue(this._getter(this._target, propName))
  62197. });
  62198. }
  62199. }
  62200. this._tracks[propName].push({
  62201. time: parseInt(time, 10),
  62202. value: props[propName]
  62203. });
  62204. }
  62205. return this;
  62206. }
  62207. /**
  62208. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.during
  62209. * @description 添加动画每一帧的回调函数
  62210. * @param {RequestCallback} callback - 回调函数
  62211. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  62212. */
  62213. }, {
  62214. key: "during",
  62215. value: function during(callback) {
  62216. this._onframeList.push(callback);
  62217. return this;
  62218. }
  62219. /**
  62220. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.start
  62221. * @description 开始执行动画
  62222. * @param {(string|function)} easing - 动画缓动函数。详见:<{@link SuperMap.LevelRenderer.Animation.easing}>。
  62223. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  62224. */
  62225. }, {
  62226. key: "start",
  62227. value: function start(easing) {
  62228. var self = this;
  62229. var setter = this._setter;
  62230. var getter = this._getter;
  62231. var onFrameListLen = self._onframeList.length;
  62232. var useSpline = easing === 'spline';
  62233. var ondestroy = function ondestroy() {
  62234. self._clipCount--;
  62235. if (self._clipCount === 0) {
  62236. // Clear all tracks
  62237. self._tracks = {};
  62238. var len = self._doneList.length;
  62239. for (var i = 0; i < len; i++) {
  62240. self._doneList[i].call(self);
  62241. }
  62242. }
  62243. };
  62244. var createTrackClip = function createTrackClip(keyframes, propName) {
  62245. var trackLen = keyframes.length;
  62246. if (!trackLen) {
  62247. return;
  62248. } // Guess data type
  62249. var firstVal = keyframes[0].value;
  62250. var isValueArray = Animation._isArrayLike(firstVal);
  62251. var isValueColor = false; // For vertices morphing
  62252. var arrDim = isValueArray && Animation._isArrayLike(firstVal[0]) ? 2 : 1; // Sort keyframe as ascending
  62253. keyframes.sort(function (a, b) {
  62254. return a.time - b.time;
  62255. });
  62256. var trackMaxTime = keyframes[trackLen - 1].time; // Percents of each keyframe
  62257. var kfPercents = []; // Value of each keyframe
  62258. var kfValues = [];
  62259. for (var _i5 = 0; _i5 < trackLen; _i5++) {
  62260. kfPercents.push(keyframes[_i5].time / trackMaxTime); // Assume value is a color when it is a string
  62261. var value = keyframes[_i5].value;
  62262. if (typeof value == 'string') {
  62263. value = SUtil_SUtil.Util_color.toArray(value);
  62264. if (value.length === 0) {
  62265. // Invalid color
  62266. value[0] = value[1] = value[2] = 0;
  62267. value[3] = 1;
  62268. }
  62269. isValueColor = true;
  62270. }
  62271. kfValues.push(value);
  62272. } // Cache the key of last frame to speed up when
  62273. // animation playback is sequency
  62274. var cacheKey = 0;
  62275. var cachePercent = 0;
  62276. var start;
  62277. var i;
  62278. var w;
  62279. var p0;
  62280. var p1;
  62281. var p2;
  62282. var p3;
  62283. if (isValueColor) {
  62284. var rgba = [0, 0, 0, 0];
  62285. }
  62286. var onframe = function onframe(target, percent) {
  62287. // Find the range keyframes
  62288. // kf1-----kf2---------current--------kf3
  62289. // find kf2 and kf3 and do interpolation
  62290. if (percent < cachePercent) {
  62291. // Start from next key
  62292. start = Math.min(cacheKey + 1, trackLen - 1);
  62293. for (i = start; i >= 0; i--) {
  62294. if (kfPercents[i] <= percent) {
  62295. break;
  62296. }
  62297. }
  62298. i = Math.min(i, trackLen - 2);
  62299. } else {
  62300. for (i = cacheKey; i < trackLen; i++) {
  62301. if (kfPercents[i] > percent) {
  62302. break;
  62303. }
  62304. }
  62305. i = Math.min(i - 1, trackLen - 2);
  62306. }
  62307. cacheKey = i;
  62308. cachePercent = percent;
  62309. var range = kfPercents[i + 1] - kfPercents[i];
  62310. if (range === 0) {
  62311. return;
  62312. } else {
  62313. w = (percent - kfPercents[i]) / range;
  62314. }
  62315. if (useSpline) {
  62316. p1 = kfValues[i];
  62317. p0 = kfValues[i === 0 ? i : i - 1];
  62318. p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1];
  62319. p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2];
  62320. if (isValueArray) {
  62321. Animation._catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);
  62322. } else {
  62323. var _value;
  62324. if (isValueColor) {
  62325. // value = SuperMap.LevelRenderer.Animation._catmullRomInterpolateArray(
  62326. // p0, p1, p2, p3, w, w * w, w * w * w,
  62327. // rgba, 1
  62328. // );
  62329. _value = Animation.rgba2String(rgba);
  62330. } else {
  62331. _value = Animation._catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);
  62332. }
  62333. setter(target, propName, _value);
  62334. }
  62335. } else {
  62336. if (isValueArray) {
  62337. Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim);
  62338. } else {
  62339. var _value2;
  62340. if (isValueColor) {
  62341. Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, rgba, 1);
  62342. _value2 = Animation.rgba2String(rgba);
  62343. } else {
  62344. _value2 = Animation._interpolateNumber(kfValues[i], kfValues[i + 1], w);
  62345. }
  62346. setter(target, propName, _value2);
  62347. }
  62348. }
  62349. for (i = 0; i < onFrameListLen; i++) {
  62350. self._onframeList[i](target, percent);
  62351. }
  62352. };
  62353. var clip = new Clip({
  62354. target: self._target,
  62355. life: trackMaxTime,
  62356. loop: self._loop,
  62357. delay: self._delay,
  62358. onframe: onframe,
  62359. ondestroy: ondestroy
  62360. });
  62361. if (easing && easing !== 'spline') {
  62362. clip.easing = easing;
  62363. }
  62364. self._clipList.push(clip);
  62365. self._clipCount++;
  62366. self.animation.add(clip);
  62367. };
  62368. for (var propName in this._tracks) {
  62369. createTrackClip(this._tracks[propName], propName);
  62370. }
  62371. return this;
  62372. }
  62373. /**
  62374. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.stop
  62375. * @description 停止动画
  62376. */
  62377. }, {
  62378. key: "stop",
  62379. value: function stop() {
  62380. for (var i = 0; i < this._clipList.length; i++) {
  62381. var clip = this._clipList[i];
  62382. this.animation.remove(clip);
  62383. }
  62384. this._clipList = [];
  62385. }
  62386. /**
  62387. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.delay
  62388. * @description 设置动画延迟开始的时间
  62389. * @param {number} time - 时间,单位ms
  62390. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  62391. */
  62392. }, {
  62393. key: "delay",
  62394. value: function delay(time) {
  62395. this._delay = time;
  62396. return this;
  62397. }
  62398. /**
  62399. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.done
  62400. * @description 添加动画结束的回调
  62401. * @param {function} cb - Function
  62402. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  62403. */
  62404. }, {
  62405. key: "done",
  62406. value: function done(cb) {
  62407. if (cb) {
  62408. this._doneList.push(cb);
  62409. }
  62410. return this;
  62411. }
  62412. }]);
  62413. return Animator;
  62414. }();
  62415. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Render.js
  62416. function Render_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62417. 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); } }
  62418. function Render_createClass(Constructor, protoProps, staticProps) { if (protoProps) Render_defineProperties(Constructor.prototype, protoProps); if (staticProps) Render_defineProperties(Constructor, staticProps); return Constructor; }
  62419. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  62420. * This program are made available under the terms of the Apache License, Version 2.0
  62421. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62422. /**
  62423. * @private
  62424. * @class SuperMap.LevelRenderer.Render
  62425. * @category Visualization Theme
  62426. * @classdesc Render 接口类,对外可用的所有接口都在这里。内部使用非 get 接口统一返回 this 对象,支持链式调用。
  62427. */
  62428. var Render = /*#__PURE__*/function () {
  62429. /**
  62430. * @function SuperMap.LevelRenderer.Render.constructor
  62431. * @description 构造函数。
  62432. *
  62433. * @param {string} id - 唯一标识。
  62434. * @param {HTMLElement} dom - Dom 对象。
  62435. */
  62436. function Render(id, dom) {
  62437. Render_classCallCheck(this, Render);
  62438. /**
  62439. * @member {string} SuperMap.LevelRenderer.Render.prototype.id
  62440. * @description 唯一标识。
  62441. */
  62442. this.id = id;
  62443. /**
  62444. * @member {SuperMap.LevelRenderer.Storage} SuperMap.LevelRenderer.Render.prototype.storage
  62445. * @description 图形仓库对象。
  62446. */
  62447. this.storage = new Storage();
  62448. /**
  62449. * @member {SuperMap.LevelRenderer.Painter} SuperMap.LevelRenderer.Render.prototype.painter
  62450. * @description 绘制器对象。
  62451. *
  62452. */
  62453. this.painter = new Painter(dom, this.storage);
  62454. /**
  62455. * @member {SuperMap.LevelRenderer.Handler} SuperMap.LevelRenderer.Render.prototype.handler
  62456. * @description 事件处理对象。
  62457. *
  62458. */
  62459. this.handler = new Handler(dom, this.storage, this.painter);
  62460. /**
  62461. * @member {Array} SuperMap.LevelRenderer.Render.prototype.animatingElements
  62462. * @description 动画控制数组。
  62463. *
  62464. */
  62465. this.animatingElements = [];
  62466. /**
  62467. * @member {SuperMap.LevelRenderer.animation.Animation} SuperMap.LevelRenderer.Render.prototype.animation
  62468. * @description 动画对象。
  62469. *
  62470. */
  62471. this.animation = new Animation({
  62472. stage: {
  62473. update: Render.getFrameCallback(this)
  62474. }
  62475. });
  62476. /**
  62477. * @member {boolean} SuperMap.LevelRenderer.Render.prototype._needsRefreshNextFrame
  62478. * @description 是否需要刷新下一帧。
  62479. *
  62480. */
  62481. this._needsRefreshNextFrame = false;
  62482. this.animation.start();
  62483. this.CLASS_NAME = "SuperMap.LevelRenderer.Render";
  62484. }
  62485. /**
  62486. * @function SuperMap.LevelRenderer.Render.prototype.destory
  62487. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  62488. */
  62489. Render_createClass(Render, [{
  62490. key: "destroy",
  62491. value: function destroy() {
  62492. this.id = null;
  62493. this.storage = null;
  62494. this.painter = null;
  62495. this.handler = null;
  62496. this.animatingElements = null;
  62497. this.animation = null;
  62498. this._needsRefreshNextFrame = null;
  62499. }
  62500. /**
  62501. * @function SuperMap.LevelRenderer.Render.prototype.getId
  62502. * @description 获取实例唯一标识。
  62503. * @return {string} 实例唯一标识。
  62504. */
  62505. }, {
  62506. key: "getId",
  62507. value: function getId() {
  62508. return this.id;
  62509. }
  62510. /**
  62511. * @function SuperMap.LevelRenderer.Render.prototype.addShape
  62512. * @description 添加图形形状到根节点。
  62513. *
  62514. * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象,可用属性全集,详见各 shape。
  62515. * @return {SuperMap.LevelRenderer.Render} this。
  62516. */
  62517. }, {
  62518. key: "addShape",
  62519. value: function addShape(shape) {
  62520. this.storage.addRoot(shape);
  62521. return this;
  62522. }
  62523. /**
  62524. * @function SuperMap.LevelRenderer.Render.prototype.addGroup
  62525. * @description 添加组到根节点。
  62526. *
  62527. * (code)
  62528. * //添加组到根节点例子
  62529. * var render = new SuperMap.LevelRenderer.Render("Render",document.getElementById('lRendertest'));
  62530. * render.clear();
  62531. * var g = new SuperMap.LevelRenderer.Group();
  62532. * g.addChild(new SuperMap.LevelRenderer.Shape.Circle({
  62533. * style: {
  62534. * x: 100,
  62535. * y: 100,
  62536. * r: 20,
  62537. * brushType: 'fill'
  62538. * }
  62539. * }));
  62540. * render.addGroup(g);
  62541. * render.render();
  62542. * (end)
  62543. *
  62544. * @param {SuperMap.LevelRenderer.Group} group - 组对象。
  62545. * @return {SuperMap.LevelRenderer.Render} this。
  62546. */
  62547. }, {
  62548. key: "addGroup",
  62549. value: function addGroup(group) {
  62550. this.storage.addRoot(group);
  62551. return this;
  62552. }
  62553. /**
  62554. * @function SuperMap.LevelRenderer.Render.prototype.delShape
  62555. * @description 从根节点删除图形形状。
  62556. *
  62557. * @param {string} shapeId - 图形对象唯一标识。
  62558. * @return {SuperMap.LevelRenderer.Render} this。
  62559. */
  62560. }, {
  62561. key: "delShape",
  62562. value: function delShape(shapeId) {
  62563. this.storage.delRoot(shapeId);
  62564. return this;
  62565. }
  62566. /**
  62567. * @function SuperMap.LevelRenderer.Render.prototype.delGroup
  62568. * @description 从根节点删除组。
  62569. *
  62570. * @param {string} groupId - 组对象唯一标识。
  62571. * @return {SuperMap.LevelRenderer.Render} this。
  62572. */
  62573. }, {
  62574. key: "delGroup",
  62575. value: function delGroup(groupId) {
  62576. this.storage.delRoot(groupId);
  62577. return this;
  62578. }
  62579. /**
  62580. * @function SuperMap.LevelRenderer.Render.prototype.modShape
  62581. * @description 修改图形形状。
  62582. *
  62583. * @param {string} shapeId - 图形对象唯一标识。
  62584. * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象。
  62585. * @return {SuperMap.LevelRenderer.Render} this。
  62586. */
  62587. }, {
  62588. key: "modShape",
  62589. value: function modShape(shapeId, shape) {
  62590. this.storage.mod(shapeId, shape);
  62591. return this;
  62592. }
  62593. /**
  62594. * @function SuperMap.LevelRenderer.Render.prototype.modGroup
  62595. * @description 修改组。
  62596. *
  62597. * @param {string} groupId - 组对象唯一标识。
  62598. * @param {SuperMap.LevelRenderer.Group} group - 组对象。
  62599. * @return {SuperMap.LevelRenderer.Render} this。
  62600. */
  62601. }, {
  62602. key: "modGroup",
  62603. value: function modGroup(groupId, group) {
  62604. this.storage.mod(groupId, group);
  62605. return this;
  62606. }
  62607. /**
  62608. * @function SuperMap.LevelRenderer.Render.prototype.modLayer
  62609. * @description 修改指定 zlevel 的绘制配置项。
  62610. *
  62611. * @param {string} zLevel - 组对象唯一标识。
  62612. * @param {Object} config - 配置对象。
  62613. * @param {string} clearColor - 每次清空画布的颜色。默认值:0。
  62614. * @param {noolean} motionBlur - 是否开启动态模糊。默认值:false。
  62615. * @param {number} lastFrameAlpha - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  62616. * @param {Array.<number>} position - 层的平移。
  62617. * @param {Array.<number>} rotation - 层的旋转。
  62618. * @param {Array.<number>} scale - 层的缩放。
  62619. * @param {boolean} zoomable - 层是否支持鼠标缩放操作。默认值:false。
  62620. * @param {boolean} panable - 层是否支持鼠标平移操作。默认值:false。
  62621. * @return {SuperMap.LevelRenderer.Render} this。
  62622. */
  62623. }, {
  62624. key: "modLayer",
  62625. value: function modLayer(zLevel, config) {
  62626. this.painter.modLayer(zLevel, config);
  62627. return this;
  62628. }
  62629. /**
  62630. * @function SuperMap.LevelRenderer.Render.prototype.addHoverShape
  62631. * @description 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空。
  62632. *
  62633. * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象。
  62634. * @return {SuperMap.LevelRenderer.Render} this。
  62635. */
  62636. }, {
  62637. key: "addHoverShape",
  62638. value: function addHoverShape(shape) {
  62639. this.storage.addHover(shape);
  62640. return this;
  62641. }
  62642. /**
  62643. * @function SuperMap.LevelRenderer.Render.prototype.render
  62644. * @description 渲染。
  62645. *
  62646. * @callback {Function} callback - 渲染结束后回调函数。
  62647. * @return {SuperMap.LevelRenderer.Render} this。
  62648. */
  62649. }, {
  62650. key: "render",
  62651. value: function render(callback) {
  62652. this.painter.render(callback);
  62653. this._needsRefreshNextFrame = false;
  62654. return this;
  62655. }
  62656. /**
  62657. * @function SuperMap.LevelRenderer.Render.prototype.refresh
  62658. * @description 视图更新。
  62659. *
  62660. * @callback {Function} callback - 视图更新后回调函数。
  62661. * @return {SuperMap.LevelRenderer.Render} this。
  62662. */
  62663. }, {
  62664. key: "refresh",
  62665. value: function refresh(callback) {
  62666. this.painter.refresh(callback);
  62667. this._needsRefreshNextFrame = false;
  62668. return this;
  62669. }
  62670. /**
  62671. * @function SuperMap.LevelRenderer.Render.prototype.refreshNextFrame
  62672. * @description 标记视图在浏览器下一帧需要绘制。
  62673. * @return {SuperMap.LevelRenderer.Render} this。
  62674. */
  62675. }, {
  62676. key: "refreshNextFrame",
  62677. value: function refreshNextFrame() {
  62678. this._needsRefreshNextFrame = true;
  62679. return this;
  62680. }
  62681. /**
  62682. * @function SuperMap.LevelRenderer.Render.prototype.refreshHover
  62683. * @description 绘制(视图更新)高亮层。
  62684. * @callback {Function} callback - 视图更新后回调函数。
  62685. * @return {SuperMap.LevelRenderer.Render} this。
  62686. */
  62687. }, {
  62688. key: "refreshHover",
  62689. value: function refreshHover(callback) {
  62690. this.painter.refreshHover(callback);
  62691. return this;
  62692. }
  62693. /**
  62694. * @function SuperMap.LevelRenderer.Render.prototype.refreshShapes
  62695. * @description 视图更新。
  62696. *
  62697. * @param {Array.<SuperMap.LevelRenderer.Shape>} shapeList - 需要更新的图形列表。
  62698. * @callback {Function} callback - 视图更新后回调函数。
  62699. * @return {SuperMap.LevelRenderer.Render} this。
  62700. */
  62701. }, {
  62702. key: "refreshShapes",
  62703. value: function refreshShapes(shapeList, callback) {
  62704. this.painter.refreshShapes(shapeList, callback);
  62705. return this;
  62706. }
  62707. /**
  62708. * @function SuperMap.LevelRenderer.Render.prototype.resize
  62709. * @description 调整视图大小。
  62710. * @return {SuperMap.LevelRenderer.Render} this。
  62711. */
  62712. }, {
  62713. key: "resize",
  62714. value: function resize() {
  62715. this.painter.resize();
  62716. return this;
  62717. }
  62718. /**
  62719. * @function SuperMap.LevelRenderer.Render.prototype.animate
  62720. * @description 动画。
  62721. *
  62722. * @example
  62723. * zr.animate(circle.id, 'style', false)
  62724. * .when(1000, {x: 10} )
  62725. * .done(function(){ // Animation done })
  62726. * .start()
  62727. *
  62728. *
  62729. * @param {Array.<(SuperMap.LevelRenderer.Shape/SuperMap.LevelRenderer.Group)>} el - 动画对象。
  62730. * @param {string} path - 需要添加动画的属性获取路径,可以通过 a.b.c 来获取深层的属性。若传入对象为<SuperMap.LevelRenderer.Group>,path需为空字符串。
  62731. * @param {Function} loop - 动画是否循环。
  62732. * @return {SuperMap.LevelRenderer.animation.Animator} Animator。
  62733. */
  62734. }, {
  62735. key: "animate",
  62736. value: function animate(el, path, loop) {
  62737. if (typeof el === 'string') {
  62738. el = this.storage.get(el);
  62739. }
  62740. if (el) {
  62741. var target;
  62742. if (path) {
  62743. var pathSplitted = path.split('.');
  62744. var prop = el;
  62745. for (var i = 0, l = pathSplitted.length; i < l; i++) {
  62746. if (!prop) {
  62747. continue;
  62748. }
  62749. prop = prop[pathSplitted[i]];
  62750. }
  62751. if (prop) {
  62752. target = prop;
  62753. }
  62754. } else {
  62755. target = el;
  62756. }
  62757. if (!target) {
  62758. SUtil_SUtil.Util_log('Property "' + path + '" is not existed in element ' + el.id);
  62759. return;
  62760. }
  62761. var animatingElements = this.animatingElements;
  62762. if (typeof el.__aniCount === 'undefined') {
  62763. // 正在进行的动画记数
  62764. el.__aniCount = 0;
  62765. }
  62766. if (el.__aniCount === 0) {
  62767. animatingElements.push(el);
  62768. }
  62769. el.__aniCount++;
  62770. return this.animation.animate(target, {
  62771. loop: loop
  62772. }).done(function () {
  62773. el.__aniCount--;
  62774. if (el.__aniCount === 0) {
  62775. // 从animatingElements里移除
  62776. var idx = new Util_Util().indexOf(animatingElements, el);
  62777. animatingElements.splice(idx, 1);
  62778. }
  62779. });
  62780. } else {
  62781. SUtil_SUtil.Util_log('Element not existed');
  62782. }
  62783. }
  62784. /**
  62785. * @function SuperMap.LevelRenderer.Render.prototype.clearAnimation
  62786. * @description 停止所有动画。
  62787. *
  62788. */
  62789. }, {
  62790. key: "clearAnimation",
  62791. value: function clearAnimation() {
  62792. this.animation.clear();
  62793. }
  62794. /**
  62795. * @function SuperMap.LevelRenderer.Render.prototype.getWidth
  62796. * @description 获取视图宽度。
  62797. * @return {number} 视图宽度。
  62798. */
  62799. }, {
  62800. key: "getWidth",
  62801. value: function getWidth() {
  62802. return this.painter.getWidth();
  62803. }
  62804. /**
  62805. * @function SuperMap.LevelRenderer.Render.prototype.getHeight
  62806. * @description 获取视图高度。
  62807. * @return {number} 视图高度。
  62808. */
  62809. }, {
  62810. key: "getHeight",
  62811. value: function getHeight() {
  62812. return this.painter.getHeight();
  62813. }
  62814. /**
  62815. * @function SuperMap.LevelRenderer.Render.prototype.toDataURL
  62816. * @description 图像导出。
  62817. *
  62818. * @param {string} type - 类型。
  62819. * @param {string} backgroundColor - 背景色,默认值:"#FFFFFF"。
  62820. * @param {string} args - 参数。
  62821. * @return {string} 图片的 Base64 url。
  62822. */
  62823. }, {
  62824. key: "toDataURL",
  62825. value: function toDataURL(type, backgroundColor, args) {
  62826. return this.painter.toDataURL(type, backgroundColor, args);
  62827. }
  62828. /**
  62829. * @function SuperMap.LevelRenderer.Render.prototype.shapeToImage
  62830. * @description 将常规 shape 转成 image shape。
  62831. *
  62832. * @param {SuperMap.LevelRenderer.Shape} e - 图形。
  62833. * @param {number} width - 宽度。
  62834. * @param {number} height - 高度。
  62835. * @return {Object} image shape。
  62836. */
  62837. }, {
  62838. key: "shapeToImage",
  62839. value: function shapeToImage(e, width, height) {
  62840. var id = Util.createUniqueID("SuperMap.LevelRenderer.ToImage_");
  62841. return this.painter.shapeToImage(id, e, width, height);
  62842. }
  62843. /**
  62844. * @function SuperMap.LevelRenderer.Render.prototype.on
  62845. * @description 事件绑定。
  62846. *
  62847. * @param {string} eventName - 事件名称。
  62848. * @param {Function} eventHandler - 响应函数。
  62849. * @return {SuperMap.LevelRenderer.Render} this。
  62850. */
  62851. }, {
  62852. key: "on",
  62853. value: function on(eventName, eventHandler) {
  62854. this.handler.on(eventName, eventHandler);
  62855. return this;
  62856. }
  62857. /**
  62858. * @function SuperMap.LevelRenderer.Render.prototype.un
  62859. * @description 事件解绑定,参数为空则解绑所有自定义事件。
  62860. *
  62861. * @param {string} eventName - 事件名称。
  62862. * @param {Function} eventHandler - 响应函数。
  62863. * @return {SuperMap.LevelRenderer.Render} this。
  62864. */
  62865. }, {
  62866. key: "un",
  62867. value: function un(eventName, eventHandler) {
  62868. this.handler.un(eventName, eventHandler);
  62869. return this;
  62870. }
  62871. /**
  62872. * @function SuperMap.LevelRenderer.Render.prototype.trigger
  62873. * @description 事件触发。
  62874. *
  62875. * @param {string} eventName - 事件名称,resize,hover,drag,etc。
  62876. * @param {event} event - event dom事件对象。
  62877. * @return {SuperMap.LevelRenderer.Render} this。
  62878. */
  62879. }, {
  62880. key: "trigger",
  62881. value: function trigger(eventName, event) {
  62882. this.handler.trigger(eventName, event);
  62883. this.handler.dispatch(eventName, event);
  62884. return this;
  62885. }
  62886. /**
  62887. * @function SuperMap.LevelRenderer.Render.prototype.clear
  62888. * @description 清除当前 Render 下所有类图的数据和显示,clear 后 MVC 和已绑定事件均还存在在,Render 可用。
  62889. * @return {SuperMap.LevelRenderer.Render} this。
  62890. */
  62891. }, {
  62892. key: "clear",
  62893. value: function clear() {
  62894. this.storage.delRoot();
  62895. this.painter.clear();
  62896. return this;
  62897. }
  62898. /**
  62899. * @function SuperMap.LevelRenderer.Render.prototype.dispose
  62900. * @description 释放当前 Render 实例(删除包括 dom,数据、显示和事件绑定),dispose后 Render 不可用。
  62901. */
  62902. }, {
  62903. key: "dispose",
  62904. value: function dispose() {
  62905. this.animation.stop();
  62906. this.clear();
  62907. this.storage.dispose();
  62908. this.painter.dispose();
  62909. this.handler.dispose();
  62910. this.animation = null;
  62911. this.animatingElements = null;
  62912. this.storage = null;
  62913. this.painter = null;
  62914. this.handler = null; // 释放后告诉全局删除对自己的索引,没想到啥好方法
  62915. // zrender.delInstance(this.id);
  62916. } // SMIC-方法扩展 - start
  62917. /**
  62918. * @function SuperMap.LevelRenderer.Render.prototype.updateHoverShapes
  62919. * @description 更新设置显示高亮图层。
  62920. *
  62921. * @param {Array.<SuperMap.LevelRenderer.Shape>} shapes - 图形数组。
  62922. * @return {SuperMap.LevelRenderer.Render} this。
  62923. */
  62924. }, {
  62925. key: "updateHoverShapes",
  62926. value: function updateHoverShapes(shapes) {
  62927. this.painter.updateHoverLayer(shapes);
  62928. return this;
  62929. }
  62930. /**
  62931. * @function SuperMap.LevelRenderer.Render.prototype.getAllShapes
  62932. * @description 获取所有图形。
  62933. * @return {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
  62934. */
  62935. }, {
  62936. key: "getAllShapes",
  62937. value: function getAllShapes() {
  62938. return this.storage._shapeList;
  62939. }
  62940. /**
  62941. * @function SuperMap.LevelRenderer.Render.prototype.clearAll
  62942. * @description 清除高亮和图形图层。
  62943. * @return {SuperMap.LevelRenderer.Render} this。
  62944. */
  62945. }, {
  62946. key: "clearAll",
  62947. value: function clearAll() {
  62948. this.clear();
  62949. this.painter.clearHover();
  62950. return this;
  62951. }
  62952. /**
  62953. * @function SuperMap.LevelRenderer.Render.prototype.getHoverOne
  62954. * @description 获取单个高亮图形,当前鼠标对应。
  62955. * @return {SuperMap.LevelRenderer.Shape} 高亮图形。
  62956. */
  62957. }, {
  62958. key: "getHoverOne",
  62959. value: function getHoverOne() {
  62960. return this.handler.getLastHoverOne();
  62961. }
  62962. }], [{
  62963. key: "getFrameCallback",
  62964. value: function getFrameCallback(renderInstance) {
  62965. return function () {
  62966. var animatingElements = renderInstance.animatingElements; //animatingElements instanceof Array 临时解决 destory 报错
  62967. if (animatingElements instanceof Array) {
  62968. for (var i = 0, l = animatingElements.length; i < l; i++) {
  62969. renderInstance.storage.mod(animatingElements[i].id);
  62970. }
  62971. if (animatingElements.length || renderInstance._needsRefreshNextFrame) {
  62972. renderInstance.refresh();
  62973. }
  62974. }
  62975. };
  62976. } // SMIC-方法扩展 - end
  62977. }]);
  62978. return Render;
  62979. }();
  62980. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/LevelRenderer.js
  62981. function LevelRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62982. 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); } }
  62983. function LevelRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) LevelRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) LevelRenderer_defineProperties(Constructor, staticProps); return Constructor; }
  62984. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  62985. * This program are made available under the terms of the Apache License, Version 2.0
  62986. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62987. /**
  62988. * @class SuperMap.LevelRenderer
  62989. * @category Visualization Theme
  62990. * @classdesc LevelRenderer 渲染器
  62991. * @private
  62992. */
  62993. var LevelRenderer = /*#__PURE__*/function () {
  62994. /**
  62995. * @function SuperMap.LevelRenderer.constructor
  62996. * @description 构造函数。
  62997. * @example
  62998. * //在渲染器上加上图形
  62999. * var levelRenderer = new SuperMap.LevelRenderer();
  63000. * var zr = levelRenderer.init(document.getElementById('lRendertest'));
  63001. * zr.clear();
  63002. * zr.addShape(new SuperMap.LevelRenderer.Shape.Circle({
  63003. * style:{
  63004. * x : 100,
  63005. * y : 100,
  63006. * r : 50,
  63007. * brushType: 'fill'
  63008. * }
  63009. * }));
  63010. * zr.render();
  63011. */
  63012. function LevelRenderer() {
  63013. LevelRenderer_classCallCheck(this, LevelRenderer);
  63014. /**
  63015. * @member {Object} SuperMap.LevelRenderer.prototype._instances
  63016. * @description LevelRenderer 实例 map 索引
  63017. */
  63018. LevelRenderer._instances = {}; // 工具
  63019. LevelRenderer.Tool = {};
  63020. /**
  63021. * @member {string} SuperMap.LevelRenderer.prototype.version
  63022. * @description 版本。zRender(Baidu)的版本号
  63023. * 记录当前 LevelRenderer 是在 zRender 的那个版本上构建而来。
  63024. * 在每次完整评判和实施由 zRender(Baidu)升级带来的 LevelRenderer 升级后修改。
  63025. */
  63026. this.version = '2.0.4';
  63027. this.CLASS_NAME = "SuperMap.LevelRenderer";
  63028. }
  63029. /**
  63030. * @function SuperMap.LevelRenderer.prototype.destroy
  63031. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  63032. */
  63033. LevelRenderer_createClass(LevelRenderer, [{
  63034. key: "destroy",
  63035. value: function destroy() {
  63036. this.dispose();
  63037. this.version = null;
  63038. }
  63039. /**
  63040. * @function SuperMap.LevelRenderer.prototype.init
  63041. * @description 创建 LevelRenderer 实例。
  63042. * @param {HTMLElement} dom - 绘图容器。
  63043. * @returns {SuperMap.LevelRenderer} LevelRenderer 实例。
  63044. */
  63045. }, {
  63046. key: "init",
  63047. value: function init(dom) {
  63048. var zr = new Render(Util.createUniqueID("LRenderer_"), dom);
  63049. LevelRenderer._instances[zr.id] = zr;
  63050. return zr;
  63051. }
  63052. /**
  63053. * @function SuperMap.LevelRenderer.prototype.dispose
  63054. * @description LevelRenderer 实例销毁。
  63055. * 可以通过 zrender.dispose(zr) 销毁指定 SuperMap.LevelRenderer.Render 实例。
  63056. * 也可以通过 zr.dispose() 直接销毁
  63057. * @param {SuperMap.LevelRenderer.Render} zr - ZRender对象,不传此参数则销毁全部。
  63058. * @returns {SuperMap.LevelRenderer} this。
  63059. */
  63060. }, {
  63061. key: "dispose",
  63062. value: function dispose(zr) {
  63063. if (zr) {
  63064. zr.dispose();
  63065. this.delInstance(zr.id);
  63066. } else {
  63067. for (var key in LevelRenderer._instances) {
  63068. LevelRenderer._instances[key].dispose();
  63069. }
  63070. LevelRenderer._instances = {};
  63071. }
  63072. return this;
  63073. }
  63074. /**
  63075. * @function SuperMap.LevelRenderer.prototype.getInstance
  63076. * @description 获取 SuperMap.LevelRenderer.Render 实例。
  63077. * @param {string} id - ZRender对象索引。
  63078. * @returns {SuperMap.LevelRenderer.Render} SuperMap.LevelRenderer.Render 实例。
  63079. */
  63080. }, {
  63081. key: "getInstance",
  63082. value: function getInstance(id) {
  63083. return LevelRenderer._instances[id];
  63084. }
  63085. /**
  63086. * @function SuperMap.LevelRenderer.prototype.delInstance
  63087. * @description 删除 zrender 实例,SuperMap.LevelRenderer.Render 实例 dispose 时会调用,删除后 getInstance 则返回 undefined
  63088. * @param {string} id - ZRender对象索引。
  63089. * @param {string} id - SuperMap.LevelRenderer.Render 对象索引。
  63090. * @returns {SuperMap.LevelRenderer} this。
  63091. */
  63092. }, {
  63093. key: "delInstance",
  63094. value: function delInstance(id) {
  63095. delete LevelRenderer._instances[id];
  63096. return this;
  63097. }
  63098. }]);
  63099. return LevelRenderer;
  63100. }();
  63101. SuperMap.LevelRenderer = LevelRenderer;
  63102. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicEllipse.js
  63103. function SmicEllipse_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicEllipse_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicEllipse_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicEllipse_typeof(obj); }
  63104. function SmicEllipse_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63105. 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); } }
  63106. function SmicEllipse_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicEllipse_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicEllipse_defineProperties(Constructor, staticProps); return Constructor; }
  63107. function SmicEllipse_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicEllipse_get = Reflect.get; } else { SmicEllipse_get = function _get(target, property, receiver) { var base = SmicEllipse_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicEllipse_get(target, property, receiver || target); }
  63108. function SmicEllipse_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicEllipse_getPrototypeOf(object); if (object === null) break; } return object; }
  63109. function SmicEllipse_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicEllipse_setPrototypeOf(subClass, superClass); }
  63110. function SmicEllipse_setPrototypeOf(o, p) { SmicEllipse_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicEllipse_setPrototypeOf(o, p); }
  63111. 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); }; }
  63112. function SmicEllipse_possibleConstructorReturn(self, call) { if (call && (SmicEllipse_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicEllipse_assertThisInitialized(self); }
  63113. function SmicEllipse_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63114. function SmicEllipse_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63115. function SmicEllipse_getPrototypeOf(o) { SmicEllipse_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicEllipse_getPrototypeOf(o); }
  63116. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63117. * This program are made available under the terms of the Apache License, Version 2.0
  63118. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63119. /**
  63120. * @private
  63121. * @class SuperMap.LevelRenderer.Shape.SmicEllipse
  63122. * @category Visualization Theme
  63123. * @classdesc 椭圆。
  63124. * @extends SuperMap.LevelRenderer.Shape
  63125. * @example
  63126. * var shape = new SuperMap.LevelRenderer.Shape.SmicEllipse({
  63127. * style: {
  63128. * x: 100,
  63129. * y: 100,
  63130. * a: 40,
  63131. * b: 20,
  63132. * brushType: 'both',
  63133. * color: 'blue',
  63134. * strokeColor: 'red',
  63135. * lineWidth: 3,
  63136. * text: 'SmicEllipse'
  63137. * }
  63138. * });
  63139. * levelRenderer.addShape(shape);
  63140. *
  63141. *
  63142. */
  63143. var SmicEllipse = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  63144. SmicEllipse_inherits(SmicEllipse, _Shape);
  63145. var _super = SmicEllipse_createSuper(SmicEllipse);
  63146. /**
  63147. * @member {Object} SuperMap.LevelRenderer.Shape.SmicEllipse.style
  63148. * @description 绘制样式。
  63149. *
  63150. * @param {number} style.x - 圆心 x 坐标,必设参数。
  63151. * @param {number} style.y - 圆心 y 坐标,必设参数。
  63152. * @param {number} style.a - 横轴半径,必设参数。
  63153. * @param {number} style.b - 纵轴半径,必设参数。
  63154. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  63155. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  63156. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  63157. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  63158. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  63159. * @param {number} style.opacity - 绘制透明度。默认值:1。
  63160. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  63161. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  63162. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  63163. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  63164. * @param {string} style.text - 图形中的附加文本。默认值:""。
  63165. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  63166. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  63167. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  63168. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  63169. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  63170. */
  63171. //打开接口 style
  63172. /**
  63173. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.constructor
  63174. * @description 构造函数。
  63175. *
  63176. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  63177. *
  63178. */
  63179. function SmicEllipse(options) {
  63180. var _this;
  63181. SmicEllipse_classCallCheck(this, SmicEllipse);
  63182. _this = _super.call(this, options);
  63183. /**
  63184. * @member {string} SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.type
  63185. * @description 图形类型。
  63186. */
  63187. _this.type = 'smicellipse';
  63188. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  63189. _this.refOriginalPosition = [0, 0];
  63190. }
  63191. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicEllipse";
  63192. return _this;
  63193. }
  63194. /**
  63195. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.destroy
  63196. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  63197. */
  63198. SmicEllipse_createClass(SmicEllipse, [{
  63199. key: "destroy",
  63200. value: function destroy() {
  63201. this.type = null;
  63202. SmicEllipse_get(SmicEllipse_getPrototypeOf(SmicEllipse.prototype), "destroy", this).call(this);
  63203. }
  63204. /**
  63205. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.buildPath
  63206. * @description 构建椭圆的 Path。
  63207. *
  63208. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  63209. * @param {Object} style - style。
  63210. *
  63211. */
  63212. }, {
  63213. key: "buildPath",
  63214. value: function buildPath(ctx, style) {
  63215. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  63216. this.refOriginalPosition = [0, 0];
  63217. }
  63218. var __OP = this.refOriginalPosition;
  63219. var k = 0.5522848;
  63220. var x = style.x + __OP[0];
  63221. var y = style.y + __OP[1];
  63222. var a = style.a;
  63223. var b = style.b;
  63224. var ox = a * k; // 水平控制点偏移量
  63225. var oy = b * k; // 垂直控制点偏移量
  63226. // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线
  63227. ctx.moveTo(x - a, y);
  63228. ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);
  63229. ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);
  63230. ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);
  63231. ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);
  63232. ctx.closePath();
  63233. }
  63234. /**
  63235. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.getRect
  63236. * @description 计算返回椭圆包围盒矩形
  63237. *
  63238. * @param {Object} style - style
  63239. * @return {Object} 边框对象。包含属性:x,y,width,height。
  63240. *
  63241. */
  63242. }, {
  63243. key: "getRect",
  63244. value: function getRect(style) {
  63245. if (style.__rect) {
  63246. return style.__rect;
  63247. }
  63248. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  63249. this.refOriginalPosition = [0, 0];
  63250. }
  63251. var __OP = this.refOriginalPosition;
  63252. var lineWidth;
  63253. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  63254. lineWidth = style.lineWidth || 1;
  63255. } else {
  63256. lineWidth = 0;
  63257. }
  63258. style.__rect = {
  63259. x: Math.round(style.x + __OP[0] - style.a - lineWidth / 2),
  63260. y: Math.round(style.x + __OP[1] - style.b - lineWidth / 2),
  63261. width: style.a * 2 + lineWidth,
  63262. height: style.b * 2 + lineWidth
  63263. };
  63264. return style.__rect;
  63265. }
  63266. }]);
  63267. return SmicEllipse;
  63268. }(Shape)));
  63269. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicIsogon.js
  63270. function SmicIsogon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicIsogon_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicIsogon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicIsogon_typeof(obj); }
  63271. function SmicIsogon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63272. 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); } }
  63273. function SmicIsogon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicIsogon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicIsogon_defineProperties(Constructor, staticProps); return Constructor; }
  63274. function SmicIsogon_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicIsogon_get = Reflect.get; } else { SmicIsogon_get = function _get(target, property, receiver) { var base = SmicIsogon_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicIsogon_get(target, property, receiver || target); }
  63275. function SmicIsogon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicIsogon_getPrototypeOf(object); if (object === null) break; } return object; }
  63276. function SmicIsogon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicIsogon_setPrototypeOf(subClass, superClass); }
  63277. function SmicIsogon_setPrototypeOf(o, p) { SmicIsogon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicIsogon_setPrototypeOf(o, p); }
  63278. 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); }; }
  63279. function SmicIsogon_possibleConstructorReturn(self, call) { if (call && (SmicIsogon_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicIsogon_assertThisInitialized(self); }
  63280. function SmicIsogon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63281. function SmicIsogon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63282. function SmicIsogon_getPrototypeOf(o) { SmicIsogon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicIsogon_getPrototypeOf(o); }
  63283. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63284. * This program are made available under the terms of the Apache License, Version 2.0
  63285. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63286. /**
  63287. * @private
  63288. * @class SuperMap.LevelRenderer.Shape.SmicIsogon
  63289. * @category Visualization Theme
  63290. * @classdesc 正多边形。
  63291. * @extends SuperMap.LevelRenderer.Shape
  63292. */
  63293. var SmicIsogon = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  63294. SmicIsogon_inherits(SmicIsogon, _Shape);
  63295. var _super = SmicIsogon_createSuper(SmicIsogon);
  63296. /**
  63297. * @member {Object} SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.style
  63298. * @description 绘制样式。
  63299. *
  63300. * @param {number} x - 正 n 边形外接圆心 x 坐标,必设参数。
  63301. * @param {number} y - 正 n 边形外接圆心 y 坐标,必设参数。
  63302. * @param {number} r - 正n边形外接圆半径,必设参数。
  63303. * @param {number} n - 指明正几边形,必设参数(n>=3)。
  63304. * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  63305. * @param {string} color - 填充颜色。默认值:"#000000'"。
  63306. * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
  63307. * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  63308. * @param {number} lineWidth - 描边宽度。默认值:1。
  63309. * @param {number} opacity - 绘制透明度。默认值:1。
  63310. * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  63311. * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  63312. * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  63313. * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  63314. * @param {string} text - 图形中的附加文本。默认值:""。
  63315. * @param {string} textColor -文本颜色。默认值:"#000000'"。
  63316. * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
  63317. * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  63318. * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  63319. * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  63320. */
  63321. //打开接口 style
  63322. /**
  63323. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.constructor
  63324. * @description 构造函数。
  63325. *
  63326. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  63327. *
  63328. */
  63329. function SmicIsogon(options) {
  63330. var _this;
  63331. SmicIsogon_classCallCheck(this, SmicIsogon);
  63332. _this = _super.call(this, options);
  63333. /**
  63334. * @member {string} SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.type
  63335. * @description 图形类型。
  63336. */
  63337. _this.type = 'smicisogon';
  63338. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  63339. _this.refOriginalPosition = [0, 0];
  63340. }
  63341. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicIsogon";
  63342. return _this;
  63343. }
  63344. /**
  63345. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.destroy
  63346. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  63347. */
  63348. SmicIsogon_createClass(SmicIsogon, [{
  63349. key: "destroy",
  63350. value: function destroy() {
  63351. this.type = null;
  63352. SmicIsogon_get(SmicIsogon_getPrototypeOf(SmicIsogon.prototype), "destroy", this).call(this);
  63353. }
  63354. /**
  63355. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.buildPath
  63356. * @description 创建n角星(n>=3)路径。
  63357. *
  63358. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  63359. * @param {Object} style - style。
  63360. *
  63361. */
  63362. }, {
  63363. key: "buildPath",
  63364. value: function buildPath(ctx, style) {
  63365. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  63366. this.refOriginalPosition = [0, 0];
  63367. }
  63368. var __OP = this.refOriginalPosition;
  63369. var sin = SUtil.Util_math.sin;
  63370. var cos = SUtil.Util_math.cos;
  63371. var PI = Math.PI;
  63372. var n = style.n;
  63373. if (!n || n < 2) {
  63374. return;
  63375. }
  63376. var x = style.x + __OP[0];
  63377. var y = style.y + __OP[1];
  63378. var r = style.r;
  63379. var dStep = 2 * PI / n;
  63380. var deg = -PI / 2;
  63381. var xStart = x + r * cos(deg);
  63382. var yStart = y + r * sin(deg);
  63383. deg += dStep; // 记录边界点,用于判断insight
  63384. var pointList = style.pointList = [];
  63385. pointList.push([xStart, yStart]);
  63386. for (var i = 0, end = n - 1; i < end; i++) {
  63387. pointList.push([x + r * cos(deg), y + r * sin(deg)]);
  63388. deg += dStep;
  63389. }
  63390. pointList.push([xStart, yStart]); // 绘制
  63391. ctx.moveTo(pointList[0][0], pointList[0][1]);
  63392. for (var _i = 0; _i < pointList.length; _i++) {
  63393. ctx.lineTo(pointList[_i][0], pointList[_i][1]);
  63394. }
  63395. ctx.closePath();
  63396. return;
  63397. }
  63398. /**
  63399. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.getRect
  63400. * @description 计算返回正多边形的包围盒矩形。
  63401. *
  63402. * @param {Object} style - style
  63403. * @return {Object} 边框对象。包含属性:x,y,width,height。
  63404. */
  63405. }, {
  63406. key: "getRect",
  63407. value: function getRect(style) {
  63408. if (style.__rect) {
  63409. return style.__rect;
  63410. }
  63411. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  63412. this.refOriginalPosition = [0, 0];
  63413. }
  63414. var __OP = this.refOriginalPosition;
  63415. var lineWidth;
  63416. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  63417. lineWidth = style.lineWidth || 1;
  63418. } else {
  63419. lineWidth = 0;
  63420. }
  63421. style.__rect = {
  63422. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  63423. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  63424. width: style.r * 2 + lineWidth,
  63425. height: style.r * 2 + lineWidth
  63426. };
  63427. return style.__rect;
  63428. }
  63429. }]);
  63430. return SmicIsogon;
  63431. }(Shape)));
  63432. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRing.js
  63433. function SmicRing_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicRing_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicRing_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicRing_typeof(obj); }
  63434. function SmicRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63435. 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); } }
  63436. function SmicRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRing_defineProperties(Constructor, staticProps); return Constructor; }
  63437. function SmicRing_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicRing_get = Reflect.get; } else { SmicRing_get = function _get(target, property, receiver) { var base = SmicRing_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicRing_get(target, property, receiver || target); }
  63438. function SmicRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRing_getPrototypeOf(object); if (object === null) break; } return object; }
  63439. function SmicRing_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicRing_setPrototypeOf(subClass, superClass); }
  63440. function SmicRing_setPrototypeOf(o, p) { SmicRing_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRing_setPrototypeOf(o, p); }
  63441. 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); }; }
  63442. function SmicRing_possibleConstructorReturn(self, call) { if (call && (SmicRing_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicRing_assertThisInitialized(self); }
  63443. function SmicRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63444. function SmicRing_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63445. function SmicRing_getPrototypeOf(o) { SmicRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRing_getPrototypeOf(o); }
  63446. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63447. * This program are made available under the terms of the Apache License, Version 2.0
  63448. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63449. /**
  63450. * @private
  63451. * @class SuperMap.LevelRenderer.Shape.SmicRing
  63452. * @category Visualization Theme
  63453. * @classdesc 圆环。
  63454. * @extends SuperMap.LevelRenderer.Shape
  63455. * @example
  63456. * var shape = new SuperMap.LevelRenderer.Shape.SmicRing({
  63457. * style: {
  63458. * x: 100,
  63459. * y: 100,
  63460. * r0: 30,
  63461. * r: 50
  63462. * }
  63463. * });
  63464. * levelRenderer.addShape(shape);
  63465. *
  63466. */
  63467. var SmicRing = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  63468. SmicRing_inherits(SmicRing, _Shape);
  63469. var _super = SmicRing_createSuper(SmicRing);
  63470. /**
  63471. * @member {Object} SuperMap.LevelRenderer.Shape.SmicRing.prototype.style
  63472. * @description 绘制样式。
  63473. *
  63474. * @param {number} x - 圆心 x 坐标,必设参数。
  63475. * @param {number} y - 圆心 y 坐标,必设参数。
  63476. * @param {number} r - 外圆半径,必设参数。
  63477. * @param {number} r0 - 内圆半径,必设参数。
  63478. * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  63479. * @param {string} color - 填充颜色。默认值:"#000000'"。
  63480. * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
  63481. * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  63482. * @param {number} lineWidth -描边宽度。默认值:1。
  63483. * @param {number} opacity - 绘制透明度。默认值:1。
  63484. * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  63485. * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  63486. * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  63487. * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  63488. * @param {string} text -图形中的附加文本。默认值:""。
  63489. * @param {string} textColor - 文本颜色。默认值:"#000000'"。
  63490. * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
  63491. * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  63492. * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  63493. * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  63494. */
  63495. //打开接口 style
  63496. /**
  63497. * @function SuperMap.LevelRenderer.Shape.SmicRing.constructor
  63498. * @description 构造函数。
  63499. *
  63500. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  63501. */
  63502. function SmicRing(options) {
  63503. var _this;
  63504. SmicRing_classCallCheck(this, SmicRing);
  63505. _this = _super.call(this, options);
  63506. /**
  63507. * @member {string} SuperMap.LevelRenderer.Shape.SmicRing.prototype.type
  63508. * @description 图形类型。
  63509. */
  63510. _this.type = 'smicring';
  63511. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  63512. _this.refOriginalPosition = [0, 0];
  63513. }
  63514. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRing";
  63515. return _this;
  63516. }
  63517. /**
  63518. * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.destroy
  63519. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  63520. */
  63521. SmicRing_createClass(SmicRing, [{
  63522. key: "destroy",
  63523. value: function destroy() {
  63524. this.type = null;
  63525. SmicRing_get(SmicRing_getPrototypeOf(SmicRing.prototype), "destroy", this).call(this);
  63526. }
  63527. /**
  63528. * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.buildPath
  63529. * @description 创建圆环路径。
  63530. *
  63531. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  63532. * @param {Object} style - style。
  63533. *
  63534. */
  63535. }, {
  63536. key: "buildPath",
  63537. value: function buildPath(ctx, style) {
  63538. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  63539. this.refOriginalPosition = [0, 0];
  63540. }
  63541. var __OP = this.refOriginalPosition; // 非零环绕填充优化
  63542. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, false);
  63543. ctx.moveTo(style.x + __OP[0] + style.r0, style.y + __OP[1]);
  63544. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r0, 0, Math.PI * 2, true);
  63545. return;
  63546. }
  63547. /**
  63548. * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.getRect
  63549. * @description 计算返回圆环包围盒矩阵
  63550. *
  63551. * @param {Object} style - style
  63552. * @return {Object} 边框对象。包含属性:x,y,width,height。
  63553. */
  63554. }, {
  63555. key: "getRect",
  63556. value: function getRect(style) {
  63557. if (style.__rect) {
  63558. return style.__rect;
  63559. }
  63560. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  63561. this.refOriginalPosition = [0, 0];
  63562. }
  63563. var __OP = this.refOriginalPosition;
  63564. var lineWidth;
  63565. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  63566. lineWidth = style.lineWidth || 1;
  63567. } else {
  63568. lineWidth = 0;
  63569. }
  63570. style.__rect = {
  63571. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  63572. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  63573. width: style.r * 2 + lineWidth,
  63574. height: style.r * 2 + lineWidth
  63575. };
  63576. return style.__rect;
  63577. }
  63578. }]);
  63579. return SmicRing;
  63580. }(Shape)));
  63581. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicStar.js
  63582. function SmicStar_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicStar_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicStar_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicStar_typeof(obj); }
  63583. function SmicStar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63584. 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); } }
  63585. function SmicStar_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicStar_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicStar_defineProperties(Constructor, staticProps); return Constructor; }
  63586. function SmicStar_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicStar_get = Reflect.get; } else { SmicStar_get = function _get(target, property, receiver) { var base = SmicStar_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return SmicStar_get(target, property, receiver || target); }
  63587. function SmicStar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicStar_getPrototypeOf(object); if (object === null) break; } return object; }
  63588. function SmicStar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SmicStar_setPrototypeOf(subClass, superClass); }
  63589. function SmicStar_setPrototypeOf(o, p) { SmicStar_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicStar_setPrototypeOf(o, p); }
  63590. 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); }; }
  63591. function SmicStar_possibleConstructorReturn(self, call) { if (call && (SmicStar_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicStar_assertThisInitialized(self); }
  63592. function SmicStar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63593. function SmicStar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63594. function SmicStar_getPrototypeOf(o) { SmicStar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicStar_getPrototypeOf(o); }
  63595. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63596. * This program are made available under the terms of the Apache License, Version 2.0
  63597. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63598. /**
  63599. * @private
  63600. * @class SuperMap.LevelRenderer.Shape.SmicStar
  63601. * @category Visualization Theme
  63602. * @classdesc n 角星(n>3)。
  63603. * @extends SuperMap.LevelRenderer.Shape
  63604. * @example
  63605. * var shape = new SuperMap.LevelRenderer.Shape.SmicStar({
  63606. * style: {
  63607. * x: 200,
  63608. * y: 100,
  63609. * r: 150,
  63610. * n: 5,
  63611. * text: '五角星'
  63612. * }
  63613. * });
  63614. * levelRenderer.addShape(shape);
  63615. *
  63616. *
  63617. */
  63618. var SmicStar = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  63619. SmicStar_inherits(SmicStar, _Shape);
  63620. var _super = SmicStar_createSuper(SmicStar);
  63621. /**
  63622. * @member {Object} SuperMap.LevelRenderer.Shape.SmicStar.prototype.style
  63623. * @description 绘制样式。
  63624. *
  63625. * @param {number} style.x - n 角星外接圆心 x 坐标,必设参数。
  63626. * @param {number} style.y - n 角星外接圆心 y 坐标,必设参数。
  63627. * @param {number} style.r - n 角星外接圆半径,必设参数。
  63628. * @param {number} style.r0 - n 角星内部顶点(凹点)的外接圆半径。如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点。
  63629. * @param {number} style.n -指明几角星,必设参数。
  63630. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  63631. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  63632. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  63633. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  63634. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  63635. * @param {number} style.opacity - 绘制透明度。默认值:1。
  63636. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  63637. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  63638. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  63639. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  63640. * @param {string} style.text - 图形中的附加文本。默认值:""。
  63641. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  63642. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  63643. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  63644. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  63645. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  63646. */
  63647. //打开接口 style
  63648. /**
  63649. * @function SuperMap.LevelRenderer.Shape.SmicStar.constructor
  63650. * @description 构造函数。
  63651. *
  63652. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  63653. *
  63654. */
  63655. function SmicStar(options) {
  63656. var _this;
  63657. SmicStar_classCallCheck(this, SmicStar);
  63658. _this = _super.call(this, options);
  63659. /**
  63660. * @member {string} SuperMap.LevelRenderer.Shape.SmicStar.prototype.type
  63661. * @description 图形类型。
  63662. */
  63663. _this.type = 'smicstar';
  63664. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  63665. _this.refOriginalPosition = [0, 0];
  63666. }
  63667. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicStar";
  63668. return _this;
  63669. }
  63670. /**
  63671. * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.destroy
  63672. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  63673. */
  63674. SmicStar_createClass(SmicStar, [{
  63675. key: "destroy",
  63676. value: function destroy() {
  63677. this.type = null;
  63678. SmicStar_get(SmicStar_getPrototypeOf(SmicStar.prototype), "destroy", this).call(this);
  63679. }
  63680. /**
  63681. * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.buildPath
  63682. * @description 创建n 角星(n>3)路径。
  63683. *
  63684. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  63685. * @param {Object} style - style。
  63686. *
  63687. */
  63688. }, {
  63689. key: "buildPath",
  63690. value: function buildPath(ctx, style) {
  63691. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  63692. this.refOriginalPosition = [0, 0];
  63693. }
  63694. var __OP = this.refOriginalPosition;
  63695. var n = style.n;
  63696. if (!n || n < 2) {
  63697. return;
  63698. }
  63699. var sin = SUtil.Util_math.sin;
  63700. var cos = SUtil.Util_math.cos;
  63701. var PI = Math.PI;
  63702. var x = style.x + __OP[0];
  63703. var y = style.y + __OP[1];
  63704. var r = style.r;
  63705. var r0 = style.r0; // 如果未指定内部顶点外接圆半径,则自动计算
  63706. if (r0 == null) {
  63707. r0 = n > 4 // 相隔的外部顶点的连线的交点,
  63708. // 被取为内部交点,以此计算r0
  63709. ? r * cos(2 * PI / n) / cos(PI / n) // 二三四角星的特殊处理
  63710. : r / 3;
  63711. }
  63712. var dStep = PI / n;
  63713. var deg = -PI / 2;
  63714. var xStart = x + r * cos(deg);
  63715. var yStart = y + r * sin(deg);
  63716. deg += dStep; // 记录边界点,用于判断inside
  63717. var pointList = style.pointList = [];
  63718. pointList.push([xStart, yStart]);
  63719. for (var i = 0, end = n * 2 - 1, ri; i < end; i++) {
  63720. ri = i % 2 === 0 ? r0 : r;
  63721. pointList.push([x + ri * cos(deg), y + ri * sin(deg)]);
  63722. deg += dStep;
  63723. }
  63724. pointList.push([xStart, yStart]); // 绘制
  63725. ctx.moveTo(pointList[0][0], pointList[0][1]);
  63726. for (var _i = 0; _i < pointList.length; _i++) {
  63727. ctx.lineTo(pointList[_i][0], pointList[_i][1]);
  63728. }
  63729. ctx.closePath();
  63730. return;
  63731. }
  63732. /**
  63733. * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.getRect
  63734. * @description 返回 n 角星包围盒矩形。
  63735. *
  63736. * @param {Object} style - style
  63737. * @return {Object} 边框对象。包含属性:x,y,width,height。
  63738. */
  63739. }, {
  63740. key: "getRect",
  63741. value: function getRect(style) {
  63742. if (style.__rect) {
  63743. return style.__rect;
  63744. }
  63745. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  63746. this.refOriginalPosition = [0, 0];
  63747. }
  63748. var __OP = this.refOriginalPosition;
  63749. var lineWidth;
  63750. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  63751. lineWidth = style.lineWidth || 1;
  63752. } else {
  63753. lineWidth = 0;
  63754. }
  63755. style.__rect = {
  63756. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  63757. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  63758. width: style.r * 2 + lineWidth,
  63759. height: style.r * 2 + lineWidth
  63760. };
  63761. return style.__rect;
  63762. }
  63763. }]);
  63764. return SmicStar;
  63765. }(Shape)));
  63766. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/index.js
  63767. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63768. * This program are made available under the terms of the Apache License, Version 2.0
  63769. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63770. ;// CONCATENATED MODULE: ./src/common/overlay/index.js
  63771. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63772. * This program are made available under the terms of the Apache License, Version 2.0
  63773. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63774. ;// CONCATENATED MODULE: ./src/common/components/CommonTypes.js
  63775. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63776. * This program are made available under the terms of the Apache License, Version 2.0
  63777. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63778. /**
  63779. * 该文件用于存储一些公用常量
  63780. *
  63781. */
  63782. var CommonTypes_FileTypes = {
  63783. EXCEL: "EXCEL",
  63784. CSV: "CSV",
  63785. ISERVER: "ISERVER",
  63786. GEOJSON: "GEOJSON",
  63787. JSON: 'JSON'
  63788. };
  63789. var CommonTypes_FileConfig = {
  63790. fileMaxSize: 10 * 1024 * 1024
  63791. };
  63792. ;// CONCATENATED MODULE: ./src/common/components/openfile/FileModel.js
  63793. function FileModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63794. 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); } }
  63795. function FileModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) FileModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) FileModel_defineProperties(Constructor, staticProps); return Constructor; }
  63796. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63797. * This program are made available under the terms of the Apache License, Version 2.0
  63798. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63799. /**
  63800. * @class SuperMap.FileModel
  63801. * @description 文件数据组件数据模型,用于存储一些文件数据或状态,todo 结构待完善
  63802. * @category Components OpenFile
  63803. * @private
  63804. */
  63805. var FileModel = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  63806. function FileModel(options) {
  63807. FileModel_classCallCheck(this, FileModel);
  63808. this.FileTypes = FileTypes;
  63809. this.FileConfig = FileConfig;
  63810. this.loadFileObject = options && options.loadFileObject ? options.loadFileObject : [];
  63811. }
  63812. /**
  63813. * @function SuperMap.FileModel.prototype.set
  63814. * @description 设置属性值
  63815. * @param {string} key - 属性名称
  63816. * @param {string|Object} value - 属性值
  63817. */
  63818. FileModel_createClass(FileModel, [{
  63819. key: "set",
  63820. value: function set(key, value) {
  63821. this[key] = value;
  63822. }
  63823. /**
  63824. * @function SuperMap.FileModel.prototype.get
  63825. * @description 获取数据值
  63826. * @param {string} key - 属性名称
  63827. * @returns {string|Object} value - 返回属性值
  63828. */
  63829. }, {
  63830. key: "get",
  63831. value: function get(key) {
  63832. return this[key];
  63833. }
  63834. }]);
  63835. return FileModel;
  63836. }()));
  63837. ;// CONCATENATED MODULE: ./src/common/components/messagebox/MessageBox.js
  63838. function MessageBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63839. 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); } }
  63840. function MessageBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) MessageBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) MessageBox_defineProperties(Constructor, staticProps); return Constructor; }
  63841. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63842. * This program are made available under the terms of the Apache License, Version 2.0
  63843. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63844. /**
  63845. * @class SuperMap.Components.MessageBox
  63846. * @version 9.1.1
  63847. * @classdesc 组件信息提示框。
  63848. * @category Components Common
  63849. */
  63850. var MessageBox = /*#__PURE__*/function () {
  63851. function MessageBox() {
  63852. MessageBox_classCallCheck(this, MessageBox);
  63853. this._initView();
  63854. }
  63855. MessageBox_createClass(MessageBox, [{
  63856. key: "_initView",
  63857. value: function _initView() {
  63858. //原生js形式
  63859. var messageBoxContainer = document.createElement("div");
  63860. messageBoxContainer.hidden = true;
  63861. messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange"); //图标
  63862. var iconContainer = document.createElement("div");
  63863. iconContainer.setAttribute("class", "icon");
  63864. this.icon = document.createElement("span");
  63865. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  63866. iconContainer.appendChild(this.icon);
  63867. messageBoxContainer.appendChild(iconContainer); //内容:
  63868. var messageBox = document.createElement("div");
  63869. messageBox.setAttribute("class", "component-messagebox");
  63870. messageBox.innerHTML = "";
  63871. messageBoxContainer.appendChild(messageBox);
  63872. this.messageBox = messageBox; //关闭按钮
  63873. var cancelContainer = document.createElement("div");
  63874. cancelContainer.setAttribute("class", "component-messagebox__cancelbtncontainer");
  63875. var cancelBtn = document.createElement("button");
  63876. cancelBtn.setAttribute("class", "component-messagebox__cancelBtn");
  63877. cancelBtn.innerHTML = "x";
  63878. cancelBtn.onclick = this.closeView.bind(this);
  63879. cancelContainer.appendChild(cancelBtn);
  63880. messageBoxContainer.appendChild(cancelContainer);
  63881. this.messageBoxContainer = messageBoxContainer;
  63882. document.body.appendChild(this.messageBoxContainer);
  63883. }
  63884. /**
  63885. * @function SuperMap.Components.MessageBox.prototype.closeView
  63886. * @description 关闭提示框。
  63887. */
  63888. }, {
  63889. key: "closeView",
  63890. value: function closeView() {
  63891. this.messageBoxContainer.hidden = true;
  63892. }
  63893. /**
  63894. * @function SuperMap.Components.MessageBox.prototype.showView
  63895. * @description 显示提示框。
  63896. * @param {string} message - 提示框显示内容。
  63897. * @param {string}[type="warring"] 提示框类型,如 "warring", "failure", "success"。
  63898. */
  63899. }, {
  63900. key: "showView",
  63901. value: function showView(message) {
  63902. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'warring';
  63903. //设置提示框的样式:
  63904. if (type === "success") {
  63905. this.icon.setAttribute("class", "supermapol-icons-message-success");
  63906. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-green");
  63907. } else if (type === "failure") {
  63908. this.icon.setAttribute("class", "supermapol-icons-message-failure");
  63909. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-red");
  63910. } else if (type === "warring") {
  63911. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  63912. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange");
  63913. }
  63914. this.messageBox.innerHTML = message;
  63915. this.messageBoxContainer.hidden = false;
  63916. }
  63917. }]);
  63918. return MessageBox;
  63919. }();
  63920. SuperMap.Components.MessageBox = MessageBox;
  63921. ;// CONCATENATED MODULE: external "function(){try{return echarts}catch(e){return {}}}()"
  63922. var external_function_try_return_echarts_catch_e_return_namespaceObject = function(){try{return echarts}catch(e){return {}}}();
  63923. var external_function_try_return_echarts_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_echarts_catch_e_return_namespaceObject);
  63924. ;// CONCATENATED MODULE: ./src/common/lang/Lang.js
  63925. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63926. * This program are made available under the terms of the Apache License, Version 2.0
  63927. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63928. /**
  63929. * @name Lang
  63930. * @memberOf SuperMap
  63931. * @namespace
  63932. * @category BaseTypes
  63933. * @description 国际化的命名空间,包含多种语言和方法库来设置和获取当前的语言。
  63934. */
  63935. var Lang = {
  63936. /**
  63937. * @member {string} SuperMap.Lang.code
  63938. * @description 当前所使用的语言类型。
  63939. */
  63940. code: null,
  63941. /**
  63942. * @member {string} [SuperMap.Lang.defaultCode='en-US']
  63943. * @description 默认使用的语言类型。
  63944. */
  63945. defaultCode: "en-US",
  63946. /**
  63947. * @function SuperMap.Lang.getCode
  63948. * @description 获取当前的语言代码。
  63949. * @returns {string} 当前的语言代码。
  63950. */
  63951. getCode: function getCode() {
  63952. if (!SuperMap.Lang.code) {
  63953. SuperMap.Lang.setCode();
  63954. }
  63955. return SuperMap.Lang.code;
  63956. },
  63957. /**
  63958. * @function SuperMap.Lang.setCode
  63959. * @description 设置语言代码。
  63960. * @param {string} code - 此参数遵循IETF规范。
  63961. */
  63962. setCode: function setCode() {
  63963. var lang = this.getLanguageFromCookie();
  63964. if (lang) {
  63965. SuperMap.Lang.code = lang;
  63966. return;
  63967. }
  63968. lang = SuperMap.Lang.defaultCode;
  63969. if (navigator.appName === 'Netscape') {
  63970. lang = navigator.language;
  63971. } else {
  63972. lang = navigator.browserLanguage;
  63973. }
  63974. if (lang.indexOf('zh') === 0) {
  63975. lang = 'zh-CN';
  63976. }
  63977. if (lang.indexOf('en') === 0) {
  63978. lang = 'en-US';
  63979. }
  63980. SuperMap.Lang.code = lang;
  63981. },
  63982. /**
  63983. * @function SuperMap.Lang.getLanguageFromCookie
  63984. * @description 从 cookie 中获取语言类型。
  63985. */
  63986. getLanguageFromCookie: function getLanguageFromCookie() {
  63987. var name = 'language=';
  63988. var ca = document.cookie.split(';');
  63989. for (var i = 0; i < ca.length; i++) {
  63990. var c = ca[i];
  63991. while (c.charAt(0) === ' ') {
  63992. c = c.substring(1);
  63993. }
  63994. if (c.indexOf(name) !== -1) {
  63995. return c.substring(name.length, c.length);
  63996. }
  63997. }
  63998. return "";
  63999. },
  64000. /**
  64001. * @function SuperMap.Lang.i18n
  64002. * @description 从当前语言字符串的字典查找 key。
  64003. * @param {string} key - 字典中 i18n 字符串值的关键字。
  64004. * @returns {string} 国际化的字符串。
  64005. */
  64006. i18n: function i18n(key) {
  64007. var dictionary = SuperMap.Lang[SuperMap.Lang.getCode()];
  64008. var message = dictionary && dictionary[key];
  64009. if (!message) {
  64010. // Message not found, fall back to message key
  64011. message = key;
  64012. }
  64013. return message;
  64014. }
  64015. };
  64016. SuperMap.Lang = Lang;
  64017. SuperMap.i18n = SuperMap.Lang.i18n;
  64018. ;// CONCATENATED MODULE: external "function(){try{return XLSX}catch(e){return {}}}()"
  64019. var external_function_try_return_XLSX_catch_e_return_namespaceObject = function(){try{return XLSX}catch(e){return {}}}();
  64020. var external_function_try_return_XLSX_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_XLSX_catch_e_return_namespaceObject);
  64021. ;// CONCATENATED MODULE: ./src/common/components/util/FileReaderUtil.js
  64022. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64023. * This program are made available under the terms of the Apache License, Version 2.0
  64024. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64025. /**
  64026. * @class SuperMap.Components.FileReaderUtil
  64027. * @classdesc 组件读取文件工具类。
  64028. * @version 9.1.1
  64029. * @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(*, *=))}}
  64030. */
  64031. var FileReaderUtil = {
  64032. rABS: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsBinaryString,
  64033. rABF: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsArrayBuffer,
  64034. rAT: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsText,
  64035. /**
  64036. * @function SuperMap.Components.FileReaderUtil.prototype.readFile
  64037. * @description 读取文件
  64038. * @param {string} fileType - 当前读取的文件类型
  64039. *
  64040. * @param {Object} file - 读取回来的文件内容对象
  64041. * @param {function} success - 读取文件成功回调函数
  64042. * @param {function} failed - 读取文件失败回调函数
  64043. * @param {Object} context - 回调重定向对象
  64044. */
  64045. readFile: function readFile(fileType, file, success, failed, context) {
  64046. if (CommonTypes_FileTypes.JSON === fileType || CommonTypes_FileTypes.GEOJSON === fileType) {
  64047. this.readTextFile(file, success, failed, context);
  64048. } else if (CommonTypes_FileTypes.EXCEL === fileType || CommonTypes_FileTypes.CSV === fileType) {
  64049. this.readXLSXFile(file, success, failed, context);
  64050. }
  64051. },
  64052. /**
  64053. * 读取文本文件
  64054. * @param file
  64055. * @param success
  64056. * @param failed
  64057. * @param {Object} context - 回调重定向对象
  64058. */
  64059. readTextFile: function readTextFile(file, success, failed, context) {
  64060. var reader = new FileReader();
  64061. reader.onloadend = function (evt) {
  64062. success && success.call(context, evt.target.result);
  64063. };
  64064. reader.onerror = function (error) {
  64065. failed && failed.call(context, error);
  64066. };
  64067. this.rAT ? reader.readAsText(file.file, 'utf-8') : reader.readAsBinaryString(file.file);
  64068. },
  64069. /**
  64070. * 读取excel或csv文件
  64071. * @param file
  64072. * @param success
  64073. * @param failed
  64074. * @param {Object} context - 回调重定向对象
  64075. */
  64076. readXLSXFile: function readXLSXFile(file, success, failed, context) {
  64077. var reader = new FileReader();
  64078. reader.onloadend = function (evt) {
  64079. var xLSXData = new Uint8Array(evt.target.result);
  64080. var workbook = external_function_try_return_XLSX_catch_e_return_default().read(xLSXData, {
  64081. type: "array"
  64082. });
  64083. try {
  64084. if (workbook && workbook.SheetNames && workbook.SheetNames.length > 0) {
  64085. //暂时只读取第一个sheets的内容
  64086. var sheetName = workbook.SheetNames[0];
  64087. var xLSXCSVString = external_function_try_return_XLSX_catch_e_return_default().utils.sheet_to_csv(workbook.Sheets[sheetName]);
  64088. success && success.call(context, xLSXCSVString);
  64089. }
  64090. } catch (error) {
  64091. failed && failed.call(context, error);
  64092. }
  64093. };
  64094. reader.onerror = function (error) {
  64095. failed && failed.call(context, error);
  64096. };
  64097. this.rABF && reader.readAsArrayBuffer(file.file);
  64098. },
  64099. /**
  64100. * @function SuperMap.Components.FileReaderUtil.prototype.processDataToGeoJson
  64101. * @description 将读取回来得数据统一处理为 GeoJSON 格式
  64102. * @param {string} type - 文件类型
  64103. * @param {Object} data - 读取返回的数据对象
  64104. * @param {function} success - 数据处理成功的回调
  64105. * @param {function} failed - 数据处理失败的回调
  64106. * @param {Object} context - 回调重定向对象
  64107. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据
  64108. * @private
  64109. */
  64110. processDataToGeoJson: function processDataToGeoJson(type, data, success, failed, context) {
  64111. var geojson = null;
  64112. if (type === "EXCEL" || type === "CSV") {
  64113. geojson = this.processExcelDataToGeoJson(data);
  64114. success && success.call(context, geojson);
  64115. } else if (type === 'JSON' || type === 'GEOJSON') {
  64116. var result = data; //geojson、json未知,通过类容来判断
  64117. if (typeof result === "string") {
  64118. result = JSON.parse(result);
  64119. }
  64120. if (result.type === 'ISERVER') {
  64121. geojson = result.data.recordsets[0].features;
  64122. } else if (result.type === 'FeatureCollection') {
  64123. //geojson
  64124. geojson = result;
  64125. } else {
  64126. //不支持数据
  64127. failed && failed.call(context, Lang.i18n('msg_dataInWrongGeoJSONFormat'));
  64128. }
  64129. success && success.call(context, geojson);
  64130. } else {
  64131. failed && failed.call(context, Lang.i18n('msg_dataInWrongFormat'));
  64132. }
  64133. },
  64134. /**
  64135. * @function SuperMap.Components.FileReaderUtil.prototype.processExcelDataToGeoJson
  64136. * @description 表格文件数据处理
  64137. * @param {Object} data - 读取的表格文件数据
  64138. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据
  64139. * @private
  64140. */
  64141. processExcelDataToGeoJson: function processExcelDataToGeoJson(data) {
  64142. //处理为对象格式转化
  64143. var dataContent = this.string2Csv(data);
  64144. var fieldCaptions = dataContent.colTitles; //位置属性处理
  64145. var xfieldIndex = -1,
  64146. yfieldIndex = -1;
  64147. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  64148. if (this.isXField(fieldCaptions[i])) {
  64149. xfieldIndex = i;
  64150. }
  64151. if (this.isYField(fieldCaptions[i])) {
  64152. yfieldIndex = i;
  64153. }
  64154. } // feature 构建后期支持坐标系 4326/3857
  64155. var features = [];
  64156. for (var _i = 0, _len = dataContent.rows.length; _i < _len; _i++) {
  64157. var row = dataContent.rows[_i]; //if (featureFrom === "LonLat") {
  64158. var x = Number(row[xfieldIndex]),
  64159. y = Number(row[yfieldIndex]); //属性信息
  64160. var attributes = {};
  64161. for (var index in dataContent.colTitles) {
  64162. var key = dataContent.colTitles[index];
  64163. attributes[key] = dataContent.rows[_i][index];
  64164. } //目前csv 只支持处理点,所以先生成点类型的 geojson
  64165. var feature = {
  64166. "type": "Feature",
  64167. "geometry": {
  64168. "type": "Point",
  64169. "coordinates": [x, y]
  64170. },
  64171. "properties": attributes
  64172. };
  64173. features.push(feature);
  64174. }
  64175. return features;
  64176. },
  64177. /**
  64178. * 判断是否地理X坐标
  64179. * @param data
  64180. */
  64181. isXField: function isXField(data) {
  64182. var lowerdata = data.toLowerCase();
  64183. return lowerdata === "x" || lowerdata === "smx" || lowerdata === "jd" || lowerdata === "经度" || lowerdata === "东经" || lowerdata === "longitude" || lowerdata === "lot" || lowerdata === "lon" || lowerdata === "lng" || lowerdata === "x坐标";
  64184. },
  64185. /**
  64186. * 判断是否地理Y坐标
  64187. * @param data
  64188. */
  64189. isYField: function isYField(data) {
  64190. var lowerdata = data.toLowerCase();
  64191. return lowerdata === "y" || lowerdata === "smy" || lowerdata === "wd" || lowerdata === "纬度" || lowerdata === "北纬" || lowerdata === "latitude" || lowerdata === "lat" || lowerdata === "y坐标";
  64192. },
  64193. /**
  64194. * 字符串转为dataEditor 支持的csv格式数据
  64195. * @param string
  64196. * @param withoutTitle
  64197. */
  64198. string2Csv: function string2Csv(string, withoutTitle) {
  64199. // let rows = string.split('\r\n');
  64200. var rows = string.split('\n');
  64201. var result = {};
  64202. if (!withoutTitle) {
  64203. result["colTitles"] = rows[0].split(',');
  64204. } else {
  64205. result["colTitles"] = [];
  64206. }
  64207. result['rows'] = [];
  64208. for (var i = withoutTitle ? 0 : 1; i < rows.length; i++) {
  64209. rows[i] && result['rows'].push(rows[i].split(','));
  64210. }
  64211. return result;
  64212. }
  64213. };
  64214. SuperMap.Components.FileReaderUtil = FileReaderUtil;
  64215. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartModel.js
  64216. function ChartModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64217. 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); } }
  64218. function ChartModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartModel_defineProperties(Constructor, staticProps); return Constructor; }
  64219. /* Copyright© 2000 - 2021 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 SuperMap.Components.ChartModel
  64224. * @classdesc 图表组件数据模型
  64225. * @private
  64226. * @param {Object} datasets - 数据来源。
  64227. * @category Components Chart
  64228. * @fires SuperMap.Components.ChartModel#getdatafailed
  64229. */
  64230. var ChartModel = /*#__PURE__*/function () {
  64231. function ChartModel(datasets) {
  64232. ChartModel_classCallCheck(this, ChartModel);
  64233. this.datasets = datasets;
  64234. this.EVENT_TYPES = ['getdatafailed'];
  64235. this.events = new Events(this, null, this.EVENT_TYPES);
  64236. }
  64237. /**
  64238. * @private
  64239. * @function SuperMap.Components.ChartModel.prototype.getDatasetInfo
  64240. * @description 获得数据集数据。
  64241. * @param {string} datasetUrl - 数据集资源地址。
  64242. */
  64243. ChartModel_createClass(ChartModel, [{
  64244. key: "getDatasetInfo",
  64245. value: function getDatasetInfo(success) {
  64246. var datasetUrl = this.datasets.url;
  64247. var me = this;
  64248. FetchRequest.get(datasetUrl).then(function (response) {
  64249. return response.json();
  64250. }).then(function (results) {
  64251. if (results.datasetInfo) {
  64252. var datasetInfo = results.datasetInfo;
  64253. me.datasetsInfo = {
  64254. dataSourceName: datasetInfo.dataSourceName,
  64255. datasetName: datasetInfo.name,
  64256. mapName: results.name
  64257. };
  64258. success({
  64259. result: me.datasetsInfo
  64260. });
  64261. }
  64262. })["catch"](function (error) {
  64263. console.log(error);
  64264. me._fireFailedEvent(error);
  64265. });
  64266. }
  64267. /**
  64268. * @private
  64269. * @function SuperMap.Components.ChartModel.prototype.getDataFeatures
  64270. * @description 请求数据集的数据信息
  64271. * @param {Object} results - 数据集信息。
  64272. * @param {function} success - 成功回调函数。
  64273. */
  64274. }, {
  64275. key: "getDataFeatures",
  64276. value: function getDataFeatures(results, success) {
  64277. var datasetsInfo = results.result;
  64278. var getFeatureParam, getFeatureBySQLParams, getFeatureBySQLService;
  64279. var params = {
  64280. name: datasetsInfo.datasetName + '@' + datasetsInfo.dataSourceName
  64281. };
  64282. Object.assign(params, this.datasets.queryInfo);
  64283. getFeatureParam = new SuperMap.FilterParameter(params);
  64284. getFeatureBySQLParams = new SuperMap.GetFeaturesBySQLParameters({
  64285. queryParameter: getFeatureParam,
  64286. datasetNames: [datasetsInfo.dataSourceName + ':' + datasetsInfo.datasetName],
  64287. fromIndex: 0,
  64288. toIndex: 100000
  64289. });
  64290. getFeatureBySQLService = new SuperMap.GetFeaturesBySQLService(datasetsInfo.dataUrl, {
  64291. eventListeners: {
  64292. processCompleted: success,
  64293. processFailed: function processFailed() {}
  64294. }
  64295. });
  64296. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  64297. }
  64298. /**
  64299. * @private
  64300. * @function SuperMap.Components.ChartModel.prototype.getLayerFeatures
  64301. * @description 请求图层要素的数据信息
  64302. * @param {Object} results - 数据集信息。
  64303. * @param {Callbacks} success - 成功回调函数。
  64304. */
  64305. }, {
  64306. key: "getLayerFeatures",
  64307. value: function getLayerFeatures(results, success) {
  64308. var datasetsInfo = results.result;
  64309. var queryParam, queryBySQLParams, queryBySQLService;
  64310. var params = {
  64311. name: datasetsInfo.mapName
  64312. };
  64313. Object.assign(params, this.datasets.queryInfo);
  64314. queryParam = new SuperMap.FilterParameter(params);
  64315. queryBySQLParams = new SuperMap.QueryBySQLParameters({
  64316. queryParams: [queryParam],
  64317. expectCount: 100000
  64318. });
  64319. queryBySQLService = new SuperMap.QueryBySQLService(datasetsInfo.dataUrl, {
  64320. eventListeners: {
  64321. processCompleted: success,
  64322. processFailed: function processFailed() {}
  64323. }
  64324. });
  64325. queryBySQLService.processAsync(queryBySQLParams);
  64326. }
  64327. /**
  64328. * @private
  64329. * @function SuperMap.Components.ChartModel.prototype.getDataInfoByIptl
  64330. * @description 用dataId获取iportal的数据。
  64331. * @param {Callbacks} success - getdatachart。
  64332. *
  64333. */
  64334. }, {
  64335. key: "getDataInfoByIptl",
  64336. value: function getDataInfoByIptl(success) {
  64337. // success是chart的回调
  64338. this.getServiceInfo(this.datasets.url, success);
  64339. }
  64340. /**
  64341. * @private
  64342. * @function SuperMap.Components.ChartModel.prototype.getServiceInfo
  64343. * @description 用iportal获取dataItemServices。
  64344. * @param {String} url
  64345. * @param {Callbacks} success - getdatachart。
  64346. * */
  64347. }, {
  64348. key: "getServiceInfo",
  64349. value: function getServiceInfo(url, success) {
  64350. var me = this;
  64351. FetchRequest.get(url, null, {
  64352. withCredentials: this.datasets.withCredentials
  64353. }).then(function (response) {
  64354. return response.json();
  64355. }).then(function (data) {
  64356. if (data.succeed === false) {
  64357. //请求失败
  64358. me._fireFailedEvent(data);
  64359. return;
  64360. } // 是否有rest服务
  64361. if (data.dataItemServices && data.dataItemServices.length > 0) {
  64362. var dataItemServices = data.dataItemServices,
  64363. resultData;
  64364. dataItemServices.forEach(function (item) {
  64365. // 如果有restdata并且发布成功,就请求restdata服务
  64366. // 如果有restmap并且发布成功,就请求restmap服务
  64367. // 其他情况就请求iportal/content.json
  64368. if (item.serviceType === 'RESTDATA' && item.serviceStatus === 'PUBLISHED') {
  64369. resultData = item;
  64370. } else if (item.serviceType === 'RESTMAP' && item.serviceStatus === 'PUBLISHED') {
  64371. resultData = item;
  64372. } else {
  64373. me.getDatafromContent(url, success);
  64374. return;
  64375. }
  64376. }); // 如果有服务,获取数据源和数据集, 然后请求rest服务
  64377. resultData && me.getDatafromRest(resultData.serviceType, resultData.address, success);
  64378. } else {
  64379. me.getDatafromContent(url, success);
  64380. return;
  64381. }
  64382. })["catch"](function (error) {
  64383. console.log(error);
  64384. me._fireFailedEvent(error);
  64385. });
  64386. }
  64387. /**
  64388. * @private
  64389. * @function SuperMap.Components.ChartModel.prototype.getDatafromURL
  64390. * @description 用iportal获取数据。(通过固定的url来请求,但是不能请求工作空间的数据)
  64391. * @param {String} url
  64392. * @param {Callbacks} success - getdatachart。
  64393. */
  64394. }, {
  64395. key: "getDatafromContent",
  64396. value: function getDatafromContent(url, success) {
  64397. var _this = this;
  64398. // 成功回调传入的results
  64399. var results = {
  64400. result: {}
  64401. },
  64402. me = this;
  64403. url += '/content.json?pageSize=9999999&currentPage=1'; // 获取图层数据
  64404. FetchRequest.get(url, null, {
  64405. withCredentials: this.datasets.withCredentials
  64406. }).then(function (response) {
  64407. return response.json();
  64408. }).then(function (data) {
  64409. if (data.succeed === false) {
  64410. //请求失败
  64411. me._fireFailedEvent(data);
  64412. return;
  64413. }
  64414. if (data.type) {
  64415. if (data.type === 'JSON' || data.type === 'GEOJSON') {
  64416. // 将字符串转换成json
  64417. data.content = JSON.parse(data.content.trim()); // 如果是json文件 data.content = {type:'fco', features},格式不固定
  64418. if (!data.content.features) {
  64419. //json格式解析失败
  64420. console.log(Lang.i18n('msg_jsonResolveFiled'));
  64421. return;
  64422. }
  64423. var features = _this._formatGeoJSON(data.content);
  64424. results.result.features = {
  64425. type: data.content.type,
  64426. features: features
  64427. };
  64428. } else if (data.type === 'EXCEL' || data.type === 'CSV') {
  64429. var _features = _this._excelData2Feature(data.content);
  64430. results.result.features = {
  64431. type: 'FeatureCollection',
  64432. features: _features
  64433. };
  64434. }
  64435. success(results, 'content');
  64436. }
  64437. }, this)["catch"](function (error) {
  64438. console.log(error);
  64439. me._fireFailedEvent(error);
  64440. });
  64441. }
  64442. /**
  64443. * @private
  64444. * @function SuperMap.Components.ChartModel.prototype._getDataSource
  64445. * @description 获取数据源名和数据集名。
  64446. * @param {string} serviceType 服务类型
  64447. * @param {string} address 地址
  64448. * @param {Callbacks} success - getdatachart。
  64449. * @return{array} [数据源名:数据集名]
  64450. * @return{string} 图层名
  64451. */
  64452. }, {
  64453. key: "getDatafromRest",
  64454. value: function getDatafromRest(serviceType, address, success) {
  64455. var me = this,
  64456. withCredentials = this.datasets.withCredentials;
  64457. if (serviceType === 'RESTDATA') {
  64458. var url = "".concat(address, "/data/datasources"),
  64459. sourceName,
  64460. datasetName; // 请求获取数据源名
  64461. FetchRequest.get(url, null, {
  64462. withCredentials: withCredentials
  64463. }).then(function (response) {
  64464. return response.json();
  64465. }).then(function (data) {
  64466. sourceName = data.datasourceNames[0];
  64467. url = "".concat(address, "/data/datasources/").concat(sourceName, "/datasets"); // 请求获取数据集名
  64468. FetchRequest.get(url, null, {
  64469. withCredentials: withCredentials
  64470. }).then(function (response) {
  64471. return response.json();
  64472. }).then(function (data) {
  64473. datasetName = data.datasetNames[0]; // 请求restdata服务
  64474. me.getDatafromRestData("".concat(address, "/data"), [sourceName + ':' + datasetName], success);
  64475. return [sourceName + ':' + datasetName];
  64476. })["catch"](function (error) {
  64477. me._fireFailedEvent(error);
  64478. });
  64479. })["catch"](function (error) {
  64480. me._fireFailedEvent(error);
  64481. });
  64482. } else {
  64483. // 如果是地图服务
  64484. var _url = "".concat(address, "/maps"),
  64485. mapName,
  64486. layerName,
  64487. path; // 请求获取地图名
  64488. FetchRequest.get(_url, null, {
  64489. withCredentials: withCredentials
  64490. }).then(function (response) {
  64491. return response.json();
  64492. }).then(function (data) {
  64493. mapName = data[0].name;
  64494. path = data[0].path;
  64495. _url = _url = "".concat(address, "/maps/").concat(mapName, "/layers"); // 请求获取图层名
  64496. FetchRequest.get(_url, null, {
  64497. withCredentials: withCredentials
  64498. }).then(function (response) {
  64499. return response.json();
  64500. }).then(function (data) {
  64501. layerName = data[0].subLayers.layers[0].caption; // 请求restmap服务
  64502. me.getDatafromRestMap(layerName, path, success);
  64503. return layerName;
  64504. })["catch"](function (error) {
  64505. me._fireFailedEvent(error);
  64506. });
  64507. })["catch"](function (error) {
  64508. me._fireFailedEvent(error);
  64509. });
  64510. }
  64511. }
  64512. /**
  64513. * @private
  64514. * @function SuperMap.Components.ChartModel.prototype.getDatafromRestData
  64515. * @description 请求restdata服务
  64516. * @param {String} url
  64517. * @param {Array<string>} dataSource [数据源名:数据集名]
  64518. * @param {Callbacks} success - getdatachart。
  64519. */
  64520. }, {
  64521. key: "getDatafromRestData",
  64522. value: function getDatafromRestData(url, dataSource, success) {
  64523. var me = this;
  64524. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'SmID>0';
  64525. this._getFeatureBySQL(url, dataSource, this.datasets.queryInfo, function (results) {
  64526. // 此时的features已经处理成geojson了
  64527. success(results, 'RESTDATA');
  64528. }, function (error) {
  64529. console.log(error);
  64530. me._fireFailedEvent(error);
  64531. });
  64532. }
  64533. /**
  64534. * @private
  64535. * @function SuperMap.Components.ChartModel.prototype.getDatafromRestMap
  64536. * @description 请求restmap服务
  64537. * @param {String} dataSource layerName
  64538. * @param {String} path - map服务地址。
  64539. * @param {Callbacks} success - getdatachart。
  64540. */
  64541. }, {
  64542. key: "getDatafromRestMap",
  64543. value: function getDatafromRestMap(dataSource, path, success) {
  64544. var me = this;
  64545. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'smid=1';
  64546. this._queryFeatureBySQL(path, dataSource, this.datasets.queryInfo, null, null, function (results) {
  64547. // let features = result.result.recordsets[0].features;
  64548. success(results, 'RESTMAP');
  64549. }, function (error) {
  64550. console.log(error);
  64551. me._fireFailedEvent(error);
  64552. });
  64553. }
  64554. /**
  64555. * @private
  64556. * @function SuperMap.Components.ChartModel.prototype._getFeatureBySQL
  64557. * @description 通过 sql 方式查询数据。
  64558. */
  64559. }, {
  64560. key: "_getFeatureBySQL",
  64561. value: function _getFeatureBySQL(url, datasetNames, queryInfo, _processCompleted, processFaild) {
  64562. var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
  64563. var params = {
  64564. name: datasetNames.join().replace(':', '@')
  64565. };
  64566. Object.assign(params, queryInfo);
  64567. getFeatureParam = new FilterParameter(params);
  64568. getFeatureBySQLParams = new GetFeaturesBySQLParameters({
  64569. queryParameter: getFeatureParam,
  64570. datasetNames: datasetNames,
  64571. fromIndex: 0,
  64572. toIndex: 100000,
  64573. returnContent: true
  64574. });
  64575. var options = {
  64576. eventListeners: {
  64577. processCompleted: function processCompleted(getFeaturesEventArgs) {
  64578. _processCompleted && _processCompleted(getFeaturesEventArgs);
  64579. },
  64580. processFailed: function processFailed(e) {
  64581. processFaild && processFaild(e);
  64582. }
  64583. }
  64584. };
  64585. getFeatureBySQLService = new GetFeaturesBySQLService(url, options);
  64586. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  64587. }
  64588. /**
  64589. * @private
  64590. * @function SuperMap.Components.ChartModel.prototype._queryFeatureBySQL
  64591. * @description 通过 sql 方式查询数据。
  64592. */
  64593. }, {
  64594. key: "_queryFeatureBySQL",
  64595. value: function _queryFeatureBySQL(url, layerName, queryInfo, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
  64596. var queryParam, queryBySQLParams;
  64597. var filterParams = {
  64598. name: layerName
  64599. };
  64600. Object.assign(filterParams, queryInfo);
  64601. queryParam = new FilterParameter(filterParams);
  64602. if (fields) {
  64603. queryParam.fields = fields;
  64604. }
  64605. var params = {
  64606. queryParams: [queryParam]
  64607. };
  64608. if (onlyAttribute) {
  64609. params.queryOption = QueryOption.ATTRIBUTE;
  64610. }
  64611. startRecord && (params.startRecord = startRecord);
  64612. recordLength && (params.expectCount = recordLength);
  64613. if (epsgCode) {
  64614. params.prjCoordSys = {
  64615. epsgCode: epsgCode
  64616. };
  64617. }
  64618. queryBySQLParams = new QueryBySQLParameters(params);
  64619. this._queryBySQL(url, queryBySQLParams, function (data) {
  64620. data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
  64621. });
  64622. }
  64623. /**
  64624. * @function SuperMap.Components.ChartModel.prototype._queryBySQL
  64625. * @description SQL 查询服务。
  64626. * @param {SuperMap.QueryBySQLParameters} params - SQL 查询相关参数类。
  64627. * @param {RequestCallback} callback - 回调函数。
  64628. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  64629. */
  64630. }, {
  64631. key: "_queryBySQL",
  64632. value: function _queryBySQL(url, params, callback, resultFormat) {
  64633. var me = this;
  64634. var queryBySQLService = new QueryBySQLService(url, {
  64635. eventListeners: {
  64636. scope: me,
  64637. processCompleted: callback,
  64638. processFailed: callback
  64639. },
  64640. format: me._processFormat(resultFormat)
  64641. });
  64642. queryBySQLService.processAsync(params);
  64643. }
  64644. /**
  64645. * @function SuperMap.Components.ChartModel.prototype._processFormat
  64646. * @description 将数据转换成geojson。
  64647. * @param {object} resultFormat - 返回结果集。
  64648. * @return {object} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  64649. */
  64650. }, {
  64651. key: "_processFormat",
  64652. value: function _processFormat(resultFormat) {
  64653. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  64654. }
  64655. /**
  64656. * @private
  64657. * @function SuperMap.Components.ChartModel.prototype._formatGeoJSON
  64658. * @description 格式 GeoJSON。
  64659. * @param {GeoJSON} data - GeoJSON 数据。
  64660. */
  64661. }, {
  64662. key: "_formatGeoJSON",
  64663. value: function _formatGeoJSON(data) {
  64664. var features = data.features;
  64665. features.forEach(function (row, index) {
  64666. row.properties['index'] = index;
  64667. });
  64668. return features;
  64669. }
  64670. /**
  64671. * @private
  64672. * @description 将 csv 和 xls 文件内容转换成 geojson
  64673. * @function SuperMap.Components.ChartModel.prototype._excelData2Feature
  64674. * @param content 文件内容
  64675. * @param layerInfo 图层信息
  64676. * @returns {Array} feature的数组集合
  64677. */
  64678. }, {
  64679. key: "_excelData2Feature",
  64680. value: function _excelData2Feature(dataContent) {
  64681. var fieldCaptions = dataContent.colTitles; //位置属性处理
  64682. var xfieldIndex = -1,
  64683. yfieldIndex = -1;
  64684. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  64685. if (FileReaderUtil.isXField(fieldCaptions[i])) {
  64686. xfieldIndex = i;
  64687. }
  64688. if (FileReaderUtil.isYField(fieldCaptions[i])) {
  64689. yfieldIndex = i;
  64690. }
  64691. } // feature 构建后期支持坐标系 4326/3857
  64692. var features = [];
  64693. for (var _i = 0, _len = dataContent.rows.length; _i < _len; _i++) {
  64694. var row = dataContent.rows[_i];
  64695. var x = Number(row[xfieldIndex]),
  64696. y = Number(row[yfieldIndex]); //属性信息
  64697. var attributes = {};
  64698. for (var index in dataContent.colTitles) {
  64699. var key = dataContent.colTitles[index];
  64700. attributes[key] = dataContent.rows[_i][index];
  64701. }
  64702. attributes['index'] = _i + ''; //目前csv 只支持处理点,所以先生成点类型的 geojson
  64703. var feature = {
  64704. type: 'Feature',
  64705. geometry: {
  64706. type: 'Point',
  64707. coordinates: [x, y]
  64708. },
  64709. properties: attributes
  64710. };
  64711. features.push(feature);
  64712. }
  64713. return features;
  64714. }
  64715. /**
  64716. * @private
  64717. * @description 请求数据失败的事件
  64718. * @function SuperMap.Components.ChartModel.prototype._fireFailedEvent
  64719. * @param {object} error 错误信息
  64720. */
  64721. }, {
  64722. key: "_fireFailedEvent",
  64723. value: function _fireFailedEvent(error) {
  64724. var errorData = error ? {
  64725. error: error,
  64726. message: Lang.i18n('msg_getdatafailed')
  64727. } : {
  64728. message: Lang.i18n('msg_getdatafailed')
  64729. };
  64730. /**
  64731. * @event SuperMap.Components.Chart#getdatafailed
  64732. * @description 监听到获取数据失败事件后触发
  64733. * @property {Object} error - 事件对象。
  64734. */
  64735. this.events.triggerEvent('getdatafailed', errorData);
  64736. }
  64737. }]);
  64738. return ChartModel;
  64739. }();
  64740. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartViewModel.js
  64741. function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  64742. 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); }
  64743. 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; }
  64744. function ChartViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64745. 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); } }
  64746. function ChartViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartViewModel_defineProperties(Constructor, staticProps); return Constructor; }
  64747. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64748. * This program are made available under the terms of the Apache License, Version 2.0
  64749. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64750. /**
  64751. * @class SuperMap.Components.ChartViewModel
  64752. * @classdesc 图表组件功能类
  64753. * @category Components Chart
  64754. * @version 10.0.0
  64755. * @param {Object} options - 可选参数。
  64756. * @param {string} options.type - 图表类型。
  64757. * @param {SuperMap.Components.Chart.Datasets} options.datasets - 数据来源。
  64758. * @param {Array.<Object>} options.chartOptions - 图表可选参数。
  64759. * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
  64760. * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
  64761. * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
  64762. * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
  64763. * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
  64764. * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
  64765. * @fires SuperMap.Components.ChartViewModel#getdatafailed
  64766. */
  64767. var ChartViewModel = /*#__PURE__*/function () {
  64768. function ChartViewModel(options) {
  64769. ChartViewModel_classCallCheck(this, ChartViewModel);
  64770. this.datasets = options.datasets;
  64771. this.xField = [];
  64772. this.yField = [];
  64773. this.grid = {
  64774. top: "50px",
  64775. bottom: "50px",
  64776. left: "50px",
  64777. right: "60px"
  64778. };
  64779. this.chartType = options.type || "bar";
  64780. this._initXYField(options.chartOptions);
  64781. this.EVENT_TYPES = ["getdatafailed"];
  64782. this.events = new Events(this, null, this.EVENT_TYPES);
  64783. }
  64784. /**
  64785. * @function SuperMap.Components.ChartViewModel.prototype._initXYField
  64786. * @description 初始化XY字段。
  64787. * @private
  64788. * @param {Object} chartOptions - options里的图表参数
  64789. */
  64790. ChartViewModel_createClass(ChartViewModel, [{
  64791. key: "_initXYField",
  64792. value: function _initXYField(chartOptions) {
  64793. var me = this;
  64794. if (chartOptions && chartOptions.length > 0) {
  64795. chartOptions.forEach(function (option) {
  64796. if (option.xAxis) {
  64797. me.xField.push({
  64798. field: option.xAxis.field,
  64799. name: option.xAxis.name
  64800. });
  64801. }
  64802. if (option.yAxis) {
  64803. me.yField.push({
  64804. field: option.yAxis.field,
  64805. name: option.yAxis.name
  64806. });
  64807. }
  64808. });
  64809. }
  64810. }
  64811. /**
  64812. * @function SuperMap.Components.ChartViewModel.prototype.getDatasetInfo
  64813. * @description 获得数据集数据。
  64814. * @param {function} success - 成功回调函数
  64815. */
  64816. }, {
  64817. key: "getDatasetInfo",
  64818. value: function getDatasetInfo(success) {
  64819. var _this = this;
  64820. this.createChart = success;
  64821. if (this.datasets && this._checkUrl(this.datasets.url)) {
  64822. this.chartModel = new ChartModel(this.datasets);
  64823. if (this.datasets.type === 'iServer') {
  64824. this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this));
  64825. } else if (this.datasets.type === 'iPortal') {
  64826. this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this));
  64827. }
  64828. /**
  64829. * @event SuperMap.Components.ChartViewModel#getdatafailed
  64830. * @description 监听到获取数据失败事件后触发
  64831. * @property {Object} error - 事件对象。
  64832. */
  64833. this.chartModel.events.on({
  64834. "getdatafailed": function getdatafailed(error) {
  64835. _this.events.triggerEvent("getdatafailed", error);
  64836. }
  64837. });
  64838. }
  64839. }
  64840. /**
  64841. * @function SuperMap.Components.ChartViewModel.prototype._getDatasetInfoSuccess
  64842. * @description 成功回调函数。
  64843. * @private
  64844. * @param {Object} results - 数据集信息
  64845. */
  64846. }, {
  64847. key: "_getDatasetInfoSuccess",
  64848. value: function _getDatasetInfoSuccess(results) {
  64849. var datasetUrl = this.datasets.url; //判断服务为地图服务 或者 数据服务
  64850. var restIndex = datasetUrl.indexOf("rest");
  64851. if (restIndex > 0) {
  64852. var index = datasetUrl.indexOf("/", restIndex + 5);
  64853. var type = datasetUrl.substring(restIndex + 5, index);
  64854. var dataUrl = datasetUrl.substring(0, restIndex + 4) + "/data";
  64855. if (type === "maps") {
  64856. var mapIndex = datasetUrl.indexOf("/", index + 1);
  64857. var mapName = datasetUrl.substring(index + 1, mapIndex);
  64858. dataUrl = datasetUrl.substring(0, restIndex + 4) + "/maps/" + mapName;
  64859. results.result.dataUrl = dataUrl;
  64860. this._getLayerFeatures(results);
  64861. } else if (type === "data") {
  64862. results.result.dataUrl = dataUrl;
  64863. this._getDataFeatures(results);
  64864. }
  64865. }
  64866. }
  64867. /**
  64868. * @function SuperMap.Components.ChartViewModel.prototype._getDataInfoSuccess
  64869. * @description 请求iportal数据成功之后的回调
  64870. * @private
  64871. */
  64872. }, {
  64873. key: "_getDataInfoSuccess",
  64874. value: function _getDataInfoSuccess(results, type) {
  64875. var me = this;
  64876. if (type === 'RESTMAP') {
  64877. me._getChartDatasFromLayer(results);
  64878. } else {
  64879. me._getChartDatas(results);
  64880. }
  64881. }
  64882. /**
  64883. * @function SuperMap.Components.ChartViewModel.prototype._getDataFeatures
  64884. * @description 请求数据集的数据信息
  64885. * @private
  64886. * @param {Object} results - 数据集信息
  64887. */
  64888. }, {
  64889. key: "_getDataFeatures",
  64890. value: function _getDataFeatures(results) {
  64891. this.chartModel.getDataFeatures(results, this._getChartDatas.bind(this));
  64892. }
  64893. /**
  64894. * @function SuperMap.Components.ChartViewModel.prototype._getLayerFeatures
  64895. * @description 请求图层的数据信息
  64896. * @private
  64897. * @param {Object} results - 数据集信息
  64898. */
  64899. }, {
  64900. key: "_getLayerFeatures",
  64901. value: function _getLayerFeatures(results) {
  64902. this.chartModel.getLayerFeatures(results, this._getChartDatasFromLayer.bind(this));
  64903. }
  64904. /**
  64905. * @function SuperMap.Components.ChartViewModel.prototype._getChartDatas
  64906. * @description 将请求回来的数据转换为图表所需的数据格式
  64907. * @private
  64908. * @param {Object} results - 数据要素信息
  64909. */
  64910. }, {
  64911. key: "_getChartDatas",
  64912. value: function _getChartDatas(results) {
  64913. if (results) {
  64914. // 数据来自restdata---results.result.features
  64915. this.features = results.result.features;
  64916. var features = this.features.features;
  64917. var data = {};
  64918. if (features.length) {
  64919. var feature = features[0];
  64920. var attrFields = [],
  64921. itemTypes = [];
  64922. for (var attr in feature.properties) {
  64923. attrFields.push(attr);
  64924. itemTypes.push(this._getDataType(feature.properties[attr]));
  64925. }
  64926. data = {
  64927. features: features,
  64928. fieldCaptions: attrFields,
  64929. fieldTypes: itemTypes,
  64930. fieldValues: []
  64931. };
  64932. for (var m in itemTypes) {
  64933. var fieldValue = [];
  64934. for (var j in features) {
  64935. var _feature = features[j];
  64936. var caption = data.fieldCaptions[m];
  64937. var value = _feature.properties[caption];
  64938. fieldValue.push(value);
  64939. }
  64940. data.fieldValues.push(fieldValue);
  64941. }
  64942. this.createChart(data);
  64943. }
  64944. }
  64945. }
  64946. /**
  64947. * @function SuperMap.Components.ChartViewModel.prototype._getChartDatasFromLayer
  64948. * @description 将请求回来的数据转换为图表所需的数据格式
  64949. * @private
  64950. * @param {Object} results - 图层数据要素信息
  64951. */
  64952. }, {
  64953. key: "_getChartDatasFromLayer",
  64954. value: function _getChartDatasFromLayer(results) {
  64955. if (results.result.recordsets) {
  64956. var recordsets = results.result.recordsets[0];
  64957. var features = recordsets.features.features;
  64958. this.features = recordsets.features;
  64959. var data = {};
  64960. if (features.length) {
  64961. data = {
  64962. features: recordsets.features,
  64963. fieldCaptions: recordsets.fieldCaptions,
  64964. fieldTypes: recordsets.fieldTypes,
  64965. fieldValues: []
  64966. };
  64967. for (var m in data.fieldCaptions) {
  64968. var fieldValue = [];
  64969. for (var j in features) {
  64970. var feature = features[j];
  64971. var caption = data.fieldCaptions[m];
  64972. var value = feature.properties[caption];
  64973. fieldValue.push(value);
  64974. }
  64975. data.fieldValues.push(fieldValue);
  64976. }
  64977. this.createChart(data);
  64978. }
  64979. }
  64980. }
  64981. /**
  64982. * @function SuperMap.Components.ChartViewModel.prototype._createChartOptions
  64983. * @description 创建图表所需参数
  64984. * @private
  64985. * @param {Object} data - 图表数据
  64986. */
  64987. }, {
  64988. key: "_createChartOptions",
  64989. value: function _createChartOptions(data) {
  64990. this.calculatedData = this._createChartDatas(data);
  64991. return this.updateChartOptions(this.chartType);
  64992. }
  64993. /**
  64994. * @function SuperMap.Components.ChartViewModel.prototype.changeType
  64995. * @description 改变图表类型
  64996. * @param {string} type - 图表类型
  64997. */
  64998. }, {
  64999. key: "changeType",
  65000. value: function changeType(type) {
  65001. if (type !== this.chartType) {
  65002. this.chartType = type;
  65003. return this.updateChartOptions(this.chartType);
  65004. }
  65005. }
  65006. /**
  65007. * @function SuperMap.Components.ChartViewModel.prototype.updateData
  65008. * @description 改变图表类型
  65009. * @param {SuperMap.Components.Chart.Datasets} datasets - 数据来源
  65010. * @param {function} success 成功回调函数
  65011. */
  65012. }, {
  65013. key: "updateData",
  65014. value: function updateData(datasets, chartOption, success) {
  65015. this.updateChart = success;
  65016. this.xField = [];
  65017. this.yField = [];
  65018. this._initXYField(chartOption); // type的设置默认值
  65019. datasets.type = datasets.type || 'iServer'; // withCredentials的设置默认值
  65020. datasets.withCredentials = datasets.withCredentials || false;
  65021. this.datasets = datasets;
  65022. this.getDatasetInfo(this._updateDataSuccess.bind(this));
  65023. }
  65024. /**
  65025. * @function SuperMap.Components.ChartViewModel.prototype._updateDataSuccess
  65026. * @description 改变图表类型
  65027. * @private
  65028. * @param {Object} data - 图表数据
  65029. */
  65030. }, {
  65031. key: "_updateDataSuccess",
  65032. value: function _updateDataSuccess(data) {
  65033. var options = this._createChartOptions(data);
  65034. this.updateChart(options);
  65035. }
  65036. /**
  65037. * @function SuperMap.Components.ChartViewModel.prototype.updateChartOptions
  65038. * @description 更新图表所需参数
  65039. * @param {string} type - 图表类型
  65040. * @param {Object} style - 图表样式
  65041. */
  65042. }, {
  65043. key: "updateChartOptions",
  65044. value: function updateChartOptions(type, style) {
  65045. if (this.calculatedData) {
  65046. var grid = this.grid;
  65047. var series = this._createChartSeries(this.calculatedData, type);
  65048. var datas = [];
  65049. for (var i in this.calculatedData.XData) {
  65050. datas.push({
  65051. value: this.calculatedData.XData[i].fieldsData
  65052. });
  65053. }
  65054. var xAxis = {
  65055. type: "category",
  65056. name: this.xField[0].name || "X",
  65057. data: datas,
  65058. nameTextStyle: {
  65059. color: '#fff',
  65060. fontSize: 14
  65061. },
  65062. splitLine: {
  65063. show: false
  65064. },
  65065. axisLine: {
  65066. lineStyle: {
  65067. color: '#eee'
  65068. }
  65069. }
  65070. };
  65071. var yAxis = {
  65072. type: "value",
  65073. name: this.yFieldName || "Y",
  65074. data: {},
  65075. nameTextStyle: {
  65076. color: '#fff',
  65077. fontSize: 14
  65078. },
  65079. splitLine: {
  65080. show: false
  65081. },
  65082. axisLine: {
  65083. lineStyle: {
  65084. color: '#eee'
  65085. }
  65086. }
  65087. };
  65088. var tooltip = {
  65089. formatter: '{b0}: {c0}'
  65090. };
  65091. var backgroundColor = '#404a59';
  65092. if (style) {
  65093. if (style.grid) {
  65094. grid = style.grid;
  65095. }
  65096. if (style.tooltip) {
  65097. tooltip = style.tooltip;
  65098. }
  65099. if (style.backgroundColor) {
  65100. backgroundColor = style.backgroundColor;
  65101. }
  65102. }
  65103. return {
  65104. backgroundColor: backgroundColor,
  65105. grid: grid,
  65106. series: series,
  65107. xAxis: xAxis,
  65108. yAxis: yAxis,
  65109. tooltip: tooltip
  65110. };
  65111. }
  65112. }
  65113. /**
  65114. * @function SuperMap.Components.ChartViewModel.prototype._createChartDatas
  65115. * @description 构建图表数据
  65116. * @private
  65117. * @param {Object} data - 源数据
  65118. */
  65119. }, {
  65120. key: "_createChartDatas",
  65121. value: function _createChartDatas(data) {
  65122. var fieldIndex = 0,
  65123. yfieldIndexs = [];
  65124. var fieldCaptions = data.fieldCaptions;
  65125. var me = this; //X
  65126. fieldCaptions.forEach(function (field, index) {
  65127. if (me.xField[0] && field === me.xField[0].field) {
  65128. fieldIndex = index;
  65129. }
  65130. }); //Y
  65131. this.yFieldName = "";
  65132. this.yField.forEach(function (value, index) {
  65133. if (index !== 0) {
  65134. me.yFieldName = me.yFieldName + ",";
  65135. }
  65136. me.yFieldName = me.yFieldName + value.name;
  65137. fieldCaptions.forEach(function (field, index) {
  65138. if (field === value.field) {
  65139. yfieldIndexs.push(index);
  65140. }
  65141. });
  65142. });
  65143. var datas = this._getAttrData(data, fieldIndex);
  65144. var yDatas = [];
  65145. if (yfieldIndexs.length > 0) {
  65146. yfieldIndexs.forEach(function (yfieldIndex) {
  65147. var yData = [];
  65148. for (var i in data.fieldValues[yfieldIndex]) {
  65149. yData.push({
  65150. value: data.fieldValues[yfieldIndex][i]
  65151. });
  65152. }
  65153. yDatas.push(yData);
  65154. });
  65155. } else {
  65156. //未指定Y字段时,y轴计数
  65157. var YData = [],
  65158. XData = [],
  65159. len = datas.length; //计算X轴,Y轴数据,并去重
  65160. for (var i = 0; i < len; i++) {
  65161. var isSame = false;
  65162. for (var j = 0, leng = XData.length; j < leng; j++) {
  65163. if (datas[i].fieldsData === XData[j].fieldsData) {
  65164. YData[j].value++;
  65165. XData[j].recordIndexs.push(i);
  65166. isSame = true;
  65167. break;
  65168. }
  65169. }
  65170. if (!isSame) {
  65171. if (datas[i].fieldsData) {
  65172. XData.push({
  65173. fieldsData: datas[i].fieldsData,
  65174. recordIndexs: [i]
  65175. });
  65176. YData.push({
  65177. value: 1
  65178. });
  65179. }
  65180. }
  65181. }
  65182. datas = XData;
  65183. yDatas = [YData];
  65184. }
  65185. return {
  65186. XData: datas,
  65187. YData: yDatas
  65188. };
  65189. }
  65190. /**
  65191. * @function SuperMap.Components.ChartViewModel.prototype._getAttrData
  65192. * @description 选中字段数据
  65193. * @private
  65194. * @param {Object} datacontent - 图表数据
  65195. * @param {number} index - 字段索引
  65196. */
  65197. }, {
  65198. key: "_getAttrData",
  65199. value: function _getAttrData(datacontent, index) {
  65200. if (index === 0) {
  65201. this.xField = [{
  65202. field: datacontent.fieldCaptions[index],
  65203. name: datacontent.fieldCaptions[index]
  65204. }];
  65205. }
  65206. var fieldsDatas = [];
  65207. for (var i = 0, len = datacontent.fieldValues[index].length; i < len; i++) {
  65208. var value = datacontent.fieldValues[index][i];
  65209. fieldsDatas.push({
  65210. recordIndexs: i,
  65211. fieldsData: value
  65212. });
  65213. }
  65214. return fieldsDatas;
  65215. }
  65216. /**
  65217. * @function SuperMap.Components.ChartViewModel.prototype._createChartSeries
  65218. * @description 图表数据
  65219. * @private
  65220. * @param {Object} calculatedData - 图表数据
  65221. * @param {string} chartType - 图表类型
  65222. */
  65223. }, {
  65224. key: "_createChartSeries",
  65225. value: function _createChartSeries(calculatedData, chartType) {
  65226. var series = [];
  65227. var yDatas = calculatedData.YData;
  65228. yDatas.forEach(function (yData) {
  65229. var value = 0;
  65230. var serieData = [];
  65231. var _iterator = _createForOfIteratorHelper(yData),
  65232. _step;
  65233. try {
  65234. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  65235. var data = _step.value;
  65236. value = data.value;
  65237. serieData.push({
  65238. value: value
  65239. });
  65240. }
  65241. } catch (err) {
  65242. _iterator.e(err);
  65243. } finally {
  65244. _iterator.f();
  65245. }
  65246. var serie = {
  65247. type: chartType,
  65248. data: serieData,
  65249. name: "y"
  65250. };
  65251. series.push(serie);
  65252. });
  65253. return series;
  65254. }
  65255. /**
  65256. * @function SuperMap.Components.ChartViewModel.prototype._isDate
  65257. * @description 判断是否为日期
  65258. * @private
  65259. * @param {string} data - 字符串
  65260. */
  65261. }, {
  65262. key: "_isDate",
  65263. value: function _isDate(data) {
  65264. 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;
  65265. return reg.test(data);
  65266. }
  65267. /**
  65268. * @function SuperMap.Components.ChartViewModel.prototype._isNumber
  65269. * @description 判断是否为数值
  65270. * @private
  65271. * @param {string} data - 字符串
  65272. */
  65273. }, {
  65274. key: "_isNumber",
  65275. value: function _isNumber(data) {
  65276. var mdata = Number(data);
  65277. if (mdata === 0) {
  65278. return true;
  65279. }
  65280. return !isNaN(mdata);
  65281. }
  65282. /**
  65283. * @function SuperMap.Components.ChartViewModel.prototype._getDataType
  65284. * @description 判断数据的类型
  65285. * @private
  65286. * @param {string} data - 字符串
  65287. */
  65288. }, {
  65289. key: "_getDataType",
  65290. value: function _getDataType(data) {
  65291. if (data !== null && data !== undefined && data !== '') {
  65292. if (this._isDate(data)) {
  65293. return "DATE";
  65294. }
  65295. if (this._isNumber(data)) {
  65296. return "NUMBER";
  65297. }
  65298. }
  65299. return "STRING";
  65300. }
  65301. /**
  65302. * @function SuperMap.Components.ChartViewModel.prototype._checkUrl
  65303. * @description 检查url是否符合要求
  65304. * @private
  65305. * @param {string} url
  65306. */
  65307. }, {
  65308. key: "_checkUrl",
  65309. value: function _checkUrl(url) {
  65310. var match;
  65311. if (url === '' || !this._isMatchUrl(url)) {
  65312. match = false;
  65313. } else if (/^http[s]?:\/\/localhost/.test(url) || /^http[s]?:\/\/127.0.0.1/.test(url)) {
  65314. //不是实际域名
  65315. match = false;
  65316. } else {
  65317. match = true;
  65318. }
  65319. return match;
  65320. }
  65321. /**
  65322. * @function SuperMap.Components.ChartViewModel.prototype._isMatchUrl
  65323. * @description 判断输入的地址是否符合地址格式
  65324. * @private
  65325. * @param {string} str - url
  65326. */
  65327. }, {
  65328. key: "_isMatchUrl",
  65329. value: function _isMatchUrl(str) {
  65330. var reg = new RegExp('(https?|http|file|ftp)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]');
  65331. return reg.test(str);
  65332. }
  65333. /**
  65334. * @function SuperMap.Components.ChartViewModel.prototype.getStyle
  65335. * @description 获取图表样式。
  65336. */
  65337. }, {
  65338. key: "getStyle",
  65339. value: function getStyle() {
  65340. var style = {
  65341. grid: this.grid,
  65342. tooltip: this.tooltip,
  65343. backgroundColor: this.backgroundColor
  65344. };
  65345. return style;
  65346. }
  65347. /**
  65348. * @function SuperMap.Components.ChartViewModel.prototype.getFeatures
  65349. * @description 获取地图服务,数据服务请求返回的数据。
  65350. */
  65351. }, {
  65352. key: "getFeatures",
  65353. value: function getFeatures() {
  65354. return this.features;
  65355. }
  65356. /**
  65357. * @function SuperMap.Components.ChartViewModel.prototype.setStyle
  65358. * @description 设置图表样式。
  65359. * @param {Object} style - 图表样式
  65360. */
  65361. }, {
  65362. key: "setStyle",
  65363. value: function setStyle(style) {
  65364. return this.updateChartOptions(this.chartType, style);
  65365. }
  65366. }]);
  65367. return ChartViewModel;
  65368. }();
  65369. SuperMap.Components.ChartViewModel = ChartViewModel;
  65370. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartView.js
  65371. function ChartView_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65372. 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); } }
  65373. function ChartView_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartView_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartView_defineProperties(Constructor, staticProps); return Constructor; }
  65374. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  65375. * This program are made available under the terms of the Apache License, Version 2.0
  65376. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65377. /**
  65378. * @class SuperMap.Components.Chart
  65379. * @classdesc 图表组件
  65380. * @version 9.1.2
  65381. * @param {string} domID - 图表dom元素ID。
  65382. * @param {Object} options - 可选参数。
  65383. * @param {string} options.type - 图表类型。
  65384. * @param {SuperMap.Components.Chart.Datasets} options.datasets - 数据来源
  65385. * @param {Array.<Object>} options.chartOptions - 图表可选参数。
  65386. * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
  65387. * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
  65388. * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
  65389. * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
  65390. * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
  65391. * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
  65392. * @category Components Chart
  65393. */
  65394. /**
  65395. * @typedef {Object} SuperMap.Components.Chart.Datasets - 数据来源
  65396. * @property {string} [type = 'iServer'] - 服务类型 iServer, iPortal。
  65397. * @property {string} url - 服务url地址。
  65398. * @property {boolean} [withCredentials = false] - 设置请求是否带cookie
  65399. * @property {SuperMap.FilterParameter} queryInfo - 查询条件
  65400. */
  65401. var ChartView = /*#__PURE__*/function () {
  65402. function ChartView(domID, options) {
  65403. ChartView_classCallCheck(this, ChartView);
  65404. this.domID = domID;
  65405. this.chartType = options.type || "bar"; // 设置options.datasets.type的默认值是iServer
  65406. options.datasets.type = options.datasets.type || 'iServer'; // 设置withCredentials的默认值为false
  65407. options.datasets.withCredentials = options.datasets.withCredentials || false;
  65408. this.viewModel = new ChartViewModel(options); //添加控件。
  65409. this._fillDataToView();
  65410. }
  65411. /**
  65412. * @function SuperMap.Components.Chart.prototype.onAdd
  65413. * @description 创建图表之后成功回调
  65414. * @param {function} addChart - 回调函数
  65415. */
  65416. ChartView_createClass(ChartView, [{
  65417. key: "onAdd",
  65418. value: function onAdd(addChart) {
  65419. this.addChart = addChart;
  65420. }
  65421. /**
  65422. * @function SuperMap.Components.Chart.prototype._fillDataToView
  65423. * @description 填充数据到 view。
  65424. * @private
  65425. */
  65426. }, {
  65427. key: "_fillDataToView",
  65428. value: function _fillDataToView() {
  65429. var messageboxs = new MessageBox(); //iclient 绑定createChart事件成功回调
  65430. this.viewModel.getDatasetInfo(this._createChart.bind(this));
  65431. this.viewModel.events.on({
  65432. "getdatafailed": function getdatafailed(error) {
  65433. messageboxs.showView(error.message);
  65434. }
  65435. });
  65436. }
  65437. /**
  65438. * @function SuperMap.Components.Chart.prototype.getStyle
  65439. * @description 获取图表样式。
  65440. */
  65441. }, {
  65442. key: "getStyle",
  65443. value: function getStyle() {
  65444. return this.viewModel.getStyle();
  65445. }
  65446. /**
  65447. * @function SuperMap.Components.Chart.prototype.getFeatures
  65448. * @description 获取地图服务,数据服务请求返回的数据。
  65449. */
  65450. }, {
  65451. key: "getFeatures",
  65452. value: function getFeatures() {
  65453. return this.viewModel.getFeatures();
  65454. }
  65455. /**
  65456. * @function SuperMap.Components.Chart.prototype.setStyle
  65457. * @description 设置图表样式。
  65458. * @param {Object} style - 图表样式 参考Echarts-options样式设置
  65459. */
  65460. }, {
  65461. key: "setStyle",
  65462. value: function setStyle(style) {
  65463. var newOptions = this.viewModel.setStyle(style);
  65464. this._updateChart(newOptions);
  65465. }
  65466. /**
  65467. * @function SuperMap.Components.Chart.prototype.changeType
  65468. * @description 改变图表类型
  65469. * @param {string} type - 图表类型
  65470. */
  65471. }, {
  65472. key: "changeType",
  65473. value: function changeType(type) {
  65474. if (this.chartType !== type) {
  65475. this.chartType = type;
  65476. var newOptions = this.viewModel.changeType(type);
  65477. this._updateChart(newOptions);
  65478. }
  65479. }
  65480. /**
  65481. * @function SuperMap.Components.Chart.prototype.updateData
  65482. * @description 更新图表数据
  65483. * @param {SuperMap.Components.Chart.Datasets} datasets - 数据来源
  65484. * @param {Object} chartOption - X,Y轴信息
  65485. */
  65486. }, {
  65487. key: "updateData",
  65488. value: function updateData(datasets, chartOption) {
  65489. var me = this;
  65490. this.viewModel.updateData(datasets, chartOption, function (options) {
  65491. me._updateChart(options);
  65492. if (me.addChart) {
  65493. me.addChart();
  65494. }
  65495. });
  65496. }
  65497. /**
  65498. * @function SuperMap.Components.Chart.prototype._createChart
  65499. * @description 创建图表
  65500. * @private
  65501. * @param {Object} data - 图表数据
  65502. */
  65503. }, {
  65504. key: "_createChart",
  65505. value: function _createChart(data) {
  65506. this.echart = external_function_try_return_echarts_catch_e_return_default().init(document.getElementById(this.domID), null, {
  65507. renderer: "canvas"
  65508. });
  65509. var options = this.viewModel._createChartOptions(data);
  65510. this.echart.setOption(options);
  65511. if (this.addChart) {
  65512. this.addChart();
  65513. }
  65514. }
  65515. /**
  65516. * @function SuperMap.Components.Chart.prototype._updateChart
  65517. * @description 更新图表
  65518. * @private
  65519. * @param {Object} options - 图表参数
  65520. */
  65521. }, {
  65522. key: "_updateChart",
  65523. value: function _updateChart(options) {
  65524. if (this.echart) {
  65525. this.echart.clear();
  65526. this.echart.setOption(options);
  65527. }
  65528. }
  65529. }]);
  65530. return ChartView;
  65531. }();
  65532. SuperMap.Components.Chart = ChartView;
  65533. ;// CONCATENATED MODULE: ./src/common/components/templates/TemplateBase.js
  65534. function TemplateBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65535. 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); } }
  65536. function TemplateBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TemplateBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TemplateBase_defineProperties(Constructor, staticProps); return Constructor; }
  65537. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  65538. * This program are made available under the terms of the Apache License, Version 2.0
  65539. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65540. /**
  65541. * @class SuperMap.Components.TemplateBase
  65542. * @classdesc 组件公用组件父类,用于约束统一封装的公用组件结构。
  65543. * @version 9.1.1
  65544. * @param {Object} options - 组件配置参数。
  65545. * @param {string} options.id - 组件 dom 元素 id。
  65546. * @category Components Common
  65547. */
  65548. var TemplateBase = /*#__PURE__*/function () {
  65549. function TemplateBase(options) {
  65550. TemplateBase_classCallCheck(this, TemplateBase);
  65551. options = options ? options : {};
  65552. /**
  65553. * @member {string} [SuperMap.Components.TemplateBase.prototype.id=null]
  65554. * @description 组件 dom 元素 id。
  65555. */
  65556. this.id = options.id ? options.id : null;
  65557. /**
  65558. * @member {Element} [SuperMap.Components.TemplateBase.prototype.rootContainer=null]
  65559. * @description 组件 dom 元素对象。
  65560. */
  65561. this.rootContainer = null;
  65562. }
  65563. /**
  65564. * @function SuperMap.Components.TemplateBase.prototype.getElement
  65565. * @description 获取当前组件元素对象。
  65566. * @return {Element}
  65567. */
  65568. TemplateBase_createClass(TemplateBase, [{
  65569. key: "getElement",
  65570. value: function getElement() {
  65571. //todo 其实感觉再这里给组件设置不太合理
  65572. if (this.id) {
  65573. this.rootContainer.id = this.id;
  65574. }
  65575. return this.rootContainer;
  65576. }
  65577. /**
  65578. * @function SuperMap.Components.TemplateBase.prototype._initView
  65579. * @private
  65580. * @description 初始化模板。
  65581. */
  65582. }, {
  65583. key: "_initView",
  65584. value: function _initView() {//子类实现此方法
  65585. }
  65586. /**
  65587. * @function SuperMap.Components.TemplateBase.prototype.showView
  65588. * @description 显示组件。
  65589. */
  65590. }, {
  65591. key: "showView",
  65592. value: function showView() {
  65593. this.rootContainer.hidden = false;
  65594. }
  65595. /**
  65596. * @function SuperMap.Components.TemplateBase.prototype.closeView
  65597. * @description 隐藏组件。
  65598. */
  65599. }, {
  65600. key: "closeView",
  65601. value: function closeView() {
  65602. this.rootContainer.hidden = true;
  65603. }
  65604. }]);
  65605. return TemplateBase;
  65606. }();
  65607. SuperMap.Components.TemplateBase = TemplateBase;
  65608. ;// CONCATENATED MODULE: ./src/common/components/templates/CommonContainer.js
  65609. function CommonContainer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { CommonContainer_typeof = function _typeof(obj) { return typeof obj; }; } else { CommonContainer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return CommonContainer_typeof(obj); }
  65610. function CommonContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65611. 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); } }
  65612. function CommonContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonContainer_defineProperties(Constructor, staticProps); return Constructor; }
  65613. function CommonContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) CommonContainer_setPrototypeOf(subClass, superClass); }
  65614. function CommonContainer_setPrototypeOf(o, p) { CommonContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CommonContainer_setPrototypeOf(o, p); }
  65615. 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); }; }
  65616. function CommonContainer_possibleConstructorReturn(self, call) { if (call && (CommonContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return CommonContainer_assertThisInitialized(self); }
  65617. function CommonContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65618. function CommonContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  65619. function CommonContainer_getPrototypeOf(o) { CommonContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CommonContainer_getPrototypeOf(o); }
  65620. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  65621. * This program are made available under the terms of the Apache License, Version 2.0
  65622. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65623. /**
  65624. * @class SuperMap.Components.CommonContainer
  65625. * @classdesc 组件统一外框。
  65626. * @version 9.1.1
  65627. * @param {Object} options - 组件可选参数。
  65628. * @param {string} options.id - 组件 dom 元素 id。
  65629. * @param {string} options.title - 标题。
  65630. * @category Components Common
  65631. * @extends {SuperMap.Components.TemplateBase}
  65632. */
  65633. var CommonContainer = /*#__PURE__*/function (_TemplateBase) {
  65634. CommonContainer_inherits(CommonContainer, _TemplateBase);
  65635. var _super = CommonContainer_createSuper(CommonContainer);
  65636. function CommonContainer(options) {
  65637. var _this;
  65638. CommonContainer_classCallCheck(this, CommonContainer);
  65639. _this = _super.call(this, options);
  65640. var title = options.title ? options.title : "";
  65641. _this._initView(title);
  65642. return _this;
  65643. }
  65644. /**
  65645. * @private
  65646. * @override
  65647. */
  65648. CommonContainer_createClass(CommonContainer, [{
  65649. key: "_initView",
  65650. value: function _initView(title) {
  65651. var container = document.createElement("div");
  65652. container.setAttribute("class", "component-container"); //title
  65653. var titleContainer = document.createElement("div");
  65654. titleContainer.setAttribute("class", "component-title");
  65655. var titleContent = document.createElement("div");
  65656. titleContent.innerHTML = title;
  65657. titleContainer.appendChild(titleContent);
  65658. container.appendChild(titleContainer); //container
  65659. var componentContent = document.createElement("div");
  65660. componentContent.setAttribute("class", "component-content");
  65661. container.appendChild(componentContent);
  65662. this.content = componentContent;
  65663. this.rootContainer = container;
  65664. return container;
  65665. }
  65666. /**
  65667. * @function SuperMap.Components.CommonContainer.prototype.getContentElement
  65668. * @description 获取内容元素容器
  65669. */
  65670. }, {
  65671. key: "getContentElement",
  65672. value: function getContentElement() {
  65673. return this.content;
  65674. }
  65675. /**
  65676. * @function SuperMap.Components.CommonContainer.prototype.appendContent
  65677. * @description 填充内容元素
  65678. */
  65679. }, {
  65680. key: "appendContent",
  65681. value: function appendContent(element) {
  65682. this.content.appendChild(element);
  65683. }
  65684. }]);
  65685. return CommonContainer;
  65686. }(TemplateBase);
  65687. SuperMap.Components.CommonContainer = CommonContainer;
  65688. ;// CONCATENATED MODULE: ./src/common/components/templates/Select.js
  65689. function Select_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Select_typeof = function _typeof(obj) { return typeof obj; }; } else { Select_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Select_typeof(obj); }
  65690. function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65691. 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); } }
  65692. function Select_createClass(Constructor, protoProps, staticProps) { if (protoProps) Select_defineProperties(Constructor.prototype, protoProps); if (staticProps) Select_defineProperties(Constructor, staticProps); return Constructor; }
  65693. function Select_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Select_setPrototypeOf(subClass, superClass); }
  65694. function Select_setPrototypeOf(o, p) { Select_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Select_setPrototypeOf(o, p); }
  65695. 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); }; }
  65696. function Select_possibleConstructorReturn(self, call) { if (call && (Select_typeof(call) === "object" || typeof call === "function")) { return call; } return Select_assertThisInitialized(self); }
  65697. function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65698. function Select_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  65699. function Select_getPrototypeOf(o) { Select_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Select_getPrototypeOf(o); }
  65700. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  65701. * This program are made available under the terms of the Apache License, Version 2.0
  65702. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65703. /**
  65704. * @class SuperMap.Components.Select
  65705. * @classdesc 组件统一的文字下拉框。
  65706. * @version 9.1.1
  65707. * @param {Array.<string|Array>} options - 需要创建的 Select 数据数组。
  65708. * @param {string} options.id - 组件 dom 元素 id。
  65709. * @param {string} [options.labelName] - label 名称。
  65710. * @param {Array.<string>} options.optionsArr - 需要创建的 option 数据数组。
  65711. * @param {Function} [options.optionsClickCb] - option 点击事件回调函数。
  65712. * @extends {SuperMap.Components.TemplateBase}
  65713. * @category Components Common
  65714. */
  65715. var Select = /*#__PURE__*/function (_TemplateBase) {
  65716. Select_inherits(Select, _TemplateBase);
  65717. var _super = Select_createSuper(Select);
  65718. function Select(options) {
  65719. var _this;
  65720. Select_classCallCheck(this, Select);
  65721. _this = _super.call(this, options);
  65722. _this._initView(options);
  65723. return _this;
  65724. }
  65725. Select_createClass(Select, [{
  65726. key: "_initView",
  65727. value: function _initView(options) {
  65728. var selectTool = this._createElement('div', "component-selecttool");
  65729. if (options.labelName) {
  65730. var label = this._createElement('label', 'component-selecttool__lable--describe', selectTool);
  65731. label.innerHTML = options.labelName;
  65732. }
  65733. var chartSelect = this._createElement('div', 'component-selecttool--chart', selectTool);
  65734. chartSelect.setAttribute('tabindex', '1');
  65735. var selectName = this._createElement('div', "component-selecttool__name", chartSelect);
  65736. selectName.title = options.optionsArr[0];
  65737. selectName.innerHTML = options.optionsArr[0];
  65738. var chartTriangleBtn = this._createElement('div', 'component-selecttool__trianglebtn--chart', chartSelect);
  65739. var triangleBtn = this._createElement('div', 'component-triangle-down-img', chartTriangleBtn);
  65740. var selectContent = this._createElement('div', 'component-selecttool__content', chartSelect);
  65741. var scrollarea = this._createElement('div', 'component-selecttool__content--chart', selectContent);
  65742. var scrollareaContent = this._createElement('div', 'component-selecttool__scrollarea__content', scrollarea);
  65743. scrollareaContent.setAttribute('tabindex', '1');
  65744. this.createOptions(scrollareaContent, options.optionsArr);
  65745. this.optionClickEvent(scrollareaContent, selectName, options.optionsClickCb); // 下拉框显示 & 隐藏事件
  65746. this._selectClickEvent(chartSelect, selectContent, triangleBtn);
  65747. this.rootContainer = selectTool;
  65748. }
  65749. /**
  65750. * @function SuperMap.Components.Select.prototype.createOptions
  65751. * @description 创建所属下拉框选项。
  65752. */
  65753. }, {
  65754. key: "createOptions",
  65755. value: function createOptions(container, optionsArr) {
  65756. for (var i in optionsArr) {
  65757. var option = this._createElement('div', 'component-selecttool__option', container);
  65758. option.title = optionsArr[i];
  65759. option.innerHTML = optionsArr[i];
  65760. }
  65761. }
  65762. /**
  65763. * @function SuperMap.Components.Select.prototype._selectClickEvent
  65764. * @description select 点击显示&隐藏事件。
  65765. * @private
  65766. */
  65767. }, {
  65768. key: "_selectClickEvent",
  65769. value: function _selectClickEvent(eventElement, contentElement, triangleBtn) {
  65770. eventElement.onclick = function (e) {
  65771. if (contentElement.style.display === "block") {
  65772. contentElement.style.display = "none";
  65773. triangleBtn.className = "component-triangle-down-img";
  65774. } else {
  65775. contentElement.style.display = "block";
  65776. triangleBtn.className = "triangle-up-img";
  65777. }
  65778. e.preventDefault();
  65779. e.stopPropagation();
  65780. };
  65781. eventElement.onmousedown = function (evt) {
  65782. //console.log('dropdownbox onmousedown '+evt.target.className);
  65783. if (evt.target !== this) {
  65784. this.focus();
  65785. evt.preventDefault();
  65786. evt.stopPropagation();
  65787. }
  65788. };
  65789. eventElement.onblur = function () {
  65790. contentElement.style.display = "none";
  65791. triangleBtn.className = "component-triangle-down-img";
  65792. };
  65793. }
  65794. /**
  65795. * @function Select.prototype._createElement
  65796. * @description 通用创建元素。
  65797. * @private
  65798. */
  65799. }, {
  65800. key: "_createElement",
  65801. value: function _createElement(tagName, className, parentEle) {
  65802. var ele = document.createElement(tagName || 'div');
  65803. className && (ele.className = className);
  65804. parentEle && parentEle.appendChild(ele);
  65805. return ele;
  65806. }
  65807. /**
  65808. * @function SuperMap.Components.Select.prototype.optionClickEvent
  65809. * @description 下拉框的 option 的点击事件。
  65810. */
  65811. }, {
  65812. key: "optionClickEvent",
  65813. value: function optionClickEvent(optionEleArr, selectNameEle, optionsClickCb) {
  65814. var _loop = function _loop(i) {
  65815. var childEle = optionEleArr.children[i];
  65816. childEle.onclick = function () {
  65817. selectNameEle.innerHTML = childEle.innerHTML;
  65818. selectNameEle.title = childEle.title;
  65819. if (childEle.getAttribute('data-value')) {
  65820. selectNameEle.setAttribute('data-value', childEle.getAttribute('data-value'));
  65821. }
  65822. optionsClickCb && optionsClickCb(childEle);
  65823. };
  65824. };
  65825. for (var i = 0; i < optionEleArr.children.length; i++) {
  65826. _loop(i);
  65827. }
  65828. }
  65829. }]);
  65830. return Select;
  65831. }(TemplateBase);
  65832. SuperMap.Components.Select = Select;
  65833. ;// CONCATENATED MODULE: ./src/common/components/templates/DropDownBox.js
  65834. function DropDownBox_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DropDownBox_typeof = function _typeof(obj) { return typeof obj; }; } else { DropDownBox_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DropDownBox_typeof(obj); }
  65835. function DropDownBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65836. 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); } }
  65837. function DropDownBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) DropDownBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) DropDownBox_defineProperties(Constructor, staticProps); return Constructor; }
  65838. function DropDownBox_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DropDownBox_setPrototypeOf(subClass, superClass); }
  65839. function DropDownBox_setPrototypeOf(o, p) { DropDownBox_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DropDownBox_setPrototypeOf(o, p); }
  65840. 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); }; }
  65841. function DropDownBox_possibleConstructorReturn(self, call) { if (call && (DropDownBox_typeof(call) === "object" || typeof call === "function")) { return call; } return DropDownBox_assertThisInitialized(self); }
  65842. function DropDownBox_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65843. function DropDownBox_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  65844. function DropDownBox_getPrototypeOf(o) { DropDownBox_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DropDownBox_getPrototypeOf(o); }
  65845. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  65846. * This program are made available under the terms of the Apache License, Version 2.0
  65847. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65848. /**
  65849. * @class SuperMap.Components.DropDownBox
  65850. * @classdesc 组件统一的图片下拉框。
  65851. * @version 9.1.1
  65852. * @param {Array.<Object>} optionsArr - 需要创建的 option 数据数组。
  65853. * @param {string} optionsArr.id - 组件 dom 元素 id。
  65854. * @param {string} optionsArr.title - 下拉框 title。
  65855. * @param {string} optionsArr.remark - 下拉框解释标记文本。
  65856. * @param {string} optionsArr.icon - 下拉框图标。
  65857. * @param {string} [optionsArr.dataValue] - 下拉框 attribute 名为 data-value 的值 。
  65858. * @param {string} [optionsArr.icon.className] - 下拉框图标类名。
  65859. * @param {string} [optionsArr.icon.background] - 下拉框图标背景 url。
  65860. * @category Components Common
  65861. * @extends {SuperMap.Components.TemplateBase}
  65862. */
  65863. var DropDownBox = /*#__PURE__*/function (_TemplateBase) {
  65864. DropDownBox_inherits(DropDownBox, _TemplateBase);
  65865. var _super = DropDownBox_createSuper(DropDownBox);
  65866. function DropDownBox(optionsArr) {
  65867. var _this;
  65868. DropDownBox_classCallCheck(this, DropDownBox);
  65869. _this = _super.call(this, optionsArr);
  65870. _this._initView(optionsArr);
  65871. return _this;
  65872. }
  65873. /**
  65874. * @function SuperMap.Components.DropDownBox.prototype._initView
  65875. * @description 初始化下拉框。
  65876. * @private
  65877. * @override
  65878. */
  65879. DropDownBox_createClass(DropDownBox, [{
  65880. key: "_initView",
  65881. value: function _initView(optionsArr) {
  65882. var dropDownContainer = document.createElement('div');
  65883. dropDownContainer.className = 'component-dropdownbox--container';
  65884. var dropDownBox = document.createElement('div');
  65885. dropDownBox.setAttribute('tabindex', '1');
  65886. dropDownBox.className = "component-dropdownbox";
  65887. dropDownContainer.appendChild(dropDownBox);
  65888. var dropDownTopContainer = document.createElement('div');
  65889. dropDownBox.appendChild(dropDownTopContainer);
  65890. this._createDropDownOption(optionsArr[0], dropDownTopContainer);
  65891. var triangleBtnContainer = document.createElement('div');
  65892. triangleBtnContainer.className = 'component-dropdownbox__triangle-btn';
  65893. dropDownBox.appendChild(triangleBtnContainer);
  65894. var triangleBtn = document.createElement('div');
  65895. triangleBtn.className = 'component-triangle-down-img';
  65896. triangleBtnContainer.appendChild(triangleBtn);
  65897. var createDropDownBoxParam = {
  65898. "parentEle": dropDownBox,
  65899. "dropDownContent": ['component-dropdownbox__content component-dropdownbox__content--chart', 'dropDownContent'],
  65900. "scrollareaContent": 'component-selecttool__scrollarea__content',
  65901. "optionsArr": optionsArr,
  65902. "triangleBtn": triangleBtn,
  65903. "dropDownTopContainer": dropDownTopContainer
  65904. };
  65905. this._createDropDownBox(createDropDownBoxParam);
  65906. this.rootContainer = dropDownContainer;
  65907. }
  65908. /**
  65909. * @function SuperMap.Components.DropDownBox.prototype._createDropDownBox
  65910. * @description 创建下拉框。
  65911. * @private
  65912. */
  65913. }, {
  65914. key: "_createDropDownBox",
  65915. value: function _createDropDownBox(createDropDownBoxParam) {
  65916. var dropDownBox = createDropDownBoxParam.parentEle;
  65917. var dropDownTopContainer = createDropDownBoxParam.dropDownTopContainer;
  65918. var dropDownContent = document.createElement('div');
  65919. dropDownContent.className = createDropDownBoxParam.dropDownContent[0];
  65920. dropDownBox.appendChild(dropDownContent);
  65921. var scrollareaContent = document.createElement('div');
  65922. scrollareaContent.className = createDropDownBoxParam.scrollareaContent;
  65923. dropDownContent.appendChild(scrollareaContent);
  65924. var optionsArr = createDropDownBoxParam.optionsArr;
  65925. for (var i = 0; i < optionsArr.length; i++) {
  65926. this._createDropDownOption(optionsArr[i], scrollareaContent);
  65927. } // 下拉框显示 & 隐藏事件
  65928. var triangleBtn = createDropDownBoxParam.triangleBtn;
  65929. this._dropDownClickEvent(dropDownBox, dropDownContent, triangleBtn);
  65930. this._eleOnblur(dropDownBox, dropDownContent, triangleBtn); // 下拉框 options 点击事件
  65931. var scrollareaOptions = scrollareaContent.children;
  65932. var _loop = function _loop(_i) {
  65933. scrollareaOptions[_i].onclick = function () {
  65934. dropDownTopContainer.innerHTML = scrollareaOptions[_i].outerHTML; //evt.stopPropagation();
  65935. };
  65936. };
  65937. for (var _i = 0; _i < scrollareaOptions.length; _i++) {
  65938. _loop(_i);
  65939. }
  65940. }
  65941. /**
  65942. * @function SuperMap.Components.DropDownBox.prototype._createDropDownOption
  65943. * @description 创建下拉框子元素。
  65944. * @private
  65945. */
  65946. }, {
  65947. key: "_createDropDownOption",
  65948. value: function _createDropDownOption(data, parentElement) {
  65949. var ele = document.createElement('div');
  65950. ele.className = 'component-dropdownbox__item';
  65951. var dataItem = data;
  65952. if (dataItem['dataValue']) {
  65953. ele.setAttribute('data-value', dataItem['dataValue']);
  65954. }
  65955. parentElement.appendChild(ele);
  65956. var imgContainer = document.createElement('div');
  65957. imgContainer.className = 'component-dropdownbox__item__img';
  65958. ele.appendChild(imgContainer);
  65959. var img = document.createElement('div');
  65960. if (dataItem.icon.className) {
  65961. img.className = dataItem.icon.className;
  65962. }
  65963. if (dataItem.icon.background) {
  65964. img.style.background = dataItem.icon.background;
  65965. }
  65966. imgContainer.appendChild(img);
  65967. var title = document.createElement('div');
  65968. title.className = 'component-dropdownbox__item__title';
  65969. title.title = dataItem.title;
  65970. title.innerHTML = dataItem.title;
  65971. ele.appendChild(title);
  65972. var remark = document.createElement('div');
  65973. remark.className = 'component-dropdownbox__item__remark';
  65974. remark.title = dataItem.remark;
  65975. remark.innerHTML = dataItem.remark;
  65976. ele.appendChild(remark);
  65977. }
  65978. /**
  65979. * @function SuperMap.Components.DropDownBox.prototype._dropDownClickEvent
  65980. * @description 下拉框点击事件。
  65981. * @private
  65982. */
  65983. }, {
  65984. key: "_dropDownClickEvent",
  65985. value: function _dropDownClickEvent(eventElement, contentElement, triangleBtn) {
  65986. eventElement.onclick = function (e) {
  65987. if (contentElement.style.display === "block") {
  65988. contentElement.style.display = "none";
  65989. triangleBtn.className = "component-triangle-down-img";
  65990. } else {
  65991. contentElement.style.display = "block";
  65992. triangleBtn.className = "triangle-up-img";
  65993. }
  65994. e.preventDefault();
  65995. e.stopPropagation();
  65996. };
  65997. eventElement.onmousedown = function (evt) {
  65998. //console.log('dropdownbox onmousedown '+evt.target.className);
  65999. if (evt.target !== this) {
  66000. this.focus();
  66001. evt.preventDefault();
  66002. evt.stopPropagation();
  66003. }
  66004. };
  66005. }
  66006. /**
  66007. * @function SuperMap.Components.DropDownBox.prototype._eleOnblur
  66008. * @description 下拉框失焦事件。
  66009. * @private
  66010. */
  66011. }, {
  66012. key: "_eleOnblur",
  66013. value: function _eleOnblur(eventElement, contentElement, triangleBtn) {
  66014. eventElement.onblur = function () {
  66015. contentElement.style.display = "none";
  66016. triangleBtn.className = "component-triangle-down-img";
  66017. };
  66018. }
  66019. /**
  66020. * @function SuperMap.Components.DropDownBox.prototype._createElement
  66021. * @description 通用创建元素。
  66022. * @private
  66023. */
  66024. }, {
  66025. key: "_createElement",
  66026. value: function _createElement(tagName, className, parentEle) {
  66027. var ele = document.createElement(tagName || 'div');
  66028. className && (ele.className = className);
  66029. parentEle && parentEle.appendChild(ele);
  66030. return ele;
  66031. }
  66032. }]);
  66033. return DropDownBox;
  66034. }(TemplateBase);
  66035. SuperMap.Components.DropDownBox = DropDownBox;
  66036. ;// CONCATENATED MODULE: ./src/common/components/templates/PopContainer.js
  66037. function PopContainer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { PopContainer_typeof = function _typeof(obj) { return typeof obj; }; } else { PopContainer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return PopContainer_typeof(obj); }
  66038. function PopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66039. 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); } }
  66040. function PopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PopContainer_defineProperties(Constructor, staticProps); return Constructor; }
  66041. function PopContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) PopContainer_setPrototypeOf(subClass, superClass); }
  66042. function PopContainer_setPrototypeOf(o, p) { PopContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PopContainer_setPrototypeOf(o, p); }
  66043. 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); }; }
  66044. function PopContainer_possibleConstructorReturn(self, call) { if (call && (PopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return PopContainer_assertThisInitialized(self); }
  66045. function PopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66046. function PopContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  66047. function PopContainer_getPrototypeOf(o) { PopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PopContainer_getPrototypeOf(o); }
  66048. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66049. * This program are made available under the terms of the Apache License, Version 2.0
  66050. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66051. /**
  66052. * @class SuperMap.Components.PopContainer
  66053. * @classdesc 弹框组件。
  66054. * @version 9.1.1
  66055. * @param {Object} options - 组件配置参数。
  66056. * @param {string} options.id - 组件 dom 元素 id。
  66057. * @param {string} options.title - 弹框组件名称。
  66058. * @extends {SuperMap.Components.TemplateBase}
  66059. * @category Components Common
  66060. */
  66061. var PopContainer = /*#__PURE__*/function (_TemplateBase) {
  66062. PopContainer_inherits(PopContainer, _TemplateBase);
  66063. var _super = PopContainer_createSuper(PopContainer);
  66064. function PopContainer(options) {
  66065. var _this;
  66066. PopContainer_classCallCheck(this, PopContainer);
  66067. options = options ? options : {};
  66068. _this = _super.call(this, options);
  66069. options.title = options.title ? options.title : "";
  66070. _this._initView(options.title);
  66071. return _this;
  66072. }
  66073. /**
  66074. * @private
  66075. * @override
  66076. */
  66077. PopContainer_createClass(PopContainer, [{
  66078. key: "_initView",
  66079. value: function _initView(titile) {
  66080. var container = document.createElement("div");
  66081. container.setAttribute("class", "component-popcontainer"); //header
  66082. var header = document.createElement("div");
  66083. header.setAttribute("class", "component-popcontainer__header");
  66084. var title = document.createElement("label");
  66085. title.setAttribute("class", "component-popcontainer__header__title");
  66086. title.innerHTML = titile;
  66087. header.appendChild(title);
  66088. var closeBtn = document.createElement("span");
  66089. closeBtn.setAttribute("class", "supermapol-icons-clear component-popcontainer__header__close");
  66090. closeBtn.onclick = this.closeView.bind(this);
  66091. container.appendChild(closeBtn);
  66092. container.appendChild(header); //content
  66093. var content = document.createElement("div");
  66094. content.setAttribute("class", "component-popcontainer__content");
  66095. this.content = content;
  66096. container.appendChild(content);
  66097. this.rootContainer = container;
  66098. }
  66099. /**
  66100. * @function SuperMap.Components.PopContainer.prototype.appendContent
  66101. * @description 追加内容。
  66102. * @param {Element} dom - 内容元素。
  66103. */
  66104. }, {
  66105. key: "appendContent",
  66106. value: function appendContent(dom) {
  66107. this.content.appendChild(dom);
  66108. }
  66109. }]);
  66110. return PopContainer;
  66111. }(TemplateBase);
  66112. SuperMap.Components.PopContainer = PopContainer;
  66113. ;// CONCATENATED MODULE: ./src/common/components/templates/AttributesPopContainer.js
  66114. function AttributesPopContainer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { AttributesPopContainer_typeof = function _typeof(obj) { return typeof obj; }; } else { AttributesPopContainer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return AttributesPopContainer_typeof(obj); }
  66115. function AttributesPopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66116. 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); } }
  66117. function AttributesPopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) AttributesPopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) AttributesPopContainer_defineProperties(Constructor, staticProps); return Constructor; }
  66118. function AttributesPopContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) AttributesPopContainer_setPrototypeOf(subClass, superClass); }
  66119. function AttributesPopContainer_setPrototypeOf(o, p) { AttributesPopContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AttributesPopContainer_setPrototypeOf(o, p); }
  66120. 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); }; }
  66121. function AttributesPopContainer_possibleConstructorReturn(self, call) { if (call && (AttributesPopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return AttributesPopContainer_assertThisInitialized(self); }
  66122. function AttributesPopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66123. function AttributesPopContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  66124. function AttributesPopContainer_getPrototypeOf(o) { AttributesPopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AttributesPopContainer_getPrototypeOf(o); }
  66125. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66126. * This program are made available under the terms of the Apache License, Version 2.0
  66127. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66128. /**
  66129. * @class SuperMap.Components.AttributesPopContainer
  66130. * @classdesc 属性弹框组件
  66131. * @version 9.1.1
  66132. * @param {Object} options - 组件配置参数。
  66133. * @param {string} options.id - 组件 dom 元素 id。
  66134. * @param {Object} options.title - 属性弹框组件名称。
  66135. * @param {Object} options.attributes - 组件需要显示的属性内容。
  66136. * @extends {SuperMap.Components.PopContainer}
  66137. * @category Components Common
  66138. */
  66139. var AttributesPopContainer = /*#__PURE__*/function (_PopContainer) {
  66140. AttributesPopContainer_inherits(AttributesPopContainer, _PopContainer);
  66141. var _super = AttributesPopContainer_createSuper(AttributesPopContainer);
  66142. function AttributesPopContainer(options) {
  66143. var _this;
  66144. AttributesPopContainer_classCallCheck(this, AttributesPopContainer);
  66145. //默认为属性:
  66146. options.title = options.title ? options.title : "属性";
  66147. _this = _super.call(this, options);
  66148. _this.rootContainer.firstChild.hidden = true;
  66149. options.attributes = options.attributes ? options.attributes : [];
  66150. _this._createAttributesTable(options.attributes);
  66151. return _this;
  66152. }
  66153. AttributesPopContainer_createClass(AttributesPopContainer, [{
  66154. key: "_createAttributesTable",
  66155. value: function _createAttributesTable(attributes) {
  66156. var table = document.createElement("table");
  66157. table.setAttribute("class", "component-popcontainer__content__table");
  66158. var tbody = document.createElement("tbody");
  66159. var single = true;
  66160. for (var name in attributes) {
  66161. var tr = document.createElement("tr");
  66162. if (single) {
  66163. tr.setAttribute("class", "component-popcontainer__content__td--color");
  66164. }
  66165. var title = document.createElement("td");
  66166. var titleSpan = document.createElement("Span");
  66167. titleSpan.innerHTML = name;
  66168. title.appendChild(titleSpan);
  66169. var value = document.createElement("td");
  66170. value.innerHTML = attributes[name];
  66171. tr.appendChild(title);
  66172. tr.appendChild(value);
  66173. tbody.appendChild(tr);
  66174. single = !single;
  66175. }
  66176. table.appendChild(tbody);
  66177. this.appendContent(table);
  66178. }
  66179. }]);
  66180. return AttributesPopContainer;
  66181. }(PopContainer);
  66182. SuperMap.Components.AttributesPopContainer = AttributesPopContainer;
  66183. ;// CONCATENATED MODULE: ./src/common/components/templates/IndexTabsPageContainer.js
  66184. function IndexTabsPageContainer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { IndexTabsPageContainer_typeof = function _typeof(obj) { return typeof obj; }; } else { IndexTabsPageContainer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return IndexTabsPageContainer_typeof(obj); }
  66185. function IndexTabsPageContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66186. 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); } }
  66187. function IndexTabsPageContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) IndexTabsPageContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) IndexTabsPageContainer_defineProperties(Constructor, staticProps); return Constructor; }
  66188. function IndexTabsPageContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) IndexTabsPageContainer_setPrototypeOf(subClass, superClass); }
  66189. function IndexTabsPageContainer_setPrototypeOf(o, p) { IndexTabsPageContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return IndexTabsPageContainer_setPrototypeOf(o, p); }
  66190. 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); }; }
  66191. function IndexTabsPageContainer_possibleConstructorReturn(self, call) { if (call && (IndexTabsPageContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return IndexTabsPageContainer_assertThisInitialized(self); }
  66192. function IndexTabsPageContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66193. function IndexTabsPageContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  66194. function IndexTabsPageContainer_getPrototypeOf(o) { IndexTabsPageContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return IndexTabsPageContainer_getPrototypeOf(o); }
  66195. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66196. * This program are made available under the terms of the Apache License, Version 2.0
  66197. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66198. /**
  66199. * @class SuperMap.Components.IndexTabsPageContainer
  66200. * @description 标签索引组件。
  66201. * @version 9.1.1
  66202. * @param {Object} options - 可选参数。
  66203. * @param {string} options.id - 组件 dom 元素 id。
  66204. * @category Components Common
  66205. * @extends {SuperMap.Components.TemplateBase}
  66206. */
  66207. var IndexTabsPageContainer = /*#__PURE__*/function (_TemplateBase) {
  66208. IndexTabsPageContainer_inherits(IndexTabsPageContainer, _TemplateBase);
  66209. var _super = IndexTabsPageContainer_createSuper(IndexTabsPageContainer);
  66210. function IndexTabsPageContainer(options) {
  66211. var _this;
  66212. IndexTabsPageContainer_classCallCheck(this, IndexTabsPageContainer);
  66213. _this = _super.call(this, options);
  66214. _this._initView();
  66215. return _this;
  66216. }
  66217. /**
  66218. * @private
  66219. * @override
  66220. */
  66221. IndexTabsPageContainer_createClass(IndexTabsPageContainer, [{
  66222. key: "_initView",
  66223. value: function _initView() {
  66224. var container = document.createElement("div");
  66225. container.setAttribute("class", "component-tabpage");
  66226. var header = document.createElement("ul");
  66227. this.header = header;
  66228. var content = document.createElement("div");
  66229. content.setAttribute("class", "component-tabpage__content");
  66230. this.content = content;
  66231. container.appendChild(header);
  66232. container.appendChild(content);
  66233. this.rootContainer = container;
  66234. }
  66235. /**
  66236. * @function SuperMap.Components.IndexTabsPageContainer.prototype.setTabs
  66237. * @description 设置标签元素。
  66238. * @param {Array.<Element>} tabs
  66239. */
  66240. }, {
  66241. key: "setTabs",
  66242. value: function setTabs(tabs) {
  66243. this.removeAllTabs();
  66244. this.appendTabs(tabs);
  66245. }
  66246. /**
  66247. * @function SuperMap.Components.IndexTabsPageContainer.prototype.appendTabs
  66248. * @description 追加标签元素。
  66249. * @param {Array.<Element>} tabs
  66250. */
  66251. }, {
  66252. key: "appendTabs",
  66253. value: function appendTabs(tabs) {
  66254. for (var i = 0; i < tabs.length; i++) {
  66255. var title = document.createElement("span");
  66256. title.index = i;
  66257. title.appendChild(document.createTextNode(tabs[i].title)); //绑定标签切换对应页面:
  66258. title.onclick = this._changeTabsPage.bind(this);
  66259. var content = tabs[i].content;
  66260. content.index = i;
  66261. content.hidden = true;
  66262. this.header.appendChild(title);
  66263. this.content.appendChild(content);
  66264. } //todo 确认是否两个子元素的 index 相互对应
  66265. //默认显示第一个标签对象
  66266. this.header.firstChild.setAttribute("class", "on");
  66267. this.content.firstChild.hidden = false;
  66268. }
  66269. /**
  66270. * @function SuperMap.Components.IndexTabsPageContainer.prototype.removeTab
  66271. * @description 删除某个标签页面。
  66272. * @param {number} index - 标签索引号。
  66273. */
  66274. }, {
  66275. key: "removeTab",
  66276. value: function removeTab(index) {
  66277. this.header.removeChild(this.header.children[index]);
  66278. this.content.removeChild(this.content.children[index]);
  66279. }
  66280. /**
  66281. * @function SuperMap.Components.IndexTabsPageContainer.prototype.removeAllTabs
  66282. * @description 删除所有标签。
  66283. */
  66284. }, {
  66285. key: "removeAllTabs",
  66286. value: function removeAllTabs() {
  66287. for (var i = this.header.children.length; i > 0; i--) {
  66288. this.header.removeChild(this.header.children[i]);
  66289. this.content.removeChild(this.content.children[i]);
  66290. }
  66291. }
  66292. }, {
  66293. key: "_changeTabsPage",
  66294. value: function _changeTabsPage(e) {
  66295. var index = e.target.index;
  66296. for (var i = 0; i < this.header.children.length; i++) {
  66297. this.header.children[i].setAttribute("class", "");
  66298. this.content.children[i].hidden = true;
  66299. if (i === index) {
  66300. this.header.children[i].setAttribute("class", "on");
  66301. this.content.children[i].hidden = false;
  66302. }
  66303. }
  66304. }
  66305. }]);
  66306. return IndexTabsPageContainer;
  66307. }(TemplateBase);
  66308. SuperMap.Components.IndexTabsPageContainer = IndexTabsPageContainer;
  66309. ;// CONCATENATED MODULE: ./src/common/components/templates/CityTabsPage.js
  66310. function CityTabsPage_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { CityTabsPage_typeof = function _typeof(obj) { return typeof obj; }; } else { CityTabsPage_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return CityTabsPage_typeof(obj); }
  66311. function CityTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66312. 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); } }
  66313. function CityTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) CityTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) CityTabsPage_defineProperties(Constructor, staticProps); return Constructor; }
  66314. function CityTabsPage_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) CityTabsPage_setPrototypeOf(subClass, superClass); }
  66315. function CityTabsPage_setPrototypeOf(o, p) { CityTabsPage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CityTabsPage_setPrototypeOf(o, p); }
  66316. 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); }; }
  66317. function CityTabsPage_possibleConstructorReturn(self, call) { if (call && (CityTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } return CityTabsPage_assertThisInitialized(self); }
  66318. function CityTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66319. function CityTabsPage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  66320. function CityTabsPage_getPrototypeOf(o) { CityTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CityTabsPage_getPrototypeOf(o); }
  66321. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66322. * This program are made available under the terms of the Apache License, Version 2.0
  66323. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66324. /**
  66325. * @class SuperMap.Components.CityTabsPage
  66326. * @classdesc 城市地址匹配组件模板
  66327. * @version 9.1.1
  66328. * @param {Object} options - 组件配置参数。
  66329. * @param {string} options.id - 组件 dom 元素 id。
  66330. * @param {Object|Array.<string>} options.config - 城市名称配置列表,支持两种格式:{key1:{A:[],B:[]}, key2:{C:[],D:[]}} 或
  66331. * ["成都市","北京市"],用户可根据自己的项目需求进行配置
  66332. * @extends {SuperMap.Components.IndexTabsPageContainer}
  66333. * @category Components Common
  66334. */
  66335. var CityTabsPage = /*#__PURE__*/function (_IndexTabsPageContain) {
  66336. CityTabsPage_inherits(CityTabsPage, _IndexTabsPageContain);
  66337. var _super = CityTabsPage_createSuper(CityTabsPage);
  66338. function CityTabsPage(options) {
  66339. var _this;
  66340. CityTabsPage_classCallCheck(this, CityTabsPage);
  66341. _this = _super.call(this, options); //去掉默认的边框阴影样式:
  66342. _this.rootContainer.classList.add("component-citytabpage--noneBoxShadow");
  66343. _this.config = options.config; //header,若 config为城市名称数组,则直接加载内容
  66344. if (Util.isArray(_this.config)) {
  66345. _this.header.hidden = true;
  66346. _this._createCityItem("城市", _this.config);
  66347. _this.content.style.border = "none";
  66348. } else {
  66349. _this._createTabs();
  66350. _this.header.onclick = function (e) {
  66351. //关闭所有元素 是否有更简化的写法?
  66352. for (var i = 0; i < _this.header.children.length; i++) {
  66353. _this.header.children[i].setAttribute("class", "");
  66354. } //打开点击内容元素
  66355. e.target.setAttribute("class", "on");
  66356. _this._createCityContent(e.target.innerHTML);
  66357. };
  66358. }
  66359. return _this;
  66360. }
  66361. /**
  66362. * @function SuperMap.Components.CityTabsPage.prototype._createTabs
  66363. * @description 创建 Tabs
  66364. * @private
  66365. */
  66366. CityTabsPage_createClass(CityTabsPage, [{
  66367. key: "_createTabs",
  66368. value: function _createTabs() {
  66369. //header
  66370. if (Util.isArray(this.config)) {
  66371. for (var i = 0; i < this.config.length; i++) {
  66372. var innerHTML = "";
  66373. for (var key in this.config[i]) {
  66374. innerHTML += key;
  66375. }
  66376. var li = document.createElement("li");
  66377. li.innerHTML = innerHTML;
  66378. this.header.appendChild(li);
  66379. }
  66380. } else {
  66381. for (var _key in this.config) {
  66382. var _li = document.createElement("li");
  66383. _li.innerHTML = _key;
  66384. this.header.appendChild(_li);
  66385. }
  66386. }
  66387. this.header.firstChild.setAttribute("class", "on");
  66388. this._createCityContent(this.header.firstChild.innerHTML);
  66389. }
  66390. /**
  66391. * @function SuperMap.Components.CityTabsPage.prototype._createCityContent
  66392. * @description 创建列表容器
  66393. * @private
  66394. */
  66395. }, {
  66396. key: "_createCityContent",
  66397. value: function _createCityContent(keyName) {
  66398. //清除元素:
  66399. for (var i = this.content.children.length; i > 0; i--) {
  66400. this.content.removeChild(this.content.children[i - 1]);
  66401. } //创建对应元素
  66402. var cities = this.config[keyName];
  66403. for (var key in cities) {
  66404. this._createCityItem(key, cities[key]);
  66405. }
  66406. }
  66407. /**
  66408. * @function SuperMap.Components.CityTabsPage.prototype._createCityContent
  66409. * @description 创建列表容器
  66410. * @private
  66411. */
  66412. }, {
  66413. key: "_createCityItem",
  66414. value: function _createCityItem(key, cities) {
  66415. var city = document.createElement("div");
  66416. var cityClass = document.createElement("div");
  66417. cityClass.setAttribute("class", "component-citytabpag__py-key");
  66418. cityClass.innerHTML = key;
  66419. city.appendChild(cityClass);
  66420. var cityContent = document.createElement("div");
  66421. cityContent.setAttribute("class", "component-citytabpag__content");
  66422. for (var i = 0; i < cities.length; i++) {
  66423. var span = document.createElement("span");
  66424. span.innerHTML = cities[i];
  66425. cityContent.appendChild(span);
  66426. } //HOT 元素长度单独微调:
  66427. if (key === "HOT") {
  66428. cityContent.style.width = "428px";
  66429. }
  66430. city.appendChild(cityContent);
  66431. this.content.appendChild(city);
  66432. }
  66433. }]);
  66434. return CityTabsPage;
  66435. }(IndexTabsPageContainer);
  66436. SuperMap.Components.CityTabsPage = CityTabsPage;
  66437. ;// CONCATENATED MODULE: ./src/common/components/templates/NavTabsPage.js
  66438. function NavTabsPage_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { NavTabsPage_typeof = function _typeof(obj) { return typeof obj; }; } else { NavTabsPage_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return NavTabsPage_typeof(obj); }
  66439. function NavTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66440. 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); } }
  66441. function NavTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) NavTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) NavTabsPage_defineProperties(Constructor, staticProps); return Constructor; }
  66442. function NavTabsPage_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) NavTabsPage_setPrototypeOf(subClass, superClass); }
  66443. function NavTabsPage_setPrototypeOf(o, p) { NavTabsPage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NavTabsPage_setPrototypeOf(o, p); }
  66444. 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); }; }
  66445. function NavTabsPage_possibleConstructorReturn(self, call) { if (call && (NavTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } return NavTabsPage_assertThisInitialized(self); }
  66446. function NavTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66447. function NavTabsPage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  66448. function NavTabsPage_getPrototypeOf(o) { NavTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NavTabsPage_getPrototypeOf(o); }
  66449. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66450. * This program are made available under the terms of the Apache License, Version 2.0
  66451. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66452. /**
  66453. * @class SuperMap.Components.NavTabsPage
  66454. * @classdesc 标签页面组件。
  66455. * @version 9.1.1
  66456. * @param {Object} options - 组件配置参数。
  66457. * @param {string} optionsArr.id - 组件 dom 元素 id。
  66458. * @param {Array.<Object>} [options.tabs=[]] - 标签对象数组,形如:[{title: "",content: HTMLElement}],初始时,传入则创建页面。
  66459. * @extends {SuperMap.Components.TemplateBase}
  66460. * @category Components Common
  66461. */
  66462. // todo 思考拆分的控件应该以哪种方式使用
  66463. var NavTabsPage = /*#__PURE__*/function (_TemplateBase) {
  66464. NavTabsPage_inherits(NavTabsPage, _TemplateBase);
  66465. var _super = NavTabsPage_createSuper(NavTabsPage);
  66466. function NavTabsPage(options) {
  66467. var _this;
  66468. NavTabsPage_classCallCheck(this, NavTabsPage);
  66469. _this = _super.call(this, options);
  66470. _this.navTabsTitle = null;
  66471. _this.navTabsContent = null;
  66472. options.tabs = options.tabs ? options.tabs : [];
  66473. _this._initView(options.tabs);
  66474. return _this;
  66475. }
  66476. /**
  66477. * @override
  66478. * @private
  66479. */
  66480. NavTabsPage_createClass(NavTabsPage, [{
  66481. key: "_initView",
  66482. value: function _initView(tabs) {
  66483. var navTabsPage = document.createElement("div");
  66484. navTabsPage.setAttribute("class", "component-navtabspage"); //关闭按钮
  66485. var closeBtn = document.createElement("span");
  66486. closeBtn.setAttribute("class", "supermapol-icons-close");
  66487. closeBtn.onclick = this.closeView.bind(this);
  66488. navTabsPage.appendChild(closeBtn); //标签
  66489. var navTabsTitle = document.createElement("div");
  66490. this.navTabsTitle = navTabsTitle;
  66491. navTabsTitle.setAttribute("class", "component-navtabspage__title");
  66492. navTabsPage.appendChild(navTabsTitle); //内容
  66493. var navTabsContent = document.createElement("div");
  66494. this.navTabsContent = navTabsContent;
  66495. navTabsContent.setAttribute("class", "component-navtabspage__content");
  66496. navTabsPage.appendChild(navTabsContent); //若 tabs 初始传入值,则
  66497. if (tabs.length > 0) {
  66498. this.appendTabs(tabs);
  66499. }
  66500. this.rootContainer = navTabsPage;
  66501. }
  66502. /**
  66503. * @function SuperMap.Components.NavTabsPage.prototype.setTabs
  66504. * @description 设置标签。
  66505. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  66506. */
  66507. }, {
  66508. key: "setTabs",
  66509. value: function setTabs(tabs) {
  66510. this.removeAllTabs();
  66511. this.appendTabs(tabs);
  66512. }
  66513. /**
  66514. * @function SuperMap.Components.NavTabsPage.prototype.appendTabs
  66515. * @description 添加标签页面。
  66516. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  66517. */
  66518. }, {
  66519. key: "appendTabs",
  66520. value: function appendTabs(tabs) {
  66521. for (var i = 0; i < tabs.length; i++) {
  66522. var title = document.createElement("span");
  66523. title.index = i;
  66524. title.appendChild(document.createTextNode(tabs[i].title)); //绑定标签切换对应页面:
  66525. title.onclick = this._changeTabsPage.bind(this);
  66526. var content = tabs[i].content;
  66527. content.index = i;
  66528. content.hidden = true;
  66529. this.navTabsTitle.appendChild(title);
  66530. this.navTabsContent.appendChild(content);
  66531. } //todo 确认是否两个子元素的 index 相互对应
  66532. //默认显示第一个标签对象
  66533. this.navTabsTitle.firstChild.setAttribute("class", "component-navtabspage__tabs--select");
  66534. this.navTabsContent.firstChild.hidden = false;
  66535. }
  66536. /**
  66537. * @function SuperMap.Components.NavTabsPage.prototype.removeTab
  66538. * @description 删除某个标签页面。
  66539. * @param {number} index - 标签索引号。
  66540. */
  66541. }, {
  66542. key: "removeTab",
  66543. value: function removeTab(index) {
  66544. this.navTabsTitle.removeChild(this.navTabsTitle.children[index]);
  66545. this.navTabsContent.removeChild(this.navTabsContent.children[index]);
  66546. }
  66547. /**
  66548. * @function SuperMap.Components.NavTabsPage.prototype.removeAllTabs
  66549. * @description 删除所有标签。
  66550. */
  66551. }, {
  66552. key: "removeAllTabs",
  66553. value: function removeAllTabs() {
  66554. for (var i = this.navTabsTitle.children.length; i > 0; i--) {
  66555. this.navTabsTitle.removeChild(this.navTabsTitle.children[i]);
  66556. this.navTabsContent.removeChild(this.navTabsContent.children[i]);
  66557. }
  66558. }
  66559. }, {
  66560. key: "_changeTabsPage",
  66561. value: function _changeTabsPage(e) {
  66562. var index = e.target.index;
  66563. for (var i = 0; i < this.navTabsTitle.children.length; i++) {
  66564. this.navTabsTitle.children[i].setAttribute("class", "");
  66565. this.navTabsContent.children[i].hidden = true;
  66566. if (i === index) {
  66567. this.navTabsTitle.children[i].setAttribute("class", "component-navtabspage__tabs--select");
  66568. this.navTabsContent.children[i].hidden = false;
  66569. }
  66570. }
  66571. }
  66572. }]);
  66573. return NavTabsPage;
  66574. }(TemplateBase);
  66575. SuperMap.Components.NavTabsPage = NavTabsPage;
  66576. ;// CONCATENATED MODULE: ./src/common/components/templates/PaginationContainer.js
  66577. function PaginationContainer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { PaginationContainer_typeof = function _typeof(obj) { return typeof obj; }; } else { PaginationContainer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return PaginationContainer_typeof(obj); }
  66578. function PaginationContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66579. 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); } }
  66580. function PaginationContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PaginationContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PaginationContainer_defineProperties(Constructor, staticProps); return Constructor; }
  66581. function PaginationContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) PaginationContainer_setPrototypeOf(subClass, superClass); }
  66582. function PaginationContainer_setPrototypeOf(o, p) { PaginationContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PaginationContainer_setPrototypeOf(o, p); }
  66583. 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); }; }
  66584. function PaginationContainer_possibleConstructorReturn(self, call) { if (call && (PaginationContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return PaginationContainer_assertThisInitialized(self); }
  66585. function PaginationContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66586. function PaginationContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  66587. function PaginationContainer_getPrototypeOf(o) { PaginationContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PaginationContainer_getPrototypeOf(o); }
  66588. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66589. * This program are made available under the terms of the Apache License, Version 2.0
  66590. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66591. /**
  66592. * @class SuperMap.Components.PaginationContainer
  66593. * @classdesc 分页组件模板。
  66594. * @version 9.1.1
  66595. * @param {Object} options - 组件配置参数。
  66596. * @param {string} optionsArr.id - 组件 dom 元素 id。
  66597. * @param {HTMLElement} options.contents - 页面填充的 DOM 元素对象。
  66598. * @param {number} options.pageCounts - 页数。
  66599. * @extends {SuperMap.Components.TemplateBase}
  66600. * @category Components Common
  66601. */
  66602. var PaginationContainer = /*#__PURE__*/function (_TemplateBase) {
  66603. PaginationContainer_inherits(PaginationContainer, _TemplateBase);
  66604. var _super = PaginationContainer_createSuper(PaginationContainer);
  66605. function PaginationContainer(options) {
  66606. var _this;
  66607. PaginationContainer_classCallCheck(this, PaginationContainer);
  66608. options = options ? options : {};
  66609. _this = _super.call(this, options);
  66610. _this.currentPage = 0;
  66611. _this.pageNumberLis = [];
  66612. _this.currentPageNumberLis = [];
  66613. _this.linkageEvent = null;
  66614. options.contents = options.contents ? options.contents : null;
  66615. options.pageCounts = options.pageCounts ? options.pageCounts : 0;
  66616. _this._initView(options.contents, options.pageCounts);
  66617. return _this;
  66618. }
  66619. /**
  66620. * @function SuperMap.Components.PaginationContainer.prototype.setLinkageEvent
  66621. * @description 设置页面联动方法。
  66622. * @param {function} linkageEvent - 联动方法,实现指定功能。
  66623. */
  66624. PaginationContainer_createClass(PaginationContainer, [{
  66625. key: "setLinkageEvent",
  66626. value: function setLinkageEvent(linkageEvent) {
  66627. this.linkageEvent = linkageEvent;
  66628. }
  66629. /**
  66630. * @private
  66631. * @override
  66632. */
  66633. }, {
  66634. key: "_initView",
  66635. value: function _initView(contents, pageCounts) {
  66636. var container = document.createElement("div");
  66637. container.setAttribute("class", "component-pagination"); //content
  66638. var content = document.createElement("div");
  66639. content.setAttribute("class", "component-pagination__content");
  66640. container.appendChild(content);
  66641. this.content = content; //link
  66642. var link = document.createElement("ul");
  66643. link.setAttribute("class", "component-pagination__link");
  66644. link.onclick = this._changePageEvent.bind(this);
  66645. container.appendChild(link);
  66646. this._createLink(link);
  66647. this.link = link; //填充内容:
  66648. if (contents) {
  66649. this.setContent(contents);
  66650. }
  66651. if (pageCounts !== 0) {
  66652. this.setPageLink(pageCounts);
  66653. }
  66654. this.rootContainer = container;
  66655. }
  66656. /**---------以下是页面相关操作 **/
  66657. /**
  66658. * @function SuperMap.Components.PaginationContainer.prototype.setContent
  66659. * @description 设置页面内容。
  66660. * @param {Element} element - 页面内容元素。
  66661. */
  66662. }, {
  66663. key: "setContent",
  66664. value: function setContent(element) {
  66665. this.clearContent();
  66666. this.appendContent(element);
  66667. }
  66668. /**
  66669. * @function SuperMap.Components.PaginationContainer.prototype.appendContent
  66670. * @description 追加内容。
  66671. * @param {Element} element - 页面内容元素。
  66672. */
  66673. }, {
  66674. key: "appendContent",
  66675. value: function appendContent(element) {
  66676. this.content.appendChild(element);
  66677. }
  66678. /**
  66679. * @function SuperMap.Components.PaginationContainer.prototype.clearContent
  66680. * @description 清空内容元素。
  66681. */
  66682. }, {
  66683. key: "clearContent",
  66684. value: function clearContent() {
  66685. for (var i = this.content.children.length - 1; i >= 0; i--) {
  66686. this.content.removeChild(this.content.children[i]);
  66687. }
  66688. }
  66689. /** -----以下是页码相关的操作:**/
  66690. /**
  66691. * @function SuperMap.Components.PaginationContainer.prototype.setPageLink
  66692. * @description 设置页码数。
  66693. * @param {number} pageNumber - 页码数。
  66694. */
  66695. }, {
  66696. key: "setPageLink",
  66697. value: function setPageLink(pageNumber) {
  66698. //清空当前页码
  66699. this.pageNumberLis = [];
  66700. this.currentPageNumberLis = [];
  66701. this.clearPageLink(); //创建页码
  66702. this._createPageLi(pageNumber); //添加页码到页码列表
  66703. this._appendPageLink();
  66704. }
  66705. /**
  66706. * @description 创建页码。
  66707. * @param pageNumber
  66708. * @private
  66709. */
  66710. }, {
  66711. key: "_createPageLi",
  66712. value: function _createPageLi(pageNumber) {
  66713. for (var i = 0; i < pageNumber; i++) {
  66714. var pageLi = document.createElement("li");
  66715. pageLi.innerHTML = i + 1;
  66716. /*const liContent = document.createElement("span");
  66717. liContent.innerHTML = i + 1;*/
  66718. // pageLi.appendChild(liContent);
  66719. this.pageNumberLis.push(pageLi);
  66720. }
  66721. this.pageNumberLis[0].setAttribute("class", "active");
  66722. this.currentPage = 1;
  66723. if (pageNumber < 5) {
  66724. this.currentPageNumberLis = this.pageNumberLis;
  66725. } else {
  66726. for (var _i = 0; _i < 5; _i++) {
  66727. this.currentPageNumberLis.push(this.pageNumberLis[_i]);
  66728. }
  66729. }
  66730. }
  66731. /**
  66732. * @description 添加页码到页码列表。
  66733. * @private
  66734. */
  66735. }, {
  66736. key: "_appendPageLink",
  66737. value: function _appendPageLink() {
  66738. //todo 如何插入中间
  66739. for (var i = 0; i < this.currentPageNumberLis.length; i++) {
  66740. this.link.insertBefore(this.currentPageNumberLis[i], this.link.childNodes[this.link.children.length - 2]);
  66741. }
  66742. for (var _i2 = 0; _i2 < this.currentPageNumberLis.length; _i2++) {
  66743. //清空 active 状态
  66744. this.currentPageNumberLis[_i2].setAttribute("class", ""); //给当前选中的 li 赋值 active 状态
  66745. if (Number(this.currentPageNumberLis[_i2].innerHTML) === this.currentPage) {
  66746. this.currentPageNumberLis[_i2].setAttribute("class", "active");
  66747. }
  66748. } //根据 currentPage 改变按钮状态
  66749. this._changeDisableState();
  66750. if (this.linkageEvent) {
  66751. this.linkageEvent(this.currentPage);
  66752. }
  66753. }
  66754. /**
  66755. * @function SuperMap.Components.PaginationContainer.prototype.clearPageLink
  66756. * @description 清除页码列表。
  66757. */
  66758. }, {
  66759. key: "clearPageLink",
  66760. value: function clearPageLink() {
  66761. for (var i = this.link.children.length - 3; i > 1; i--) {
  66762. this.link.removeChild(this.link.children[i]);
  66763. }
  66764. }
  66765. /**
  66766. * @description 创建页码按钮。
  66767. * @param ul
  66768. * @private
  66769. */
  66770. }, {
  66771. key: "_createLink",
  66772. value: function _createLink(ul) {
  66773. for (var i = 0; i < 4; i++) {
  66774. var li = document.createElement("li");
  66775. li.setAttribute("class", "disable");
  66776. var liContent = document.createElement("span");
  66777. li.appendChild(liContent);
  66778. if (i === 0) {
  66779. liContent.id = "first";
  66780. liContent.setAttribute("class", "supermapol-icons-first");
  66781. } else if (i === 1) {
  66782. liContent.id = "prev";
  66783. liContent.setAttribute("class", "supermapol-icons-prev");
  66784. } else if (i === 2) {
  66785. liContent.id = "next";
  66786. liContent.setAttribute("class", "supermapol-icons-next");
  66787. } else if (i === 3) {
  66788. liContent.id = "last";
  66789. liContent.setAttribute("class", "supermapol-icons-last");
  66790. }
  66791. ul.appendChild(li);
  66792. }
  66793. }
  66794. /**
  66795. * @description 点击页码事件。
  66796. * @param e
  66797. * @private
  66798. */
  66799. }, {
  66800. key: "_changePageEvent",
  66801. value: function _changePageEvent(e) {
  66802. //todo
  66803. var trigger = e.target; //若列表禁用,点击无效
  66804. if (trigger.parentElement.classList[0] === "disable") {
  66805. return;
  66806. }
  66807. var targetLi;
  66808. if (trigger.id) {
  66809. targetLi = trigger.id;
  66810. } else if (Number(trigger.innerHTML)) {
  66811. targetLi = Number(trigger.innerHTML);
  66812. } else {
  66813. return;
  66814. } //页码预处理:
  66815. this._prePageNum(targetLi); //根据 currentPageNumberLis 创建页码列表
  66816. this.clearPageLink();
  66817. this._appendPageLink();
  66818. }
  66819. /**
  66820. * @description 根据 currentPage 改变按钮状态。
  66821. * @private
  66822. */
  66823. }, {
  66824. key: "_changeDisableState",
  66825. value: function _changeDisableState() {
  66826. this.link.children[0].setAttribute("class", "");
  66827. this.link.children[1].setAttribute("class", "");
  66828. this.link.children[this.link.children.length - 1].setAttribute("class", "");
  66829. this.link.children[this.link.children.length - 2].setAttribute("class", "");
  66830. if (this.currentPage === 1) {
  66831. this.link.children[0].setAttribute("class", "disable");
  66832. this.link.children[1].setAttribute("class", "disable");
  66833. }
  66834. if (this.currentPage === this.pageNumberLis.length) {
  66835. this.link.children[this.link.children.length - 1].setAttribute("class", "disable");
  66836. this.link.children[this.link.children.length - 2].setAttribute("class", "disable");
  66837. }
  66838. }
  66839. /**
  66840. * @description 根据点击页码列表事件准备需展现的页码列表。
  66841. * @param {string|number} targetLi - 被点击的列表对象 id 或 被点击的页码值。
  66842. * @private
  66843. */
  66844. }, {
  66845. key: "_prePageNum",
  66846. value: function _prePageNum(targetLi) {
  66847. var currentPageNumberLis = [];
  66848. if (targetLi === "first") {
  66849. this.currentPage = 1;
  66850. } else if (targetLi === "last") {
  66851. this.currentPage = this.pageNumberLis.length;
  66852. } else if (targetLi === "prev") {
  66853. this.currentPage = this.currentPage - 1;
  66854. } else if (targetLi === "next") {
  66855. this.currentPage = this.currentPage + 1;
  66856. } else {
  66857. this.currentPage = targetLi;
  66858. }
  66859. if (this.pageNumberLis.length <= 5) {
  66860. for (var i = 0; i < this.pageNumberLis.length; i++) {
  66861. currentPageNumberLis.push(this.pageNumberLis[i]);
  66862. }
  66863. } else {
  66864. //当前点击前三,都取前五
  66865. if (this.currentPage <= 3) {
  66866. for (var _i3 = 0; _i3 < 5; _i3++) {
  66867. currentPageNumberLis.push(this.pageNumberLis[_i3]);
  66868. }
  66869. } else if (this.currentPage >= this.pageNumberLis.length - 3) {
  66870. //点击后三,都取后5
  66871. for (var _i4 = this.pageNumberLis.length - 5; _i4 < this.pageNumberLis.length; _i4++) {
  66872. currentPageNumberLis.push(this.pageNumberLis[_i4]);
  66873. }
  66874. } else {
  66875. //其他,取中间:
  66876. for (var _i5 = this.currentPage - 3; _i5 <= this.currentPage + 1; _i5++) {
  66877. currentPageNumberLis.push(this.pageNumberLis[_i5]);
  66878. }
  66879. }
  66880. }
  66881. if (currentPageNumberLis.length > 0) {
  66882. this.currentPageNumberLis = currentPageNumberLis;
  66883. }
  66884. }
  66885. }]);
  66886. return PaginationContainer;
  66887. }(TemplateBase);
  66888. SuperMap.Components.PaginationContainer = PaginationContainer;
  66889. ;// CONCATENATED MODULE: ./src/common/components/util/Util.js
  66890. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66891. * This program are made available under the terms of the Apache License, Version 2.0
  66892. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66893. var ComponentsUtil = {
  66894. /**
  66895. * 获取上传文件类型
  66896. * @param fileName
  66897. */
  66898. getFileType: function getFileType(fileName) {
  66899. var regCSV = /^.*\.(?:csv)$/i;
  66900. var regExcel = /^.*\.(?:xls|xlsx)$/i; //文件名可以带空格
  66901. var regGeojson = /^.*\.(?:geojson|json)$/i;
  66902. if (regExcel.test(fileName)) {
  66903. //校验不通过
  66904. return CommonTypes_FileTypes.EXCEL;
  66905. } else if (regCSV.test(fileName)) {
  66906. return CommonTypes_FileTypes.CSV;
  66907. } else if (regGeojson.test(fileName)) {
  66908. return CommonTypes_FileTypes.GEOJSON;
  66909. }
  66910. return null;
  66911. }
  66912. };
  66913. ;// CONCATENATED MODULE: ./src/common/components/util/index.js
  66914. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66915. * This program are made available under the terms of the Apache License, Version 2.0
  66916. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66917. ;// CONCATENATED MODULE: ./src/common/components/index.js
  66918. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66919. * This program are made available under the terms of the Apache License, Version 2.0
  66920. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66921. //数据
  66922. //组件
  66923. //提示框组件
  66924. //图表组件
  66925. //公用模板:
  66926. //工具类
  66927. ;// CONCATENATED MODULE: ./src/common/lang/locales/en-US.js
  66928. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66929. * This program are made available under the terms of the Apache License, Version 2.0
  66930. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66931. /**
  66932. * Namespace: SuperMap.Lang["en"]
  66933. * Dictionary for English. Keys for entries are used in calls to
  66934. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  66935. * strings formatted for use with <SuperMap.String.format> calls.
  66936. */
  66937. var en = {
  66938. 'title_dataFlowService': 'Data Flow Service',
  66939. 'title_distributedAnalysis': 'Distributed Analysis',
  66940. 'title_clientComputing': 'Client Computing',
  66941. 'title_dataServiceQuery': 'Data Service Query',
  66942. 'title_searchCity': 'Search city',
  66943. 'title_searchLayer': ' Search layer',
  66944. 'text_input_value_inputDataFlowUrl': 'Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  66945. 'text_displayFeaturesInfo': 'Display feature information',
  66946. 'text_subscribe': 'subscribe',
  66947. 'text_cancelSubscribe': 'unsubscribe',
  66948. 'text_densityAnalysis': 'Density Analysis',
  66949. 'text_CalculateTheValuePerUnitArea': 'Calculate the value per unit area within the neighborhood shape',
  66950. 'text_option_selectDataset': 'Please select a dataset',
  66951. 'text_label_dataset': 'Dataset',
  66952. 'text_option_simplePointDensityAnalysis': 'Simple point density analysis',
  66953. 'text_option_nuclearDensityAnalysis': 'Nuclear density analysis',
  66954. 'text_label_analyticalMethod': 'Analytical method',
  66955. 'text_option_quadrilateral': 'Quadrilateral',
  66956. 'text_option_hexagon': 'hexagon',
  66957. 'text_label_meshType': 'Mesh type',
  66958. 'text_option_notSet': 'Not set',
  66959. 'text_label_weightField': 'Weight field',
  66960. 'text_label_gridSizeInMeters': 'Grid size',
  66961. 'text_label_searchRadius': 'Search radius',
  66962. 'text_label_queryRange': 'Scope of analysis',
  66963. 'text_label_areaUnit': 'Area unit',
  66964. 'text_option_equidistantSegmentation': 'Equidistant segmentation',
  66965. 'text_option_logarithm': 'Logarithm',
  66966. 'text_option_equalCountingSegment': 'Equal counting segment',
  66967. 'text_option_squareRootSegmentation': 'Square root segmentation',
  66968. 'text_label_thematicMapSegmentationMode': 'Thematic map segmentation mode',
  66969. 'text_label_thematicMapSegmentationParameters': 'Thematic map segmentation parameters',
  66970. 'text_option_greenOrangePurpleGradient': 'Green orange purple gradient',
  66971. 'text_option_greenOrangeRedGradient': 'Green orange red gradient',
  66972. 'text_option_rainbowGradient': 'Rainbow gradient',
  66973. 'text_option_spectralGradient': 'Spectral gradient',
  66974. 'text_option_terrainGradient': 'Terrain gradient',
  66975. 'text_label_thematicMapColorGradientMode': 'Thematic map color gradient mode',
  66976. 'text_label_resultLayerName': 'Result layer name',
  66977. 'text_chooseFile': 'Open File',
  66978. 'text_isoline': 'Isoline',
  66979. 'text_extractDiscreteValue': 'Extract discrete value generation curve',
  66980. 'text_buffer': 'Buffer',
  66981. 'text_specifyTheDistance': 'Specify the distance to create the surrounding area',
  66982. 'text_label_analysisLayer': 'Analysis layer',
  66983. 'text_label_extractField': 'Extract field',
  66984. 'text_label_extractedValue': 'Extracted value',
  66985. 'text_label_distanceAttenuation': 'Distance attenuation',
  66986. 'text_label_gridSize': 'gridSize',
  66987. 'text_label_bufferRadius': 'Buffer radius',
  66988. 'text_label_defaultkilometers': 'Default 10 kilometers',
  66989. 'text_label_kilometer': 'kilometer',
  66990. 'text_label_unit': 'unit',
  66991. 'text_retainOriginal': 'Retain original object field',
  66992. 'text_mergeBuffer': 'Merge buffer',
  66993. 'text_label_color': 'Color',
  66994. 'text_label_buffer': '[Buffer]',
  66995. 'text_label_isolines': '[Isolines]',
  66996. 'text_label_queryRangeTips': 'The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850',
  66997. 'text_label_queryModel': 'Query mode',
  66998. 'text_label_IDArrayOfFeatures': 'ID array of features',
  66999. 'text_label_maxFeatures': 'The maximum number of features that can be returned',
  67000. 'text_label_bufferDistance': 'Buffer distance',
  67001. 'text_label_queryRange1': 'Query range',
  67002. 'text_label_spatialQueryMode': 'Spatial query mode',
  67003. 'text_label_featureFilter': 'Feature filter',
  67004. 'text_label_geometricObject': 'Geometric object',
  67005. 'text_label_queryMode': 'Query mode',
  67006. 'text_label_searchTips': 'Search for city locations or layer features',
  67007. 'text_label_chooseSearchLayers': 'Select a query layer',
  67008. 'text_loadSearchCriteria': 'Load search criteria',
  67009. 'text_saveSearchCriteria': 'Save search criteria',
  67010. "btn_analyze": "Analyze",
  67011. "btn_analyzing": "Analyzing",
  67012. "btn_emptyTheAnalysisLayer": "Empty the analysis layer",
  67013. "btn_cancelAnalysis": "Cancel",
  67014. "btn_query": "Query",
  67015. "btn_querying": "Querying",
  67016. "btn_emptyTheRresultLayer": "Clear all result layers",
  67017. 'msg_dataReturnedIsEmpty.': 'The request is successful and the data returned by the query is empty.',
  67018. 'msg_dataFlowServiceHasBeenSubscribed': 'The data stream service has been subscribed to.',
  67019. 'msg_inputDataFlowUrlFirst': 'Please enter the data stream service address first.',
  67020. 'msg_datasetOrMethodUnsupport': 'This dataset does not support this analysis type. Please reselect the dataset.',
  67021. 'msg_selectDataset': 'Please select a data set!',
  67022. 'msg_setTheWeightField': 'Please set the weight field!',
  67023. 'msg_theFieldNotSupportAnalysis': 'The field you currently select does not support analysis!',
  67024. 'msg_resultIsEmpty': 'The result of the analysis is empty!',
  67025. 'msg_openFileFail': 'Failed to open file!',
  67026. 'msg_fileTypeUnsupported': 'File format is not supported!',
  67027. 'msg_fileSizeExceeded': 'File size exceeded! The file size should not exceed 10M!',
  67028. 'msg_dataInWrongGeoJSONFormat': 'Wrong data format! Non standard GEOJSON format data!',
  67029. 'msg_dataInWrongFormat': 'Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!',
  67030. 'msg_searchKeywords': "Search keywords cannot be empty. Please enter your search criteria.",
  67031. 'msg_searchGeocodeField': "Did not match the address matching service data!",
  67032. 'msg_cityGeocodeField': "The address matching service of the current city is not configured.",
  67033. 'msg_getFeatureField': "No related vector features found!",
  67034. 'msg_dataflowservicesubscribed': 'The data stream service has been subscribed to.',
  67035. 'msg_subscribesucceeded': 'The data stream service subscription was successful.',
  67036. 'msg_crsunsupport': 'Does not support the coordinate system of the current map',
  67037. 'msg_tilematrixsetunsupport': 'Incoming TileMatrixSet is not supported',
  67038. 'msg_jsonResolveFiled': 'JSON format parsing failure!',
  67039. 'msg_requestContentFiled': 'Failed to request data through iportal!',
  67040. 'msg_getdatafailed': 'Failed to get data!'
  67041. };
  67042. SuperMap.Lang["en-US"] = en;
  67043. ;// CONCATENATED MODULE: ./src/common/lang/locales/zh-CN.js
  67044. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67045. * This program are made available under the terms of the Apache License, Version 2.0
  67046. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67047. /**
  67048. * Namespace: SuperMap.Lang["zh-CN"]
  67049. * Dictionary for Simplified Chinese. Keys for entries are used in calls to
  67050. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  67051. * strings formatted for use with <SuperMap.String.format> calls.
  67052. */
  67053. var zh = {
  67054. 'title_dataFlowService': '数据流服务',
  67055. 'title_distributedAnalysis': '分布式分析',
  67056. 'title_clientComputing': '客户端计算',
  67057. 'title_dataServiceQuery': '数据服务查询',
  67058. 'title_searchCity': '搜索城市',
  67059. 'title_searchLayer': '搜索图层',
  67060. 'text_input_value_inputDataFlowUrl': '请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  67061. 'text_displayFeaturesInfo': '显示要素信息',
  67062. 'text_subscribe': '订阅',
  67063. 'text_cancelSubscribe': '取消订阅',
  67064. 'text_densityAnalysis': '密度分析',
  67065. 'text_CalculateTheValuePerUnitArea': '计算点指定邻域形状内的每单位面积量值',
  67066. 'text_option_selectDataset': '请选择数据集',
  67067. 'text_label_dataset': '数据集',
  67068. 'text_option_simplePointDensityAnalysis': '简单点密度分析',
  67069. 'text_option_nuclearDensityAnalysis': '核密度分析',
  67070. 'text_label_analyticalMethod': '分析方法',
  67071. 'text_option_quadrilateral': '四边形',
  67072. 'text_option_hexagon': '六边形',
  67073. 'text_label_meshType': '网格面类型',
  67074. 'text_option_notSet': '未设置',
  67075. 'text_label_weightField': '权重字段',
  67076. 'text_label_gridSizeInMeters': '网格大小',
  67077. 'text_label_searchRadius': '搜索半径',
  67078. 'text_label_queryRange': '分析范围',
  67079. 'text_label_areaUnit': '面积单位',
  67080. 'text_option_equidistantSegmentation': '等距离分段',
  67081. 'text_option_logarithm': '对数',
  67082. 'text_option_equalCountingSegment': '等计数分段',
  67083. 'text_option_squareRootSegmentation': '平方根分段',
  67084. 'text_label_thematicMapSegmentationMode': '专题图分段模式',
  67085. 'text_label_thematicMapSegmentationParameters': '专题图分段参数',
  67086. 'text_option_greenOrangePurpleGradient': '绿橙紫渐变',
  67087. 'text_option_greenOrangeRedGradient': '绿橙红渐变',
  67088. 'text_option_rainbowGradient': '彩虹渐变',
  67089. 'text_option_spectralGradient': '光谱渐变',
  67090. 'text_option_terrainGradient': '地形渐变',
  67091. 'text_label_thematicMapColorGradientMode': '专题图颜色渐变模式',
  67092. 'text_label_resultLayerName': '结果图层名称',
  67093. 'text_chooseFile': '选择文件',
  67094. 'text_isoline': '等值线',
  67095. 'text_extractDiscreteValue': '提取离散值生成曲线',
  67096. 'text_buffer': '缓冲区',
  67097. 'text_specifyTheDistance': '指定距离创建周边区域',
  67098. 'text_label_analysisLayer': '分析图层',
  67099. 'text_label_extractField': '提取字段',
  67100. 'text_label_extractedValue': '提取值',
  67101. 'text_label_distanceAttenuation': '距离衰减',
  67102. 'text_label_gridSize': '栅格大小',
  67103. 'text_label_bufferRadius': '缓冲半径',
  67104. 'text_label_defaultkilometers': '默认10千米',
  67105. 'text_option_kilometer': '千米',
  67106. 'text_label_unit': '单位',
  67107. 'text_retainOriginal': '保留原对象字段属性',
  67108. 'text_mergeBuffer': '合并缓冲区',
  67109. 'text_label_color': '颜色',
  67110. 'text_label_buffer': '[缓冲区]',
  67111. 'text_label_isolines': '[等值线]',
  67112. 'text_label_queryRangeTips': '默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850',
  67113. 'text_label_IDArrayOfFeatures': '要素 ID 数组',
  67114. 'text_label_maxFeatures': '最多可返回的要素数量',
  67115. 'text_label_bufferDistance': '缓冲区距离',
  67116. 'text_label_queryRange1': '查询范围',
  67117. 'text_label_spatialQueryMode': '空间查询模式',
  67118. 'text_label_featureFilter': '要素过滤器',
  67119. 'text_label_geometricObject': '几何对象',
  67120. 'text_label_queryMode': '查询模式',
  67121. 'text_label_searchTips': '搜索城市地点或图层要素',
  67122. 'text_label_chooseSearchLayers': '选择查询图层',
  67123. 'text_loadSearchCriteria': '加载搜索条件',
  67124. 'text_saveSearchCriteria': '保存搜索条件',
  67125. "btn_analyze": "分析",
  67126. "btn_analyzing": "分析中",
  67127. "btn_emptyTheAnalysisLayer": "清空分析图层",
  67128. "btn_cancelAnalysis": "取消",
  67129. "btn_query": "查询",
  67130. "btn_querying": "查询中",
  67131. "btn_emptyTheRresultLayer": "清除所有结果图层",
  67132. 'msg_dataFlowServiceHasBeenSubscribed': '已订阅该数据流服务。',
  67133. 'msg_inputDataFlowUrlFirst': '请先输入数据流服务地址。',
  67134. 'msg_datasetOrMethodUnsupport': '该数据集不支持本分析类型,请重新选择数据集',
  67135. 'msg_selectDataset': '请选择数据集!',
  67136. 'msg_setTheWeightField': '请设置权重字段!',
  67137. 'msg_theFieldNotSupportAnalysis': '您当前选择的字段不支持分析!',
  67138. 'msg_resultIsEmpty': '分析的结果为空!',
  67139. 'msg_dataReturnedIsEmpty': '请求成功,查询返回的数据为空。',
  67140. 'msg_openFileFail': '打开文件失败!',
  67141. 'msg_fileTypeUnsupported': '不支持该文件格式!',
  67142. 'msg_fileSizeExceeded': '文件大小超限!文件大小不得超过 10M!',
  67143. 'msg_dataInWrongGeoJSONFormat': '数据格式错误!非标准的 GEOJSON 格式数据!',
  67144. 'msg_dataInWrongFormat': '数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!',
  67145. 'msg_searchKeywords': "搜索关键字不能为空,请输入搜索条件。",
  67146. 'msg_searchGeocodeField': "未匹配到地址匹配服务数据!",
  67147. 'msg_cityGeocodeField': "未配置当前城市的地址匹配服务。",
  67148. 'msg_getFeatureField': "未查找到相关矢量要素!",
  67149. 'msg_dataflowservicesubscribed': '已订阅该数据流服务。',
  67150. 'msg_subscribesucceeded': '数据流服务订阅成功。',
  67151. 'msg_crsunsupport': '不支持当前地图的坐标系',
  67152. 'msg_tilematrixsetunsupport': '不支持传入的TileMatrixSet',
  67153. 'msg_jsonResolveFiled': 'json格式解析失败!',
  67154. 'msg_requestContentFiled': '通过iportal请求数据失败!',
  67155. 'msg_getdatafailed': '获取数据失败!'
  67156. };
  67157. SuperMap.Lang["zh-CN"] = zh;
  67158. ;// CONCATENATED MODULE: ./src/common/lang/index.js
  67159. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67160. * This program are made available under the terms of the Apache License, Version 2.0
  67161. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67162. ;// CONCATENATED MODULE: ./src/common/index.js
  67163. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67164. * This program are made available under the terms of the Apache License, Version 2.0
  67165. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67166. ;// CONCATENATED MODULE: ./src/openlayers/services/MapService.js
  67167. function services_MapService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_MapService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_MapService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_MapService_typeof(obj); }
  67168. function services_MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67169. function services_MapService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  67170. function services_MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_MapService_defineProperties(Constructor, staticProps); return Constructor; }
  67171. function services_MapService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) services_MapService_setPrototypeOf(subClass, superClass); }
  67172. function services_MapService_setPrototypeOf(o, p) { services_MapService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_MapService_setPrototypeOf(o, p); }
  67173. function services_MapService_createSuper(Derived) { var hasNativeReflectConstruct = services_MapService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_MapService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_MapService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_MapService_possibleConstructorReturn(this, result); }; }
  67174. function services_MapService_possibleConstructorReturn(self, call) { if (call && (services_MapService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_MapService_assertThisInitialized(self); }
  67175. function services_MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  67176. function services_MapService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  67177. function services_MapService_getPrototypeOf(o) { services_MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_MapService_getPrototypeOf(o); }
  67178. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67179. * This program are made available under the terms of the Apache License, Version 2.0
  67180. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67181. /**
  67182. * @class ol.supermap.MapService
  67183. * @category iServer Map
  67184. * @classdesc 地图信息服务类。
  67185. * @extends {ol.supermap.ServiceBase}
  67186. * @param {string} url - 地图服务地址。
  67187. * @param {Object} options - 参数。
  67188. * @param {string} [options.proxy] - 服务代理地址。
  67189. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  67190. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  67191. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  67192. * @param {Object} [options.headers] - 请求头。
  67193. * @example
  67194. * new ol.supermap.MapService(url)
  67195. * .getMapInfo(function(result){
  67196. * //doSomething
  67197. * })
  67198. */
  67199. var MapService = /*#__PURE__*/function (_ServiceBase) {
  67200. services_MapService_inherits(MapService, _ServiceBase);
  67201. var _super = services_MapService_createSuper(MapService);
  67202. function MapService(url, options) {
  67203. services_MapService_classCallCheck(this, MapService);
  67204. return _super.call(this, url, options);
  67205. }
  67206. /**
  67207. * @function ol.supermap.MapService.prototype.getMapInfo
  67208. * @description 地图信息查询服务。
  67209. * @param {RequestCallback} callback - 回调函数。
  67210. * @returns {ol.supermap.MapService} 获取服务信息。
  67211. */
  67212. services_MapService_createClass(MapService, [{
  67213. key: "getMapInfo",
  67214. value: function getMapInfo(callback) {
  67215. var me = this;
  67216. var getMapStatusService = new MapService_MapService(me.url, {
  67217. proxy: me.options.proxy,
  67218. withCredentials: me.options.withCredentials,
  67219. crossOrigin: me.options.crossOrigin,
  67220. headers: me.options.headers,
  67221. serverType: me.options.serverType,
  67222. eventListeners: {
  67223. scope: me,
  67224. processCompleted: callback,
  67225. processFailed: callback
  67226. },
  67227. projection: me.options.projection
  67228. });
  67229. getMapStatusService.processAsync();
  67230. }
  67231. /**
  67232. * @function ol.supermap.MapService.prototype.getTilesets
  67233. * @description 切片列表信息查询服务。
  67234. * @param {RequestCallback} callback - 回调函数。
  67235. * @returns {ol.supermap.MapService} 获取服务信息。
  67236. */
  67237. }, {
  67238. key: "getTilesets",
  67239. value: function getTilesets(callback) {
  67240. var me = this;
  67241. var tilesetsService = new TilesetsService(me.url, {
  67242. proxy: me.options.proxy,
  67243. withCredentials: me.options.withCredentials,
  67244. crossOrigin: me.options.crossOrigin,
  67245. headers: me.options.headers,
  67246. serverType: me.options.serverType,
  67247. eventListeners: {
  67248. scope: me,
  67249. processCompleted: callback,
  67250. processFailed: callback
  67251. }
  67252. });
  67253. tilesetsService.processAsync();
  67254. }
  67255. }]);
  67256. return MapService;
  67257. }(ServiceBase);
  67258. ;// CONCATENATED MODULE: external "ol.control.Control"
  67259. var external_ol_control_Control_namespaceObject = ol.control.Control;
  67260. var external_ol_control_Control_default = /*#__PURE__*/__webpack_require__.n(external_ol_control_Control_namespaceObject);
  67261. ;// CONCATENATED MODULE: ./src/openlayers/control/ChangeTileVersion.js
  67262. function ChangeTileVersion_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ChangeTileVersion_typeof = function _typeof(obj) { return typeof obj; }; } else { ChangeTileVersion_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ChangeTileVersion_typeof(obj); }
  67263. function ChangeTileVersion_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67264. function ChangeTileVersion_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  67265. function ChangeTileVersion_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChangeTileVersion_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChangeTileVersion_defineProperties(Constructor, staticProps); return Constructor; }
  67266. function ChangeTileVersion_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ChangeTileVersion_setPrototypeOf(subClass, superClass); }
  67267. function ChangeTileVersion_setPrototypeOf(o, p) { ChangeTileVersion_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChangeTileVersion_setPrototypeOf(o, p); }
  67268. function ChangeTileVersion_createSuper(Derived) { var hasNativeReflectConstruct = ChangeTileVersion_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ChangeTileVersion_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ChangeTileVersion_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ChangeTileVersion_possibleConstructorReturn(this, result); }; }
  67269. function ChangeTileVersion_possibleConstructorReturn(self, call) { if (call && (ChangeTileVersion_typeof(call) === "object" || typeof call === "function")) { return call; } return ChangeTileVersion_assertThisInitialized(self); }
  67270. function ChangeTileVersion_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  67271. function ChangeTileVersion_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  67272. function ChangeTileVersion_getPrototypeOf(o) { ChangeTileVersion_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChangeTileVersion_getPrototypeOf(o); }
  67273. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67274. * This program are made available under the terms of the Apache License, Version 2.0
  67275. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67276. /**
  67277. * @class ol.supermap.control.ChangeTileVersion
  67278. * @category Control
  67279. * @classdesc 版本切换控件(目前仅支持 IE10 及以上)暂时不支持自定义位置。
  67280. * @extends {ol/control/Control}
  67281. * @param {options} options -参数。
  67282. * @param {string} [options.title='switch tile version'] - 提示信息。
  67283. * @param {string} [options.tooltip='top'] - 提示显示位置 top | right | bottom | left。
  67284. * @param {boolean} [options.collapsed=true] - 是否折叠。
  67285. * @param {string} [options.lastText='-'] - 上一个版本的按钮布局。
  67286. * @param {string} [options.nextText='+'] - 下一个版本的按钮布局。
  67287. * @param {string} [options.ico='V'] - 控件显示的logo。
  67288. * @param {string} [options.orientation='horizontal'] - 方向 horizontal|vertical。
  67289. * @param {boolean} [options.switch=true] - 是否显示上/下一个版本切换控件。
  67290. * @example
  67291. * var control = new ol.supermap.control.ChangeTileVersion({
  67292. * layer: baseLayer,
  67293. * orientation: "horizontal"
  67294. * });
  67295. * map.addControl(control)
  67296. */
  67297. var ChangeTileVersion = /*#__PURE__*/function (_Control) {
  67298. ChangeTileVersion_inherits(ChangeTileVersion, _Control);
  67299. var _super = ChangeTileVersion_createSuper(ChangeTileVersion);
  67300. function ChangeTileVersion(options) {
  67301. var _this;
  67302. ChangeTileVersion_classCallCheck(this, ChangeTileVersion);
  67303. options = options || {}; //鼠标滑过时提示
  67304. if (!options.title) {
  67305. options.title = 'switch tile version';
  67306. } //tooltip提示显示位置 top | right | bottom | left
  67307. if (!options.tooltip) {
  67308. options.tooltip = 'top';
  67309. } //是否折叠
  67310. if (!options.collapsed) {
  67311. options.collapsed = true;
  67312. } //上一个版本的按钮布局
  67313. if (!options.lastText) {
  67314. options.lastText = '-';
  67315. } //下一个版本的按钮布局
  67316. if (!options.nextText) {
  67317. options.nextText = '+';
  67318. } //控件显示的logo
  67319. if (!options.ico) {
  67320. options.ico = 'V';
  67321. } //方向horizontal|vertical
  67322. if (options.orientation !== 'vertical') {
  67323. options.orientation = 'horizontal';
  67324. } //是否显示上/下一个版本切换控件
  67325. if (!options["switch"]) {
  67326. options["switch"] = true;
  67327. }
  67328. _this = _super.call(this, options);
  67329. _this.options = options;
  67330. _this.element = options.element = initLayout.call(ChangeTileVersion_assertThisInitialized(_this));
  67331. if (options.layer) {
  67332. _this.setLayer(options.layer);
  67333. }
  67334. /**
  67335. * @function ol.supermap.control.ChangeTileVersion.prototype.initLayout
  67336. * @description 初始化。
  67337. */
  67338. function initLayout() {
  67339. var className = 'ol-control-ctv';
  67340. this._container = createElement('div', className + ' ' + className + '-' + options.orientation + ' ol-unselectable ol-control'); //正常情况下显示btn
  67341. this._sliderBtn = createElement('button', className + '-toggle', this._container);
  67342. this._sliderBtn.setAttribute('title', options.title);
  67343. this._sliderBtn.innerHTML = options.ico; //滑块拖动时值显示区域
  67344. this._sliderValue = createElement('p', className + '-value', this._container);
  67345. this._sliderValue.innerHTML = options.ico;
  67346. this._sliderValue.setAttribute('title', options.title);
  67347. var sliderClassName = 'ol-ctv-slider';
  67348. this._sliderContent = createElement('div', sliderClassName + '-main' + ' tooltip', this._container); //tooltip提示框
  67349. if (options.orientation === 'vertical' && options.tooltip === 'top') {
  67350. options.tooltip = 'right';
  67351. }
  67352. this.tooltip = createElement('span', 'tooltip-text' + ' ' + 'tooltip-' + options.tooltip, this._sliderContent);
  67353. this.tooltip.innerHTML = options.ico; //加控件
  67354. if (options["switch"]) {
  67355. this._next = createElement('a', sliderClassName + '-incdec' + ' ' + sliderClassName + '-next', this._sliderContent);
  67356. this._next.innerHTML = options.nextText;
  67357. addDomEvent(this._next, 'click', this.nextTilesVersion, this);
  67358. this._container.classList.add(className + '-incdec');
  67359. } //滑块
  67360. this._sliderContainer = createElement('div', sliderClassName + '-container', this._sliderContent);
  67361. this.slider = createElement('input', sliderClassName, this._sliderContainer);
  67362. this.min = this.min == null || isNaN(this.min) ? 0 : parseInt(this.min);
  67363. this.slider.setAttribute('title', options.title);
  67364. this.slider.setAttribute('id', 'slider');
  67365. this.slider.setAttribute('type', 'range');
  67366. this.slider.setAttribute('min', this.min);
  67367. this.slider.setAttribute('max', 0);
  67368. this.slider.setAttribute('step', 1);
  67369. this.slider.setAttribute('value', 0); // //判断浏览器是否支持Range滑动条
  67370. // if (this.slider.type == "text") {
  67371. // console.error("抱歉,您的浏览器不支持HTML5 range滑动条,请使用高版本浏览器");
  67372. // }
  67373. this.firstLoad = true;
  67374. if ('oninput' in this.slider || 'onchange' in this.slider) {
  67375. addDomEvent(this.slider, 'change', tilesVersion, this);
  67376. } else {
  67377. this.slider.onpropertychange = tilesVersion;
  67378. } //减控件
  67379. if (options["switch"]) {
  67380. this._last = createElement('a', sliderClassName + '-incdec' + ' ' + sliderClassName + '-last', this._sliderContent);
  67381. this._last.innerHTML = options.lastText;
  67382. addDomEvent(this._last, 'click', this.lastTilesVersion, this);
  67383. } // if (window.matchMedia("screen and (-webkit-min-device-pixel-ratio:0)").matches && options.orientation == 'vertical') {
  67384. if (options.orientation == 'vertical') {
  67385. this.slider.style.width = 170 + 'px';
  67386. this._sliderContainer.style.height = 170 + 'px';
  67387. } else {
  67388. this._sliderContainer.style.width = 150 + 'px';
  67389. }
  67390. /**
  67391. * @function ol.supermap.control.ChangeTileVersion.prototype.addDomEvent
  67392. * @description 为元素添加事件。
  67393. */
  67394. addDomEvent(this._container, 'click', function (e) {
  67395. e.preventDefault();
  67396. e.stopPropagation();
  67397. }, this);
  67398. if (options.collapsed) {
  67399. addDomEvent(this._container, 'mouseenter', expand, this);
  67400. addDomEvent(this._container, 'mouseleave', collapse, this);
  67401. addDomEvent(this._sliderBtn, 'click', function (e) {
  67402. e.preventDefault();
  67403. e.stopPropagation();
  67404. });
  67405. addDomEvent(this._sliderBtn, 'click', expand, this);
  67406. addDomEvent(this._sliderBtn, 'focus', expand, this);
  67407. } else {
  67408. expand();
  67409. }
  67410. return this._container;
  67411. }
  67412. /**
  67413. * @function ol.supermap.control.ChangeTileVersion.prototype.createElement
  67414. * @description 新建元素。
  67415. * @param {string} tagName - 标签名。
  67416. * @param {string} className - 类名。
  67417. * @param {Object} container - 容器。
  67418. * @returns {object|Element} 元素
  67419. */
  67420. function createElement(tagName, className, container) {
  67421. var el = document.createElement(tagName);
  67422. el.className = className || '';
  67423. if (container) {
  67424. container.appendChild(el);
  67425. }
  67426. return el;
  67427. }
  67428. /**
  67429. * @function ol.supermap.control.ChangeTileVersion.prototype.addDomEvent
  67430. * @description 为元素添加事件。
  67431. * @param {Object} obj - 事件对象集。
  67432. * @param {string} type - 事件类型。
  67433. * @param {Object} fn -容器。
  67434. * @param {Object} context -当前环境。
  67435. * @returns {addDomEvent} 添加的事件
  67436. */
  67437. function addDomEvent(obj, type, fn, context) {
  67438. var handler = function handler(e) {
  67439. if (fn) {
  67440. return fn.call(context || obj, e || window.event);
  67441. }
  67442. };
  67443. var originalHandler = handler;
  67444. if ('addEventListener' in obj) {
  67445. if (type === 'mousewheel') {
  67446. obj.addEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);
  67447. } else if (type === 'mouseenter' || type === 'mouseleave') {
  67448. handler = function handler(e) {
  67449. e = e || window.event;
  67450. if (isExternalTarget(obj, e)) {
  67451. originalHandler(e);
  67452. }
  67453. };
  67454. obj.addEventListener(type === 'mouseenter' ? 'mouseover' : 'mouseout', handler, false);
  67455. } else {
  67456. obj.addEventListener(type, handler, false);
  67457. }
  67458. } else if ('attachEvent' in obj) {
  67459. obj.attachEvent('on' + type, handler);
  67460. }
  67461. return this;
  67462. }
  67463. function isExternalTarget(el, e) {
  67464. var related = e.relatedTarget;
  67465. if (!related) {
  67466. return true;
  67467. }
  67468. try {
  67469. while (related && related !== el) {
  67470. related = related.parentNode;
  67471. }
  67472. } catch (err) {
  67473. return false;
  67474. }
  67475. return related !== el;
  67476. }
  67477. function expand() {
  67478. this._container.classList.add('ol-control-ctv-expanded');
  67479. }
  67480. function collapse() {
  67481. this._container.classList.remove('ol-control-ctv-expanded');
  67482. }
  67483. function tilesVersion() {
  67484. var version = this.getVersion();
  67485. this.tilesVersion(version);
  67486. }
  67487. return _this;
  67488. }
  67489. /**
  67490. * @function ol.supermap.control.ChangeTileVersion.prototype.setContent
  67491. * @description 设置版本相关信息。
  67492. * @param {Object} version - 版本信息。
  67493. */
  67494. ChangeTileVersion_createClass(ChangeTileVersion, [{
  67495. key: "setContent",
  67496. value: function setContent(version) {
  67497. var content = version || {};
  67498. this.setVersionName(content.desc).setToolTip(content.desc);
  67499. }
  67500. /**
  67501. * @function ol.supermap.control.ChangeTileVersion.prototype.setVersionName
  67502. * @description 设置版本号
  67503. * @param {string} content -版本内容。
  67504. */
  67505. }, {
  67506. key: "setVersionName",
  67507. value: function setVersionName(content) {
  67508. var value = content;
  67509. if (!content) {
  67510. value = this.getValue();
  67511. }
  67512. this._sliderValue.innerHTML = value;
  67513. return this;
  67514. }
  67515. /**
  67516. * @function ol.supermap.control.ChangeTileVersion.prototype.setToolTip
  67517. * @description 设置提示信息。
  67518. * @param {string} tooltip - 工具提示。
  67519. * @returns {this} this
  67520. */
  67521. }, {
  67522. key: "setToolTip",
  67523. value: function setToolTip(tooltip) {
  67524. this.tooltip.innerHTML = tooltip;
  67525. return this;
  67526. }
  67527. /**
  67528. * @function ol.supermap.control.ChangeTileVersion.prototype.updateLength
  67529. * @description 更新进度条长度。
  67530. * @param {number} length - 进度条长度。
  67531. */
  67532. }, {
  67533. key: "updateLength",
  67534. value: function updateLength(length) {
  67535. if (length > 0) {
  67536. this.length = length;
  67537. this.max = this.length - 1;
  67538. this.slider.setAttribute('max', this.max);
  67539. }
  67540. }
  67541. /**
  67542. * @function ol.supermap.control.ChangeTileVersion.prototype.setLayer
  67543. * @description 绑定图层。
  67544. * @param {Object} layer - 图层。
  67545. */
  67546. }, {
  67547. key: "setLayer",
  67548. value: function setLayer(layer) {
  67549. if (layer) {
  67550. this.options.layer = layer;
  67551. }
  67552. var me = this;
  67553. var tileLayer = me.options.layer;
  67554. tileLayer.on('tilesetsinfoloaded', function (evt) {
  67555. var tileVersions = evt.value && evt.value.tileVersions;
  67556. me.update(tileVersions);
  67557. });
  67558. tileLayer.on('tileversionschanged', function (evt) {
  67559. var tileVersions = evt.value && evt.value.tileVersion;
  67560. me.setContent(tileVersions);
  67561. });
  67562. me.getTileSetsInfo();
  67563. }
  67564. /**
  67565. * @function ol.supermap.control.ChangeTileVersion.prototype.update
  67566. * @description 更新缓存切片集及进度条长度。
  67567. * @param {Object} tileVersions - 待更新的切片版本。
  67568. */
  67569. }, {
  67570. key: "update",
  67571. value: function update(tileVersions) {
  67572. this.tileVersions = tileVersions;
  67573. this.updateLength(this.tileVersions.length);
  67574. }
  67575. /**
  67576. * @function ol.supermap.control.ChangeTileVersion.prototype.getTileSetsInfo
  67577. * @description 请求获取切片集信息。
  67578. */
  67579. }, {
  67580. key: "getTileSetsInfo",
  67581. value: function getTileSetsInfo() {
  67582. var me = this;
  67583. if (me.options.layer) {
  67584. new MapService(me.options.layer._url).getTilesets(function getTilesInfoSucceed(info) {
  67585. me.options.layer.setTileSetsInfo(info.result);
  67586. });
  67587. }
  67588. }
  67589. /**
  67590. * @function ol.supermap.control.ChangeTileVersion.prototype.removeLayer
  67591. * @description 移除绑定的地图图层。
  67592. */
  67593. }, {
  67594. key: "removeLayer",
  67595. value: function removeLayer() {
  67596. this.options.layer = null;
  67597. }
  67598. /**
  67599. * @function ol.supermap.control.ChangeTileVersion.prototype.nextTilesVersion
  67600. * @description 下一个版本,第一次不进行加减,是无版本的状态。
  67601. * @returns {this} this
  67602. */
  67603. }, {
  67604. key: "nextTilesVersion",
  67605. value: function nextTilesVersion() {
  67606. if (this.firstLoad) {
  67607. this.options.layer.nextTilesVersion();
  67608. this.firstLoad = !!0;
  67609. return this;
  67610. }
  67611. if (parseInt(this.slider.value) > this.max - 1) {
  67612. return this;
  67613. }
  67614. this.slider.value = parseInt(this.slider.value) + 1;
  67615. this.options.layer.nextTilesVersion();
  67616. return this;
  67617. }
  67618. /**
  67619. * @function ol.supermap.control.ChangeTileVersion.prototype.lastTilesVersion
  67620. * @description 获取上一个版本信息。
  67621. * @returns {this} this
  67622. */
  67623. }, {
  67624. key: "lastTilesVersion",
  67625. value: function lastTilesVersion() {
  67626. if (parseInt(this.slider.value) < this.min + 1) {
  67627. return this;
  67628. }
  67629. this.slider.value = parseInt(this.slider.value) - 1;
  67630. this.options.layer.lastTilesVersion();
  67631. return this;
  67632. }
  67633. /**
  67634. * @function ol.supermap.control.ChangeTileVersion.prototype.tilesVersion
  67635. * @description 根据指定版本号请求版本。
  67636. * @param {Object} version - 版本信息。
  67637. */
  67638. }, {
  67639. key: "tilesVersion",
  67640. value: function tilesVersion(version) {
  67641. var layer = this.options.layer,
  67642. tileVersions = this.tileVersions;
  67643. var len = tileVersions.length;
  67644. for (var i = 0; i < len; i++) {
  67645. if (tileVersions[i].name == version) {
  67646. layer.updateCurrentTileSetsIndex(i);
  67647. layer.changeTilesVersion();
  67648. break;
  67649. }
  67650. }
  67651. }
  67652. /**
  67653. * @function ol.supermap.control.ChangeTileVersion.prototype.getValue
  67654. * @description 获取进度条的值。注:(进度条的值并不是版本号)。
  67655. */
  67656. }, {
  67657. key: "getValue",
  67658. value: function getValue() {
  67659. return this.slider.value;
  67660. }
  67661. /**
  67662. * @function ol.supermap.control.ChangeTileVersion.prototype.getVersion
  67663. * @description 获取当前进度条值对应的版本号。
  67664. */
  67665. }, {
  67666. key: "getVersion",
  67667. value: function getVersion() {
  67668. var version = this.tileVersions[this.getValue()];
  67669. return version && version.name;
  67670. }
  67671. }]);
  67672. return ChangeTileVersion;
  67673. }((external_ol_control_Control_default()));
  67674. ;// CONCATENATED MODULE: external "ol.control.ScaleLine"
  67675. var external_ol_control_ScaleLine_namespaceObject = ol.control.ScaleLine;
  67676. var external_ol_control_ScaleLine_default = /*#__PURE__*/__webpack_require__.n(external_ol_control_ScaleLine_namespaceObject);
  67677. ;// CONCATENATED MODULE: external "ol.proj"
  67678. var external_ol_proj_namespaceObject = ol.proj;
  67679. ;// CONCATENATED MODULE: external "ol.AssertionError"
  67680. var external_ol_AssertionError_namespaceObject = ol.AssertionError;
  67681. var external_ol_AssertionError_default = /*#__PURE__*/__webpack_require__.n(external_ol_AssertionError_namespaceObject);
  67682. ;// CONCATENATED MODULE: ./src/openlayers/control/ScaleLine.js
  67683. function ScaleLine_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ScaleLine_typeof = function _typeof(obj) { return typeof obj; }; } else { ScaleLine_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ScaleLine_typeof(obj); }
  67684. function ScaleLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67685. function ScaleLine_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  67686. function ScaleLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) ScaleLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) ScaleLine_defineProperties(Constructor, staticProps); return Constructor; }
  67687. function ScaleLine_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ScaleLine_setPrototypeOf(subClass, superClass); }
  67688. function ScaleLine_setPrototypeOf(o, p) { ScaleLine_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ScaleLine_setPrototypeOf(o, p); }
  67689. function ScaleLine_createSuper(Derived) { var hasNativeReflectConstruct = ScaleLine_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ScaleLine_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ScaleLine_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ScaleLine_possibleConstructorReturn(this, result); }; }
  67690. function ScaleLine_possibleConstructorReturn(self, call) { if (call && (ScaleLine_typeof(call) === "object" || typeof call === "function")) { return call; } return ScaleLine_assertThisInitialized(self); }
  67691. function ScaleLine_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  67692. function ScaleLine_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  67693. function ScaleLine_getPrototypeOf(o) { ScaleLine_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ScaleLine_getPrototypeOf(o); }
  67694. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67695. * This program are made available under the terms of the Apache License, Version 2.0
  67696. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67697. /**
  67698. * @class ol.supermap.control.ScaleLine
  67699. * @category Control
  67700. * @version 9.1.2
  67701. * @classdesc 比例尺控件。
  67702. * <div style="padding: 20px;border: 1px solid #eee;border-left-width: 5px;border-radius: 3px;border-left-color: #ce4844;">
  67703. * <p style="color: #ce4844">Notice</p>
  67704. * <p style="font-size: 13px">该功能继承 {@link ol.control.ScaleLine },与 {@link ol.control.ScaleLine } 功能完全相同。仅为修复 `openlayers` v4.6.5 版本中 WGS84 等地理坐标系比例尺数值错误的问题。
  67705. * </div>
  67706. * @extends {ol/control/ScaleLine}
  67707. * @param {options} options -参数。
  67708. * @param {string} [options.className='ol-scale-line'] - CSS Class name.。
  67709. * @param {number} [options.minWidth=64] - 最小像素宽度。
  67710. * @param {(HTMLElement|string) } [options.target] - 指定比例尺控件目标容器。
  67711. * @param {(ol.control.ScaleLineUnits|string)} [options.units='metric'] - 上一个版本的按钮布局。
  67712. * @example
  67713. * var control = new ol.supermap.control.ScaleLine();
  67714. * map.addControl(control)
  67715. */
  67716. var ScaleLine = /*#__PURE__*/function (_Scale) {
  67717. ScaleLine_inherits(ScaleLine, _Scale);
  67718. var _super = ScaleLine_createSuper(ScaleLine);
  67719. function ScaleLine(options) {
  67720. ScaleLine_classCallCheck(this, ScaleLine);
  67721. options = options || {}; //需在super之前定义render,真正的调用是在初始化完成后
  67722. options.render = function (mapEvent) {
  67723. var frameState = mapEvent.frameState;
  67724. if (!frameState) {
  67725. this.viewState_ = null; //NOSONAR
  67726. } else {
  67727. this.viewState_ = frameState.viewState; //NOSONAR
  67728. }
  67729. this.updateElementRepair(); //NOSONAR
  67730. };
  67731. return _super.call(this, options); //NOSONAR
  67732. }
  67733. ScaleLine_createClass(ScaleLine, [{
  67734. key: "updateElementRepair",
  67735. value: function updateElementRepair() {
  67736. var viewState = this.viewState_ || this.o;
  67737. if (!viewState) {
  67738. this.renderedVisible_ = this.renderedVisible_ || this.j;
  67739. if (this.renderedVisible_) {
  67740. this.element_ = this.element_ || this.c;
  67741. this.element.style.display = 'none';
  67742. this.renderedVisible_ = false;
  67743. }
  67744. return;
  67745. }
  67746. var center = viewState.center;
  67747. var projection = viewState.projection;
  67748. var units = this.getUnits();
  67749. var pointResolutionUnits = units == "degrees" ? "degrees" : "m";
  67750. var pointResolution = external_ol_proj_namespaceObject.getPointResolution(projection, viewState.resolution, center, pointResolutionUnits);
  67751. this.minWidth_ = this.minWidth_ || this.v;
  67752. var nominalCount = this.minWidth_ * pointResolution;
  67753. var suffix = '';
  67754. if (units == "degrees") {
  67755. var metersPerDegree = external_ol_proj_namespaceObject.METERS_PER_UNIT.degrees;
  67756. nominalCount *= metersPerDegree;
  67757. if (nominalCount < metersPerDegree / 60) {
  67758. suffix = "\u2033"; // seconds
  67759. pointResolution *= 3600;
  67760. } else if (nominalCount < metersPerDegree) {
  67761. suffix = "\u2032"; // minutes
  67762. pointResolution *= 60;
  67763. } else {
  67764. suffix = "\xB0"; // degrees
  67765. }
  67766. } else if (units == "imperial") {
  67767. if (nominalCount < 0.9144) {
  67768. suffix = 'in';
  67769. pointResolution /= 0.0254;
  67770. } else if (nominalCount < 1609.344) {
  67771. suffix = 'ft';
  67772. pointResolution /= 0.3048;
  67773. } else {
  67774. suffix = 'mi';
  67775. pointResolution /= 1609.344;
  67776. }
  67777. } else if (units == "nautical") {
  67778. pointResolution /= 1852;
  67779. suffix = 'nm';
  67780. } else if (units == "metric") {
  67781. if (nominalCount < 0.001) {
  67782. suffix = 'μm';
  67783. pointResolution *= 1000000;
  67784. } else if (nominalCount < 1) {
  67785. suffix = 'mm';
  67786. pointResolution *= 1000;
  67787. } else if (nominalCount < 1000) {
  67788. suffix = 'm';
  67789. } else {
  67790. suffix = 'km';
  67791. pointResolution /= 1000;
  67792. }
  67793. } else if (units == "us") {
  67794. if (nominalCount < 0.9144) {
  67795. suffix = 'in';
  67796. pointResolution *= 39.37;
  67797. } else if (nominalCount < 1609.344) {
  67798. suffix = 'ft';
  67799. pointResolution /= 0.30480061;
  67800. } else {
  67801. suffix = 'mi';
  67802. pointResolution /= 1609.3472;
  67803. }
  67804. } else {
  67805. throw new (external_ol_AssertionError_default())(33); // Invalid units
  67806. }
  67807. var DIGITS = [1, 2, 5];
  67808. var i = 3 * Math.floor(Math.log(this.minWidth_ * pointResolution) / Math.log(10));
  67809. var count, width, decimalCount;
  67810. while (true) {
  67811. //eslint-disable-line no-constant-condition
  67812. decimalCount = Math.floor(i / 3);
  67813. var decimal = Math.pow(10, decimalCount);
  67814. count = DIGITS[(i % 3 + 3) % 3] * decimal;
  67815. width = Math.round(count / pointResolution);
  67816. if (isNaN(width)) {
  67817. this.element.style.display = 'none';
  67818. this.renderedVisible_ = false;
  67819. return;
  67820. } else if (width >= this.minWidth_) {
  67821. break;
  67822. }
  67823. ++i;
  67824. }
  67825. this.renderedHTML_ = this.renderedHTML_ || this.D;
  67826. this.innerElement_ = this.innerElement_ || this.l;
  67827. this.renderedWidth_ = this.renderedWidth_ || this.B;
  67828. this.renderedVisible_ = this.renderedVisible_ || this.j;
  67829. this.element_ = this.element_ || this.c;
  67830. var html = count.toFixed(decimalCount < 0 ? -decimalCount : 0) + ' ' + suffix;
  67831. if (this.renderedHTML_ != html) {
  67832. this.innerElement_.innerHTML = html;
  67833. this.renderedHTML_ = html;
  67834. }
  67835. if (this.renderedWidth_ != width) {
  67836. this.innerElement_.style.width = width + 'px';
  67837. this.renderedWidth_ = width;
  67838. }
  67839. if (!this.renderedVisible_) {
  67840. this.element.style.display = '';
  67841. this.renderedVisible_ = true;
  67842. }
  67843. }
  67844. }]);
  67845. return ScaleLine;
  67846. }((external_ol_control_ScaleLine_default()));
  67847. ;// CONCATENATED MODULE: ./src/common/control/img/Logo.js
  67848. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67849. * This program are made available under the terms of the Apache License, Version 2.0
  67850. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67851. 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=";
  67852. ;// CONCATENATED MODULE: ./src/openlayers/control/Logo.js
  67853. function Logo_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Logo_typeof = function _typeof(obj) { return typeof obj; }; } else { Logo_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Logo_typeof(obj); }
  67854. function Logo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67855. function Logo_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Logo_setPrototypeOf(subClass, superClass); }
  67856. function Logo_setPrototypeOf(o, p) { Logo_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Logo_setPrototypeOf(o, p); }
  67857. function Logo_createSuper(Derived) { var hasNativeReflectConstruct = Logo_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Logo_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Logo_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Logo_possibleConstructorReturn(this, result); }; }
  67858. function Logo_possibleConstructorReturn(self, call) { if (call && (Logo_typeof(call) === "object" || typeof call === "function")) { return call; } return Logo_assertThisInitialized(self); }
  67859. function Logo_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  67860. function Logo_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  67861. function Logo_getPrototypeOf(o) { Logo_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Logo_getPrototypeOf(o); }
  67862. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67863. * This program are made available under the terms of the Apache License, Version 2.0
  67864. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67865. /**
  67866. * @class ol.supermap.control.Logo
  67867. * @category Control
  67868. * @classdesc Logo控件。默认不显示,需手动添加控件。
  67869. * @extends {ol/control/Control}
  67870. * @example
  67871. * var control = new ol.supermap.control.Logo();
  67872. * map.addControl(control);
  67873. * @param {Object} options - logo 控件配置项。
  67874. * @param {string} [options.imageUrl] - logo 图片地址。
  67875. * @param {number} [options.width] - logo 图片宽。
  67876. * @param {number} [options.height] - logo 图片高。
  67877. * @param {string} [options.link='https://iclient.supermap.io'] - 跳转链接。
  67878. * @param {string} [options.alt='SuperMap iClient'] - logo 图片失效时显示文本。
  67879. */
  67880. var Logo = /*#__PURE__*/function (_Control) {
  67881. Logo_inherits(Logo, _Control);
  67882. var _super = Logo_createSuper(Logo);
  67883. function Logo(options) {
  67884. var _this;
  67885. Logo_classCallCheck(this, Logo);
  67886. options = options || {};
  67887. options.imageUrl = options.imageUrl || null;
  67888. options.width = options.width || null;
  67889. options.height = options.height || null;
  67890. options.link = options.link || "https://iclient.supermap.io";
  67891. options.alt = options.alt || "SuperMap iClient";
  67892. _this = _super.call(this, options);
  67893. _this.options = options;
  67894. _this.element = options.element = initLayerout.call(Logo_assertThisInitialized(_this));
  67895. /**
  67896. * @function ol.supermap.control.Logo.prototype.initLayerout
  67897. * @description 初始化图层信息。
  67898. */
  67899. function initLayerout() {
  67900. var className = 'ol-control-logo ol-unselectable ol-control';
  67901. var div = document.createElement("div");
  67902. div.className = className;
  67903. setDivStyle.call(this, div);
  67904. var imgSrc = LogoBase64;
  67905. if (this.options.imageUrl) {
  67906. imgSrc = this.options.imageUrl;
  67907. }
  67908. var alt = this.options.alt;
  67909. var link = this.options.link;
  67910. var imageWidth = "94px";
  67911. var imageHeight = "29px";
  67912. var styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  67913. if (this.options.imageUrl) {
  67914. imageWidth = this.options.width;
  67915. imageHeight = this.options.height;
  67916. styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  67917. if (!imageWidth || !imageHeight) {
  67918. styleSize = "";
  67919. }
  67920. }
  67921. div.innerHTML = "<a href='" + link + "' target='_blank' style='border: none;display: block;'>" + "<img src=" + imgSrc + " alt='" + alt + "' style='border: none;" + styleSize + "white-space: nowrap;margin-bottom: 2px'></a>";
  67922. return div;
  67923. }
  67924. /**
  67925. * @function ol.supermap.control.Logo.prototype.setDivStyle
  67926. * @description 设置对象 style。
  67927. * @param {HTMLElement} 待设置的 div。
  67928. */
  67929. function setDivStyle(div) {
  67930. var attributionsElem = document.getElementsByClassName('ol-attribution');
  67931. attributionsElem = attributionsElem && attributionsElem[0];
  67932. var attrHeight = attributionsElem && attributionsElem.clientHeight || 29;
  67933. div.style.bottom = parseInt(attrHeight) + 6 + "px";
  67934. div.style.right = "4px";
  67935. div.style.marginTop = 0;
  67936. div.style.marginLeft = 0;
  67937. div.style.marginBottom = 0;
  67938. div.style.marginRight = 0;
  67939. var logoStyle = document.createElement('style');
  67940. logoStyle.type = 'text/css';
  67941. logoStyle.innerHTML = '.ol-control-logo,.ol-control-logo:hover {' + 'background-color: rgba(255,255,255,0);' + '}';
  67942. document.getElementsByTagName('head')[0].appendChild(logoStyle);
  67943. }
  67944. return _this;
  67945. }
  67946. return Logo;
  67947. }((external_ol_control_Control_default()));
  67948. ;// CONCATENATED MODULE: ./src/openlayers/control/index.js
  67949. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67950. * This program are made available under the terms of the Apache License, Version 2.0
  67951. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67952. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/StyleMap.js
  67953. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67954. * This program are made available under the terms of the Apache License, Version 2.0
  67955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67956. /**
  67957. * @constant ol.supermap.pointMap
  67958. * @description 点图。
  67959. * @private
  67960. */
  67961. var pointMap = {
  67962. "point-file": "pointFile",
  67963. "point-fill": "fillStyle",
  67964. "point-radius": "pointRadius",
  67965. "point-halo-radius": "pointHaloRadius",
  67966. "point-halo-color": "pointHaloColor",
  67967. "point-dx": "offsetX",
  67968. "point-dy": "offsetY",
  67969. "point-opacity": "globalAlpha",
  67970. "point-comp-op": "globalCompositeOperation"
  67971. };
  67972. /**
  67973. * @constant ol.supermap.lineMap
  67974. * @description 线图。
  67975. * @private
  67976. */
  67977. var lineMap = {
  67978. "line-color": "strokeStyle",
  67979. "line-width": "lineWidth",
  67980. "line-cap": "lineCap",
  67981. "line-join": "lineJoin",
  67982. "line-miterlimit": "miterLimit",
  67983. "line-dash-offset": "lineDashOffset",
  67984. /*expand*/
  67985. "line-opacity": "strokeOpacity",
  67986. "line-dasharray": "lineDasharray",
  67987. "line-offset": "offset",
  67988. "line-comp-op": "globalCompositeOperation"
  67989. };
  67990. /**
  67991. * @constant ol.supermap.polygonMap
  67992. * @description 面图。
  67993. * @private
  67994. */
  67995. var polygonMap = {
  67996. /*包括LINE的部分,用以设置面的外围边界*/
  67997. "line-color": "strokeStyle",
  67998. "line-width": "lineWidth",
  67999. "line-cap": "lineCap",
  68000. "line-join": "lineJoin",
  68001. "line-miterlimit": "miterLimit",
  68002. "line-dash-offset": "lineDashOffset",
  68003. /*expand*/
  68004. "line-opacity": "strokeOpacity",
  68005. "line-dasharray": "lineDasharray",
  68006. /*以下为面的特性*/
  68007. "polygon-fill": "fillStyle",
  68008. "polygon-dx": "offsetX",
  68009. "polygon-dy": "offsetY",
  68010. "polygon-opacity": "fillOpacity",
  68011. "polygon-comp-op": "globalCompositeOperation"
  68012. };
  68013. /**
  68014. * @constant ol.supermap.StyleMap
  68015. * @description 地图样式。
  68016. */
  68017. var StyleMap = {
  68018. /**
  68019. * @constant ol.supermap.StyleMap.prototype.CartoStyleMap
  68020. * @description CartoCSS 中的 style 属性名与 Canvas 的 style 属性名的对应表
  68021. */
  68022. CartoStyleMap: {
  68023. "TEXT": {
  68024. //前两个属性值组成font
  68025. "text-size": "fontSize",
  68026. "text-face-name": "fontFamily",
  68027. "text-align": "textAlign",
  68028. "text-vertical-alignment": "textBaseline",
  68029. "text-horizontal-alignment": "textAlign",
  68030. /*expand*/
  68031. 'text-bold': 'bold',
  68032. 'text-weight': 'fontWeight',
  68033. "text-name": "textName",
  68034. "text-halo-radius": "haloRadius",
  68035. "text-halo-color": "backColor",
  68036. "text-fill": "foreColor",
  68037. "text-opacity": "globalAlpha",
  68038. "text-dx": "offsetX",
  68039. "text-dy": "offsetY",
  68040. "text-comp-op": "globalCompositeOperation"
  68041. },
  68042. /*expand*/
  68043. "POINT": pointMap,
  68044. "MULTIPOINT": pointMap,
  68045. "LINE": lineMap,
  68046. "LINESTRING": lineMap,
  68047. "MULTILINESTRING": lineMap,
  68048. "REGION": polygonMap,
  68049. "POLYGON": polygonMap,
  68050. "MULTIPOLYGON": polygonMap
  68051. },
  68052. /**
  68053. * @constant ol.supermap.StyleMap.prototype.ServerStyleMap
  68054. * @description 服务端传过来的 style 属性名与 Canvas 的 style 属性名的对应表。
  68055. */
  68056. ServerStyleMap: {
  68057. fillBackOpaque: {
  68058. canvasStyle: "",
  68059. type: "bool",
  68060. defaultValue: true
  68061. },
  68062. lineWidth: {
  68063. canvasStyle: "lineWidth",
  68064. type: "number",
  68065. unit: "mm",
  68066. defaultValue: 0.1
  68067. },
  68068. fillBackColor: {
  68069. canvasStyle: "",
  68070. type: "color",
  68071. defaultValue: "rgba(0,0,0,0)"
  68072. },
  68073. markerWidth: {
  68074. canvasStyle: "",
  68075. type: "number",
  68076. unit: "mm",
  68077. defaultValue: ""
  68078. },
  68079. markerAngle: {
  68080. canvasStyle: "",
  68081. type: "number",
  68082. unit: "degree",
  68083. defaultValue: ""
  68084. },
  68085. fillForeColor: {
  68086. canvasStyle: "fillStyle",
  68087. type: "color",
  68088. defaultValue: "rgba(0,0,0,0)"
  68089. },
  68090. foreColor: {
  68091. canvasStyle: "fillStyle",
  68092. type: "color",
  68093. defaultValue: "rgba(0,0,0,0)"
  68094. },
  68095. markerSize: {
  68096. canvasStyle: "markerSize",
  68097. type: "number",
  68098. unit: "mm",
  68099. defaultValue: 2.4
  68100. },
  68101. fillGradientOffsetRatioX: {
  68102. canvasStyle: "",
  68103. type: "number",
  68104. defaultValue: 0
  68105. },
  68106. fillGradientOffsetRatioY: {
  68107. canvasStyle: "",
  68108. type: "number",
  68109. defaultValue: 0
  68110. },
  68111. lineColor: {
  68112. canvasStyle: "strokeStyle",
  68113. type: "color",
  68114. defaultValue: "rgba(0,0,0,0)"
  68115. },
  68116. fillOpaqueRate: {
  68117. canvasStyle: "",
  68118. type: "number",
  68119. defaultValue: 100
  68120. },
  68121. markerHeight: {
  68122. canvasStyle: "",
  68123. type: "number",
  68124. unit: "mm",
  68125. defaultValue: 0
  68126. },
  68127. fillGradientMode: {
  68128. canvasStyle: "",
  68129. type: "string",
  68130. defaultValue: "NONE"
  68131. },
  68132. fillSymbolID: {
  68133. canvasStyle: "",
  68134. type: "number",
  68135. defaultValue: 0
  68136. },
  68137. fillGradientAngle: {
  68138. canvasStyle: "",
  68139. type: "number",
  68140. unit: "degree",
  68141. defaultValue: 0
  68142. },
  68143. markerSymbolID: {
  68144. canvasStyle: "",
  68145. type: "number",
  68146. defaultValue: 0
  68147. },
  68148. lineSymbolID: {
  68149. canvasStyle: "",
  68150. type: "number",
  68151. defaultValue: 0
  68152. }
  68153. },
  68154. /**
  68155. * @constant ol.supermap.StyleMap.prototype.CartoCompOpMap
  68156. * @description Canvas 中的 globalCompositeOperation 属性值与 CartoCSS 中的 CompOp 属性值对照表。
  68157. */
  68158. CartoCompOpMap: {
  68159. "clear": "",
  68160. "src": "",
  68161. "dst": "",
  68162. "src-over": "source-over",
  68163. "dst-over": "destination-over",
  68164. "src-in": "source-in",
  68165. "dst-in": "destination-in",
  68166. "src-out": "source-out",
  68167. "dst-out": "destination-out",
  68168. "src-atop": "source-atop",
  68169. "dst-atop": "destination-atop",
  68170. "xor": "xor",
  68171. "plus": "lighter",
  68172. "minus": "",
  68173. "multiply": "",
  68174. "screen": "",
  68175. "overlay": "",
  68176. "darken": "",
  68177. "lighten": "lighter",
  68178. "color-dodge": "",
  68179. "color-burn": "",
  68180. "hard-light": "",
  68181. "soft-light": "",
  68182. "difference": "",
  68183. "exclusion": "",
  68184. "contrast": "",
  68185. "invert": "",
  68186. "invert-rgb": "",
  68187. "grain-merge": "",
  68188. "grain-extract": "",
  68189. "hue": "",
  68190. "saturation": "",
  68191. "color": "",
  68192. "value": ""
  68193. }
  68194. };
  68195. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/DeafultCanvasStyle.js
  68196. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  68197. * This program are made available under the terms of the Apache License, Version 2.0
  68198. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68199. /**
  68200. * @constant ol.supermap.pointStyle
  68201. * @description 点属性名的对应表。
  68202. * @private
  68203. */
  68204. var pointStyle = {
  68205. pointFile: "",
  68206. /*expand*/
  68207. pointRadius: 3,
  68208. pointHaloRadius: 1,
  68209. pointHaloColor: "#c33",
  68210. offsetX: 0,
  68211. offsetY: 0,
  68212. fillStyle: "#fc0",
  68213. globalAlpha: 1,
  68214. globalCompositeOperation: "source-over",
  68215. imageSmoothingEnabled: true
  68216. };
  68217. /**
  68218. * @constant ol.supermap.lineStyle
  68219. * @description 线属性名的对应表。
  68220. * @private
  68221. */
  68222. var lineStyle = {
  68223. strokeStyle: "rgba(0,0,0,0)",
  68224. lineWidth: 1,
  68225. lineCap: "butt",
  68226. lineJoin: "round",
  68227. miterLimit: 10,
  68228. lineDashOffset: 0,
  68229. /*expand*/
  68230. lineDasharray: [],
  68231. strokeOpacity: 1,
  68232. offset: 0,
  68233. globalAlpha: 1,
  68234. globalCompositeOperation: "source-over",
  68235. imageSmoothingEnabled: true
  68236. };
  68237. /**
  68238. * @constant ol.supermap.polygonStyle
  68239. * @description 面属性名的对应表。
  68240. * @private
  68241. */
  68242. var polygonStyle = {
  68243. /*包含LINE的部分*/
  68244. strokeStyle: "rgba(0,0,0,0)",
  68245. lineWidth: 1,
  68246. lineCap: "butt",
  68247. lineJoin: "round",
  68248. miterLimit: 10,
  68249. lineDashOffset: 0,
  68250. /*expand*/
  68251. lineOpacity: 1,
  68252. fillOpacity: 1,
  68253. lineDasharray: [],
  68254. fillStyle: "rgba(0,0,0,0)",
  68255. polygonOpacity: 1,
  68256. /*expand*/
  68257. offsetX: 0,
  68258. offsetY: 0,
  68259. globalAlpha: 1,
  68260. globalCompositeOperation: "source-over",
  68261. imageSmoothingEnabled: true
  68262. };
  68263. /**
  68264. * @constant ol.supermap.DeafultCanvasStyle
  68265. * @description 默认画布属性名的对应表。
  68266. * @private
  68267. */
  68268. var DeafultCanvasStyle = {
  68269. /**
  68270. * @constant ol.supermap.DeafultCanvasStyle.prototype.TEXT
  68271. * @description 默认文本样式。
  68272. */
  68273. "TEXT": {
  68274. font: "10px sans-serif",
  68275. textAlign: "middle",
  68276. textBaseline: "center",
  68277. direction: "ltr",
  68278. /*expand*/
  68279. bold: false,
  68280. haloRadius: 0,
  68281. backColor: "rgba(255,255,255,1)",
  68282. foreColor: "rgba(0,0,0,1)",
  68283. // foreColor: "rgba(0,0,0,0)",
  68284. offsetX: 0,
  68285. offsetY: 0,
  68286. textHeight: 0,
  68287. globalAlpha: 1,
  68288. globalCompositeOperation: "source-over",
  68289. imageSmoothingEnabled: true
  68290. },
  68291. "POINT": pointStyle,
  68292. "MULTIPOINT": pointStyle,
  68293. "LINE": lineStyle,
  68294. "LINESTRING": lineStyle,
  68295. "MULTILINESTRING": lineStyle,
  68296. "REGION": polygonStyle,
  68297. "POLYGON": polygonStyle,
  68298. "MULTIPOLYGON": polygonStyle,
  68299. "SHADOW": {
  68300. shadowBlur: 0,
  68301. shadowColor: "rgba(0,0,0,0)",
  68302. shadowOffsetX: 0,
  68303. shadowOffsetY: 0
  68304. },
  68305. "GLOBAL": {
  68306. globalAlpha: 1,
  68307. globalCompositeOperation: "source-over",
  68308. imageSmoothingEnabled: true
  68309. }
  68310. };
  68311. ;// CONCATENATED MODULE: external "ol.geom.Point"
  68312. var external_ol_geom_Point_namespaceObject = ol.geom.Point;
  68313. var external_ol_geom_Point_default = /*#__PURE__*/__webpack_require__.n(external_ol_geom_Point_namespaceObject);
  68314. ;// CONCATENATED MODULE: external "ol.format.GeoJSON"
  68315. var external_ol_format_GeoJSON_namespaceObject = ol.format.GeoJSON;
  68316. var external_ol_format_GeoJSON_default = /*#__PURE__*/__webpack_require__.n(external_ol_format_GeoJSON_namespaceObject);
  68317. ;// CONCATENATED MODULE: ./src/openlayers/services/QueryService.js
  68318. function services_QueryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_QueryService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_QueryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_QueryService_typeof(obj); }
  68319. function services_QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68320. function services_QueryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68321. function services_QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_QueryService_defineProperties(Constructor, staticProps); return Constructor; }
  68322. function services_QueryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) services_QueryService_setPrototypeOf(subClass, superClass); }
  68323. function services_QueryService_setPrototypeOf(o, p) { services_QueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_QueryService_setPrototypeOf(o, p); }
  68324. function services_QueryService_createSuper(Derived) { var hasNativeReflectConstruct = services_QueryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_QueryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_QueryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_QueryService_possibleConstructorReturn(this, result); }; }
  68325. function services_QueryService_possibleConstructorReturn(self, call) { if (call && (services_QueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_QueryService_assertThisInitialized(self); }
  68326. function services_QueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68327. function services_QueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  68328. function services_QueryService_getPrototypeOf(o) { services_QueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_QueryService_getPrototypeOf(o); }
  68329. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  68330. * This program are made available under the terms of the Apache License, Version 2.0
  68331. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68332. /**
  68333. * @class ol.supermap.QueryService
  68334. * @category iServer Map QueryResults
  68335. * @classdesc 地图查询服务类。
  68336. * 提供:范围查询,SQL 查询,几何查询,距离查询。
  68337. * @extends {ol.supermap.ServiceBase}
  68338. * @param {string} url - 地图查询服务访问地址。
  68339. * @param {Object} options - 参数。
  68340. * @param {string} [options.proxy] - 服务代理地址。
  68341. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  68342. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  68343. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  68344. * @param {Object} [options.headers] - 请求头。
  68345. * @example
  68346. * new ol.supermap.QueryService(url)
  68347. * .queryByBounds(param,function(result){
  68348. * //doSomething
  68349. * })
  68350. */
  68351. var QueryService_QueryService = /*#__PURE__*/function (_ServiceBase) {
  68352. services_QueryService_inherits(QueryService, _ServiceBase);
  68353. var _super = services_QueryService_createSuper(QueryService);
  68354. function QueryService(url, options) {
  68355. services_QueryService_classCallCheck(this, QueryService);
  68356. return _super.call(this, url, options);
  68357. }
  68358. /**
  68359. * @function ol.supermap.QueryService.prototype.queryByBounds
  68360. * @description bounds 查询地图服务。
  68361. * @param {SuperMap.QueryByBoundsParameters} params - 通过 bounds 查询的相关参数类。
  68362. * @param {RequestCallback} callback - 回调函数。
  68363. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  68364. * @returns {ol.supermap.QueryService}
  68365. */
  68366. services_QueryService_createClass(QueryService, [{
  68367. key: "queryByBounds",
  68368. value: function queryByBounds(params, callback, resultFormat) {
  68369. var me = this;
  68370. var queryService = new QueryByBoundsService(me.url, {
  68371. proxy: me.options.proxy,
  68372. withCredentials: me.options.withCredentials,
  68373. crossOrigin: me.options.crossOrigin,
  68374. headers: me.options.headers,
  68375. serverType: me.options.serverType,
  68376. eventListeners: {
  68377. scope: me,
  68378. processCompleted: callback,
  68379. processFailed: callback
  68380. },
  68381. format: me._processFormat(resultFormat)
  68382. });
  68383. queryService.processAsync(me._processParams(params));
  68384. }
  68385. /**
  68386. * @function ol.supermap.QueryService.prototype.queryByDistance
  68387. * @description 地图距离查询服务。
  68388. * @param {SuperMap.QueryByDistanceParameters} params - Distance 查询相关参数类。
  68389. * @param {RequestCallback} callback 回调函数。
  68390. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  68391. */
  68392. }, {
  68393. key: "queryByDistance",
  68394. value: function queryByDistance(params, callback, resultFormat) {
  68395. var me = this;
  68396. var queryByDistanceService = new QueryByDistanceService(me.url, {
  68397. proxy: me.options.proxy,
  68398. withCredentials: me.options.withCredentials,
  68399. crossOrigin: me.options.crossOrigin,
  68400. headers: me.options.headers,
  68401. serverType: me.options.serverType,
  68402. eventListeners: {
  68403. scope: me,
  68404. processCompleted: callback,
  68405. processFailed: callback
  68406. },
  68407. format: me._processFormat(resultFormat)
  68408. });
  68409. queryByDistanceService.processAsync(me._processParams(params));
  68410. }
  68411. /**
  68412. * @function ol.supermap.QueryService.prototype.queryBySQL
  68413. * @description 地图 SQL 查询服务。
  68414. * @param {SuperMap.QueryBySQLParameters} params - SQL 查询相关参数类。
  68415. * @param {RequestCallback} callback 回调函数。
  68416. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  68417. */
  68418. }, {
  68419. key: "queryBySQL",
  68420. value: function queryBySQL(params, callback, resultFormat) {
  68421. var me = this;
  68422. var queryBySQLService = new QueryBySQLService(me.url, {
  68423. proxy: me.options.proxy,
  68424. withCredentials: me.options.withCredentials,
  68425. crossOrigin: me.options.crossOrigin,
  68426. headers: me.options.headers,
  68427. serverType: me.options.serverType,
  68428. eventListeners: {
  68429. scope: me,
  68430. processCompleted: callback,
  68431. processFailed: callback
  68432. },
  68433. format: me._processFormat(resultFormat)
  68434. });
  68435. queryBySQLService.processAsync(me._processParams(params));
  68436. }
  68437. /**
  68438. * @function ol.supermap.QueryService.prototype.queryByGeometry
  68439. * @description 地图几何查询服务。
  68440. * @param {SuperMap.QueryByGeometryParameters} params - Geometry 查询相关参数类。
  68441. * @param {RequestCallback} callback 回调函数。
  68442. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  68443. */
  68444. }, {
  68445. key: "queryByGeometry",
  68446. value: function queryByGeometry(params, callback, resultFormat) {
  68447. var me = this;
  68448. var queryByGeometryService = new QueryByGeometryService(me.url, {
  68449. proxy: me.options.proxy,
  68450. withCredentials: me.options.withCredentials,
  68451. crossOrigin: me.options.crossOrigin,
  68452. headers: me.options.headers,
  68453. serverType: me.options.serverType,
  68454. eventListeners: {
  68455. scope: me,
  68456. processCompleted: callback,
  68457. processFailed: callback
  68458. },
  68459. format: me._processFormat(resultFormat)
  68460. });
  68461. queryByGeometryService.processAsync(me._processParams(params));
  68462. }
  68463. }, {
  68464. key: "_processParams",
  68465. value: function _processParams(params) {
  68466. if (!params) {
  68467. return {};
  68468. }
  68469. params.returnContent = params.returnContent == null ? true : params.returnContent;
  68470. if (params.queryParams && !core_Util_Util.isArray(params.queryParams)) {
  68471. params.queryParams = [params.queryParams];
  68472. }
  68473. if (params.bounds) {
  68474. params.bounds = new Bounds(params.bounds[0], params.bounds[1], params.bounds[2], params.bounds[3]);
  68475. }
  68476. if (params.geometry) {
  68477. if (params.geometry instanceof (external_ol_geom_Point_default())) {
  68478. params.geometry = new Point(params.geometry.getCoordinates()[0], params.geometry.getCoordinates()[1]);
  68479. } else {
  68480. params.geometry = core_Util_Util.toSuperMapGeometry(JSON.parse(new (external_ol_format_GeoJSON_default())().writeGeometry(params.geometry)));
  68481. }
  68482. }
  68483. return params;
  68484. }
  68485. }, {
  68486. key: "_processFormat",
  68487. value: function _processFormat(resultFormat) {
  68488. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  68489. }
  68490. }]);
  68491. return QueryService;
  68492. }(ServiceBase);
  68493. ;// CONCATENATED MODULE: ./src/openlayers/services/FeatureService.js
  68494. function FeatureService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FeatureService_typeof = function _typeof(obj) { return typeof obj; }; } else { FeatureService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FeatureService_typeof(obj); }
  68495. function FeatureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68496. 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); } }
  68497. function FeatureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FeatureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FeatureService_defineProperties(Constructor, staticProps); return Constructor; }
  68498. function FeatureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FeatureService_setPrototypeOf(subClass, superClass); }
  68499. function FeatureService_setPrototypeOf(o, p) { FeatureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FeatureService_setPrototypeOf(o, p); }
  68500. function FeatureService_createSuper(Derived) { var hasNativeReflectConstruct = FeatureService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FeatureService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FeatureService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FeatureService_possibleConstructorReturn(this, result); }; }
  68501. function FeatureService_possibleConstructorReturn(self, call) { if (call && (FeatureService_typeof(call) === "object" || typeof call === "function")) { return call; } return FeatureService_assertThisInitialized(self); }
  68502. function FeatureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68503. function FeatureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  68504. function FeatureService_getPrototypeOf(o) { FeatureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FeatureService_getPrototypeOf(o); }
  68505. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  68506. * This program are made available under the terms of the Apache License, Version 2.0
  68507. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68508. /**
  68509. * @class ol.supermap.FeatureService
  68510. * @constructs ol.supermap.FeatureService
  68511. * @category iServer Data Feature
  68512. * @classdesc 数据集类。提供:ID 查询,范围查询,SQL查询,几何查询,bounds 查询,缓冲区查询,地物编辑。
  68513. * @example
  68514. * new ol.supermap.FeatureService(url)
  68515. * .getFeaturesByIDs(param,function(result){
  68516. * //doSomething
  68517. * })
  68518. * @param {string} url - 与客户端交互的服务地址。
  68519. * @param {Object} options - 参数。
  68520. * @param {string} [options.proxy] - 服务代理地址。
  68521. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  68522. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  68523. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  68524. * @param {Object} [options.headers] - 请求头。
  68525. * @extends {ol.supermap.ServiceBase}
  68526. */
  68527. var FeatureService = /*#__PURE__*/function (_ServiceBase) {
  68528. FeatureService_inherits(FeatureService, _ServiceBase);
  68529. var _super = FeatureService_createSuper(FeatureService);
  68530. function FeatureService(url, options) {
  68531. FeatureService_classCallCheck(this, FeatureService);
  68532. return _super.call(this, url, options);
  68533. }
  68534. /**
  68535. * @function ol.supermap.FeatureService.prototype.getFeaturesByIDs
  68536. * @description 数据集 ID 查询服务。
  68537. * @param {SuperMap.GetFeaturesByIDsParameters} params - 查询所需参数类。
  68538. * @param {RequestCallback} callback - 回调函数。
  68539. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的数据格式。
  68540. */
  68541. FeatureService_createClass(FeatureService, [{
  68542. key: "getFeaturesByIDs",
  68543. value: function getFeaturesByIDs(params, callback, resultFormat) {
  68544. var me = this;
  68545. var getFeaturesByIDsService = new GetFeaturesByIDsService(me.url, {
  68546. proxy: me.options.proxy,
  68547. withCredentials: me.options.withCredentials,
  68548. crossOrigin: me.options.crossOrigin,
  68549. headers: me.options.headers,
  68550. serverType: me.options.serverType,
  68551. eventListeners: {
  68552. processCompleted: callback,
  68553. processFailed: callback
  68554. },
  68555. format: me._processFormat(resultFormat)
  68556. });
  68557. getFeaturesByIDsService.processAsync(me._processParams(params));
  68558. }
  68559. /**
  68560. * @function ol.supermap.FeatureService.prototype.getFeaturesByBounds
  68561. * @description 数据集 Bounds 查询服务。
  68562. * @param {SuperMap.GetFeaturesByBoundsParameters} params - 查询所需参数类。
  68563. * @param {RequestCallback} callback - 回调函数。
  68564. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的数据格式。
  68565. */
  68566. }, {
  68567. key: "getFeaturesByBounds",
  68568. value: function getFeaturesByBounds(params, callback, resultFormat) {
  68569. var me = this;
  68570. var getFeaturesByBoundsService = new GetFeaturesByBoundsService(me.url, {
  68571. proxy: me.options.proxy,
  68572. withCredentials: me.options.withCredentials,
  68573. crossOrigin: me.options.crossOrigin,
  68574. headers: me.options.headers,
  68575. serverType: me.options.serverType,
  68576. eventListeners: {
  68577. processCompleted: callback,
  68578. processFailed: callback
  68579. },
  68580. format: me._processFormat(resultFormat)
  68581. });
  68582. getFeaturesByBoundsService.processAsync(me._processParams(params));
  68583. }
  68584. /**
  68585. * @function ol.supermap.FeatureService.prototype.getFeaturesByBuffer
  68586. * @description 数据集 Buffer 查询服务。
  68587. * @param {SuperMap.GetFeaturesByBufferParameters} params - 查询所需参数类。
  68588. * @param {RequestCallback} callback - 回调函数。
  68589. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的数据格式。
  68590. */
  68591. }, {
  68592. key: "getFeaturesByBuffer",
  68593. value: function getFeaturesByBuffer(params, callback, resultFormat) {
  68594. var me = this;
  68595. var getFeatureService = new GetFeaturesByBufferService(me.url, {
  68596. proxy: me.options.proxy,
  68597. withCredentials: me.options.withCredentials,
  68598. crossOrigin: me.options.crossOrigin,
  68599. headers: me.options.headers,
  68600. serverType: me.options.serverType,
  68601. eventListeners: {
  68602. processCompleted: callback,
  68603. processFailed: callback
  68604. },
  68605. format: me._processFormat(resultFormat)
  68606. });
  68607. getFeatureService.processAsync(me._processParams(params));
  68608. }
  68609. /**
  68610. * @function ol.supermap.FeatureService.prototype.getFeaturesBySQL
  68611. * @description 数据集 SQL 查询服务。
  68612. * @param {SuperMap.GetFeaturesBySQLParameters} params - 查询所需参数类。
  68613. * @param {RequestCallback} callback - 回调函数。
  68614. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的数据格式。
  68615. */
  68616. }, {
  68617. key: "getFeaturesBySQL",
  68618. value: function getFeaturesBySQL(params, callback, resultFormat) {
  68619. var me = this;
  68620. var getFeatureBySQLService = new GetFeaturesBySQLService(me.url, {
  68621. proxy: me.options.proxy,
  68622. withCredentials: me.options.withCredentials,
  68623. crossOrigin: me.options.crossOrigin,
  68624. headers: me.options.headers,
  68625. serverType: me.options.serverType,
  68626. eventListeners: {
  68627. processCompleted: callback,
  68628. processFailed: callback
  68629. },
  68630. format: me._processFormat(resultFormat)
  68631. });
  68632. getFeatureBySQLService.processAsync(me._processParams(params));
  68633. }
  68634. /**
  68635. * @function ol.supermap.FeatureService.prototype.getFeaturesByGeometry
  68636. * @description 数据集几何查询服务类。
  68637. * @param {SuperMap.GetFeaturesByGeometryParameters} params - 查询所需参数类。
  68638. * @param {RequestCallback} callback - 回调函数。
  68639. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的数据格式。
  68640. */
  68641. }, {
  68642. key: "getFeaturesByGeometry",
  68643. value: function getFeaturesByGeometry(params, callback, resultFormat) {
  68644. var me = this;
  68645. var getFeaturesByGeometryService = new GetFeaturesByGeometryService(me.url, {
  68646. proxy: me.options.proxy,
  68647. withCredentials: me.options.withCredentials,
  68648. crossOrigin: me.options.crossOrigin,
  68649. headers: me.options.headers,
  68650. serverType: me.options.serverType,
  68651. eventListeners: {
  68652. processCompleted: callback,
  68653. processFailed: callback
  68654. },
  68655. format: me._processFormat(resultFormat)
  68656. });
  68657. getFeaturesByGeometryService.processAsync(me._processParams(params));
  68658. }
  68659. /**
  68660. * @function ol.supermap.FeatureService.prototype.editFeatures
  68661. * @description 地物编辑服务。
  68662. * @param {SuperMap.EditFeaturesParameters} params - 查询所需参数类。
  68663. * @param {RequestCallback} callback - 回调函数。
  68664. */
  68665. }, {
  68666. key: "editFeatures",
  68667. value: function editFeatures(params, callback) {
  68668. if (!params || !params.dataSourceName || !params.dataSetName) {
  68669. return;
  68670. }
  68671. var me = this,
  68672. url = me.url,
  68673. dataSourceName = params.dataSourceName,
  68674. dataSetName = params.dataSetName;
  68675. url = Util.urlPathAppend(url, "datasources/" + dataSourceName + "/datasets/" + dataSetName);
  68676. var editFeatureService = new EditFeaturesService(url, {
  68677. proxy: me.options.proxy,
  68678. withCredentials: me.options.withCredentials,
  68679. crossOrigin: me.options.crossOrigin,
  68680. headers: me.options.headers,
  68681. serverType: me.options.serverType,
  68682. eventListeners: {
  68683. processCompleted: callback,
  68684. processFailed: callback
  68685. }
  68686. });
  68687. editFeatureService.processAsync(me._processParams(params));
  68688. }
  68689. }, {
  68690. key: "_processParams",
  68691. value: function _processParams(params) {
  68692. if (!params) {
  68693. return {};
  68694. }
  68695. var me = this;
  68696. params.returnContent = params.returnContent == null ? true : params.returnContent;
  68697. params.fromIndex = params.fromIndex ? params.fromIndex : 0;
  68698. params.toIndex = params.toIndex ? params.toIndex : -1;
  68699. if (params.bounds) {
  68700. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  68701. }
  68702. if (params.geometry) {
  68703. params.geometry = core_Util_Util.toSuperMapGeometry(JSON.parse(new (external_ol_format_GeoJSON_default())().writeGeometry(params.geometry)));
  68704. }
  68705. if (params.editType) {
  68706. params.editType = params.editType.toLowerCase();
  68707. }
  68708. if (params.features) {
  68709. var features = [];
  68710. if (core_Util_Util.isArray(params.features)) {
  68711. params.features.map(function (feature) {
  68712. features.push(me._createServerFeature(feature));
  68713. return feature;
  68714. });
  68715. } else {
  68716. features.push(me._createServerFeature(params.features));
  68717. }
  68718. params.features = features;
  68719. }
  68720. return params;
  68721. }
  68722. }, {
  68723. key: "_createServerFeature",
  68724. value: function _createServerFeature(geoFeature) {
  68725. var feature = {},
  68726. fieldNames = [],
  68727. fieldValues = [];
  68728. var properties = geoFeature.getProperties();
  68729. for (var key in properties) {
  68730. if (key === geoFeature.getGeometryName()) {
  68731. continue;
  68732. }
  68733. fieldNames.push(key);
  68734. fieldValues.push(properties[key]);
  68735. }
  68736. feature.fieldNames = fieldNames;
  68737. feature.fieldValues = fieldValues;
  68738. if (geoFeature.getId()) {
  68739. feature.id = geoFeature.getId();
  68740. }
  68741. feature.geometry = core_Util_Util.toSuperMapGeometry(new (external_ol_format_GeoJSON_default())().writeFeatureObject(geoFeature));
  68742. return feature;
  68743. }
  68744. }, {
  68745. key: "_processFormat",
  68746. value: function _processFormat(resultFormat) {
  68747. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  68748. }
  68749. }]);
  68750. return FeatureService;
  68751. }(ServiceBase);
  68752. ;// CONCATENATED MODULE: external "ol.util"
  68753. var external_ol_util_namespaceObject = ol.util;
  68754. ;// CONCATENATED MODULE: external "ol.geom.Geometry"
  68755. var external_ol_geom_Geometry_namespaceObject = ol.geom.Geometry;
  68756. var external_ol_geom_Geometry_default = /*#__PURE__*/__webpack_require__.n(external_ol_geom_Geometry_namespaceObject);
  68757. ;// CONCATENATED MODULE: external "ol.render"
  68758. var external_ol_render_namespaceObject = ol.render;
  68759. ;// CONCATENATED MODULE: external "ol.source.Vector"
  68760. var external_ol_source_Vector_namespaceObject = ol.source.Vector;
  68761. var external_ol_source_Vector_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_Vector_namespaceObject);
  68762. ;// CONCATENATED MODULE: external "ol.layer.Vector"
  68763. var external_ol_layer_Vector_namespaceObject = ol.layer.Vector;
  68764. var external_ol_layer_Vector_default = /*#__PURE__*/__webpack_require__.n(external_ol_layer_Vector_namespaceObject);
  68765. ;// CONCATENATED MODULE: external "ol.style"
  68766. var external_ol_style_namespaceObject = ol.style;
  68767. ;// CONCATENATED MODULE: external "ol.Feature"
  68768. var external_ol_Feature_namespaceObject = ol.Feature;
  68769. var external_ol_Feature_default = /*#__PURE__*/__webpack_require__.n(external_ol_Feature_namespaceObject);
  68770. ;// CONCATENATED MODULE: ./src/openlayers/core/Util.js
  68771. function core_Util_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68772. function core_Util_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68773. function core_Util_createClass(Constructor, protoProps, staticProps) { if (protoProps) core_Util_defineProperties(Constructor.prototype, protoProps); if (staticProps) core_Util_defineProperties(Constructor, staticProps); return Constructor; }
  68774. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  68775. * This program are made available under the terms of the Apache License, Version 2.0
  68776. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68777. /**
  68778. * @class ol.supermap.Util
  68779. * @category BaseTypes Util
  68780. * @classdesc 工具类。
  68781. */
  68782. var core_Util_Util = /*#__PURE__*/function () {
  68783. function Util() {
  68784. core_Util_classCallCheck(this, Util);
  68785. }
  68786. core_Util_createClass(Util, null, [{
  68787. key: "getOlVersion",
  68788. value: function getOlVersion() {
  68789. if (external_ol_util_namespaceObject && external_ol_util_namespaceObject.VERSION) {
  68790. return external_ol_util_namespaceObject.VERSION.split('.')[0];
  68791. }
  68792. if (window && window.ol) {
  68793. if (window.ol.util) {
  68794. return '6';
  68795. }
  68796. if (window.ol.WebGLMap) {
  68797. return '5';
  68798. }
  68799. }
  68800. return '4';
  68801. }
  68802. /**
  68803. * @function ol.supermap.Util.toGeoJSON
  68804. * @description 将传入对象转为 GeoJSON 格式。
  68805. * @param {Object} smObj - 待转参数。
  68806. */
  68807. }, {
  68808. key: "toGeoJSON",
  68809. value: function toGeoJSON(smObj) {
  68810. if (!smObj) {
  68811. return null;
  68812. }
  68813. return new GeoJSON().toGeoJSON(smObj);
  68814. }
  68815. /**
  68816. * @function ol.supermap.Util.toSuperMapGeometry
  68817. * @description 将 GeoJSON 对象转为 SuperMap 几何图形。
  68818. * @param {GeoJSONObject} geoJSON - GeoJSON 对象。
  68819. */
  68820. }, {
  68821. key: "toSuperMapGeometry",
  68822. value: function toSuperMapGeometry(geoJSON) {
  68823. if (!geoJSON || !geoJSON.type) {
  68824. return null;
  68825. }
  68826. var result = new GeoJSON().read(geoJSON, 'FeatureCollection');
  68827. return result[0].geometry;
  68828. }
  68829. /**
  68830. * @function ol.supermap.Util.resolutionToScale
  68831. * @description 通过分辨率计算比例尺。
  68832. * @param {number} resolution - 分辨率。
  68833. * @param {number} dpi - 屏幕分辨率。
  68834. * @param {string} mapUnit - 地图单位。
  68835. * @returns {number} 比例尺。
  68836. */
  68837. }, {
  68838. key: "resolutionToScale",
  68839. value: function resolutionToScale(resolution, dpi, mapUnit) {
  68840. var inchPerMeter = 1 / 0.0254; // 地球半径。
  68841. var meterPerMapUnit = this.getMeterPerMapUnit(mapUnit);
  68842. var scale = 1 / (resolution * dpi * inchPerMeter * meterPerMapUnit);
  68843. return scale;
  68844. }
  68845. /**
  68846. * @function ol.supermap.Util.toSuperMapBounds
  68847. * @description 转为 SuperMapBounds 格式。
  68848. * @param {Array.<number>} bounds - bounds 数组。
  68849. * @returns {SuperMap.Bounds} 返回 SuperMap 的 Bounds 对象。
  68850. */
  68851. }, {
  68852. key: "toSuperMapBounds",
  68853. value: function toSuperMapBounds(bounds) {
  68854. return new Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
  68855. }
  68856. /**
  68857. * @function ol.supermap.Util.toProcessingParam
  68858. * @description 将 Region 节点数组转为 Processing 服务需要的分析参数。
  68859. * @param {Array} points - Region 各个节点数组。
  68860. * @returns processing 服务裁剪、查询分析的分析参数。
  68861. */
  68862. }, {
  68863. key: "toProcessingParam",
  68864. value: function toProcessingParam(points) {
  68865. if (points.length < 1) {
  68866. return '';
  68867. }
  68868. var geometryParam = {};
  68869. var results = [];
  68870. for (var i = 0; i < points.length; i++) {
  68871. var point = {
  68872. x: points[i][0],
  68873. y: points[i][1]
  68874. };
  68875. results.push(point);
  68876. }
  68877. results.push(results[0]);
  68878. geometryParam.type = 'REGION';
  68879. geometryParam.points = results;
  68880. return geometryParam;
  68881. }
  68882. /**
  68883. * @function ol.supermap.Util.scaleToResolution
  68884. * @description 通过比例尺计算分辨率。
  68885. * @param {number} scale - 比例尺。
  68886. * @param {number} dpi - 屏幕分辨率。
  68887. * @param {string} mapUnit - 地图单位。
  68888. * @returns {number} 分辨率。
  68889. */
  68890. }, {
  68891. key: "scaleToResolution",
  68892. value: function scaleToResolution(scale, dpi, mapUnit) {
  68893. var inchPerMeter = 1 / 0.0254;
  68894. var meterPerMapUnitValue = this.getMeterPerMapUnit(mapUnit);
  68895. var resolution = 1 / (scale * dpi * inchPerMeter * meterPerMapUnitValue);
  68896. return resolution;
  68897. }
  68898. /**
  68899. * @private
  68900. * @function ol.supermap.Util.getMeterPerMapUnit
  68901. * @description 获取每地图单位多少米。
  68902. * @param {string} mapUnit - 地图单位。
  68903. * @returns {number} 返回每地图单位多少米。
  68904. */
  68905. }, {
  68906. key: "getMeterPerMapUnit",
  68907. value: function getMeterPerMapUnit(mapUnit) {
  68908. var earchRadiusInMeters = 6378137;
  68909. var meterPerMapUnit;
  68910. if (mapUnit === REST_Unit.METER) {
  68911. meterPerMapUnit = 1;
  68912. } else if (mapUnit === REST_Unit.DEGREE) {
  68913. // 每度表示多少米。
  68914. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  68915. } else if (mapUnit === REST_Unit.KILOMETER) {
  68916. meterPerMapUnit = 1.0e-3;
  68917. } else if (mapUnit === REST_Unit.INCH) {
  68918. meterPerMapUnit = 1 / 2.5399999918e-2;
  68919. } else if (mapUnit === REST_Unit.FOOT) {
  68920. meterPerMapUnit = 0.3048;
  68921. } else {
  68922. return meterPerMapUnit;
  68923. }
  68924. return meterPerMapUnit;
  68925. }
  68926. /**
  68927. * @function ol.supermap.Util.isArray
  68928. * @description 判断是否为数组格式。
  68929. * @param {Object} obj - 待判断对象。
  68930. * @returns {boolean} 是否是数组。
  68931. */
  68932. }, {
  68933. key: "isArray",
  68934. value: function isArray(obj) {
  68935. return Object.prototype.toString.call(obj) === '[object Array]';
  68936. }
  68937. /**
  68938. * @function ol.supermap.Util.Csv2GeoJSON
  68939. * @description 将 csv 格式转为 GeoJSON。
  68940. * @param {Object} csv - csv 对象。
  68941. * @param {Object} options - 转换参数。
  68942. */
  68943. }, {
  68944. key: "Csv2GeoJSON",
  68945. value: function Csv2GeoJSON(csv, options) {
  68946. var defaultOptions = {
  68947. titles: ['lon', 'lat'],
  68948. latitudeTitle: 'lat',
  68949. longitudeTitle: 'lon',
  68950. fieldSeparator: ',',
  68951. lineSeparator: '\n',
  68952. deleteDoubleQuotes: true,
  68953. firstLineTitles: false
  68954. };
  68955. options = options || defaultOptions;
  68956. var _propertiesNames = [];
  68957. if (typeof csv === 'string') {
  68958. var titulos = options.titles;
  68959. if (options.firstLineTitles) {
  68960. csv = csv.split(options.lineSeparator);
  68961. if (csv.length < 2) {
  68962. return;
  68963. }
  68964. titulos = csv[0];
  68965. csv.splice(0, 1);
  68966. csv = csv.join(options.lineSeparator);
  68967. titulos = titulos.trim().split(options.fieldSeparator);
  68968. for (var i = 0; i < titulos.length; i++) {
  68969. titulos[i] = _deleteDoubleQuotes(titulos[i]);
  68970. }
  68971. options.titles = titulos;
  68972. }
  68973. for (var _i = 0; _i < titulos.length; _i++) {
  68974. var prop = titulos[_i].toLowerCase().replace(/[^\w ]+/g, '').replace(/ +/g, '_');
  68975. if (prop === '' || prop === '_') {
  68976. prop = "prop-".concat(_i);
  68977. }
  68978. _propertiesNames[_i] = prop;
  68979. }
  68980. csv = _csv2json(csv);
  68981. }
  68982. return csv;
  68983. function _deleteDoubleQuotes(cadena) {
  68984. if (options.deleteDoubleQuotes) {
  68985. cadena = cadena.trim().replace(/^"/, '').replace(/"$/, '');
  68986. }
  68987. return cadena;
  68988. }
  68989. function _csv2json(csv) {
  68990. var json = {};
  68991. json['type'] = 'FeatureCollection';
  68992. json['features'] = [];
  68993. var titulos = options.titles;
  68994. csv = csv.split(options.lineSeparator);
  68995. for (var num_linea = 0; num_linea < csv.length; num_linea++) {
  68996. var campos = csv[num_linea].trim().split(options.fieldSeparator),
  68997. lng = parseFloat(campos[titulos.indexOf(options.longitudeTitle)]),
  68998. lat = parseFloat(campos[titulos.indexOf(options.latitudeTitle)]);
  68999. var isInRange = lng < 180 && lng > -180 && lat < 90 && lat > -90;
  69000. if (!(campos.length === titulos.length && isInRange)) {
  69001. continue;
  69002. }
  69003. var feature = {};
  69004. feature['type'] = 'Feature';
  69005. feature['geometry'] = {};
  69006. feature['properties'] = {};
  69007. feature['geometry']['type'] = 'Point';
  69008. feature['geometry']['coordinates'] = [lng, lat];
  69009. for (var _i2 = 0; _i2 < titulos.length; _i2++) {
  69010. if (titulos[_i2] !== options.latitudeTitle && titulos[_i2] !== options.longitudeTitle) {
  69011. feature['properties'][_propertiesNames[_i2]] = _deleteDoubleQuotes(campos[_i2]);
  69012. }
  69013. }
  69014. json['features'].push(feature);
  69015. }
  69016. return json;
  69017. }
  69018. }
  69019. /**
  69020. * @function ol.supermap.Util.createCanvasContext2D
  69021. * @description 创建 2D 画布。
  69022. * @param {number} opt_width - 画布宽度。
  69023. * @param {number} opt_height - 画布高度。
  69024. */
  69025. }, {
  69026. key: "createCanvasContext2D",
  69027. value: function createCanvasContext2D(opt_width, opt_height) {
  69028. var canvas = document.createElement('CANVAS');
  69029. if (opt_width) {
  69030. canvas.width = opt_width;
  69031. }
  69032. if (opt_height) {
  69033. canvas.height = opt_height;
  69034. }
  69035. return canvas.getContext('2d');
  69036. }
  69037. /**
  69038. * @function ol.supermap.Util.supportWebGL2
  69039. * @description 是否支持 webgl2。
  69040. */
  69041. }, {
  69042. key: "supportWebGL2",
  69043. value: function supportWebGL2() {
  69044. var canvas = document.createElement('canvas');
  69045. return Boolean(canvas && canvas.getContext('webgl2'));
  69046. }
  69047. /**
  69048. * @function ol.supermap.Util.isString
  69049. * @description 是否为字符串
  69050. * @param {string} str - 需要判断的内容
  69051. * @returns {boolean}
  69052. */
  69053. }, {
  69054. key: "isString",
  69055. value: function isString(str) {
  69056. return typeof str === 'string' && str.constructor === String;
  69057. }
  69058. /**
  69059. * @function ol.supermap.Util.isObject
  69060. * @description 是否为对象
  69061. * @param {any} obj - 需要判断的内容
  69062. * @returns {boolean}
  69063. */
  69064. }, {
  69065. key: "isObject",
  69066. value: function isObject(obj) {
  69067. return Object.prototype.toString.call(obj) === '[object Object]';
  69068. }
  69069. /**
  69070. * @function ol.supermap.Util.trim
  69071. * @description 字符串裁剪两边的空格
  69072. * @param {string} str - 需要裁剪的字符串
  69073. * @returns {boolean}
  69074. */
  69075. }, {
  69076. key: "trim",
  69077. value: function trim() {
  69078. var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  69079. return str.replace(/(^\s*)|(\s*$)/g, '');
  69080. }
  69081. /**
  69082. * @function ol.supermap.Util.newGuid
  69083. * @description 随机生成id
  69084. * @param {string} attr - 几位数字的id
  69085. * @returns {string}
  69086. */
  69087. }, {
  69088. key: "newGuid",
  69089. value: function newGuid(attr) {
  69090. var len = attr || 32;
  69091. var guid = '';
  69092. for (var i = 1; i < len; i++) {
  69093. var n = Math.floor(Math.random() * 16.0).toString(16);
  69094. guid += n;
  69095. }
  69096. return guid;
  69097. }
  69098. /**
  69099. * @function ol.supermap.Util.isNumber
  69100. * @description 检测数据是否为number
  69101. * @param {string} value - 值,未知数据类型
  69102. * @returns {boolean}
  69103. */
  69104. }, {
  69105. key: "isNumber",
  69106. value: function isNumber(value) {
  69107. if (value === '') {
  69108. return false;
  69109. }
  69110. var mdata = Number(value);
  69111. if (mdata === 0) {
  69112. return true;
  69113. }
  69114. return !isNaN(mdata);
  69115. }
  69116. /**
  69117. * @function ol.supermap.Util.getFeatureBySQL
  69118. * @description 获取feature
  69119. * @param {string} url - 获取feature的请求地址
  69120. * @param {string} datasetNames - 数据集名称
  69121. * @param {object} serviceOptions - 服务类需要的参数
  69122. * @param {function} processCompleted - 成功请求的回调函数
  69123. * @param {function} processFaild - 失败请求的回调函数
  69124. * @param {string | number} targetEpsgCode - 动态投影的目标坐标系对应的 EPSG Code
  69125. */
  69126. }, {
  69127. key: "getFeatureBySQL",
  69128. value: function getFeatureBySQL(url, datasetNames, serviceOptions, processCompleted, processFaild, targetEpsgCode) {
  69129. var getFeatureParam = new FilterParameter({
  69130. name: datasetNames.join().replace(':', '@') // attributeFilter: 'SMID > 0' // shp第三方发布的数据没有SMID字段,http://yt.ispeco.com:8099/issue/DV-131
  69131. }),
  69132. getFeatureBySQLParams = new GetFeaturesBySQLParameters({
  69133. queryParameter: getFeatureParam,
  69134. datasetNames: datasetNames,
  69135. fromIndex: 0,
  69136. toIndex: 100000,
  69137. maxFeatures: 100000,
  69138. returnContent: true,
  69139. targetEpsgCode: targetEpsgCode
  69140. }),
  69141. callback = function callback(serviceResult) {
  69142. if (serviceResult.type === 'processCompleted') {
  69143. processCompleted && processCompleted(serviceResult);
  69144. } else {
  69145. processFaild && processFaild(serviceResult);
  69146. }
  69147. };
  69148. new FeatureService(url, serviceOptions).getFeaturesBySQL(getFeatureBySQLParams, callback);
  69149. }
  69150. }, {
  69151. key: "queryFeatureBySQL",
  69152. value: function queryFeatureBySQL(url, layerName, attributeFilter, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
  69153. var queryParam = new FilterParameter({
  69154. name: layerName,
  69155. attributeFilter: attributeFilter
  69156. });
  69157. if (fields) {
  69158. queryParam.fields = fields;
  69159. }
  69160. var params = {
  69161. queryParams: [queryParam]
  69162. };
  69163. if (onlyAttribute) {
  69164. params.queryOption = QueryOption.ATTRIBUTE;
  69165. }
  69166. startRecord && (params.startRecord = startRecord);
  69167. recordLength && (params.expectCount = recordLength);
  69168. if (epsgCode) {
  69169. params.prjCoordSys = {
  69170. epsgCode: epsgCode
  69171. };
  69172. }
  69173. var queryBySQLParams = new QueryBySQLParameters(params);
  69174. var queryBySQLService = new QueryService_QueryService(url);
  69175. queryBySQLService.queryBySQL(queryBySQLParams, function (data) {
  69176. data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
  69177. });
  69178. }
  69179. /**
  69180. * @function ol.supermap.Util.getFeatureProperties
  69181. * @description 从feature中获取properties
  69182. * @param {array} features 要素数组
  69183. * @returns {array} 属性
  69184. */
  69185. }, {
  69186. key: "getFeatureProperties",
  69187. value: function getFeatureProperties(features) {
  69188. var properties = [];
  69189. if (Util.isArray(features) && features.length) {
  69190. features.forEach(function (feature) {
  69191. var property = feature.get('attributes');
  69192. property && properties.push(property);
  69193. });
  69194. }
  69195. return properties;
  69196. }
  69197. /**
  69198. * @function ol.supermap.Util.isMatchAdministrativeName
  69199. * @param {string} featureName 原始数据中的地名
  69200. * @param {string} fieldName 需要匹配的地名
  69201. * @returns {boolean} 是否匹配
  69202. */
  69203. }, {
  69204. key: "isMatchAdministrativeName",
  69205. value: function isMatchAdministrativeName(featureName, fieldName) {
  69206. if (Util.isString(fieldName)) {
  69207. var shortName = featureName.substr(0, 2); // 张家口市和张家界市 特殊处理
  69208. if (shortName === '张家') {
  69209. shortName = featureName.substr(0, 3);
  69210. }
  69211. return !!fieldName.match(new RegExp(shortName));
  69212. }
  69213. return false;
  69214. }
  69215. /**
  69216. * @function ol.supermap.Util.getHighestMatchAdministration
  69217. * @param {string} featureName 初始匹配的要素数组
  69218. * @param {string} fieldName 要匹配的地名
  69219. * @returns {boolean} 是否匹配
  69220. */
  69221. }, {
  69222. key: "getHighestMatchAdministration",
  69223. value: function getHighestMatchAdministration(features, fieldName) {
  69224. var filterFeatures = features.filter(function (item) {
  69225. return Util.isMatchAdministrativeName(item.properties.Name, fieldName);
  69226. });
  69227. var maxMatchPercent = 0,
  69228. maxMatchFeature = null;
  69229. filterFeatures.forEach(function (feature) {
  69230. var count = 0;
  69231. Array.from(new Set(feature.properties.Name.split(''))).forEach(function (_char) {
  69232. if (fieldName.includes(_char)) {
  69233. count++;
  69234. }
  69235. });
  69236. if (count > maxMatchPercent) {
  69237. maxMatchPercent = count;
  69238. maxMatchFeature = feature;
  69239. }
  69240. });
  69241. return maxMatchFeature;
  69242. }
  69243. /**
  69244. * @function ol.supermap.Util.setMask
  69245. * @description 为图层设置掩膜。
  69246. * @version 10.1.0
  69247. * @param {ol/layer/Layer|Array.<ol/layer/Layer>} layers 图层
  69248. * @param {ol/geom/Geometry|ol/feature} polygon 掩膜矢量要素,支持面类型的要素。
  69249. */
  69250. }, {
  69251. key: "setMask",
  69252. value: function setMask(layers, polygon) {
  69253. if (!polygon) {
  69254. return;
  69255. }
  69256. var geo = polygon instanceof (external_ol_Feature_default()) ? polygon.getGeometry() : polygon;
  69257. if (!(geo instanceof (external_ol_geom_Geometry_default())) && ['MultiPolygon', 'Polygon'].indexOf(polygon.getType()) < 0) {
  69258. return;
  69259. }
  69260. var feature = polygon instanceof (external_ol_Feature_default()) ? polygon : new (external_ol_Feature_default())(polygon);
  69261. var style = new external_ol_style_namespaceObject.Style({
  69262. fill: new external_ol_style_namespaceObject.Fill({
  69263. color: 'black'
  69264. })
  69265. });
  69266. var clipLayer = new (external_ol_layer_Vector_default())({
  69267. source: new (external_ol_source_Vector_default())({
  69268. features: [feature],
  69269. wrapX: false
  69270. })
  69271. });
  69272. var clipRender = function clipRender(e) {
  69273. var vectorContext = (0,external_ol_render_namespaceObject.getVectorContext)(e);
  69274. e.context.globalCompositeOperation = 'destination-in';
  69275. clipLayer.getSource().forEachFeature(function (feature) {
  69276. vectorContext.drawFeature(feature, style);
  69277. e.context.globalCompositeOperation = 'source-over';
  69278. });
  69279. };
  69280. var todoLayers = Array.isArray(layers) ? layers : [layers];
  69281. Util.unsetMask(todoLayers);
  69282. todoLayers.forEach(function (layer) {
  69283. layer.classNameBak_ = layer.className_;
  69284. layer.className_ = "ol_mask_layer_".concat(layer.ol_uid);
  69285. layer.clipRender = clipRender;
  69286. layer.extentBak_ = layer.getExtent();
  69287. layer.setExtent(clipLayer.getSource().getExtent());
  69288. layer.on('postrender', clipRender);
  69289. layer.changed();
  69290. });
  69291. }
  69292. /**
  69293. * @function ol.supermap.Util.unsetMask
  69294. * @description 取消图层掩膜。
  69295. * @version 10.1.0
  69296. * @param {ol/layer/Layer|Array.<ol/layer/Layer>} layers 图层
  69297. */
  69298. }, {
  69299. key: "unsetMask",
  69300. value: function unsetMask(layers) {
  69301. var todoLayers = Array.isArray(layers) ? layers : [layers];
  69302. for (var index = 0; index < todoLayers.length; index++) {
  69303. var layer = todoLayers[index];
  69304. if (!layer.clipRender) {
  69305. continue;
  69306. }
  69307. layer.un('postrender', layer.clipRender);
  69308. layer.className_ = layer.classNameBak_;
  69309. layer.setExtent(layer.extentBak);
  69310. delete layer.classNameBak_;
  69311. delete layer.clipRender;
  69312. delete layer.extentBak_;
  69313. layer.changed();
  69314. }
  69315. }
  69316. }]);
  69317. return Util;
  69318. }();
  69319. ;// CONCATENATED MODULE: external "function(){try{return canvg}catch(e){return {}}}()"
  69320. var external_function_try_return_canvg_catch_e_return_namespaceObject = function(){try{return canvg}catch(e){return {}}}();
  69321. var external_function_try_return_canvg_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_canvg_catch_e_return_namespaceObject);
  69322. ;// CONCATENATED MODULE: external "ol.style.Style"
  69323. var external_ol_style_Style_namespaceObject = ol.style.Style;
  69324. var external_ol_style_Style_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Style_namespaceObject);
  69325. ;// CONCATENATED MODULE: external "ol.style.Icon"
  69326. var external_ol_style_Icon_namespaceObject = ol.style.Icon;
  69327. var external_ol_style_Icon_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Icon_namespaceObject);
  69328. ;// CONCATENATED MODULE: external "ol.style.Circle"
  69329. var external_ol_style_Circle_namespaceObject = ol.style.Circle;
  69330. var external_ol_style_Circle_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Circle_namespaceObject);
  69331. ;// CONCATENATED MODULE: external "ol.style.Fill"
  69332. var external_ol_style_Fill_namespaceObject = ol.style.Fill;
  69333. var external_ol_style_Fill_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Fill_namespaceObject);
  69334. ;// CONCATENATED MODULE: external "ol.style.Stroke"
  69335. var external_ol_style_Stroke_namespaceObject = ol.style.Stroke;
  69336. var external_ol_style_Stroke_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Stroke_namespaceObject);
  69337. ;// CONCATENATED MODULE: external "ol.style.Text"
  69338. var external_ol_style_Text_namespaceObject = ol.style.Text;
  69339. var external_ol_style_Text_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Text_namespaceObject);
  69340. ;// CONCATENATED MODULE: ./src/openlayers/core/StyleUtils.js
  69341. function StyleUtils_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69342. function StyleUtils_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  69343. function StyleUtils_createClass(Constructor, protoProps, staticProps) { if (protoProps) StyleUtils_defineProperties(Constructor.prototype, protoProps); if (staticProps) StyleUtils_defineProperties(Constructor, staticProps); return Constructor; }
  69344. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  69345. * This program are made available under the terms of the Apache License, Version 2.0
  69346. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69347. var padding = 8,
  69348. doublePadding = padding * 2;
  69349. var ZERO = 0.0000001;
  69350. /**
  69351. * @class ol.supermap.StyleUtils
  69352. * @classdesc 样式工具类。
  69353. * @private
  69354. */
  69355. var StyleUtils = /*#__PURE__*/function () {
  69356. function StyleUtils() {
  69357. StyleUtils_classCallCheck(this, StyleUtils);
  69358. }
  69359. StyleUtils_createClass(StyleUtils, null, [{
  69360. key: "getValidStyleFromLayerInfo",
  69361. /**
  69362. * @function ol.supermap.StyleUtils.getValidStyleFromLayerInfo
  69363. * @description 通过图层信息获取有效的样式。
  69364. * @param {Object} layerInfo - 图层信息。
  69365. * @param {ol.Feature} feature - 要素。
  69366. * @param {string} url - 图层数据地址。
  69367. * @returns {ol/style/Style} 返回图层样式。
  69368. */
  69369. value: function getValidStyleFromLayerInfo(layerInfo, feature, url) {
  69370. var type = feature.getGeometry().getType().toUpperCase(),
  69371. shader = layerInfo.layerStyle,
  69372. style = this.getDefaultStyle(type);
  69373. if ((type === "POINT" || type === 'MULTIPOINT') && !feature.getProperties().textStyle && layerInfo.type !== 'LABEL' && !feature.getProperties().TEXT_FEATURE_CONTENT) {
  69374. if (shader) {
  69375. var symbolParameters = {
  69376. "transparent": true,
  69377. "resourceType": "SYMBOLMARKER",
  69378. "picWidth": Math.ceil(shader.markerSize * SuperMap.DOTS_PER_INCH * SuperMap.INCHES_PER_UNIT.mm) || 13,
  69379. "picHeight": Math.ceil(shader.markerSize * SuperMap.DOTS_PER_INCH * SuperMap.INCHES_PER_UNIT.mm) || 13,
  69380. "style": JSON.stringify(shader)
  69381. };
  69382. var imageUrl = Util.urlAppend(url + "/symbol.png", Util.getParameterString(symbolParameters));
  69383. style.pointFile = imageUrl;
  69384. return new (external_ol_style_Style_default())({
  69385. image: new (external_ol_style_Icon_default())({
  69386. src: style.pointFile
  69387. })
  69388. });
  69389. }
  69390. return this.toOLPointStyle(style);
  69391. } else if ((type === "POINT" || type === 'MULTIPOINT') && (feature.getProperties().textStyle || layerInfo.type === 'LABEL' || feature.getProperties().TEXT_STYLE_INFO)) {
  69392. style = this.getDefaultStyle('TEXT');
  69393. if (feature.getProperties().textStyle) {
  69394. shader = feature.getProperties().textStyle;
  69395. }
  69396. if (feature.getProperties().TEXT_STYLE_INFO) {
  69397. shader = JSON.parse(feature.getProperties().TEXT_STYLE_INFO).textStyle;
  69398. }
  69399. if (shader && shader !== "{}") {
  69400. var fontStr = ""; //设置文本是否倾斜
  69401. style.fontStyle = shader.italic ? "italic" : "normal"; //设置文本是否使用粗体
  69402. style.fontWeight = shader.bold ? shader.fontWeight : "normal"; //设置文本的尺寸(对应fontHeight属性)和行高,行高iserver不支持,默认5像素
  69403. //固定大小的时候单位是毫米
  69404. var text_h = shader.fontHeight * SuperMap.DOTS_PER_INCH * SuperMap.INCHES_PER_UNIT.mm * 0.85; //毫米转像素,服务端的字体貌似要稍微小一点
  69405. style.fontSize = text_h + "px"; //设置文本字体类型
  69406. //在桌面字体钱加@时为了解决对联那种形式,但是在canvas不支持,并且添加了@会导致
  69407. //字体大小被固定,这里需要去掉
  69408. if (shader.fontName.indexOf("@")) {
  69409. fontStr = shader.fontName.replace(/@/g, "");
  69410. } else {
  69411. fontStr = shader.fontName;
  69412. }
  69413. style.fontFamily = fontStr;
  69414. style.textHeight = text_h; //设置对齐方式
  69415. var alignStr = shader.align.replace(/TOP|MIDDLE|BASELINE|BOTTOM/, "");
  69416. style.textAlign = alignStr.toLowerCase();
  69417. var baselineStr = shader.align.replace(/LEFT|RIGHT|CENTER/, "");
  69418. if (baselineStr === "BASELINE") {
  69419. baselineStr = "alphabetic";
  69420. }
  69421. style.textBaseline = baselineStr.toLowerCase();
  69422. /*//首先判定是否需要绘制阴影,如果需要绘制,阴影应该在最下面
  69423. if(shader.shadow)
  69424. {
  69425. //桌面里面的阴影没有做模糊处理,这里统一设置为0,
  69426. style.shadowBlur=0;
  69427. //和桌面统一,往右下角偏移阴影,默认3像素
  69428. style.shadowOffsetX=3;
  69429. style.shadowOffsetY=3;
  69430. //颜色取一个灰色,调成半透明
  69431. style.shadowColor="rgba(50,50,50,0.5)";
  69432. }else{
  69433. style.shadowOffsetX=0;
  69434. style.shadowOffsetY=0;
  69435. }*/
  69436. style.haloRadius = shader.outline ? shader.outlineWidth : 0;
  69437. style.backColor = "rgba(" + shader.backColor.red + "," + shader.backColor.green + "," + shader.backColor.blue + ",1)";
  69438. style.foreColor = "rgba(" + shader.foreColor.red + "," + shader.foreColor.green + "," + shader.foreColor.blue + ",1)";
  69439. style.rotation = shader.rotation;
  69440. }
  69441. var text;
  69442. if (feature.getProperties().textStyle && feature.getProperties().texts) {
  69443. text = feature.getProperties().texts[0];
  69444. }
  69445. if (layerInfo.type === 'LABEL') {
  69446. var textField = layerInfo.textField;
  69447. if (textField && textField.indexOf('.')) {
  69448. var arr = textField.split('.');
  69449. textField = arr && arr.length > 0 && arr[arr.length - 1];
  69450. }
  69451. text = feature.getProperties().attributes ? feature.getProperties().attributes[textField] : feature.getProperties()[textField];
  69452. }
  69453. if (feature.getProperties().TEXT_FEATURE_CONTENT) {
  69454. text = feature.getProperties().TEXT_FEATURE_CONTENT;
  69455. }
  69456. if (!text) {
  69457. return this.toOLPointStyle(this.getDefaultStyle('POINT'));
  69458. }
  69459. return this.toOLTextStyle(style, text);
  69460. } else if (shader) {
  69461. //目前只实现桌面系统默认的几种symbolID,非系统默认的面用颜色填充替代,线则用实线来替代
  69462. var fillSymbolID = shader["fillSymbolID"] > 7 ? 0 : shader["fillSymbolID"];
  69463. var lineSymbolID = shader["lineSymbolID"] > 5 ? 0 : shader["lineSymbolID"];
  69464. for (var attr in shader) {
  69465. var obj = StyleMap.ServerStyleMap[attr];
  69466. var canvasStyle = obj.canvasStyle;
  69467. if (canvasStyle && canvasStyle != "") {
  69468. var value;
  69469. switch (obj.type) {
  69470. case "number":
  69471. value = shader[attr];
  69472. if (obj.unit) {
  69473. //将单位转换为像素单位
  69474. value = value * SuperMap.DOTS_PER_INCH * SuperMap.INCHES_PER_UNIT[obj.unit] * 2.5;
  69475. }
  69476. style[canvasStyle] = value;
  69477. break;
  69478. case "color":
  69479. var color = shader[attr];
  69480. var backColor = shader["fillBackColor"];
  69481. var alpha = 1;
  69482. if (canvasStyle === "fillStyle") {
  69483. if (fillSymbolID === 0 || fillSymbolID === 1) {
  69484. //当fillSymbolID为0时,用颜色填充,为1是无填充,即为透明填充,alpha通道为0
  69485. alpha = 1 - fillSymbolID;
  69486. value = "rgba(" + color.red + "," + color.green + "," + color.blue + "," + alpha + ")";
  69487. } else {
  69488. //当fillSymbolID为2~7时,用的纹理填充,但要按照前景色修改其颜色
  69489. try {
  69490. var tempCvs = document.createElement("canvas");
  69491. tempCvs.height = 8;
  69492. tempCvs.width = 8;
  69493. var tempCtx = tempCvs.getContext("2d");
  69494. var image = new Image();
  69495. if (this.layer && this.layer.fillImages) {
  69496. tempCtx.drawImage(this.layer.fillImages["System " + fillSymbolID], 0, 0);
  69497. }
  69498. var imageData = tempCtx.getImageData(0, 0, tempCvs.width, tempCvs.height);
  69499. var pix = imageData.data;
  69500. for (var i = 0, len = pix.length; i < len; i += 4) {
  69501. var r = pix[i],
  69502. g = pix[i + 1],
  69503. b = pix[i + 2]; //将符号图片中的灰色或者黑色的部分替换为前景色,其余为后景色
  69504. if (r < 225 && g < 225 && b < 225) {
  69505. pix[i] = color.red;
  69506. pix[i + 1] = color.green;
  69507. pix[i + 2] = color.blue;
  69508. } else if (backColor) {
  69509. pix[i] = backColor.red;
  69510. pix[i + 1] = backColor.green;
  69511. pix[i + 2] = backColor.blue;
  69512. }
  69513. }
  69514. tempCtx.putImageData(imageData, 0, 0);
  69515. image.src = tempCvs.toDataURL();
  69516. if (this.context) {
  69517. value = this.context.createPattern(image, "repeat");
  69518. }
  69519. } catch (e) {
  69520. throw Error(e.message);
  69521. }
  69522. }
  69523. } else if (canvasStyle === "strokeStyle") {
  69524. if (lineSymbolID === 0 || lineSymbolID === 5) {
  69525. //对于lineSymbolID为0时,线为实线,为lineSymbolID为5时,为无线模式,即线为透明,即alpha通道为0
  69526. alpha = lineSymbolID === 0 ? 1 : 0;
  69527. } else {
  69528. //以下几种linePattern分别模拟了桌面的SymbolID为1~4几种符号的linePattern
  69529. var linePattern = [1, 0];
  69530. switch (lineSymbolID) {
  69531. case 1:
  69532. linePattern = [9.7, 3.7];
  69533. break;
  69534. case 2:
  69535. linePattern = [3.7, 3.7];
  69536. break;
  69537. case 3:
  69538. linePattern = [9.7, 3.7, 2.3, 3.7];
  69539. break;
  69540. case 4:
  69541. linePattern = [9.7, 3.7, 2.3, 3.7, 2.3, 3.7];
  69542. break;
  69543. default:
  69544. break;
  69545. }
  69546. style.lineDasharray = linePattern;
  69547. }
  69548. value = "rgba(" + color.red + "," + color.green + "," + color.blue + "," + alpha + ")";
  69549. }
  69550. style[canvasStyle] = value;
  69551. break;
  69552. default:
  69553. break;
  69554. }
  69555. }
  69556. }
  69557. }
  69558. if (type === 'LINESTRING' || type === 'MULTILINESTRING') {
  69559. return this.toOLLineStyle(style);
  69560. }
  69561. if (type === 'POLYGON' || type === 'MULTIPOLYGON') {
  69562. return this.toOLPolygonStyle(style);
  69563. }
  69564. }
  69565. /**
  69566. * @function ol.supermap.StyleUtils.getStyleFromCarto
  69567. * @description 从 Carto 中获取有效的样式。
  69568. * @param {number} zoom -缩放级别。
  69569. * @param {number} scale - 比例尺。
  69570. * @param {Array} shader - 渲染器对象数组。
  69571. * @param {Object} feature - 要素。
  69572. * @param {string} fromServer - 服务源。
  69573. * @param {string} url - 地址。
  69574. */
  69575. }, {
  69576. key: "getStyleFromCarto",
  69577. value: function getStyleFromCarto(zoom, scale, shader, feature, fromServer, url) {
  69578. var type = feature.getGeometry().getType().toUpperCase(),
  69579. attributes = {},
  69580. style = this.getDefaultStyle(type);
  69581. attributes.FEATUREID = feature.getProperties().id;
  69582. attributes.SCALE = scale;
  69583. var cartoStyleType = feature.getProperties().type === "TEXT" ? "TEXT" : type;
  69584. var cartoStyleMap = StyleMap.CartoStyleMap[cartoStyleType];
  69585. var fontSize, fontName;
  69586. if (shader) {
  69587. for (var i = 0, len = shader.length; i < len; i++) {
  69588. var _shader = shader[i];
  69589. var prop = cartoStyleMap[_shader.property];
  69590. var value = _shader.getValue(attributes, zoom, true);
  69591. if (value !== null && prop) {
  69592. if (prop === "fontSize") {
  69593. if (fromServer) {
  69594. value *= 0.8;
  69595. } //斜杠后面为行间距,默认为0.5倍行间距
  69596. fontSize = value + "px";
  69597. style.fontSize = fontSize;
  69598. } else if (prop === "fontName") {
  69599. fontName = value;
  69600. style.fontName = fontName;
  69601. } else {
  69602. if (prop === "globalCompositeOperation") {
  69603. value = StyleMap.CartoCompOpMap[value];
  69604. if (!value) {
  69605. continue;
  69606. }
  69607. } else if (fromServer && prop === 'pointFile') {
  69608. value = url + '/tileFeature/symbols/' + value.replace(/(___)/gi, '@');
  69609. value = value.replace(/(__0__0__)/gi, '__8__8__');
  69610. }
  69611. if (prop === 'lineWidth' && value < 1) {
  69612. value = Math.ceil(value);
  69613. }
  69614. style[prop] = value;
  69615. }
  69616. }
  69617. }
  69618. }
  69619. if (feature.getProperties().type === 'TEXT') {
  69620. var text;
  69621. if (feature.getProperties().texts) {
  69622. text = feature.getProperties().texts[0];
  69623. }
  69624. if (text == null && style.textName) {
  69625. var textName = style.textName.substring(1, style.textName.length - 1);
  69626. text = feature.getProperties().attributes ? feature.getProperties().attributes[textName] : feature.getProperties()[textName];
  69627. if (text != null) {
  69628. var texts = feature.getProperties().texts || [];
  69629. texts.push(text);
  69630. feature.setProperties({
  69631. texts: texts
  69632. });
  69633. }
  69634. }
  69635. return this.toOLTextStyle(style, text);
  69636. }
  69637. if (type === 'POINT' || type === 'MULTIPOINT') {
  69638. return this.toOLPointStyle(style);
  69639. }
  69640. if (type === 'LINESTRING' || type === 'MULTILINESTRING') {
  69641. return this.toOLLineStyle(style);
  69642. }
  69643. if (type === 'POLYGON' || type === 'MULTIPOLYGON') {
  69644. return this.toOLPolygonStyle(style);
  69645. }
  69646. }
  69647. /**
  69648. * @function ol.supermap.StyleUtils.toOLPointStyle
  69649. * @description 点样式。
  69650. * @param {Object} style - 样式参数。
  69651. * @returns {ol/style/Style} 获取点样式。
  69652. */
  69653. }, {
  69654. key: "toOLPointStyle",
  69655. value: function toOLPointStyle(style) {
  69656. if (style.pointFile !== '') {
  69657. return new (external_ol_style_Style_default())({
  69658. image: new (external_ol_style_Icon_default())({
  69659. src: style.pointFile
  69660. })
  69661. });
  69662. }
  69663. return new (external_ol_style_Style_default())({
  69664. image: new (external_ol_style_Circle_default())({
  69665. radius: style.pointRadius,
  69666. fill: new (external_ol_style_Fill_default())({
  69667. color: style.fillStyle
  69668. }),
  69669. stroke: new (external_ol_style_Stroke_default())({
  69670. color: style.pointHaloColor,
  69671. width: style.pointHaloRadius
  69672. })
  69673. })
  69674. });
  69675. }
  69676. /**
  69677. * @function ol.supermap.StyleUtils.toOLLineStyle
  69678. * @description 线样式。
  69679. * @param {Object} style - 样式参数。
  69680. * @returns {ol/style/Style} 获取线的样式。
  69681. */
  69682. }, {
  69683. key: "toOLLineStyle",
  69684. value: function toOLLineStyle(style) {
  69685. return new (external_ol_style_Style_default())({
  69686. stroke: new (external_ol_style_Stroke_default())({
  69687. color: style.strokeStyle,
  69688. width: style.lineWidth,
  69689. lineCap: style.lineCap,
  69690. lineDash: style.lineDasharray,
  69691. lineDashOffset: style.lineDashOffset,
  69692. lineJoin: style.lineJoin,
  69693. miterLimit: style.miterLimit
  69694. })
  69695. });
  69696. }
  69697. /**
  69698. * @function ol.supermap.StyleUtils.toOLPolygonStyle
  69699. * @description 面样式。
  69700. * @param {Object} style - 样式参数。
  69701. * @returns {ol/style/Style} 获取面的样式。
  69702. */
  69703. }, {
  69704. key: "toOLPolygonStyle",
  69705. value: function toOLPolygonStyle(style) {
  69706. var fill = new (external_ol_style_Fill_default())({
  69707. color: style.fillStyle
  69708. });
  69709. var stroke = new (external_ol_style_Stroke_default())({
  69710. color: style.strokeStyle,
  69711. width: style.lineWidth,
  69712. lineCap: style.lineCap,
  69713. lineDash: style.lineDasharray,
  69714. lineDashOffset: style.lineDashOffset,
  69715. lineJoin: style.lineJoin,
  69716. miterLimit: style.miterLimit
  69717. });
  69718. return new (external_ol_style_Style_default())({
  69719. fill: fill,
  69720. stroke: stroke
  69721. });
  69722. }
  69723. /**
  69724. * @function ol.supermap.StyleUtils.toOLTextStyle
  69725. * @description 文本样式。
  69726. * @param {Object} style - 样式对象。
  69727. * @param {string} text - 文本参数。
  69728. * @returns {ol/style/Style} 获取的文本样式。
  69729. */
  69730. }, {
  69731. key: "toOLTextStyle",
  69732. value: function toOLTextStyle(style, text) {
  69733. return new (external_ol_style_Style_default())({
  69734. text: new (external_ol_style_Text_default())({
  69735. font: (style.fontStyle || '') + ' ' + (style.fontWeight || '') + ' ' + (style.fontSize || '') + ' ' + style.fontFamily,
  69736. text: text,
  69737. textAlign: style.textAlign,
  69738. textBaseline: style.textBaseline,
  69739. fill: new (external_ol_style_Fill_default())({
  69740. color: style.foreColor
  69741. }),
  69742. stroke: new (external_ol_style_Stroke_default())({
  69743. color: style.backColor
  69744. }),
  69745. offsetX: style.offsetX,
  69746. offsetY: style.offsetY
  69747. })
  69748. });
  69749. }
  69750. /**
  69751. * @function ol.supermap.StyleUtils.dashStyle
  69752. * @description 符号样式。
  69753. * @param {Object} style - 样式参数。
  69754. * @param {number} widthFactor - 宽度系数。
  69755. */
  69756. }, {
  69757. key: "dashStyle",
  69758. value: function dashStyle(style, widthFactor) {
  69759. if (!style) {
  69760. return [];
  69761. }
  69762. var w = style.strokeWidth * widthFactor;
  69763. var str = style.strokeDashstyle || style.lineDash;
  69764. switch (str) {
  69765. case 'solid':
  69766. return [0];
  69767. case 'dot':
  69768. return [1, 4 * w];
  69769. case 'dash':
  69770. return [4 * w, 4 * w];
  69771. case 'dashdot':
  69772. return [4 * w, 4 * w, 1, 4 * w];
  69773. case 'longdash':
  69774. return [8 * w, 4 * w];
  69775. case 'longdashdot':
  69776. return [8 * w, 4 * w, 1, 4 * w];
  69777. default:
  69778. if (!str) {
  69779. return [];
  69780. }
  69781. if (Util.isArray(str)) {
  69782. return str;
  69783. }
  69784. str = StringExt.trim(str).replace(/\s+/g, ",");
  69785. return str.replace(/\[|\]/gi, "").split(",");
  69786. }
  69787. }
  69788. /**
  69789. * @function ol.supermap.StyleUtils.getStyleFromiPortalMarker
  69790. * @description 从 iPortal 标记获取样式。
  69791. * @param {Object} icon - 图标参数。
  69792. */
  69793. }, {
  69794. key: "getStyleFromiPortalMarker",
  69795. value: function getStyleFromiPortalMarker(icon) {
  69796. if (icon.indexOf("./") == 0) {
  69797. return null;
  69798. } //兼容iportal示例的问题
  69799. if (icon.indexOf("http://support.supermap.com.cn:8092/static/portal") == 0) {
  69800. icon = icon.replace("http://support.supermap.com.cn:8092/static/portal", "http://support.supermap.com.cn:8092/apps/viewer/static");
  69801. }
  69802. return new (external_ol_style_Style_default())({
  69803. image: new (external_ol_style_Icon_default())({
  69804. src: icon,
  69805. opacity: 1,
  69806. size: [48, 43],
  69807. anchor: [0.5, 1]
  69808. })
  69809. });
  69810. }
  69811. /**
  69812. * @function ol.supermap.StyleUtils.getStyleFromiPortalStyle
  69813. * @description 从 iPortal 标记获取样式。
  69814. * @param {Object} iPortalStyle - iportal 样式。
  69815. * @param {string} type - 样式类型。
  69816. * @param {Object} fStyle - 要素样式。
  69817. */
  69818. }, {
  69819. key: "getStyleFromiPortalStyle",
  69820. value: function getStyleFromiPortalStyle(iPortalStyle, type, fStyle) {
  69821. var featureStyle = fStyle ? JSON.parse(fStyle) : null;
  69822. var me = this;
  69823. if (type === 'Point' || type === 'MultiPoint') {
  69824. var pointStyle = featureStyle || iPortalStyle.pointStyle;
  69825. if (pointStyle.externalGraphic) {
  69826. if (pointStyle.externalGraphic.indexOf("./") == 0) {
  69827. return null;
  69828. } //兼容iportal示例的问题
  69829. if (pointStyle.externalGraphic.indexOf("http://support.supermap.com.cn:8092/static/portal") == 0) {
  69830. pointStyle.externalGraphic = pointStyle.externalGraphic.replace("http://support.supermap.com.cn:8092/static/portal", "http://support.supermap.com.cn:8092/apps/viewer/static");
  69831. }
  69832. return new (external_ol_style_Style_default())({
  69833. image: new (external_ol_style_Icon_default())({
  69834. src: pointStyle.externalGraphic,
  69835. opacity: pointStyle.graphicOpacity,
  69836. size: [pointStyle.graphicWidth, pointStyle.graphicHeight] //anchor: [-pointStyle.graphicXOffset / pointStyle.graphicWidth, -pointStyle.graphicYOffset / pointStyle.graphicHeight]
  69837. })
  69838. });
  69839. }
  69840. return new (external_ol_style_Style_default())({
  69841. image: new (external_ol_style_Circle_default())({
  69842. fill: new (external_ol_style_Fill_default())({
  69843. color: me.hexToRgba(pointStyle.fillColor, pointStyle.fillOpacity)
  69844. }),
  69845. stroke: new (external_ol_style_Stroke_default())({
  69846. color: me.hexToRgba(pointStyle.strokeColor, pointStyle.strokeOpacity),
  69847. lineCap: pointStyle.strokeLineCap,
  69848. lineDash: this.dashStyle(pointStyle, 1),
  69849. width: pointStyle.strokeWidth
  69850. }),
  69851. radius: pointStyle.pointRadius
  69852. })
  69853. });
  69854. }
  69855. if (type === 'LineString' || type === 'MultiLineString' || type === 'Box') {
  69856. var lineStyle = featureStyle || iPortalStyle.lineStyle;
  69857. return new (external_ol_style_Style_default())({
  69858. stroke: new (external_ol_style_Stroke_default())({
  69859. color: me.hexToRgba(lineStyle.strokeColor, lineStyle.strokeOpacity),
  69860. lineCap: lineStyle.strokeLineCap,
  69861. lineDash: this.dashStyle(lineStyle, 1),
  69862. width: lineStyle.strokeWidth
  69863. })
  69864. });
  69865. }
  69866. if (type === 'Polygon' || type === 'MultiPolygon') {
  69867. var polygonStyle = featureStyle || iPortalStyle.polygonStyle;
  69868. return new (external_ol_style_Style_default())({
  69869. fill: new (external_ol_style_Fill_default())({
  69870. color: me.hexToRgba(polygonStyle.fillColor, polygonStyle.fillOpacity)
  69871. }),
  69872. stroke: new (external_ol_style_Stroke_default())({
  69873. color: me.hexToRgba(polygonStyle.strokeColor, polygonStyle.strokeOpacity),
  69874. lineCap: polygonStyle.strokeLineCap,
  69875. lineDash: this.dashStyle(polygonStyle, 1),
  69876. width: polygonStyle.strokeWidth
  69877. })
  69878. });
  69879. }
  69880. }
  69881. /**
  69882. * @function ol.supermap.StyleUtils.hexToRgba
  69883. * @description 十六进制转 RGBA 格式。
  69884. * @param {Object} hex - 十六进制格式参数。
  69885. * @param {number} opacity -Alpha 参数。
  69886. * @returns {string} 生成的 RGBA 格式。
  69887. */
  69888. }, {
  69889. key: "hexToRgba",
  69890. value: function hexToRgba(hex, opacity) {
  69891. var color = [],
  69892. rgba = [];
  69893. hex = hex.replace(/#/, "");
  69894. if (hex.length == 3) {
  69895. var tmp = [];
  69896. for (var i = 0; i < 3; i++) {
  69897. tmp.push(hex.charAt(i) + hex.charAt(i));
  69898. }
  69899. hex = tmp.join("");
  69900. }
  69901. for (var _i = 0; _i < 6; _i += 2) {
  69902. color[_i] = "0x" + hex.substr(_i, 2);
  69903. rgba.push(parseInt(Number(color[_i])));
  69904. }
  69905. rgba.push(opacity);
  69906. return "rgba(" + rgba.join(",") + ")";
  69907. }
  69908. /**
  69909. * @function ol.supermap.StyleUtils.getDefaultStyle
  69910. * @description 获取默认风格
  69911. * @param {string} type - 类型参数。
  69912. * @returns {string}
  69913. */
  69914. }, {
  69915. key: "getDefaultStyle",
  69916. value: function getDefaultStyle(type) {
  69917. var style = {};
  69918. var canvasStyle = DeafultCanvasStyle[type];
  69919. for (var prop in canvasStyle) {
  69920. var val = canvasStyle[prop];
  69921. style[prop] = val;
  69922. }
  69923. return style;
  69924. }
  69925. /**
  69926. * @function ol.supermap.StyleUtils.getDefaultStyle
  69927. * @description 将样式对象转换成openlayer要求的ol.style
  69928. * @param {string} style - 样式对象
  69929. * @param {string} type - feature的类型
  69930. * @returns {ol/style/Style}
  69931. */
  69932. }, {
  69933. key: "toOpenLayersStyle",
  69934. value: function toOpenLayersStyle(style, type) {
  69935. style = style || this.getDefaultStyle();
  69936. var olStyle = new (external_ol_style_Style_default())();
  69937. var newImage, newFill, newStroke;
  69938. var _style = style,
  69939. fillColor = _style.fillColor,
  69940. fillOpacity = _style.fillOpacity,
  69941. strokeColor = _style.strokeColor,
  69942. strokeWidth = _style.strokeWidth,
  69943. strokeOpacity = _style.strokeOpacity,
  69944. radius = _style.radius,
  69945. lineCap = _style.lineCap,
  69946. src = _style.src,
  69947. scale = _style.scale,
  69948. offsetX = _style.offsetX,
  69949. offsetY = _style.offsetY,
  69950. anchor = _style.anchor;
  69951. var fillColorArray = this.hexToRgb(fillColor);
  69952. if (fillColorArray) {
  69953. fillColorArray.push(fillOpacity);
  69954. }
  69955. var strokeColorArray = this.hexToRgb(strokeColor);
  69956. if (strokeColorArray) {
  69957. strokeColorArray.push(strokeOpacity);
  69958. }
  69959. if (type === "POINT") {
  69960. if (src) {
  69961. if (/.+(\.svg$)/.test(src)) {
  69962. if (!this.svgDiv) {
  69963. this.svgDiv = document.createElement('div');
  69964. document.body.appendChild(this.svgDiv);
  69965. }
  69966. this.getCanvasFromSVG(src, this.svgDiv, function (canvas) {
  69967. newImage = new (external_ol_style_Icon_default())({
  69968. img: canvas,
  69969. scale: radius / canvas.width,
  69970. imgSize: [canvas.width, canvas.height],
  69971. anchor: [0.5, 0.5]
  69972. });
  69973. });
  69974. } else {
  69975. newImage = new (external_ol_style_Icon_default())({
  69976. src: src,
  69977. scale: scale,
  69978. anchor: anchor
  69979. });
  69980. }
  69981. } else {
  69982. newImage = new (external_ol_style_Circle_default())({
  69983. radius: radius,
  69984. fill: new (external_ol_style_Fill_default())({
  69985. color: fillColorArray
  69986. }),
  69987. stroke: new (external_ol_style_Stroke_default())({
  69988. width: strokeWidth || ZERO,
  69989. color: strokeColorArray
  69990. }),
  69991. displacement: this.getCircleDisplacement(radius, offsetX, offsetY)
  69992. });
  69993. }
  69994. olStyle.setImage(newImage);
  69995. } else if (type === "LINE" || type === "LINESTRING" || type === 'MULTILINESTRING' || type === 'LINEARRING') {
  69996. newStroke = new (external_ol_style_Stroke_default())({
  69997. width: strokeWidth || ZERO,
  69998. color: strokeColorArray,
  69999. lineCap: lineCap || 'round',
  70000. lineDash: this.dashStyle(style, 1)
  70001. });
  70002. olStyle.setStroke(newStroke);
  70003. } else if (type === 'POLYGON' || type === 'MULTIPOLYGON' || type === 'REGION') {
  70004. newFill = new (external_ol_style_Fill_default())({
  70005. color: fillColorArray
  70006. });
  70007. newStroke = new (external_ol_style_Stroke_default())({
  70008. width: strokeWidth || ZERO,
  70009. color: strokeColorArray,
  70010. lineCap: lineCap || 'round',
  70011. lineDash: this.dashStyle(style, 1)
  70012. });
  70013. olStyle.setFill(newFill);
  70014. olStyle.setStroke(newStroke);
  70015. } else {
  70016. var result = this.getCanvas(style);
  70017. newImage = new (external_ol_style_Icon_default())({
  70018. img: result.canvas,
  70019. imgSize: [result.width, result.height],
  70020. scale: 1,
  70021. anchor: [0.5, 0.5]
  70022. });
  70023. olStyle.setImage(newImage);
  70024. }
  70025. return olStyle;
  70026. }
  70027. /**
  70028. * @function ol.supermap.StyleUtils.getIconAnchor
  70029. * @description 获取图标的锚点
  70030. * @param {number} offsetX - X方向偏移分数
  70031. * @param {number} offsetY - Y方向偏移分数
  70032. * @returns {array}
  70033. */
  70034. }, {
  70035. key: "getIconAnchor",
  70036. value: function getIconAnchor() {
  70037. var offsetX = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5;
  70038. var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5;
  70039. return [offsetX, offsetY];
  70040. }
  70041. /**
  70042. * @function ol.supermap.StyleUtils.getCircleDisplacement
  70043. * @description 获取圆圈的偏移
  70044. * @param {number} radius - 圆圈半径
  70045. * @param {number} offsetX - X方向偏移分数
  70046. * @param {number} offsetY - Y方向偏移分数
  70047. * @returns {array}
  70048. */
  70049. }, {
  70050. key: "getCircleDisplacement",
  70051. value: function getCircleDisplacement(radius) {
  70052. var offsetX = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  70053. var offsetY = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  70054. var dispX = radius * offsetX,
  70055. dispY = radius * offsetY;
  70056. return [dispX, -dispY];
  70057. }
  70058. /**
  70059. * @function ol.supermap.StyleUtils.getTextOffset
  70060. * @description 获取字体图标的偏移值
  70061. * @param {string} fontSize - 字体大小,如12px
  70062. * @param {number} offsetX - X方向偏移分数
  70063. * @param {number} offsetY - Y方向偏移分数
  70064. * @returns {object}
  70065. */
  70066. }, {
  70067. key: "getTextOffset",
  70068. value: function getTextOffset(fontSize) {
  70069. var offsetX = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  70070. var offsetY = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  70071. var radius = fontSize.substr(0, fontSize.length - 2) / 2;
  70072. return {
  70073. x: radius * offsetX,
  70074. y: radius * offsetY
  70075. };
  70076. }
  70077. /**
  70078. * 获取文字标注对应的canvas
  70079. * @param style
  70080. * @returns {{canvas: *, width: number, height: number}}
  70081. */
  70082. }, {
  70083. key: "getCanvas",
  70084. value: function getCanvas(style) {
  70085. var canvas;
  70086. if (style.canvas) {
  70087. if (document.querySelector("#" + style.canvas)) {
  70088. canvas = document.getElemntById(style.canvas);
  70089. } else {
  70090. canvas = this.createCanvas(style);
  70091. }
  70092. } else {
  70093. //不存在canvas,当前feature
  70094. canvas = this.createCanvas(style);
  70095. style.canvas = canvas.id;
  70096. }
  70097. canvas.style.display = "none";
  70098. var ctx = canvas.getContext("2d"); //行高
  70099. var lineHeight = Number(style.font.replace(/[^0-9]/ig, ""));
  70100. var textArray = style.text.split('\r\n');
  70101. var lenght = textArray.length; //在改变canvas大小后再绘制。否则会被清除
  70102. ctx.font = style.font;
  70103. var size = this.drawRect(ctx, style, textArray, lineHeight, canvas);
  70104. this.positionY = padding;
  70105. if (lenght > 1) {
  70106. textArray.forEach(function (text, i) {
  70107. if (i !== 0) {
  70108. this.positionY = this.positionY + lineHeight;
  70109. }
  70110. this.canvasTextAutoLine(text, style, ctx, lineHeight, size.width);
  70111. }, this);
  70112. } else {
  70113. this.canvasTextAutoLine(textArray[0], style, ctx, lineHeight, size.width);
  70114. }
  70115. return {
  70116. canvas: canvas,
  70117. width: size.width,
  70118. height: size.height
  70119. };
  70120. }
  70121. /**
  70122. * 创建当前feature对应的canvas
  70123. * @param style {object}
  70124. * @returns {HTMLElement}
  70125. */
  70126. }, {
  70127. key: "createCanvas",
  70128. value: function createCanvas(style) {
  70129. var div = document.createElement('div');
  70130. document.body.appendChild(div);
  70131. var canvas = document.createElement('canvas');
  70132. canvas.id = style.canvas ? style.canvas : 'textCanvas' + core_Util_Util.newGuid(8);
  70133. div.appendChild(canvas);
  70134. return canvas;
  70135. }
  70136. /**
  70137. * 绘制矩形边框背景
  70138. * @param ctx
  70139. * @param style
  70140. * @param textArray
  70141. * @param lineHeight
  70142. * @param canvas
  70143. * @returns {{width: number, height: number}}
  70144. */
  70145. }, {
  70146. key: "drawRect",
  70147. value: function drawRect(ctx, style, textArray, lineHeight, canvas) {
  70148. var backgroundFill = style.backgroundFill,
  70149. maxWidth = style.maxWidth - doublePadding;
  70150. var width,
  70151. height = 0,
  70152. lineCount = 0,
  70153. lineWidths = []; //100的宽度,去掉左右两边3padding
  70154. textArray.forEach(function (arrText) {
  70155. var line = '',
  70156. isOverMax;
  70157. lineCount++;
  70158. for (var n = 0; n < arrText.length; n++) {
  70159. var textLine = line + arrText[n];
  70160. var metrics = ctx.measureText(textLine);
  70161. var textWidth = metrics.width;
  70162. if (textWidth > maxWidth && n > 0 || arrText[n] === '\n') {
  70163. line = arrText[n];
  70164. lineCount++; //有换行,记录当前换行的width
  70165. isOverMax = true;
  70166. } else {
  70167. line = textLine;
  70168. width = textWidth;
  70169. }
  70170. }
  70171. if (isOverMax) {
  70172. lineWidths.push(maxWidth);
  70173. } else {
  70174. lineWidths.push(width);
  70175. }
  70176. }, this);
  70177. width = this.getCanvasWidth(lineWidths, maxWidth);
  70178. height = lineCount * lineHeight;
  70179. height += doublePadding;
  70180. canvas.width = width;
  70181. canvas.height = height;
  70182. ctx.fillStyle = backgroundFill;
  70183. ctx.fillRect(0, 0, width, height);
  70184. return {
  70185. width: width,
  70186. height: height
  70187. };
  70188. }
  70189. /**
  70190. * 获取自适应的宽度(如果没有超过最大宽度,就用文字的宽度)
  70191. * @param lineWidths
  70192. * @param maxWidth
  70193. * @returns {number}
  70194. */
  70195. }, {
  70196. key: "getCanvasWidth",
  70197. value: function getCanvasWidth(lineWidths, maxWidth) {
  70198. var width = 0;
  70199. for (var i = 0; i < lineWidths.length; i++) {
  70200. var lineW = lineWidths[i];
  70201. if (lineW >= maxWidth) {
  70202. //有任何一行超过最大高度,就用最大高度
  70203. return maxWidth + doublePadding;
  70204. } else if (lineW > width) {
  70205. //自己换行,就要比较每行的最大宽度
  70206. width = lineW;
  70207. }
  70208. }
  70209. return width + doublePadding;
  70210. }
  70211. /**
  70212. * 绘制文字,解决换行问题
  70213. * @param text
  70214. * @param style
  70215. * @param ctx
  70216. * @param lineHeight
  70217. */
  70218. }, {
  70219. key: "canvasTextAutoLine",
  70220. value: function canvasTextAutoLine(text, style, ctx, lineHeight, canvasWidth) {
  70221. // 字符分隔为数组
  70222. ctx.font = style.font;
  70223. var textAlign = style.textAlign;
  70224. var x = this.getPositionX(textAlign, canvasWidth);
  70225. var arrText = text.split('');
  70226. var line = '',
  70227. fillColor = style.fillColor; //每一行限制的高度
  70228. var maxWidth = style.maxWidth - doublePadding;
  70229. for (var n = 0; n < arrText.length; n++) {
  70230. var testLine = line + arrText[n];
  70231. var metrics = ctx.measureText(testLine);
  70232. var testWidth = metrics.width;
  70233. if (testWidth > maxWidth && n > 0 || arrText[n] === '\n') {
  70234. ctx.fillStyle = fillColor;
  70235. ctx.textAlign = textAlign;
  70236. ctx.textBaseline = "top";
  70237. ctx.fillText(line, x, this.positionY);
  70238. line = arrText[n];
  70239. this.positionY += lineHeight;
  70240. } else {
  70241. line = testLine;
  70242. }
  70243. }
  70244. ctx.fillStyle = fillColor;
  70245. ctx.textAlign = textAlign;
  70246. ctx.textBaseline = "top";
  70247. ctx.fillText(line, x, this.positionY);
  70248. }
  70249. /**
  70250. * 得到绘制的起点位置,根据align不同,位置也不同
  70251. * @param textAlign
  70252. * @returns {number}
  70253. */
  70254. }, {
  70255. key: "getPositionX",
  70256. value: function getPositionX(textAlign, canvasWidth) {
  70257. var x;
  70258. var width = canvasWidth - doublePadding; //减去padding
  70259. switch (textAlign) {
  70260. case 'center':
  70261. x = width / 2;
  70262. break;
  70263. case 'right':
  70264. x = width;
  70265. break;
  70266. default:
  70267. x = 8;
  70268. break;
  70269. }
  70270. return x;
  70271. }
  70272. /**
  70273. * @function ol.supermap.StyleUtils.hexToRgb
  70274. * @description 将16进制的颜色,转换成rgb格式
  70275. * @param {string} hexColor 16进制颜色
  70276. * @returns {string} rgb格式的颜色
  70277. */
  70278. }, {
  70279. key: "hexToRgb",
  70280. value: function hexToRgb(hexColor) {
  70281. if (!hexColor) {
  70282. return;
  70283. }
  70284. var s = hexColor.replace('#', '').split('');
  70285. var rgb = [s[0] + s[1], s[2] + s[3], s[4] + s[5]];
  70286. rgb = rgb.map(function (hex) {
  70287. return parseInt(hex, 16);
  70288. });
  70289. return rgb;
  70290. }
  70291. /**
  70292. * @function ol.supermap.StyleUtils.formatRGB
  70293. * @description 将颜色数组转换成标准的rgb颜色格式
  70294. * @param {Array} colorArray - 颜色数组
  70295. * @returns {String} 'rgb(0,0,0)'或者 rgba(0,0,0,0)
  70296. */
  70297. }, {
  70298. key: "formatRGB",
  70299. value: function formatRGB(colorArray) {
  70300. var rgb;
  70301. if (colorArray.length === 3) {
  70302. rgb = 'rgb(';
  70303. colorArray.forEach(function (color, index) {
  70304. index === 2 ? rgb += color : rgb += color + ',';
  70305. });
  70306. } else {
  70307. rgb = 'rgba(';
  70308. colorArray.forEach(function (color, index) {
  70309. index === 3 ? rgb += color : rgb += color + ',';
  70310. });
  70311. }
  70312. rgb += ")";
  70313. return rgb;
  70314. }
  70315. /**
  70316. * @function ol.supermap.StyleUtils.getCanvasFromSVG
  70317. * @description 将SVG转换成Canvas
  70318. * @param {string} svgUrl - 颜色数组
  70319. * @param {object} divDom - div的dom对象
  70320. * @param {function} callBack - 转换成功执行的回调函数
  70321. */
  70322. }, {
  70323. key: "getCanvasFromSVG",
  70324. value: function getCanvasFromSVG(svgUrl, divDom, callBack) {
  70325. //一个图层对应一个canvas
  70326. var canvgs = window.canvg ? window.canvg : (external_function_try_return_canvg_catch_e_return_default());
  70327. var canvas = document.createElement('canvas');
  70328. canvas.id = 'dataviz-canvas-' + core_Util_Util.newGuid(8);
  70329. canvas.style.display = "none";
  70330. divDom.appendChild(canvas);
  70331. try {
  70332. canvgs(canvas.id, svgUrl, {
  70333. ignoreMouse: true,
  70334. ignoreAnimation: true,
  70335. renderCallback: function renderCallback() {
  70336. if (canvas.width > 300 || canvas.height > 300) {
  70337. // Util.showMessage(DataViz.Language.sizeIsWrong,'WARNING');
  70338. return;
  70339. }
  70340. callBack(canvas);
  70341. },
  70342. forceRedraw: function forceRedraw() {
  70343. return false;
  70344. }
  70345. });
  70346. } catch (e) {
  70347. return;
  70348. }
  70349. }
  70350. /**
  70351. * @function ol.supermap.StyleUtils.getMarkerDefaultStyle 获取默认标注图层feature的样式
  70352. * @param featureType {String} feature的类型
  70353. * @param server {String} 当前地图前缀
  70354. * @returns {Object} style对象
  70355. */
  70356. }, {
  70357. key: "getMarkerDefaultStyle",
  70358. value: function getMarkerDefaultStyle(featureType, server) {
  70359. var style;
  70360. switch (featureType) {
  70361. case 'POINT':
  70362. style = {
  70363. src: "".concat(server, "apps/dataviz/static/imgs/markers/mark_red.png"),
  70364. scale: 1,
  70365. anchor: [0.5, 1]
  70366. };
  70367. break;
  70368. case 'LINE':
  70369. case 'LINESTRING':
  70370. case 'MULTILINESTRING':
  70371. style = {
  70372. strokeColor: '#3498db',
  70373. strokeOpacity: 1,
  70374. strokeWidth: 5,
  70375. lineCap: 'round',
  70376. lineDash: 'solid'
  70377. };
  70378. break;
  70379. case 'REGION':
  70380. case 'POLYGON':
  70381. case 'MULTIPOLYGON':
  70382. style = {
  70383. fillColor: '#1abd9c',
  70384. fillOpacity: 1,
  70385. strokeColor: '#3498db',
  70386. strokeOpacity: 1,
  70387. strokeWidth: 3,
  70388. lineCap: 'round',
  70389. lineDash: 'solid'
  70390. };
  70391. break;
  70392. }
  70393. return style;
  70394. }
  70395. /**
  70396. * @function ol.supermap.StyleUtils.getOpenlayerStyle 获取专题图对应的openlayers格式的style
  70397. * @param styleParams {String} 样式参数
  70398. * @param featureType {String} feature类型
  70399. * @param isRank {Boolean} 是否为等级符号
  70400. * @returns {Object} style对象
  70401. */
  70402. }, {
  70403. key: "getOpenlayersStyle",
  70404. value: function getOpenlayersStyle(styleParams, featureType, isRank) {
  70405. var style;
  70406. if (styleParams.type === "BASIC_POINT") {
  70407. style = this.toOpenLayersStyle(styleParams, featureType);
  70408. } else if (styleParams.type === "SYMBOL_POINT") {
  70409. style = this.getSymbolStyle(styleParams, isRank);
  70410. } else if (styleParams.type === "SVG_POINT") {
  70411. style = this.getSVGStyle(styleParams);
  70412. } else if (styleParams.type === 'IMAGE_POINT') {
  70413. style = this.getImageStyle(styleParams);
  70414. }
  70415. return style;
  70416. }
  70417. /**
  70418. * @function ol.supermap.StyleUtils.getSymbolStyle 获取符号样式
  70419. * @param {object} parameters - 样式参数
  70420. * @returns {Object} style对象
  70421. */
  70422. }, {
  70423. key: "getSymbolStyle",
  70424. value: function getSymbolStyle(parameters, isRank) {
  70425. var text = '';
  70426. if (parameters.unicode) {
  70427. text = String.fromCharCode(parseInt(parameters.unicode.replace(/^&#x/, ''), 16));
  70428. } // 填充色 + 透明度
  70429. var fillColor = StyleUtils.hexToRgb(parameters.fillColor);
  70430. fillColor.push(parameters.fillOpacity); // 边框充色 + 透明度
  70431. var strokeColor = StyleUtils.hexToRgb(parameters.strokeColor);
  70432. strokeColor.push(parameters.strokeOpacity);
  70433. var fontSize = isRank ? 2 * parameters.radius + "px" : parameters.fontSize;
  70434. var offsetX = parameters.offsetX,
  70435. offsetY = parameters.offsetY,
  70436. _parameters$rotation = parameters.rotation,
  70437. rotation = _parameters$rotation === void 0 ? 0 : _parameters$rotation;
  70438. var offset = StyleUtils.getTextOffset(fontSize, offsetX, offsetY);
  70439. return new (external_ol_style_Style_default())({
  70440. text: new (external_ol_style_Text_default())({
  70441. text: text,
  70442. font: fontSize + " supermapol-icons",
  70443. placement: 'point',
  70444. textAlign: 'center',
  70445. fill: new (external_ol_style_Fill_default())({
  70446. color: fillColor
  70447. }),
  70448. backgroundFill: new (external_ol_style_Fill_default())({
  70449. color: [0, 0, 0, 0]
  70450. }),
  70451. stroke: new (external_ol_style_Stroke_default())({
  70452. width: parameters.strokeWidth || 0.000001,
  70453. color: strokeColor
  70454. }),
  70455. offsetX: offset.x,
  70456. offsetY: offset.y,
  70457. rotation: rotation
  70458. })
  70459. });
  70460. }
  70461. /**
  70462. * @function ol.supermap.StyleUtils.getSVGStyle 获取svg的样式
  70463. * @param {object} styleParams - 样式参数
  70464. * @returns {Object} style对象
  70465. */
  70466. }, {
  70467. key: "getSVGStyle",
  70468. value: function getSVGStyle(styleParams) {
  70469. var style,
  70470. that = this;
  70471. if (!that.svgDiv) {
  70472. that.svgDiv = document.createElement('div');
  70473. document.body.appendChild(that.svgDiv);
  70474. }
  70475. var url = styleParams.url,
  70476. radius = styleParams.radius,
  70477. offsetX = styleParams.offsetX,
  70478. offsetY = styleParams.offsetY,
  70479. fillOpacity = styleParams.fillOpacity,
  70480. rotation = styleParams.rotation;
  70481. var anchor = this.getIconAnchor(offsetX, offsetY);
  70482. StyleUtils.getCanvasFromSVG(url, that.svgDiv, function (canvas) {
  70483. style = new (external_ol_style_Style_default())({
  70484. image: new (external_ol_style_Icon_default())({
  70485. img: that.setColorToCanvas(canvas, styleParams),
  70486. scale: 2 * radius / canvas.width,
  70487. imgSize: [canvas.width, canvas.height],
  70488. anchor: anchor || [0.5, 0.5],
  70489. opacity: fillOpacity,
  70490. anchorOrigin: 'bottom-right',
  70491. rotation: rotation
  70492. })
  70493. });
  70494. });
  70495. return style;
  70496. }
  70497. /**
  70498. * @function ol.supermap.StyleUtils.setColorToCanvas 将颜色,透明度等样式设置到canvas上
  70499. * @param {object} canvas - 渲染的canvas对象
  70500. * @param {object} parameters - 样式参数
  70501. * @returns {Object} style对象
  70502. */
  70503. }, {
  70504. key: "setColorToCanvas",
  70505. value: function setColorToCanvas(canvas, parameters) {
  70506. var context = canvas.getContext('2d');
  70507. var fillColor = StyleUtils.hexToRgb(parameters.fillColor);
  70508. fillColor && fillColor.push(parameters.fillOpacity);
  70509. var strokeColor = StyleUtils.hexToRgb(parameters.strokeColor);
  70510. strokeColor && strokeColor.push(parameters.strokeOpacity);
  70511. context.fillStyle = StyleUtils.formatRGB(fillColor);
  70512. context.fill();
  70513. context.strokeStyle = StyleUtils.formatRGB(strokeColor);
  70514. context.lineWidth = parameters.strokeWidth;
  70515. context.stroke();
  70516. return canvas;
  70517. }
  70518. /**
  70519. * @function ol.supermap.StyleUtils.getImageStyle 获取图片样式
  70520. * @param {object} styleParams - 样式参数
  70521. * @returns {Object} style对象
  70522. */
  70523. }, {
  70524. key: "getImageStyle",
  70525. value: function getImageStyle(styleParams) {
  70526. var size = styleParams.imageInfo.size,
  70527. scale = 2 * styleParams.radius / size.w;
  70528. var imageInfo = styleParams.imageInfo;
  70529. var imgDom = imageInfo.img;
  70530. if (!imgDom || !imgDom.src) {
  70531. imgDom = new Image(); //要组装成完整的url
  70532. imgDom.src = imageInfo.url;
  70533. }
  70534. var offsetX = styleParams.offsetX,
  70535. offsetY = styleParams.offsetY,
  70536. rotation = styleParams.rotation;
  70537. var anchor = this.getIconAnchor(offsetX, offsetY);
  70538. return new (external_ol_style_Style_default())({
  70539. image: new (external_ol_style_Icon_default())({
  70540. img: imgDom,
  70541. scale: scale,
  70542. imgSize: [size.w, size.h],
  70543. anchor: anchor || [0.5, 0.5],
  70544. anchorOrigin: 'bottom-right',
  70545. rotation: rotation
  70546. })
  70547. });
  70548. }
  70549. /**
  70550. * @function ol.supermap.StyleUtils.getRoadPath 获取道路样式
  70551. * @param {object} style - 样式参数
  70552. * @param {object} outlineStyle - 轮廓样式参数
  70553. * @returns {Object} style对象
  70554. */
  70555. }, {
  70556. key: "getRoadPath",
  70557. value: function getRoadPath(style, outlineStyle) {
  70558. var _style$strokeWidth = style.strokeWidth,
  70559. strokeWidth = _style$strokeWidth === void 0 ? ZERO : _style$strokeWidth,
  70560. lineCap = style.lineCap,
  70561. strokeColor = style.strokeColor,
  70562. strokeOpacity = style.strokeOpacity; // 道路线都是solid
  70563. var strokeColorArray = this.hexToRgb(strokeColor);
  70564. strokeColorArray && strokeColorArray.push(strokeOpacity);
  70565. var stroke = new (external_ol_style_Style_default())({
  70566. stroke: new (external_ol_style_Stroke_default())({
  70567. width: strokeWidth || ZERO,
  70568. color: strokeColorArray,
  70569. lineCap: lineCap || 'round',
  70570. lineDash: [0]
  70571. })
  70572. });
  70573. var outlineColor = outlineStyle.strokeColor;
  70574. var outlineColorArray = this.hexToRgb(outlineColor); // opacity使用style的透明度。保持两根线透明度一致
  70575. outlineColorArray && outlineColorArray.push(strokeOpacity);
  70576. var outlineWidth = strokeWidth === 0 ? ZERO : strokeWidth + 2; //外部宽度=内部样式宽度 + 2
  70577. var outlineStroke = new (external_ol_style_Style_default())({
  70578. stroke: new (external_ol_style_Stroke_default())({
  70579. width: outlineWidth,
  70580. //外部宽度=内部样式宽度 + 2
  70581. color: outlineColorArray,
  70582. lineCap: lineCap || 'round',
  70583. lineDash: [0]
  70584. })
  70585. });
  70586. return [outlineStroke, stroke];
  70587. }
  70588. /**
  70589. * @function ol.supermap.StyleUtils.getPathway 获取铁路样式
  70590. * @param {object} style - 样式参数
  70591. * @param {object} outlineStyle - 轮廓样式参数
  70592. * @returns {Object} style对象
  70593. */
  70594. }, {
  70595. key: "getPathway",
  70596. value: function getPathway(style, outlineStyle) {
  70597. var _style$strokeWidth2 = style.strokeWidth,
  70598. strokeWidth = _style$strokeWidth2 === void 0 ? ZERO : _style$strokeWidth2,
  70599. strokeColor = style.strokeColor,
  70600. strokeOpacity = style.strokeOpacity; // 道路线都是solid, lineCap都是直角
  70601. var lineDash = function (w) {
  70602. return [w, w + strokeWidth * 2];
  70603. }(4 * strokeWidth),
  70604. lineCap = 'square';
  70605. var strokeColorArray = this.hexToRgb(strokeColor);
  70606. strokeColorArray && strokeColorArray.push(strokeOpacity);
  70607. var stroke = new (external_ol_style_Style_default())({
  70608. stroke: new (external_ol_style_Stroke_default())({
  70609. width: strokeWidth * 0.5 || ZERO,
  70610. color: strokeColorArray,
  70611. lineCap: lineCap,
  70612. lineDash: lineDash
  70613. })
  70614. });
  70615. var outlineColor = outlineStyle.strokeColor;
  70616. var outlineColorArray = this.hexToRgb(outlineColor); // opacity使用style的透明度。保持两根线透明度一致
  70617. outlineColorArray && outlineColorArray.push(strokeOpacity);
  70618. var outlineStroke = new (external_ol_style_Style_default())({
  70619. stroke: new (external_ol_style_Stroke_default())({
  70620. width: strokeWidth || ZERO,
  70621. color: outlineColorArray,
  70622. lineCap: lineCap
  70623. })
  70624. });
  70625. return [outlineStroke, stroke];
  70626. }
  70627. }]);
  70628. return StyleUtils;
  70629. }();
  70630. ;// CONCATENATED MODULE: external "ol.Map"
  70631. var external_ol_Map_namespaceObject = ol.Map;
  70632. var external_ol_Map_default = /*#__PURE__*/__webpack_require__.n(external_ol_Map_namespaceObject);
  70633. ;// CONCATENATED MODULE: external "ol.layer.Group"
  70634. var external_ol_layer_Group_namespaceObject = ol.layer.Group;
  70635. var external_ol_layer_Group_default = /*#__PURE__*/__webpack_require__.n(external_ol_layer_Group_namespaceObject);
  70636. ;// CONCATENATED MODULE: ./src/openlayers/core/MapExtend.js
  70637. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  70638. * This program are made available under the terms of the Apache License, Version 2.0
  70639. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70640. /**
  70641. * @function MapExtend
  70642. * @description 扩展 OpenLayers 的一些原始方法。
  70643. * @private
  70644. */
  70645. var MapExtend = function () {
  70646. var fun = function fun(layer, coordinate, resolution, callback, pixel, e) {
  70647. if (layer instanceof (external_ol_layer_Group_default())) {
  70648. layer.getLayers().forEach(function (subLayer) {
  70649. fun(subLayer, coordinate, resolution, callback, pixel, e);
  70650. });
  70651. } else {
  70652. //当前高效率点图层满足筛选条件/并且可视时,可被选中:
  70653. if (layer.getSource()._forEachFeatureAtCoordinate) {
  70654. layer.getSource()._forEachFeatureAtCoordinate(coordinate, resolution, function (feature) {
  70655. callback(feature, layer);
  70656. }, pixel, e);
  70657. }
  70658. }
  70659. };
  70660. (external_ol_Map_default()).prototype.forEachFeatureAtPixelDefault = (external_ol_Map_default()).prototype.forEachFeatureAtPixel;
  70661. (external_ol_Map_default()).prototype.forEachFeatureAtPixel = (external_ol_Map_default()).prototype.Tc = function (pixel, callback, opt_options, e) {
  70662. //如果满足高效率图层选取要求优先返回高效率图层选中结果
  70663. var layerFilter = opt_options && opt_options.layerFilter ? opt_options.layerFilter : function () {
  70664. return true;
  70665. };
  70666. var layers = this.getLayers().getArray();
  70667. var resolution = this.getView().getResolution();
  70668. var coordinate = this.getCoordinateFromPixel(pixel);
  70669. for (var i = 0; i < layers.length; i++) {
  70670. var layer = layers[i];
  70671. if (layer.getVisible() && layerFilter.call(null, layer)) {
  70672. fun(layer, coordinate, resolution, callback, pixel, e);
  70673. }
  70674. }
  70675. return this.forEachFeatureAtPixelDefault(pixel, callback, opt_options);
  70676. };
  70677. }();
  70678. ;// CONCATENATED MODULE: ./src/openlayers/core/index.js
  70679. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  70680. * This program are made available under the terms of the Apache License, Version 2.0
  70681. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70682. ;// CONCATENATED MODULE: external "ol.source.TileImage"
  70683. var external_ol_source_TileImage_namespaceObject = ol.source.TileImage;
  70684. var external_ol_source_TileImage_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_TileImage_namespaceObject);
  70685. ;// CONCATENATED MODULE: external "ol.asserts"
  70686. var external_ol_asserts_namespaceObject = ol.asserts;
  70687. ;// CONCATENATED MODULE: external "ol.tilegrid.TileGrid"
  70688. var external_ol_tilegrid_TileGrid_namespaceObject = ol.tilegrid.TileGrid;
  70689. var external_ol_tilegrid_TileGrid_default = /*#__PURE__*/__webpack_require__.n(external_ol_tilegrid_TileGrid_namespaceObject);
  70690. ;// CONCATENATED MODULE: ./src/openlayers/mapping/BaiduMap.js
  70691. function BaiduMap_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { BaiduMap_typeof = function _typeof(obj) { return typeof obj; }; } else { BaiduMap_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return BaiduMap_typeof(obj); }
  70692. function BaiduMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70693. function BaiduMap_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  70694. function BaiduMap_createClass(Constructor, protoProps, staticProps) { if (protoProps) BaiduMap_defineProperties(Constructor.prototype, protoProps); if (staticProps) BaiduMap_defineProperties(Constructor, staticProps); return Constructor; }
  70695. function BaiduMap_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) BaiduMap_setPrototypeOf(subClass, superClass); }
  70696. function BaiduMap_setPrototypeOf(o, p) { BaiduMap_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BaiduMap_setPrototypeOf(o, p); }
  70697. function BaiduMap_createSuper(Derived) { var hasNativeReflectConstruct = BaiduMap_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = BaiduMap_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = BaiduMap_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return BaiduMap_possibleConstructorReturn(this, result); }; }
  70698. function BaiduMap_possibleConstructorReturn(self, call) { if (call && (BaiduMap_typeof(call) === "object" || typeof call === "function")) { return call; } return BaiduMap_assertThisInitialized(self); }
  70699. function BaiduMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70700. function BaiduMap_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  70701. function BaiduMap_getPrototypeOf(o) { BaiduMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BaiduMap_getPrototypeOf(o); }
  70702. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  70703. * This program are made available under the terms of the Apache License, Version 2.0
  70704. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70705. /**
  70706. * @class ol.source.BaiduMap
  70707. * @category ThirdPartyMap
  70708. * @classdesc 百度地图图层源。
  70709. * @param {Object} opt_options - 参数。
  70710. * @param {string} [opt_options.url='http://online1.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20170408'] - 服务地址。
  70711. * @param {string} [opt_options.tileProxy] - 代理地址。
  70712. * @param {boolean} [hidpi = false] - 是否使用高分辨率地图。
  70713. * @extends {ol/source/TileImage}
  70714. */
  70715. var BaiduMap = /*#__PURE__*/function (_TileImage) {
  70716. BaiduMap_inherits(BaiduMap, _TileImage);
  70717. var _super = BaiduMap_createSuper(BaiduMap);
  70718. function BaiduMap(opt_options) {
  70719. var _this;
  70720. BaiduMap_classCallCheck(this, BaiduMap);
  70721. var options = opt_options || {};
  70722. var attributions = options.attributions || "Map Data © 2018 Baidu - GS(2016)2089号 - Data © 长地万方 with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>";
  70723. var tileGrid = BaiduMap.defaultTileGrid();
  70724. var crossOrigin = options.crossOrigin !== undefined ? options.crossOrigin : 'anonymous';
  70725. var url = options.url !== undefined ? options.url : 'http://online1.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20170408';
  70726. var hidpi = options.hidpi || (window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI) > 1;
  70727. url = url.replace('{styles}', hidpi ? 'ph' : 'pl');
  70728. _this = _super.call(this, {
  70729. attributions: attributions,
  70730. cacheSize: options.cacheSize,
  70731. crossOrigin: crossOrigin,
  70732. opaque: options.opaque !== undefined ? options.opaque : true,
  70733. maxZoom: options.maxZoom !== undefined ? options.maxZoom : 19,
  70734. reprojectionErrorThreshold: options.reprojectionErrorThreshold,
  70735. tileLoadFunction: options.tileLoadFunction,
  70736. projection: 'EPSG:3857',
  70737. wrapX: options.wrapX,
  70738. tilePixelRatio: hidpi ? 2 : 1,
  70739. tileGrid: tileGrid,
  70740. tileUrlFunction: tileUrlFunction
  70741. });
  70742. if (options.tileProxy) {
  70743. _this.tileProxy = options.tileProxy;
  70744. }
  70745. var me = BaiduMap_assertThisInitialized(_this); // eslint-disable-next-line no-unused-vars
  70746. function tileUrlFunction(tileCoord, pixelRatio, projection) {
  70747. var tempUrl = url.replace('{z}', tileCoord[0].toString()).replace('{x}', tileCoord[1].toString()).replace('{y}', function () {
  70748. console.log(core_Util_Util.getOlVersion());
  70749. var y = ['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1 ? tileCoord[2] : -tileCoord[2] - 1;
  70750. return y.toString();
  70751. }).replace('{-y}', function () {
  70752. var z = tileCoord[0];
  70753. var range = tileGrid.getFullTileRange(z);
  70754. external_ol_asserts_namespaceObject.assert(range, 55); // The {-y} placeholder requires a tile grid with extent
  70755. var y = range.getHeight() + tileCoord[2];
  70756. return y.toString();
  70757. }); //支持代理
  70758. if (me.tileProxy) {
  70759. tempUrl = me.tileProxy + encodeURIComponent(tempUrl);
  70760. }
  70761. return tempUrl;
  70762. }
  70763. return _this;
  70764. } // TODO 确认这个方法是否要开出去
  70765. /**
  70766. * @function ol.source.BaiduMap.defaultTileGrid
  70767. * @description 获取默认瓦片格网。
  70768. * @returns {ol/tilegrid/TileGrid} 返回瓦片格网对象。
  70769. */
  70770. BaiduMap_createClass(BaiduMap, null, [{
  70771. key: "defaultTileGrid",
  70772. value: function defaultTileGrid() {
  70773. var tileGird = new (external_ol_tilegrid_TileGrid_default())({
  70774. extent: [-33554432, -33554432, 33554432, 33554432],
  70775. resolutions: [131072 * 2, 131072, 65536, 32768, 16284, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5],
  70776. origin: [0, 0],
  70777. minZoom: 3
  70778. });
  70779. return tileGird;
  70780. }
  70781. }]);
  70782. return BaiduMap;
  70783. }((external_ol_source_TileImage_default()));
  70784. ;// CONCATENATED MODULE: external "ol.size"
  70785. var external_ol_size_namespaceObject = ol.size;
  70786. ;// CONCATENATED MODULE: external "ol.tilegrid"
  70787. var external_ol_tilegrid_namespaceObject = ol.tilegrid;
  70788. ;// CONCATENATED MODULE: ./src/openlayers/mapping/ImageSuperMapRest.js
  70789. function ImageSuperMapRest_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ImageSuperMapRest_typeof = function _typeof(obj) { return typeof obj; }; } else { ImageSuperMapRest_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ImageSuperMapRest_typeof(obj); }
  70790. function ImageSuperMapRest_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70791. function ImageSuperMapRest_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  70792. function ImageSuperMapRest_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageSuperMapRest_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageSuperMapRest_defineProperties(Constructor, staticProps); return Constructor; }
  70793. function ImageSuperMapRest_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ImageSuperMapRest_setPrototypeOf(subClass, superClass); }
  70794. function ImageSuperMapRest_setPrototypeOf(o, p) { ImageSuperMapRest_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ImageSuperMapRest_setPrototypeOf(o, p); }
  70795. function ImageSuperMapRest_createSuper(Derived) { var hasNativeReflectConstruct = ImageSuperMapRest_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ImageSuperMapRest_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ImageSuperMapRest_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ImageSuperMapRest_possibleConstructorReturn(this, result); }; }
  70796. function ImageSuperMapRest_possibleConstructorReturn(self, call) { if (call && (ImageSuperMapRest_typeof(call) === "object" || typeof call === "function")) { return call; } return ImageSuperMapRest_assertThisInitialized(self); }
  70797. function ImageSuperMapRest_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70798. function ImageSuperMapRest_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  70799. function ImageSuperMapRest_getPrototypeOf(o) { ImageSuperMapRest_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ImageSuperMapRest_getPrototypeOf(o); }
  70800. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  70801. * This program are made available under the terms of the Apache License, Version 2.0
  70802. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70803. /**
  70804. * @class ol.source.ImageSuperMapRest
  70805. * @category iServer Map
  70806. * @classdesc SuperMap iServer Image 图层源。
  70807. * @param {Object} options - 参数。
  70808. * @param {string} options.url - 地图服务地址,例如: http://{ip}:{port}/iserver/services/map-world/rest/maps/World。
  70809. * @param {ol/tilegrid/TileGrid} [options.tileGrid] - 瓦片网格对象。
  70810. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务类型 ISERVER|IPORTAL|ONLINE。
  70811. * @param {boolean} [options.redirect=false] - 是否重定向。
  70812. * @param {boolean} [options.transparent=true] - 瓦片是否透明。
  70813. * @param {boolean} [options.cacheEnabled=true] - 是否使用服务端的缓存,true 表示使用服务端的缓存。
  70814. * @param {Object} [options.prjCoordSys] - 请求的地图的坐标参考系统。当此参数设置的坐标系统不同于地图的原有坐标系统时, 系统会进行动态投影,并返回动态投影后的地图瓦片。例如:{"epsgCode":3857}。
  70815. * @param {string} [options.layersID] - 获取进行切片的地图图层 ID,即指定进行地图切片的图层,可以是临时图层集,也可以是当前地图中图层的组合。
  70816. * @param {boolean} [options.clipRegionEnabled = false] - 是否地图只显示该区域覆盖的部分。true 表示地图只显示该区域覆盖的部分。
  70817. * @param {(ol/geom/Geometry|ol/geom/Geometry)} [options.clipRegion] - 地图显示裁剪的区域。是一个面对象,当 clipRegionEnabled = true 时有效,即地图只显示该区域覆盖的部分。
  70818. * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。如果为 true,则同一范围内的对象会直接压盖;如果为 false 则通过 overlapDisplayedOptions 控制对象不压盖显示。
  70819. * @param {SuperMap.OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 避免地图对象压盖显示的过滤选项,当 overlapDisplayed 为 false 时有效,用来增强对地图对象压盖时的处理。
  70820. * @param {string} [options.tileversion] - 切片版本名称,_cache 为 true 时有效。
  70821. * @param {string} [options.tileProxy] - 代理地址。
  70822. * @param {(SuperMap.NDVIParameter|SuperMap.HillshadeParameter)} [options.rasterfunction] - 栅格分析参数。
  70823. * @param {string} [options.format = 'png'] - 瓦片表述类型,支持 "png" 、"webp"、"bmp" 、"jpg"、 "gif" 等图片类型。
  70824. * @extends {ol/source/TileImage}
  70825. */
  70826. var ImageSuperMapRest = /*#__PURE__*/function (_TileImage) {
  70827. ImageSuperMapRest_inherits(ImageSuperMapRest, _TileImage);
  70828. var _super = ImageSuperMapRest_createSuper(ImageSuperMapRest);
  70829. function ImageSuperMapRest(options) {
  70830. var _this;
  70831. ImageSuperMapRest_classCallCheck(this, ImageSuperMapRest);
  70832. if (options.url === undefined) {
  70833. return ImageSuperMapRest_possibleConstructorReturn(_this);
  70834. }
  70835. options.attributions = options.attributions || "Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <a href='https://iclient.supermap.io/'>© SuperMap iClient</a>";
  70836. options.format = options.format ? options.format : 'png';
  70837. var layerUrl = Util.urlPathAppend(options.url, "image." + options.format);
  70838. options.serverType = options.serverType || ServerType.ISERVER; //为url添加安全认证信息片段
  70839. layerUrl = appendCredential(options.url, layerUrl, options.serverType);
  70840. /**
  70841. * @function ol.source.ImageSuperMapRest.prototype.appendCredential
  70842. * @description 添加凭据。
  70843. * @param {string} url - 地址。
  70844. * @param {Object} [serverType=SuperMap.ServerType.ISERVER] - 服务类型 ISERVER|IPORTAL|ONLINE。
  70845. * @returns {string} 添加生成后的新地址。
  70846. */
  70847. function appendCredential(id, url, serverType) {
  70848. var newUrl = url,
  70849. credential,
  70850. value;
  70851. switch (serverType) {
  70852. case ServerType.IPORTAL:
  70853. value = SecurityManager.getToken(id);
  70854. credential = value ? new Credential(value, 'token') : null;
  70855. if (!credential) {
  70856. value = SecurityManager.getKey(id);
  70857. credential = value ? new Credential(value, 'key') : null;
  70858. }
  70859. break;
  70860. case ServerType.ONLINE:
  70861. value = SecurityManager.getKey(id);
  70862. credential = value ? new Credential(value, 'key') : null;
  70863. break;
  70864. default:
  70865. //iserver or others
  70866. value = SecurityManager.getToken(id);
  70867. credential = value ? new Credential(value, 'token') : null;
  70868. break;
  70869. }
  70870. if (credential) {
  70871. newUrl = Util.urlAppend(newUrl, credential.getUrlParameters());
  70872. }
  70873. return newUrl;
  70874. }
  70875. var params = {}; //切片是否透明
  70876. var transparent = options.transparent !== undefined ? options.transparent : true;
  70877. params['transparent'] = transparent; //是否使用缓存吗,默认为true
  70878. var cacheEnabled = options.cacheEnabled !== undefined ? options.cacheEnabled : true;
  70879. params['cacheEnabled'] = cacheEnabled; //如果有layersID,则是在使用专题图
  70880. if (options.layersID !== undefined) {
  70881. params['layersID'] = options.layersID;
  70882. } //是否重定向,默认为false
  70883. var redirect = false;
  70884. if (options.redirect !== undefined) {
  70885. redirect = options.redirect;
  70886. }
  70887. params['redirect'] = redirect;
  70888. if (options.prjCoordSys) {
  70889. params['prjCoordSys'] = JSON.stringify(options.prjCoordSys);
  70890. }
  70891. if (options.clipRegionEnabled && options.clipRegion instanceof (external_ol_geom_Geometry_default())) {
  70892. options.clipRegion = core_Util_Util.toSuperMapGeometry(new (external_ol_format_GeoJSON_default())().writeGeometryObject(options.clipRegion));
  70893. options.clipRegion = Util.toJSON(ServerGeometry.fromGeometry(options.clipRegion));
  70894. params['clipRegionEnabled'] = options.clipRegionEnabled;
  70895. params['clipRegion'] = JSON.stringify(options.clipRegion);
  70896. }
  70897. if (!!options.overlapDisplayed && options.overlapDisplayedOptions) {
  70898. // options.overlapDisplayedOptions = options.overlapDisplayedOptions;
  70899. params['overlapDisplayed'] = options.overlapDisplayed;
  70900. params['overlapDisplayedOptions'] = options.overlapDisplayedOptions.toString();
  70901. }
  70902. if (cacheEnabled === true && options.tileversion) {
  70903. params['tileversion'] = options.tileversion;
  70904. }
  70905. if (options.rasterfunction) {
  70906. params['rasterfunction'] = JSON.stringify(options.rasterfunction);
  70907. }
  70908. layerUrl = Util.urlAppend(encodeURI(layerUrl), Util.getParameterString(params));
  70909. _this = _super.call(this, {
  70910. attributions: options.attributions,
  70911. cacheSize: options.cacheSize,
  70912. crossOrigin: options.crossOrigin,
  70913. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  70914. opaque: options.opaque,
  70915. projection: options.projection,
  70916. reprojectionErrorThreshold: options.reprojectionErrorThreshold,
  70917. state: options.state,
  70918. tileClass: options.tileClass,
  70919. tileGrid: options.tileGrid,
  70920. tileLoadFunction: options.tileLoadFunction,
  70921. tilePixelRatio: options.tilePixelRatio,
  70922. tileUrlFunction: tileUrlFunction,
  70923. wrapX: options.wrapX !== undefined ? options.wrapX : false,
  70924. cacheEnabled: options.cacheEnabled,
  70925. layersID: options.layersID
  70926. }); //存储一个cacheEnabled
  70927. _this.cacheEnabled = cacheEnabled;
  70928. if (options.tileProxy) {
  70929. _this.tileProxy = options.tileProxy;
  70930. }
  70931. var me = ImageSuperMapRest_assertThisInitialized(_this);
  70932. /**
  70933. * @function ol.source.ImageSuperMapRest.prototype.tileUrlFunction
  70934. * @param {Object} tileCoord - 瓦片坐标系。
  70935. * @param {Object} pixelRatio - 像素密度。
  70936. * @param {string} projection - 投影参考系。
  70937. * @description 瓦片地址参数。
  70938. * @returns {string} 返回瓦片地址参数
  70939. */
  70940. function tileUrlFunction(tileCoord, pixelRatio, projection) {
  70941. if (!this.tileGrid) {
  70942. this.tileGrid = this.getTileGridForProjection && this.getTileGridForProjection(projection);
  70943. }
  70944. if (!this.tileGrid) {
  70945. if (options.extent) {
  70946. this.tileGrid = ImageSuperMapRest.createTileGrid(options.extent);
  70947. if (this.resolutions) {
  70948. this.tileGrid.resolutions = me.resolutions;
  70949. }
  70950. } else {
  70951. if (projection.getCode() === 'EPSG:3857') {
  70952. this.tileGrid = ImageSuperMapRest.createTileGrid([-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892]);
  70953. this.extent = [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892];
  70954. }
  70955. if (projection.getCode() === 'EPSG:4326') {
  70956. this.tileGrid = ImageSuperMapRest.createTileGrid([-180, -90, 180, 90]);
  70957. this.extent = [-180, -90, 180, 90];
  70958. }
  70959. }
  70960. }
  70961. var tileExtent = this.tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent_);
  70962. var tileSize = external_ol_size_namespaceObject.toSize(this.tileGrid.getTileSize(tileCoord[0]), this.tmpSize);
  70963. var url = layerUrl + encodeURI('&width=' + tileSize[0] + '&height=' + tileSize[1] + '&viewBounds=' + '{"leftBottom" : {"x":' + tileExtent[0] + ',"y":' + tileExtent[1] + '},"rightTop" : {"x":' + tileExtent[2] + ',"y":' + tileExtent[3] + '}}'); //支持代理
  70964. if (me.tileProxy) {
  70965. url = me.tileProxy + encodeURIComponent(url);
  70966. } //不启用缓存时启用时间戳
  70967. if (!me.cacheEnabled) {
  70968. url += '&_t=' + new Date().getTime();
  70969. }
  70970. return url;
  70971. }
  70972. return _this;
  70973. }
  70974. /**
  70975. * @function ol.source.ImageSuperMapRest.optionsFromMapJSON
  70976. * @param {string} url - 地址。
  70977. * @param {Object} mapJSONObj - 地图 JSON。
  70978. * @description 获取地图 JSON 信息。
  70979. */
  70980. ImageSuperMapRest_createClass(ImageSuperMapRest, null, [{
  70981. key: "optionsFromMapJSON",
  70982. value: function optionsFromMapJSON(url, mapJSONObj) {
  70983. var options = {};
  70984. options.url = url;
  70985. options.crossOrigin = 'anonymous';
  70986. var extent = [mapJSONObj.bounds.left, mapJSONObj.bounds.bottom, mapJSONObj.bounds.right, mapJSONObj.bounds.top];
  70987. var resolutions = getResolutions();
  70988. function getResolutions() {
  70989. var level = 17;
  70990. var dpi = 96;
  70991. var width = extent[2] - extent[0];
  70992. var height = extent[3] - extent[1];
  70993. var tileSize = width >= height ? width : height;
  70994. var maxReolution;
  70995. if (tileSize === width) {
  70996. maxReolution = tileSize / mapJSONObj.viewer.width;
  70997. } else {
  70998. maxReolution = tileSize / mapJSONObj.viewer.height;
  70999. }
  71000. var resolutions = [];
  71001. var unit = REST_Unit.METER;
  71002. if (mapJSONObj.coordUnit === REST_Unit.DEGREE) {
  71003. unit = REST_Unit.DEGREE;
  71004. }
  71005. if (mapJSONObj.visibleScales.length > 0) {
  71006. for (var i = 0; i < mapJSONObj.visibleScales.length; i++) {
  71007. resolutions.push(core_Util_Util.scaleToResolution(mapJSONObj.visibleScales[i], dpi, unit));
  71008. }
  71009. } else {
  71010. for (var _i = 0; _i < level; _i++) {
  71011. resolutions.push(maxReolution / Math.pow(2, _i));
  71012. }
  71013. }
  71014. function sortNumber(a, b) {
  71015. return b - a;
  71016. }
  71017. return resolutions.sort(sortNumber);
  71018. }
  71019. options.tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  71020. extent: extent,
  71021. resolutions: resolutions
  71022. });
  71023. return options;
  71024. }
  71025. /**
  71026. * @function ol.source.ImageSuperMapRest.createTileGrid
  71027. * @param {number} extent - 长度。
  71028. * @param {number} maxZoom - 最大的放大级别。
  71029. * @param {number} minZoom - 最小的放大级别。
  71030. * @param {number} tileSize - 瓦片的尺寸。
  71031. * @param {number} origin - 原点。
  71032. * @description 创建网格切片。
  71033. * @returns {ol/tilegrid/TileGrid} 创建的网格切片
  71034. */
  71035. }, {
  71036. key: "createTileGrid",
  71037. value: function createTileGrid(extent, maxZoom, minZoom, tileSize, origin) {
  71038. var tilegrid = external_ol_tilegrid_namespaceObject.createXYZ({
  71039. extent: extent,
  71040. maxZoom: maxZoom,
  71041. minZoom: minZoom,
  71042. tileSize: tileSize
  71043. });
  71044. return new (external_ol_tilegrid_TileGrid_default())({
  71045. extent: extent,
  71046. minZoom: minZoom,
  71047. origin: origin,
  71048. resolutions: tilegrid.getResolutions(),
  71049. tileSize: tilegrid.getTileSize()
  71050. });
  71051. }
  71052. }]);
  71053. return ImageSuperMapRest;
  71054. }((external_ol_source_TileImage_default()));
  71055. ;// CONCATENATED MODULE: external "ol.source.XYZ"
  71056. var external_ol_source_XYZ_namespaceObject = ol.source.XYZ;
  71057. var external_ol_source_XYZ_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_XYZ_namespaceObject);
  71058. ;// CONCATENATED MODULE: ./src/openlayers/mapping/SuperMapCloud.js
  71059. function SuperMapCloud_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SuperMapCloud_typeof = function _typeof(obj) { return typeof obj; }; } else { SuperMapCloud_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SuperMapCloud_typeof(obj); }
  71060. function SuperMapCloud_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71061. function SuperMapCloud_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SuperMapCloud_setPrototypeOf(subClass, superClass); }
  71062. function SuperMapCloud_setPrototypeOf(o, p) { SuperMapCloud_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SuperMapCloud_setPrototypeOf(o, p); }
  71063. function SuperMapCloud_createSuper(Derived) { var hasNativeReflectConstruct = SuperMapCloud_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SuperMapCloud_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SuperMapCloud_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SuperMapCloud_possibleConstructorReturn(this, result); }; }
  71064. function SuperMapCloud_possibleConstructorReturn(self, call) { if (call && (SuperMapCloud_typeof(call) === "object" || typeof call === "function")) { return call; } return SuperMapCloud_assertThisInitialized(self); }
  71065. function SuperMapCloud_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  71066. function SuperMapCloud_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  71067. function SuperMapCloud_getPrototypeOf(o) { SuperMapCloud_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SuperMapCloud_getPrototypeOf(o); }
  71068. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  71069. * This program are made available under the terms of the Apache License, Version 2.0
  71070. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71071. /**
  71072. * @class ol.source.SuperMapCloud
  71073. * @category ThirdPartyMap
  71074. * @classdesc 超图云地图图层源。
  71075. * @param {Object} opt_options - 参数。
  71076. * @param {string} [opt_options.url='http://t2.dituhui.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}'] - 服务地址。
  71077. * @param {string} [opt_options.tileProxy] - 代理地址。
  71078. * @extends {ol/source/XYZ}
  71079. */
  71080. var SuperMapCloud = /*#__PURE__*/function (_XYZ) {
  71081. SuperMapCloud_inherits(SuperMapCloud, _XYZ);
  71082. var _super = SuperMapCloud_createSuper(SuperMapCloud);
  71083. function SuperMapCloud(opt_options) {
  71084. var _this;
  71085. SuperMapCloud_classCallCheck(this, SuperMapCloud);
  71086. var options = opt_options || {};
  71087. var attributions = options.attributions || "Map Data ©2014 SuperMap - GS(2014)6070号-data©Navinfo with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>";
  71088. var mapName = options.mapName || 'quanguo';
  71089. var mapType = options.mapType || 'web';
  71090. var url = options.url || 'http://t2.dituhui.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}';
  71091. url = url.replace('{mapName}', mapName).replace('{type}', mapType);
  71092. var superOptions = {
  71093. attributions: attributions,
  71094. cacheSize: options.cacheSize,
  71095. crossOrigin: options.crossOrigin,
  71096. opaque: options.opaque === undefined ? true : options.opaque,
  71097. maxZoom: options.maxZoom || 18,
  71098. reprojectionErrorThreshold: options.reprojectionErrorThreshold,
  71099. url: url,
  71100. wrapX: options.wrapX
  71101. }; //需要代理时走自定义 tileLoadFunction,否则走默认的tileLoadFunction
  71102. if (options.tileProxy) {
  71103. superOptions.tileLoadFunction = tileLoadFunction;
  71104. }
  71105. _this = _super.call(this, superOptions);
  71106. if (options.tileProxy) {
  71107. _this.tileProxy = options.tileProxy;
  71108. } //需要代理时,走以下代码
  71109. var me = SuperMapCloud_assertThisInitialized(_this);
  71110. function tileLoadFunction(imageTile, src) {
  71111. //支持代理
  71112. imageTile.getImage().src = me.tileProxy + encodeURIComponent(src);
  71113. }
  71114. return _this;
  71115. }
  71116. return SuperMapCloud;
  71117. }((external_ol_source_XYZ_default()));
  71118. ;// CONCATENATED MODULE: external "ol.source.WMTS"
  71119. var external_ol_source_WMTS_namespaceObject = ol.source.WMTS;
  71120. var external_ol_source_WMTS_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_WMTS_namespaceObject);
  71121. ;// CONCATENATED MODULE: external "ol.tilegrid.WMTS"
  71122. var external_ol_tilegrid_WMTS_namespaceObject = ol.tilegrid.WMTS;
  71123. var external_ol_tilegrid_WMTS_default = /*#__PURE__*/__webpack_require__.n(external_ol_tilegrid_WMTS_namespaceObject);
  71124. ;// CONCATENATED MODULE: ./src/openlayers/mapping/Tianditu.js
  71125. function Tianditu_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Tianditu_typeof = function _typeof(obj) { return typeof obj; }; } else { Tianditu_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Tianditu_typeof(obj); }
  71126. function Tianditu_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71127. function Tianditu_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  71128. function Tianditu_createClass(Constructor, protoProps, staticProps) { if (protoProps) Tianditu_defineProperties(Constructor.prototype, protoProps); if (staticProps) Tianditu_defineProperties(Constructor, staticProps); return Constructor; }
  71129. function Tianditu_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Tianditu_setPrototypeOf(subClass, superClass); }
  71130. function Tianditu_setPrototypeOf(o, p) { Tianditu_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Tianditu_setPrototypeOf(o, p); }
  71131. function Tianditu_createSuper(Derived) { var hasNativeReflectConstruct = Tianditu_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Tianditu_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Tianditu_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Tianditu_possibleConstructorReturn(this, result); }; }
  71132. function Tianditu_possibleConstructorReturn(self, call) { if (call && (Tianditu_typeof(call) === "object" || typeof call === "function")) { return call; } return Tianditu_assertThisInitialized(self); }
  71133. function Tianditu_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  71134. function Tianditu_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  71135. function Tianditu_getPrototypeOf(o) { Tianditu_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Tianditu_getPrototypeOf(o); }
  71136. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  71137. * This program are made available under the terms of the Apache License, Version 2.0
  71138. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71139. /**
  71140. * @class ol.source.Tianditu
  71141. * @category ThirdPartyMap
  71142. * @classdesc 天地图图层源。
  71143. * @param {Object} opt_options - 参数。
  71144. * @param {string} [opt_options.url='http://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?'] - 服务地址。
  71145. * @param {string} opt_options.key - 天地图服务密钥。详见{@link http://lbs.tianditu.gov.cn/server/MapService.html}
  71146. * @param {string} [opt_options.layerType='vec'] - 图层类型。(vec:矢量图层,img:影像图层,ter:地形图层)
  71147. * @param {string} [opt_options.attributions] - 版权描述信息。
  71148. * @param {number} [opt_options.cacheSize = 2048] - 缓冲大小。
  71149. * @param {function} [opt_options.tileLoadFunction] - 切片加载完成后执行函数。
  71150. * @param {string} [opt_options.style] - 图层风格。
  71151. * @param {string} [opt_options.format='tiles'] - 格式。
  71152. * @param {boolean} [opt_options.isLabel] - 是否是标注图层。
  71153. * @param {boolean} [opt_options.opaque=true] - 是否透明。
  71154. * @param {string} [opt_options.tileProxy] - 代理地址。
  71155. * @extends {ol/source/WMTS}
  71156. */
  71157. var Tianditu = /*#__PURE__*/function (_WMTS) {
  71158. Tianditu_inherits(Tianditu, _WMTS);
  71159. var _super = Tianditu_createSuper(Tianditu);
  71160. function Tianditu(opt_options) {
  71161. var _this;
  71162. Tianditu_classCallCheck(this, Tianditu);
  71163. var layerLabelMap = {
  71164. "vec": "cva",
  71165. "ter": "cta",
  71166. "img": "cia"
  71167. };
  71168. var layerZoomMap = {
  71169. "vec": 18,
  71170. "ter": 14,
  71171. "img": 18
  71172. };
  71173. var options = opt_options || {};
  71174. var attributions = options.attributions || "Map Data <a href='http://www.tianditu.gov.cn' target='_blank'><img style='background-color:transparent;bottom:2px;opacity:1;' " + "src='http://api.tianditu.gov.cn/img/map/logo.png' width='53px' height='22px' opacity='0'></a> with " + "<span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>";
  71175. options.layerType = options.layerType || "vec";
  71176. options.layerType = options.isLabel ? layerLabelMap[options.layerType] : options.layerType;
  71177. options.matrixSet = options.projection === 'EPSG:4326' || options.projection === 'EPSG:4490' ? "c" : "w";
  71178. if (!options.url && !options.urls) {
  71179. options.url = "http://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?";
  71180. }
  71181. if (options.key) {
  71182. options.url = "".concat(options.url, "tk=").concat(options.key);
  71183. }
  71184. options.url = options.url.replace("{layer}", options.layerType).replace("{proj}", options.matrixSet);
  71185. var tileGrid = options.tileGrid || Tianditu.getTileGrid(options.projection || 'EPSG:3857');
  71186. var crossOrigin = options.crossOrigin !== undefined ? options.crossOrigin : 'anonymous';
  71187. var superOptions = {
  71188. version: options.version || '1.0.0',
  71189. format: options.format || 'tiles',
  71190. dimensions: options.dimensions || {},
  71191. layer: options.layerType,
  71192. matrixSet: options.matrixSet,
  71193. tileGrid: tileGrid,
  71194. style: options.style || 'default',
  71195. attributions: attributions,
  71196. cacheSize: options.cacheSize,
  71197. crossOrigin: crossOrigin,
  71198. opaque: options.opaque === undefined ? true : options.opaque,
  71199. maxZoom: layerZoomMap[options.layerType],
  71200. reprojectionErrorThreshold: options.reprojectionErrorThreshold,
  71201. url: options.url,
  71202. urls: options.urls,
  71203. projection: options.projection || 'EPSG:3857',
  71204. wrapX: options.wrapX
  71205. }; //需要代理时走自定义 tileLoadFunction,否则走默认的tileLoadFunction
  71206. if (options.tileProxy) {
  71207. superOptions.tileLoadFunction = tileLoadFunction;
  71208. }
  71209. _this = _super.call(this, superOptions);
  71210. if (options.tileProxy) {
  71211. _this.tileProxy = options.tileProxy;
  71212. } //需要代理时,走以下代码
  71213. var me = Tianditu_assertThisInitialized(_this);
  71214. function tileLoadFunction(imageTile, src) {
  71215. //支持代理
  71216. imageTile.getImage().src = me.tileProxy + encodeURIComponent(src);
  71217. }
  71218. return _this;
  71219. }
  71220. /**
  71221. * @function ol.source.Tianditu.getTileGrid
  71222. * @description 获取瓦片网格。
  71223. * @param {Object} projection - 投影参考对象。
  71224. * @returns {ol/tilegrid/WMTS} 返回瓦片网格对象
  71225. */
  71226. Tianditu_createClass(Tianditu, null, [{
  71227. key: "getTileGrid",
  71228. value: function getTileGrid(projection) {
  71229. if (projection === "EPSG:4326" || projection === "EPSG:4490") {
  71230. return Tianditu.default4326TileGrid();
  71231. }
  71232. return Tianditu.default3857TileGrid();
  71233. }
  71234. /**
  71235. * @function ol.source.Tianditu.default4326TileGrid
  71236. * @description 获取默认 4326 网格瓦片。
  71237. * @returns {ol/tilegrid/WMTS} 返回默认 4326 网格瓦片对象。
  71238. */
  71239. }, {
  71240. key: "default4326TileGrid",
  71241. value: function default4326TileGrid() {
  71242. var tdt_WGS84_resolutions = [];
  71243. var matrixIds = [];
  71244. for (var i = 1; i < 19; i++) {
  71245. tdt_WGS84_resolutions.push(0.703125 * 2 / Math.pow(2, i));
  71246. matrixIds.push(i);
  71247. }
  71248. var tileGird = new (external_ol_tilegrid_WMTS_default())({
  71249. extent: [-180, -90, 180, 90],
  71250. resolutions: tdt_WGS84_resolutions,
  71251. origin: [-180, 90],
  71252. matrixIds: matrixIds,
  71253. minZoom: 1
  71254. });
  71255. return tileGird;
  71256. }
  71257. /**
  71258. * @function ol.source.Tianditu.default3857TileGrid
  71259. * @description 获取默认 3857 网格瓦片。
  71260. * @returns {ol/tilegrid/WMTS} 返回默认 3857 网格瓦片对象。
  71261. */
  71262. }, {
  71263. key: "default3857TileGrid",
  71264. value: function default3857TileGrid() {
  71265. var tdt_Mercator_resolutions = [];
  71266. var matrixIds = [];
  71267. for (var i = 1; i < 19; i++) {
  71268. tdt_Mercator_resolutions.push(78271.5169640203125 * 2 / Math.pow(2, i));
  71269. matrixIds.push(i);
  71270. }
  71271. var tileGird = new (external_ol_tilegrid_WMTS_default())({
  71272. extent: [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892],
  71273. resolutions: tdt_Mercator_resolutions,
  71274. matrixIds: matrixIds,
  71275. origin: [-20037508.3427892, 20037508.3427892],
  71276. minZoom: 1
  71277. });
  71278. return tileGird;
  71279. }
  71280. }]);
  71281. return Tianditu;
  71282. }((external_ol_source_WMTS_default()));
  71283. ;// CONCATENATED MODULE: ./src/openlayers/mapping/TileSuperMapRest.js
  71284. function TileSuperMapRest_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TileSuperMapRest_typeof = function _typeof(obj) { return typeof obj; }; } else { TileSuperMapRest_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TileSuperMapRest_typeof(obj); }
  71285. function TileSuperMapRest_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71286. function TileSuperMapRest_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  71287. function TileSuperMapRest_createClass(Constructor, protoProps, staticProps) { if (protoProps) TileSuperMapRest_defineProperties(Constructor.prototype, protoProps); if (staticProps) TileSuperMapRest_defineProperties(Constructor, staticProps); return Constructor; }
  71288. function TileSuperMapRest_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) TileSuperMapRest_setPrototypeOf(subClass, superClass); }
  71289. function TileSuperMapRest_setPrototypeOf(o, p) { TileSuperMapRest_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TileSuperMapRest_setPrototypeOf(o, p); }
  71290. function TileSuperMapRest_createSuper(Derived) { var hasNativeReflectConstruct = TileSuperMapRest_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TileSuperMapRest_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TileSuperMapRest_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TileSuperMapRest_possibleConstructorReturn(this, result); }; }
  71291. function TileSuperMapRest_possibleConstructorReturn(self, call) { if (call && (TileSuperMapRest_typeof(call) === "object" || typeof call === "function")) { return call; } return TileSuperMapRest_assertThisInitialized(self); }
  71292. function TileSuperMapRest_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  71293. function TileSuperMapRest_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  71294. function TileSuperMapRest_getPrototypeOf(o) { TileSuperMapRest_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TileSuperMapRest_getPrototypeOf(o); }
  71295. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  71296. * This program are made available under the terms of the Apache License, Version 2.0
  71297. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71298. /**
  71299. * @class ol.source.TileSuperMapRest
  71300. * @category iServer Map
  71301. * @classdesc SuperMap iServer TileImage 图层源。
  71302. * @param {Object} options - 参数。
  71303. * @param {string} options.url - 地图服务地址,例如: http://{ip}:{port}/iserver/services/map-world/rest/maps/World。
  71304. * @param {ol/tilegrid/TileGrid} [options.tileGrid] - 瓦片网格对象。当不指定时,会通过 options.extent 或投影范围生成。
  71305. * @param {SuperMap.ServerType} [options.serverType=ServerType.ISERVER] - 服务类型 ISERVER|IPORTAL|ONLINE。
  71306. * @param {boolean} [options.redirect = false] - 是否重定向。
  71307. * @param {boolean} [options.transparent = true] - 瓦片是否透明。
  71308. * @param {boolean} [options.cacheEnabled = true] - 是否使用服务端的缓存。
  71309. * @param {Object} [options.prjCoordSys] - 请求的地图的坐标参考系统。当此参数设置的坐标系统不同于地图的原有坐标系统时, 系统会进行动态投影,并返回动态投影后的地图瓦片。例如:{"epsgCode":3857}。
  71310. * @param {string} [options.layersID] - 获取进行切片的地图图层 ID,即指定进行地图切片的图层,可以是临时图层集,也可以是当前地图中图层的组合。
  71311. * @param {boolean} [options.clipRegionEnabled = false] - 是否只地图只显示该区域覆盖的部分。true 表示地图只显示该区域覆盖的部分。
  71312. * @param {(ol/geom/Geometry|ol/geom/Geometry)} [options.clipRegion] - 地图显示裁剪的区域。是一个面对象,当 clipRegionEnabled = true 时有效,即地图只显示该区域覆盖的部分。
  71313. * @param {boolean} [options.overlapDisplayed = false] - 地图对象在同一范围内时,是否重叠显示。如果为 true,则同一范围内的对象会直接压盖;如果为 false 则通过 overlapDisplayedOptions 控制对象不压盖显示。
  71314. * @param {SuperMap.OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 避免地图对象压盖显示的过滤选项,当 overlapDisplayed 为 false 时有效,用来增强对地图对象压盖时的处理。
  71315. * @param {string} [options.tileversion] - 切片版本名称,_cache 为 true 时有效。
  71316. * @param {string} [options.tileProxy] - 代理地址。
  71317. * @param {string} [options.format = 'png'] - 瓦片表述类型,支持 "png" 、"webp"、"bmp" 、"jpg"、 "gif" 等图片类型。
  71318. * @param {(SuperMap.NDVIParameter|SuperMap.HillshadeParameter)} [options.rasterfunction] - 栅格分析参数。
  71319. * @extends {ol/source/TileImage}
  71320. */
  71321. var TileSuperMapRest = /*#__PURE__*/function (_TileImage) {
  71322. TileSuperMapRest_inherits(TileSuperMapRest, _TileImage);
  71323. var _super = TileSuperMapRest_createSuper(TileSuperMapRest);
  71324. function TileSuperMapRest(options) {
  71325. var _this;
  71326. TileSuperMapRest_classCallCheck(this, TileSuperMapRest);
  71327. options = options || {};
  71328. if (options.url === undefined) {
  71329. return TileSuperMapRest_possibleConstructorReturn(_this);
  71330. }
  71331. options.attributions = options.attributions || "Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>";
  71332. options.format = options.format ? options.format : 'png';
  71333. options.serverType = options.serverType || ServerType.ISERVER;
  71334. _this = _super.call(this, {
  71335. attributions: options.attributions,
  71336. cacheSize: options.cacheSize,
  71337. crossOrigin: options.crossOrigin,
  71338. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  71339. opaque: options.opaque,
  71340. projection: options.projection,
  71341. reprojectionErrorThreshold: options.reprojectionErrorThreshold,
  71342. state: options.state,
  71343. tileClass: options.tileClass,
  71344. tileGrid: options.tileGrid,
  71345. tileLoadFunction: options.tileLoadFunction,
  71346. tilePixelRatio: options.tilePixelRatio,
  71347. tileUrlFunction: tileUrlFunction,
  71348. wrapX: options.wrapX !== undefined ? options.wrapX : false,
  71349. cacheEnabled: options.cacheEnabled,
  71350. layersID: options.layersID
  71351. });
  71352. if (options.tileProxy) {
  71353. _this.tileProxy = options.tileProxy;
  71354. }
  71355. _this.options = options;
  71356. _this._url = options.url; //当前切片在切片集中的index
  71357. _this.tileSetsIndex = -1;
  71358. _this.tempIndex = -1;
  71359. _this.dpi = _this.options.dpi || 96;
  71360. var me = TileSuperMapRest_assertThisInitialized(_this);
  71361. var layerUrl = Util.urlPathAppend(options.url, 'tileImage.' + options.format);
  71362. function appendCredential(url, serverType) {
  71363. var newUrl = url,
  71364. credential,
  71365. value;
  71366. switch (serverType) {
  71367. case ServerType.IPORTAL:
  71368. value = SecurityManager.getToken(me._url);
  71369. credential = value ? new Credential(value, 'token') : null;
  71370. if (!credential) {
  71371. value = SecurityManager.getKey(me._url);
  71372. credential = value ? new Credential(value, 'key') : null;
  71373. }
  71374. break;
  71375. case ServerType.ONLINE:
  71376. value = SecurityManager.getKey(me._url);
  71377. credential = value ? new Credential(value, 'key') : null;
  71378. break;
  71379. default:
  71380. //iserver or others
  71381. value = SecurityManager.getToken(me._url);
  71382. credential = value ? new Credential(value, 'token') : null;
  71383. break;
  71384. }
  71385. if (credential) {
  71386. newUrl = Util.urlAppend(newUrl, credential.getUrlParameters());
  71387. }
  71388. return newUrl;
  71389. }
  71390. /**
  71391. * @function ol.source.TileSuperMapRest.prototype.getAllRequestParams
  71392. * @description 获取全部请求参数。
  71393. */
  71394. function getAllRequestParams() {
  71395. var me = this,
  71396. params = {};
  71397. params['redirect'] = options.redirect !== undefined ? options.redirect : false; //切片是否透明
  71398. params['transparent'] = options.transparent !== undefined ? options.transparent : true;
  71399. params['cacheEnabled'] = !(options.cacheEnabled === false); //存储一个cacheEnabled参数
  71400. me.cacheEnabled = params['cacheEnabled'];
  71401. params['_cache'] = params['cacheEnabled']; //设置切片原点
  71402. if (this.origin) {
  71403. params['origin'] = JSON.stringify({
  71404. x: this.origin[0],
  71405. y: this.origin[1]
  71406. });
  71407. }
  71408. if (options.prjCoordSys) {
  71409. params['prjCoordSys'] = JSON.stringify(options.prjCoordSys);
  71410. }
  71411. if (options.layersID) {
  71412. params['layersID'] = options.layersID.toString();
  71413. }
  71414. if (options.clipRegion instanceof (external_ol_geom_Geometry_default())) {
  71415. options.clipRegionEnabled = true;
  71416. options.clipRegion = core_Util_Util.toSuperMapGeometry(new (external_ol_format_GeoJSON_default())().writeGeometryObject(options.clipRegion));
  71417. options.clipRegion = Util.toJSON(ServerGeometry.fromGeometry(options.clipRegion));
  71418. params['clipRegionEnabled'] = options.clipRegionEnabled;
  71419. params['clipRegion'] = JSON.stringify(options.clipRegion);
  71420. }
  71421. if (!options.overlapDisplayed) {
  71422. params['overlapDisplayed'] = false;
  71423. if (options.overlapDisplayedOptions) {
  71424. params['overlapDisplayedOptions'] = me.overlapDisplayedOptions.toString();
  71425. }
  71426. } else {
  71427. params['overlapDisplayed'] = true;
  71428. }
  71429. if (params.cacheEnabled && options.tileversion) {
  71430. params['tileversion'] = options.tileversion.toString();
  71431. }
  71432. if (options.rasterfunction) {
  71433. params['rasterfunction'] = JSON.stringify(options.rasterfunction);
  71434. }
  71435. return params;
  71436. }
  71437. /**
  71438. * @function ol.source.TileSuperMapRest.prototype.getFullRequestUrl
  71439. * @description 获取完整的请求地址。
  71440. */
  71441. function getFullRequestUrl() {
  71442. if (this._paramsChanged) {
  71443. this._layerUrl = createLayerUrl.call(this);
  71444. this._paramsChanged = false;
  71445. }
  71446. return this._layerUrl || createLayerUrl.call(this);
  71447. }
  71448. /**
  71449. * @function ol.source.TileSuperMapRest.prototype.createLayerUrl
  71450. * @description 获取新建图层地址。
  71451. */
  71452. function createLayerUrl() {
  71453. this.requestParams = this.requestParams || getAllRequestParams.call(this);
  71454. this._layerUrl = Util.urlAppend(layerUrl, Util.getParameterString(this.requestParams)); //为url添加安全认证信息片段
  71455. this._layerUrl = appendCredential(this._layerUrl, options.serverType);
  71456. return this._layerUrl;
  71457. }
  71458. function tileUrlFunction(tileCoord, pixelRatio, projection) {
  71459. if (!me.tileGrid) {
  71460. if (options.extent) {
  71461. me.tileGrid = TileSuperMapRest.createTileGrid(options.extent);
  71462. if (me.resolutions) {
  71463. me.tileGrid.resolutions = me.resolutions;
  71464. }
  71465. } else {
  71466. if (projection.getCode() === 'EPSG:3857') {
  71467. me.tileGrid = TileSuperMapRest.createTileGrid([-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892]);
  71468. me.extent = [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892];
  71469. }
  71470. if (projection.getCode() === 'EPSG:4326') {
  71471. me.tileGrid = TileSuperMapRest.createTileGrid([-180, -90, 180, 90]);
  71472. me.extent = [-180, -90, 180, 90];
  71473. }
  71474. }
  71475. }
  71476. me.origin = me.tileGrid.getOrigin(0);
  71477. var z = tileCoord[0];
  71478. var x = tileCoord[1];
  71479. var y = ['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1 ? -tileCoord[2] - 1 : tileCoord[2];
  71480. var resolution = me.tileGrid.getResolution(z);
  71481. var dpi = me.dpi || 96;
  71482. var unit = projection.getUnits() || REST_Unit.DEGREE; // OGC WKT 解析出单位是 degree
  71483. if (unit === 'degrees' || unit === 'degree') {
  71484. unit = REST_Unit.DEGREE;
  71485. } //通过wkt方式自定义坐标系的时候,是meter
  71486. if (unit === 'm' || unit === 'meter') {
  71487. unit = REST_Unit.METER;
  71488. }
  71489. var scale = core_Util_Util.resolutionToScale(resolution, dpi, unit);
  71490. var tileSize = external_ol_size_namespaceObject.toSize(me.tileGrid.getTileSize(z, me.tmpSize));
  71491. var layerUrl = getFullRequestUrl.call(me);
  71492. var url = layerUrl + encodeURI('&x=' + x + '&y=' + y + '&width=' + tileSize[0] + '&height=' + tileSize[1] + '&scale=' + scale); //支持代理
  71493. if (me.tileProxy) {
  71494. url = me.tileProxy + encodeURIComponent(url);
  71495. }
  71496. if (!me.cacheEnabled) {
  71497. url += '&_t=' + new Date().getTime();
  71498. }
  71499. return url;
  71500. }
  71501. return _this;
  71502. }
  71503. /**
  71504. * @function ol.source.TileSuperMapRest.prototype.setTileSetsInfo
  71505. * @description 设置瓦片集信息。
  71506. * @param {Object} tileSets - 瓦片集合。
  71507. */
  71508. TileSuperMapRest_createClass(TileSuperMapRest, [{
  71509. key: "setTileSetsInfo",
  71510. value: function setTileSetsInfo(tileSets) {
  71511. this.tileSets = tileSets;
  71512. if (core_Util_Util.isArray(this.tileSets)) {
  71513. this.tileSets = tileSets[0];
  71514. }
  71515. if (!this.tileSets) {
  71516. return;
  71517. }
  71518. this.dispatchEvent({
  71519. type: 'tilesetsinfoloaded',
  71520. value: {
  71521. tileVersions: this.tileSets.tileVersions
  71522. }
  71523. });
  71524. this.changeTilesVersion();
  71525. }
  71526. /**
  71527. * @function ol.source.TileSuperMapRest.prototype.lastTilesVersion
  71528. * @description 请求上一个版本切片,并重新绘制。
  71529. */
  71530. }, {
  71531. key: "lastTilesVersion",
  71532. value: function lastTilesVersion() {
  71533. this.tempIndex = this.tileSetsIndex - 1;
  71534. this.changeTilesVersion();
  71535. }
  71536. /**
  71537. * @function ol.source.TileSuperMapRest.prototype.nextTilesVersion
  71538. * @description 请求下一个版本切片,并重新绘制。
  71539. */
  71540. }, {
  71541. key: "nextTilesVersion",
  71542. value: function nextTilesVersion() {
  71543. this.tempIndex = this.tileSetsIndex + 1;
  71544. this.changeTilesVersion();
  71545. }
  71546. /**
  71547. * @function ol.source.TileSuperMapRest.prototype.changeTilesVersion
  71548. * @description 切换到某一版本的切片,并重绘。通过 this.tempIndex 保存需要切换的版本索引。
  71549. */
  71550. }, {
  71551. key: "changeTilesVersion",
  71552. value: function changeTilesVersion() {
  71553. var me = this; //切片版本集信息是否存在
  71554. if (me.tileSets == null) {
  71555. return;
  71556. }
  71557. if (me.tempIndex === me.tileSetsIndex || this.tempIndex < 0) {
  71558. return;
  71559. } //检测index是否可用
  71560. var tileVersions = me.tileSets.tileVersions;
  71561. if (tileVersions && me.tempIndex < tileVersions.length && me.tempIndex >= 0) {
  71562. var name = tileVersions[me.tempIndex].name;
  71563. var result = me.mergeTileVersionParam(name);
  71564. if (result) {
  71565. me.tileSetsIndex = me.tempIndex;
  71566. me.dispatchEvent({
  71567. type: 'tileversionschanged',
  71568. value: {
  71569. tileVersion: tileVersions[me.tempIndex]
  71570. }
  71571. });
  71572. }
  71573. }
  71574. }
  71575. /**
  71576. * @function ol.source.TileSuperMapRest.prototype.updateCurrentTileSetsIndex
  71577. * @description 更新当前切片集索引,目前主要提供给控件使用。
  71578. * @param {number} index - 索引号。
  71579. */
  71580. }, {
  71581. key: "updateCurrentTileSetsIndex",
  71582. value: function updateCurrentTileSetsIndex(index) {
  71583. this.tempIndex = index;
  71584. }
  71585. /**
  71586. * @function ol.source.TileSuperMapRest.prototype.mergeTileVersionParam
  71587. * @description 更改 URL 请求参数中的切片版本号,并重绘。
  71588. * @param {Object} version - 版本信息。
  71589. * @returns {boolean} 是否成功。
  71590. */
  71591. }, {
  71592. key: "mergeTileVersionParam",
  71593. value: function mergeTileVersionParam(version) {
  71594. if (version) {
  71595. this.requestParams['tileversion'] = version;
  71596. this._paramsChanged = true;
  71597. this.refresh();
  71598. return true;
  71599. }
  71600. return false;
  71601. }
  71602. /**
  71603. * @function ol.source.TileSuperMapRest.optionsFromMapJSON
  71604. * @description 从 MapJSON 中获取参数对象。
  71605. * @param {string} url - 地址。
  71606. * @param {Object} mapJSONObj - 地图 JSON 对象。
  71607. */
  71608. }], [{
  71609. key: "optionsFromMapJSON",
  71610. value: function optionsFromMapJSON(url, mapJSONObj) {
  71611. var options = {};
  71612. options.url = url;
  71613. options.crossOrigin = 'anonymous';
  71614. var extent = [mapJSONObj.bounds.left, mapJSONObj.bounds.bottom, mapJSONObj.bounds.right, mapJSONObj.bounds.top];
  71615. var resolutions = getResolutions();
  71616. function getResolutions() {
  71617. var level = 22;
  71618. var dpi = 96;
  71619. var width = extent[2] - extent[0];
  71620. var height = extent[3] - extent[1];
  71621. var tileSize = width >= height ? width : height;
  71622. var maxReolution;
  71623. if (tileSize === width) {
  71624. maxReolution = tileSize / mapJSONObj.viewer.width;
  71625. } else {
  71626. maxReolution = tileSize / mapJSONObj.viewer.height;
  71627. }
  71628. var resolutions = [];
  71629. var unit = REST_Unit.METER;
  71630. if (mapJSONObj.coordUnit === REST_Unit.DEGREE) {
  71631. unit = REST_Unit.DEGREE;
  71632. }
  71633. if (mapJSONObj.visibleScalesEnabled && mapJSONObj.visibleScales && mapJSONObj.visibleScales.length > 0) {
  71634. for (var i = 0; i < mapJSONObj.visibleScales.length; i++) {
  71635. resolutions.push(core_Util_Util.scaleToResolution(mapJSONObj.visibleScales[i], dpi, unit));
  71636. }
  71637. } else {
  71638. for (var _i = 0; _i < level; _i++) {
  71639. resolutions.push(maxReolution / Math.pow(2, _i));
  71640. }
  71641. }
  71642. function sortNumber(a, b) {
  71643. return b - a;
  71644. }
  71645. return resolutions.sort(sortNumber);
  71646. }
  71647. options.tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  71648. extent: extent,
  71649. resolutions: resolutions
  71650. });
  71651. return options;
  71652. }
  71653. /**
  71654. * @function ol.source.TileSuperMapRest.createTileGrid
  71655. * @description 创建切片网格。
  71656. * @param {number} extent - 长度。
  71657. * @param {number} maxZoom - 最大的放大级别。
  71658. * @param {number} minZoom - 最小的放大级别。
  71659. * @param {number} tileSize - 瓦片的尺寸。
  71660. * @param {number} origin - 原点。
  71661. * */
  71662. }, {
  71663. key: "createTileGrid",
  71664. value: function createTileGrid(extent, maxZoom, minZoom, tileSize, origin) {
  71665. var tilegrid = external_ol_tilegrid_namespaceObject.createXYZ({
  71666. extent: extent,
  71667. maxZoom: maxZoom,
  71668. minZoom: minZoom,
  71669. tileSize: tileSize
  71670. });
  71671. return new (external_ol_tilegrid_TileGrid_default())({
  71672. extent: extent,
  71673. minZoom: minZoom,
  71674. origin: origin,
  71675. resolutions: tilegrid.getResolutions(),
  71676. tileSize: tilegrid.getTileSize()
  71677. });
  71678. }
  71679. }]);
  71680. return TileSuperMapRest;
  71681. }((external_ol_source_TileImage_default()));
  71682. // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
  71683. var regenerator = __webpack_require__(898);
  71684. var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
  71685. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/global.js
  71686. /* harmony default export */ function global(defs) {
  71687. defs('EPSG:4326', "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");
  71688. defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
  71689. 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");
  71690. defs.WGS84 = defs['EPSG:4326'];
  71691. defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857
  71692. defs.GOOGLE = defs['EPSG:3857'];
  71693. defs['EPSG:900913'] = defs['EPSG:3857'];
  71694. defs['EPSG:102113'] = defs['EPSG:3857'];
  71695. }
  71696. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/constants/values.js
  71697. var PJD_3PARAM = 1;
  71698. var PJD_7PARAM = 2;
  71699. var PJD_WGS84 = 4; // WGS84 or equivalent
  71700. var PJD_NODATUM = 5; // WGS84 or equivalent
  71701. var SEC_TO_RAD = 4.84813681109535993589914102357e-6;
  71702. var HALF_PI = Math.PI / 2; // ellipoid pj_set_ell.c
  71703. var SIXTH = 0.1666666666666666667;
  71704. /* 1/6 */
  71705. var RA4 = 0.04722222222222222222;
  71706. /* 17/360 */
  71707. var RA6 = 0.02215608465608465608;
  71708. var EPSLN = 1.0e-10; // you'd think you could use Number.EPSILON above but that makes
  71709. // Mollweide get into an infinate loop.
  71710. var D2R = 0.01745329251994329577;
  71711. var R2D = 57.29577951308232088;
  71712. var FORTPI = Math.PI / 4;
  71713. var TWO_PI = Math.PI * 2; // SPI is slightly greater than Math.PI, so values that exceed the -180..180
  71714. // degree range by a tiny amount don't get wrapped. This prevents points that
  71715. // have drifted from their original location along the 180th meridian (due to
  71716. // floating point error) from changing their sign.
  71717. var SPI = 3.14159265359;
  71718. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/constants/PrimeMeridian.js
  71719. var PrimeMeridian_exports = {};
  71720. PrimeMeridian_exports.greenwich = 0.0; //"0dE",
  71721. PrimeMeridian_exports.lisbon = -9.131906111111; //"9d07'54.862\"W",
  71722. PrimeMeridian_exports.paris = 2.337229166667; //"2d20'14.025\"E",
  71723. PrimeMeridian_exports.bogota = -74.080916666667; //"74d04'51.3\"W",
  71724. PrimeMeridian_exports.madrid = -3.687938888889; //"3d41'16.58\"W",
  71725. PrimeMeridian_exports.rome = 12.452333333333; //"12d27'8.4\"E",
  71726. PrimeMeridian_exports.bern = 7.439583333333; //"7d26'22.5\"E",
  71727. PrimeMeridian_exports.jakarta = 106.807719444444; //"106d48'27.79\"E",
  71728. PrimeMeridian_exports.ferro = -17.666666666667; //"17d40'W",
  71729. PrimeMeridian_exports.brussels = 4.367975; //"4d22'4.71\"E",
  71730. PrimeMeridian_exports.stockholm = 18.058277777778; //"18d3'29.8\"E",
  71731. PrimeMeridian_exports.athens = 23.7163375; //"23d42'58.815\"E",
  71732. PrimeMeridian_exports.oslo = 10.722916666667; //"10d43'22.5\"E"
  71733. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/constants/units.js
  71734. /* harmony default export */ var constants_units = ({
  71735. ft: {
  71736. to_meter: 0.3048
  71737. },
  71738. 'us-ft': {
  71739. to_meter: 1200 / 3937
  71740. }
  71741. });
  71742. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/match.js
  71743. var ignoredChar = /[\s_\-\/\(\)]/g;
  71744. function match(obj, key) {
  71745. if (obj[key]) {
  71746. return obj[key];
  71747. }
  71748. var keys = Object.keys(obj);
  71749. var lkey = key.toLowerCase().replace(ignoredChar, '');
  71750. var i = -1;
  71751. var testkey, processedKey;
  71752. while (++i < keys.length) {
  71753. testkey = keys[i];
  71754. processedKey = testkey.toLowerCase().replace(ignoredChar, '');
  71755. if (processedKey === lkey) {
  71756. return obj[testkey];
  71757. }
  71758. }
  71759. }
  71760. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projString.js
  71761. /* harmony default export */ function projString(defData) {
  71762. var self = {};
  71763. var paramObj = defData.split('+').map(function (v) {
  71764. return v.trim();
  71765. }).filter(function (a) {
  71766. return a;
  71767. }).reduce(function (p, a) {
  71768. var split = a.split('=');
  71769. split.push(true);
  71770. p[split[0].toLowerCase()] = split[1];
  71771. return p;
  71772. }, {});
  71773. var paramName, paramVal, paramOutname;
  71774. var params = {
  71775. proj: 'projName',
  71776. datum: 'datumCode',
  71777. rf: function rf(v) {
  71778. self.rf = parseFloat(v);
  71779. },
  71780. lat_0: function lat_0(v) {
  71781. self.lat0 = v * D2R;
  71782. },
  71783. lat_1: function lat_1(v) {
  71784. self.lat1 = v * D2R;
  71785. },
  71786. lat_2: function lat_2(v) {
  71787. self.lat2 = v * D2R;
  71788. },
  71789. lat_ts: function lat_ts(v) {
  71790. self.lat_ts = v * D2R;
  71791. },
  71792. lon_0: function lon_0(v) {
  71793. self.long0 = v * D2R;
  71794. },
  71795. lon_1: function lon_1(v) {
  71796. self.long1 = v * D2R;
  71797. },
  71798. lon_2: function lon_2(v) {
  71799. self.long2 = v * D2R;
  71800. },
  71801. alpha: function alpha(v) {
  71802. self.alpha = parseFloat(v) * D2R;
  71803. },
  71804. lonc: function lonc(v) {
  71805. self.longc = v * D2R;
  71806. },
  71807. x_0: function x_0(v) {
  71808. self.x0 = parseFloat(v);
  71809. },
  71810. y_0: function y_0(v) {
  71811. self.y0 = parseFloat(v);
  71812. },
  71813. k_0: function k_0(v) {
  71814. self.k0 = parseFloat(v);
  71815. },
  71816. k: function k(v) {
  71817. self.k0 = parseFloat(v);
  71818. },
  71819. a: function a(v) {
  71820. self.a = parseFloat(v);
  71821. },
  71822. b: function b(v) {
  71823. self.b = parseFloat(v);
  71824. },
  71825. r_a: function r_a() {
  71826. self.R_A = true;
  71827. },
  71828. zone: function zone(v) {
  71829. self.zone = parseInt(v, 10);
  71830. },
  71831. south: function south() {
  71832. self.utmSouth = true;
  71833. },
  71834. towgs84: function towgs84(v) {
  71835. self.datum_params = v.split(",").map(function (a) {
  71836. return parseFloat(a);
  71837. });
  71838. },
  71839. to_meter: function to_meter(v) {
  71840. self.to_meter = parseFloat(v);
  71841. },
  71842. units: function units(v) {
  71843. self.units = v;
  71844. var unit = match(constants_units, v);
  71845. if (unit) {
  71846. self.to_meter = unit.to_meter;
  71847. }
  71848. },
  71849. from_greenwich: function from_greenwich(v) {
  71850. self.from_greenwich = v * D2R;
  71851. },
  71852. pm: function pm(v) {
  71853. var pm = match(PrimeMeridian_exports, v);
  71854. self.from_greenwich = (pm ? pm : parseFloat(v)) * D2R;
  71855. },
  71856. nadgrids: function nadgrids(v) {
  71857. if (v === '@null') {
  71858. self.datumCode = 'none';
  71859. } else {
  71860. self.nadgrids = v;
  71861. }
  71862. },
  71863. axis: function axis(v) {
  71864. var legalAxis = "ewnsud";
  71865. 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) {
  71866. self.axis = v;
  71867. }
  71868. }
  71869. };
  71870. for (paramName in paramObj) {
  71871. paramVal = paramObj[paramName];
  71872. if (paramName in params) {
  71873. paramOutname = params[paramName];
  71874. if (typeof paramOutname === 'function') {
  71875. paramOutname(paramVal);
  71876. } else {
  71877. self[paramOutname] = paramVal;
  71878. }
  71879. } else {
  71880. self[paramName] = paramVal;
  71881. }
  71882. }
  71883. if (typeof self.datumCode === 'string' && self.datumCode !== "WGS84") {
  71884. self.datumCode = self.datumCode.toLowerCase();
  71885. }
  71886. return self;
  71887. }
  71888. ;// CONCATENATED MODULE: ./node_modules/wkt-parser/parser.js
  71889. /* harmony default export */ var parser = (parseString);
  71890. var NEUTRAL = 1;
  71891. var KEYWORD = 2;
  71892. var NUMBER = 3;
  71893. var QUOTED = 4;
  71894. var AFTERQUOTE = 5;
  71895. var ENDED = -1;
  71896. var whitespace = /\s/;
  71897. var latin = /[A-Za-z]/;
  71898. var keyword = /[A-Za-z84]/;
  71899. var endThings = /[,\]]/;
  71900. var digets = /[\d\.E\-\+]/; // const ignoredChar = /[\s_\-\/\(\)]/g;
  71901. function Parser(text) {
  71902. if (typeof text !== 'string') {
  71903. throw new Error('not a string');
  71904. }
  71905. this.text = text.trim();
  71906. this.level = 0;
  71907. this.place = 0;
  71908. this.root = null;
  71909. this.stack = [];
  71910. this.currentObject = null;
  71911. this.state = NEUTRAL;
  71912. }
  71913. Parser.prototype.readCharicter = function () {
  71914. var _char = this.text[this.place++];
  71915. if (this.state !== QUOTED) {
  71916. while (whitespace.test(_char)) {
  71917. if (this.place >= this.text.length) {
  71918. return;
  71919. }
  71920. _char = this.text[this.place++];
  71921. }
  71922. }
  71923. switch (this.state) {
  71924. case NEUTRAL:
  71925. return this.neutral(_char);
  71926. case KEYWORD:
  71927. return this.keyword(_char);
  71928. case QUOTED:
  71929. return this.quoted(_char);
  71930. case AFTERQUOTE:
  71931. return this.afterquote(_char);
  71932. case NUMBER:
  71933. return this.number(_char);
  71934. case ENDED:
  71935. return;
  71936. }
  71937. };
  71938. Parser.prototype.afterquote = function (_char2) {
  71939. if (_char2 === '"') {
  71940. this.word += '"';
  71941. this.state = QUOTED;
  71942. return;
  71943. }
  71944. if (endThings.test(_char2)) {
  71945. this.word = this.word.trim();
  71946. this.afterItem(_char2);
  71947. return;
  71948. }
  71949. throw new Error('havn\'t handled "' + _char2 + '" in afterquote yet, index ' + this.place);
  71950. };
  71951. Parser.prototype.afterItem = function (_char3) {
  71952. if (_char3 === ',') {
  71953. if (this.word !== null) {
  71954. this.currentObject.push(this.word);
  71955. }
  71956. this.word = null;
  71957. this.state = NEUTRAL;
  71958. return;
  71959. }
  71960. if (_char3 === ']') {
  71961. this.level--;
  71962. if (this.word !== null) {
  71963. this.currentObject.push(this.word);
  71964. this.word = null;
  71965. }
  71966. this.state = NEUTRAL;
  71967. this.currentObject = this.stack.pop();
  71968. if (!this.currentObject) {
  71969. this.state = ENDED;
  71970. }
  71971. return;
  71972. }
  71973. };
  71974. Parser.prototype.number = function (_char4) {
  71975. if (digets.test(_char4)) {
  71976. this.word += _char4;
  71977. return;
  71978. }
  71979. if (endThings.test(_char4)) {
  71980. this.word = parseFloat(this.word);
  71981. this.afterItem(_char4);
  71982. return;
  71983. }
  71984. throw new Error('havn\'t handled "' + _char4 + '" in number yet, index ' + this.place);
  71985. };
  71986. Parser.prototype.quoted = function (_char5) {
  71987. if (_char5 === '"') {
  71988. this.state = AFTERQUOTE;
  71989. return;
  71990. }
  71991. this.word += _char5;
  71992. return;
  71993. };
  71994. Parser.prototype.keyword = function (_char6) {
  71995. if (keyword.test(_char6)) {
  71996. this.word += _char6;
  71997. return;
  71998. }
  71999. if (_char6 === '[') {
  72000. var newObjects = [];
  72001. newObjects.push(this.word);
  72002. this.level++;
  72003. if (this.root === null) {
  72004. this.root = newObjects;
  72005. } else {
  72006. this.currentObject.push(newObjects);
  72007. }
  72008. this.stack.push(this.currentObject);
  72009. this.currentObject = newObjects;
  72010. this.state = NEUTRAL;
  72011. return;
  72012. }
  72013. if (endThings.test(_char6)) {
  72014. this.afterItem(_char6);
  72015. return;
  72016. }
  72017. throw new Error('havn\'t handled "' + _char6 + '" in keyword yet, index ' + this.place);
  72018. };
  72019. Parser.prototype.neutral = function (_char7) {
  72020. if (latin.test(_char7)) {
  72021. this.word = _char7;
  72022. this.state = KEYWORD;
  72023. return;
  72024. }
  72025. if (_char7 === '"') {
  72026. this.word = '';
  72027. this.state = QUOTED;
  72028. return;
  72029. }
  72030. if (digets.test(_char7)) {
  72031. this.word = _char7;
  72032. this.state = NUMBER;
  72033. return;
  72034. }
  72035. if (endThings.test(_char7)) {
  72036. this.afterItem(_char7);
  72037. return;
  72038. }
  72039. throw new Error('havn\'t handled "' + _char7 + '" in neutral yet, index ' + this.place);
  72040. };
  72041. Parser.prototype.output = function () {
  72042. while (this.place < this.text.length) {
  72043. this.readCharicter();
  72044. }
  72045. if (this.state === ENDED) {
  72046. return this.root;
  72047. }
  72048. throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
  72049. };
  72050. function parseString(txt) {
  72051. var parser = new Parser(txt);
  72052. return parser.output();
  72053. }
  72054. ;// CONCATENATED MODULE: ./node_modules/wkt-parser/process.js
  72055. function mapit(obj, key, value) {
  72056. if (Array.isArray(key)) {
  72057. value.unshift(key);
  72058. key = null;
  72059. }
  72060. var thing = key ? {} : obj;
  72061. var out = value.reduce(function (newObj, item) {
  72062. sExpr(item, newObj);
  72063. return newObj;
  72064. }, thing);
  72065. if (key) {
  72066. obj[key] = out;
  72067. }
  72068. }
  72069. function sExpr(v, obj) {
  72070. if (!Array.isArray(v)) {
  72071. obj[v] = true;
  72072. return;
  72073. }
  72074. var key = v.shift();
  72075. if (key === 'PARAMETER') {
  72076. key = v.shift();
  72077. }
  72078. if (v.length === 1) {
  72079. if (Array.isArray(v[0])) {
  72080. obj[key] = {};
  72081. sExpr(v[0], obj[key]);
  72082. return;
  72083. }
  72084. obj[key] = v[0];
  72085. return;
  72086. }
  72087. if (!v.length) {
  72088. obj[key] = true;
  72089. return;
  72090. }
  72091. if (key === 'TOWGS84') {
  72092. obj[key] = v;
  72093. return;
  72094. }
  72095. if (key === 'AXIS') {
  72096. if (!(key in obj)) {
  72097. obj[key] = [];
  72098. }
  72099. obj[key].push(v);
  72100. return;
  72101. }
  72102. if (!Array.isArray(key)) {
  72103. obj[key] = {};
  72104. }
  72105. var i;
  72106. switch (key) {
  72107. case 'UNIT':
  72108. case 'PRIMEM':
  72109. case 'VERT_DATUM':
  72110. obj[key] = {
  72111. name: v[0].toLowerCase(),
  72112. convert: v[1]
  72113. };
  72114. if (v.length === 3) {
  72115. sExpr(v[2], obj[key]);
  72116. }
  72117. return;
  72118. case 'SPHEROID':
  72119. case 'ELLIPSOID':
  72120. obj[key] = {
  72121. name: v[0],
  72122. a: v[1],
  72123. rf: v[2]
  72124. };
  72125. if (v.length === 4) {
  72126. sExpr(v[3], obj[key]);
  72127. }
  72128. return;
  72129. case 'PROJECTEDCRS':
  72130. case 'PROJCRS':
  72131. case 'GEOGCS':
  72132. case 'GEOCCS':
  72133. case 'PROJCS':
  72134. case 'LOCAL_CS':
  72135. case 'GEODCRS':
  72136. case 'GEODETICCRS':
  72137. case 'GEODETICDATUM':
  72138. case 'EDATUM':
  72139. case 'ENGINEERINGDATUM':
  72140. case 'VERT_CS':
  72141. case 'VERTCRS':
  72142. case 'VERTICALCRS':
  72143. case 'COMPD_CS':
  72144. case 'COMPOUNDCRS':
  72145. case 'ENGINEERINGCRS':
  72146. case 'ENGCRS':
  72147. case 'FITTED_CS':
  72148. case 'LOCAL_DATUM':
  72149. case 'DATUM':
  72150. v[0] = ['name', v[0]];
  72151. mapit(obj, key, v);
  72152. return;
  72153. default:
  72154. i = -1;
  72155. while (++i < v.length) {
  72156. if (!Array.isArray(v[i])) {
  72157. return sExpr(v, obj[key]);
  72158. }
  72159. }
  72160. return mapit(obj, key, v);
  72161. }
  72162. }
  72163. ;// CONCATENATED MODULE: ./node_modules/wkt-parser/index.js
  72164. function wkt_parser_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { wkt_parser_typeof = function _typeof(obj) { return typeof obj; }; } else { wkt_parser_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return wkt_parser_typeof(obj); }
  72165. var wkt_parser_D2R = 0.01745329251994329577;
  72166. function rename(obj, params) {
  72167. var outName = params[0];
  72168. var inName = params[1];
  72169. if (!(outName in obj) && inName in obj) {
  72170. obj[outName] = obj[inName];
  72171. if (params.length === 3) {
  72172. obj[outName] = params[2](obj[outName]);
  72173. }
  72174. }
  72175. }
  72176. function d2r(input) {
  72177. return input * wkt_parser_D2R;
  72178. }
  72179. function cleanWKT(wkt) {
  72180. if (wkt.type === 'GEOGCS') {
  72181. wkt.projName = 'longlat';
  72182. } else if (wkt.type === 'LOCAL_CS') {
  72183. wkt.projName = 'identity';
  72184. wkt.local = true;
  72185. } else {
  72186. if (wkt_parser_typeof(wkt.PROJECTION) === 'object') {
  72187. wkt.projName = Object.keys(wkt.PROJECTION)[0];
  72188. } else {
  72189. wkt.projName = wkt.PROJECTION;
  72190. }
  72191. }
  72192. if (wkt.AXIS) {
  72193. var axisOrder = '';
  72194. for (var i = 0, ii = wkt.AXIS.length; i < ii; ++i) {
  72195. var axis = wkt.AXIS[i];
  72196. var descriptor = axis[0].toLowerCase();
  72197. if (descriptor.indexOf('north') !== -1) {
  72198. axisOrder += 'n';
  72199. } else if (descriptor.indexOf('south') !== -1) {
  72200. axisOrder += 's';
  72201. } else if (descriptor.indexOf('east') !== -1) {
  72202. axisOrder += 'e';
  72203. } else if (descriptor.indexOf('west') !== -1) {
  72204. axisOrder += 'w';
  72205. }
  72206. }
  72207. if (axisOrder.length === 2) {
  72208. axisOrder += 'u';
  72209. }
  72210. if (axisOrder.length === 3) {
  72211. wkt.axis = axisOrder;
  72212. }
  72213. }
  72214. if (wkt.UNIT) {
  72215. wkt.units = wkt.UNIT.name.toLowerCase();
  72216. if (wkt.units === 'metre') {
  72217. wkt.units = 'meter';
  72218. }
  72219. if (wkt.UNIT.convert) {
  72220. if (wkt.type === 'GEOGCS') {
  72221. if (wkt.DATUM && wkt.DATUM.SPHEROID) {
  72222. wkt.to_meter = wkt.UNIT.convert * wkt.DATUM.SPHEROID.a;
  72223. }
  72224. } else {
  72225. wkt.to_meter = wkt.UNIT.convert;
  72226. }
  72227. }
  72228. }
  72229. var geogcs = wkt.GEOGCS;
  72230. if (wkt.type === 'GEOGCS') {
  72231. geogcs = wkt;
  72232. }
  72233. if (geogcs) {
  72234. //if(wkt.GEOGCS.PRIMEM&&wkt.GEOGCS.PRIMEM.convert){
  72235. // wkt.from_greenwich=wkt.GEOGCS.PRIMEM.convert*D2R;
  72236. //}
  72237. if (geogcs.DATUM) {
  72238. wkt.datumCode = geogcs.DATUM.name.toLowerCase();
  72239. } else {
  72240. wkt.datumCode = geogcs.name.toLowerCase();
  72241. }
  72242. if (wkt.datumCode.slice(0, 2) === 'd_') {
  72243. wkt.datumCode = wkt.datumCode.slice(2);
  72244. }
  72245. if (wkt.datumCode === 'new_zealand_geodetic_datum_1949' || wkt.datumCode === 'new_zealand_1949') {
  72246. wkt.datumCode = 'nzgd49';
  72247. }
  72248. if (wkt.datumCode === 'wgs_1984' || wkt.datumCode === 'world_geodetic_system_1984') {
  72249. if (wkt.PROJECTION === 'Mercator_Auxiliary_Sphere') {
  72250. wkt.sphere = true;
  72251. }
  72252. wkt.datumCode = 'wgs84';
  72253. }
  72254. if (wkt.datumCode.slice(-6) === '_ferro') {
  72255. wkt.datumCode = wkt.datumCode.slice(0, -6);
  72256. }
  72257. if (wkt.datumCode.slice(-8) === '_jakarta') {
  72258. wkt.datumCode = wkt.datumCode.slice(0, -8);
  72259. }
  72260. if (~wkt.datumCode.indexOf('belge')) {
  72261. wkt.datumCode = 'rnb72';
  72262. }
  72263. if (geogcs.DATUM && geogcs.DATUM.SPHEROID) {
  72264. wkt.ellps = geogcs.DATUM.SPHEROID.name.replace('_19', '').replace(/[Cc]larke\_18/, 'clrk');
  72265. if (wkt.ellps.toLowerCase().slice(0, 13) === 'international') {
  72266. wkt.ellps = 'intl';
  72267. }
  72268. wkt.a = geogcs.DATUM.SPHEROID.a;
  72269. wkt.rf = parseFloat(geogcs.DATUM.SPHEROID.rf, 10);
  72270. }
  72271. if (geogcs.DATUM && geogcs.DATUM.TOWGS84) {
  72272. wkt.datum_params = geogcs.DATUM.TOWGS84;
  72273. }
  72274. if (~wkt.datumCode.indexOf('osgb_1936')) {
  72275. wkt.datumCode = 'osgb36';
  72276. }
  72277. if (~wkt.datumCode.indexOf('osni_1952')) {
  72278. wkt.datumCode = 'osni52';
  72279. }
  72280. if (~wkt.datumCode.indexOf('tm65') || ~wkt.datumCode.indexOf('geodetic_datum_of_1965')) {
  72281. wkt.datumCode = 'ire65';
  72282. }
  72283. if (wkt.datumCode === 'ch1903+') {
  72284. wkt.datumCode = 'ch1903';
  72285. }
  72286. if (~wkt.datumCode.indexOf('israel')) {
  72287. wkt.datumCode = 'isr93';
  72288. }
  72289. }
  72290. if (wkt.b && !isFinite(wkt.b)) {
  72291. wkt.b = wkt.a;
  72292. }
  72293. function toMeter(input) {
  72294. var ratio = wkt.to_meter || 1;
  72295. return input * ratio;
  72296. }
  72297. var renamer = function renamer(a) {
  72298. return rename(wkt, a);
  72299. };
  72300. var list = [['standard_parallel_1', 'Standard_Parallel_1'], ['standard_parallel_2', 'Standard_Parallel_2'], ['false_easting', 'False_Easting'], ['false_northing', 'False_Northing'], ['central_meridian', 'Central_Meridian'], ['latitude_of_origin', 'Latitude_Of_Origin'], ['latitude_of_origin', 'Central_Parallel'], ['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']];
  72301. list.forEach(renamer);
  72302. if (!wkt.long0 && wkt.longc && (wkt.projName === 'Albers_Conic_Equal_Area' || wkt.projName === 'Lambert_Azimuthal_Equal_Area')) {
  72303. wkt.long0 = wkt.longc;
  72304. }
  72305. if (!wkt.lat_ts && wkt.lat1 && (wkt.projName === 'Stereographic_South_Pole' || wkt.projName === 'Polar Stereographic (variant B)')) {
  72306. wkt.lat0 = d2r(wkt.lat1 > 0 ? 90 : -90);
  72307. wkt.lat_ts = wkt.lat1;
  72308. }
  72309. }
  72310. /* harmony default export */ function wkt_parser(wkt) {
  72311. var lisp = parser(wkt);
  72312. var type = lisp.shift();
  72313. var name = lisp.shift();
  72314. lisp.unshift(['name', name]);
  72315. lisp.unshift(['type', type]);
  72316. var obj = {};
  72317. sExpr(lisp, obj);
  72318. cleanWKT(obj);
  72319. return obj;
  72320. }
  72321. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/defs.js
  72322. function defs(name) {
  72323. /*global console*/
  72324. var that = this;
  72325. if (arguments.length === 2) {
  72326. var def = arguments[1];
  72327. if (typeof def === 'string') {
  72328. if (def.charAt(0) === '+') {
  72329. defs[name] = projString(arguments[1]);
  72330. } else {
  72331. defs[name] = wkt_parser(arguments[1]);
  72332. }
  72333. } else {
  72334. defs[name] = def;
  72335. }
  72336. } else if (arguments.length === 1) {
  72337. if (Array.isArray(name)) {
  72338. return name.map(function (v) {
  72339. if (Array.isArray(v)) {
  72340. defs.apply(that, v);
  72341. } else {
  72342. defs(v);
  72343. }
  72344. });
  72345. } else if (typeof name === 'string') {
  72346. if (name in defs) {
  72347. return defs[name];
  72348. }
  72349. } else if ('EPSG' in name) {
  72350. defs['EPSG:' + name.EPSG] = name;
  72351. } else if ('ESRI' in name) {
  72352. defs['ESRI:' + name.ESRI] = name;
  72353. } else if ('IAU2000' in name) {
  72354. defs['IAU2000:' + name.IAU2000] = name;
  72355. } else {
  72356. console.log(name);
  72357. }
  72358. return;
  72359. }
  72360. }
  72361. global(defs);
  72362. /* harmony default export */ var lib_defs = (defs);
  72363. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/parseCode.js
  72364. function testObj(code) {
  72365. return typeof code === 'string';
  72366. }
  72367. function testDef(code) {
  72368. return code in lib_defs;
  72369. }
  72370. var codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS', 'GEOCCS', 'PROJCS', 'LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS'];
  72371. function testWKT(code) {
  72372. return codeWords.some(function (word) {
  72373. return code.indexOf(word) > -1;
  72374. });
  72375. }
  72376. var codes = ['3857', '900913', '3785', '102113'];
  72377. function checkMercator(item) {
  72378. var auth = match(item, 'authority');
  72379. if (!auth) {
  72380. return;
  72381. }
  72382. var code = match(auth, 'epsg');
  72383. return code && codes.indexOf(code) > -1;
  72384. }
  72385. function checkProjStr(item) {
  72386. var ext = match(item, 'extension');
  72387. if (!ext) {
  72388. return;
  72389. }
  72390. return match(ext, 'proj4');
  72391. }
  72392. function testProj(code) {
  72393. return code[0] === '+';
  72394. }
  72395. function parse(code) {
  72396. if (testObj(code)) {
  72397. //check to see if this is a WKT string
  72398. if (testDef(code)) {
  72399. return lib_defs[code];
  72400. }
  72401. if (testWKT(code)) {
  72402. var out = wkt_parser(code); // test of spetial case, due to this being a very common and often malformed
  72403. if (checkMercator(out)) {
  72404. return lib_defs["EPSG:3857"];
  72405. }
  72406. var maybeProjStr = checkProjStr(out);
  72407. if (maybeProjStr) {
  72408. return projString(maybeProjStr);
  72409. }
  72410. return out;
  72411. }
  72412. if (testProj(code)) {
  72413. return projString(code);
  72414. }
  72415. } else {
  72416. return code;
  72417. }
  72418. }
  72419. /* harmony default export */ var parseCode = (parse);
  72420. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/extend.js
  72421. /* harmony default export */ function extend(destination, source) {
  72422. destination = destination || {};
  72423. var value, property;
  72424. if (!source) {
  72425. return destination;
  72426. }
  72427. for (property in source) {
  72428. value = source[property];
  72429. if (value !== undefined) {
  72430. destination[property] = value;
  72431. }
  72432. }
  72433. return destination;
  72434. }
  72435. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/msfnz.js
  72436. /* harmony default export */ function msfnz(eccent, sinphi, cosphi) {
  72437. var con = eccent * sinphi;
  72438. return cosphi / Math.sqrt(1 - con * con);
  72439. }
  72440. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/sign.js
  72441. /* harmony default export */ function sign(x) {
  72442. return x < 0 ? -1 : 1;
  72443. }
  72444. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/adjust_lon.js
  72445. /* harmony default export */ function adjust_lon(x) {
  72446. return Math.abs(x) <= SPI ? x : x - sign(x) * TWO_PI;
  72447. }
  72448. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/tsfnz.js
  72449. /* harmony default export */ function tsfnz(eccent, phi, sinphi) {
  72450. var con = eccent * sinphi;
  72451. var com = 0.5 * eccent;
  72452. con = Math.pow((1 - con) / (1 + con), com);
  72453. return Math.tan(0.5 * (HALF_PI - phi)) / con;
  72454. }
  72455. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/phi2z.js
  72456. /* harmony default export */ function phi2z(eccent, ts) {
  72457. var eccnth = 0.5 * eccent;
  72458. var con, dphi;
  72459. var phi = HALF_PI - 2 * Math.atan(ts);
  72460. for (var i = 0; i <= 15; i++) {
  72461. con = eccent * Math.sin(phi);
  72462. dphi = HALF_PI - 2 * Math.atan(ts * Math.pow((1 - con) / (1 + con), eccnth)) - phi;
  72463. phi += dphi;
  72464. if (Math.abs(dphi) <= 0.0000000001) {
  72465. return phi;
  72466. }
  72467. } //console.log("phi2z has NoConvergence");
  72468. return -9999;
  72469. }
  72470. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/merc.js
  72471. function init() {
  72472. var con = this.b / this.a;
  72473. this.es = 1 - con * con;
  72474. if (!('x0' in this)) {
  72475. this.x0 = 0;
  72476. }
  72477. if (!('y0' in this)) {
  72478. this.y0 = 0;
  72479. }
  72480. this.e = Math.sqrt(this.es);
  72481. if (this.lat_ts) {
  72482. if (this.sphere) {
  72483. this.k0 = Math.cos(this.lat_ts);
  72484. } else {
  72485. this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
  72486. }
  72487. } else {
  72488. if (!this.k0) {
  72489. if (this.k) {
  72490. this.k0 = this.k;
  72491. } else {
  72492. this.k0 = 1;
  72493. }
  72494. }
  72495. }
  72496. }
  72497. /* Mercator forward equations--mapping lat,long to x,y
  72498. --------------------------------------------------*/
  72499. function forward(p) {
  72500. var lon = p.x;
  72501. var lat = p.y; // convert to radians
  72502. if (lat * R2D > 90 && lat * R2D < -90 && lon * R2D > 180 && lon * R2D < -180) {
  72503. return null;
  72504. }
  72505. var x, y;
  72506. if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
  72507. return null;
  72508. } else {
  72509. if (this.sphere) {
  72510. x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
  72511. y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat));
  72512. } else {
  72513. var sinphi = Math.sin(lat);
  72514. var ts = tsfnz(this.e, lat, sinphi);
  72515. x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
  72516. y = this.y0 - this.a * this.k0 * Math.log(ts);
  72517. }
  72518. p.x = x;
  72519. p.y = y;
  72520. return p;
  72521. }
  72522. }
  72523. /* Mercator inverse equations--mapping x,y to lat/long
  72524. --------------------------------------------------*/
  72525. function inverse(p) {
  72526. var x = p.x - this.x0;
  72527. var y = p.y - this.y0;
  72528. var lon, lat;
  72529. if (this.sphere) {
  72530. lat = HALF_PI - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));
  72531. } else {
  72532. var ts = Math.exp(-y / (this.a * this.k0));
  72533. lat = phi2z(this.e, ts);
  72534. if (lat === -9999) {
  72535. return null;
  72536. }
  72537. }
  72538. lon = adjust_lon(this.long0 + x / (this.a * this.k0));
  72539. p.x = lon;
  72540. p.y = lat;
  72541. return p;
  72542. }
  72543. var names = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "merc"];
  72544. /* harmony default export */ var merc = ({
  72545. init: init,
  72546. forward: forward,
  72547. inverse: inverse,
  72548. names: names
  72549. });
  72550. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/longlat.js
  72551. function longlat_init() {//no-op for longlat
  72552. }
  72553. function identity(pt) {
  72554. return pt;
  72555. }
  72556. var longlat_names = ["longlat", "identity"];
  72557. /* harmony default export */ var longlat = ({
  72558. init: longlat_init,
  72559. forward: identity,
  72560. inverse: identity,
  72561. names: longlat_names
  72562. });
  72563. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections.js
  72564. var projs = [merc, longlat];
  72565. var projections_names = {};
  72566. var projStore = [];
  72567. function add(proj, i) {
  72568. var len = projStore.length;
  72569. if (!proj.names) {
  72570. console.log(i);
  72571. return true;
  72572. }
  72573. projStore[len] = proj;
  72574. proj.names.forEach(function (n) {
  72575. projections_names[n.toLowerCase()] = len;
  72576. });
  72577. return this;
  72578. }
  72579. function get(name) {
  72580. if (!name) {
  72581. return false;
  72582. }
  72583. var n = name.toLowerCase();
  72584. if (typeof projections_names[n] !== 'undefined' && projStore[projections_names[n]]) {
  72585. return projStore[projections_names[n]];
  72586. }
  72587. }
  72588. function start() {
  72589. projs.forEach(add);
  72590. }
  72591. /* harmony default export */ var projections = ({
  72592. start: start,
  72593. add: add,
  72594. get: get
  72595. });
  72596. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/constants/Ellipsoid.js
  72597. var Ellipsoid_exports = {};
  72598. Ellipsoid_exports.MERIT = {
  72599. a: 6378137.0,
  72600. rf: 298.257,
  72601. ellipseName: "MERIT 1983"
  72602. };
  72603. Ellipsoid_exports.SGS85 = {
  72604. a: 6378136.0,
  72605. rf: 298.257,
  72606. ellipseName: "Soviet Geodetic System 85"
  72607. };
  72608. Ellipsoid_exports.GRS80 = {
  72609. a: 6378137.0,
  72610. rf: 298.257222101,
  72611. ellipseName: "GRS 1980(IUGG, 1980)"
  72612. };
  72613. Ellipsoid_exports.IAU76 = {
  72614. a: 6378140.0,
  72615. rf: 298.257,
  72616. ellipseName: "IAU 1976"
  72617. };
  72618. Ellipsoid_exports.airy = {
  72619. a: 6377563.396,
  72620. b: 6356256.910,
  72621. ellipseName: "Airy 1830"
  72622. };
  72623. Ellipsoid_exports.APL4 = {
  72624. a: 6378137,
  72625. rf: 298.25,
  72626. ellipseName: "Appl. Physics. 1965"
  72627. };
  72628. Ellipsoid_exports.NWL9D = {
  72629. a: 6378145.0,
  72630. rf: 298.25,
  72631. ellipseName: "Naval Weapons Lab., 1965"
  72632. };
  72633. Ellipsoid_exports.mod_airy = {
  72634. a: 6377340.189,
  72635. b: 6356034.446,
  72636. ellipseName: "Modified Airy"
  72637. };
  72638. Ellipsoid_exports.andrae = {
  72639. a: 6377104.43,
  72640. rf: 300.0,
  72641. ellipseName: "Andrae 1876 (Den., Iclnd.)"
  72642. };
  72643. Ellipsoid_exports.aust_SA = {
  72644. a: 6378160.0,
  72645. rf: 298.25,
  72646. ellipseName: "Australian Natl & S. Amer. 1969"
  72647. };
  72648. Ellipsoid_exports.GRS67 = {
  72649. a: 6378160.0,
  72650. rf: 298.2471674270,
  72651. ellipseName: "GRS 67(IUGG 1967)"
  72652. };
  72653. Ellipsoid_exports.bessel = {
  72654. a: 6377397.155,
  72655. rf: 299.1528128,
  72656. ellipseName: "Bessel 1841"
  72657. };
  72658. Ellipsoid_exports.bess_nam = {
  72659. a: 6377483.865,
  72660. rf: 299.1528128,
  72661. ellipseName: "Bessel 1841 (Namibia)"
  72662. };
  72663. Ellipsoid_exports.clrk66 = {
  72664. a: 6378206.4,
  72665. b: 6356583.8,
  72666. ellipseName: "Clarke 1866"
  72667. };
  72668. Ellipsoid_exports.clrk80 = {
  72669. a: 6378249.145,
  72670. rf: 293.4663,
  72671. ellipseName: "Clarke 1880 mod."
  72672. };
  72673. Ellipsoid_exports.clrk58 = {
  72674. a: 6378293.645208759,
  72675. rf: 294.2606763692654,
  72676. ellipseName: "Clarke 1858"
  72677. };
  72678. Ellipsoid_exports.CPM = {
  72679. a: 6375738.7,
  72680. rf: 334.29,
  72681. ellipseName: "Comm. des Poids et Mesures 1799"
  72682. };
  72683. Ellipsoid_exports.delmbr = {
  72684. a: 6376428.0,
  72685. rf: 311.5,
  72686. ellipseName: "Delambre 1810 (Belgium)"
  72687. };
  72688. Ellipsoid_exports.engelis = {
  72689. a: 6378136.05,
  72690. rf: 298.2566,
  72691. ellipseName: "Engelis 1985"
  72692. };
  72693. Ellipsoid_exports.evrst30 = {
  72694. a: 6377276.345,
  72695. rf: 300.8017,
  72696. ellipseName: "Everest 1830"
  72697. };
  72698. Ellipsoid_exports.evrst48 = {
  72699. a: 6377304.063,
  72700. rf: 300.8017,
  72701. ellipseName: "Everest 1948"
  72702. };
  72703. Ellipsoid_exports.evrst56 = {
  72704. a: 6377301.243,
  72705. rf: 300.8017,
  72706. ellipseName: "Everest 1956"
  72707. };
  72708. Ellipsoid_exports.evrst69 = {
  72709. a: 6377295.664,
  72710. rf: 300.8017,
  72711. ellipseName: "Everest 1969"
  72712. };
  72713. Ellipsoid_exports.evrstSS = {
  72714. a: 6377298.556,
  72715. rf: 300.8017,
  72716. ellipseName: "Everest (Sabah & Sarawak)"
  72717. };
  72718. Ellipsoid_exports.fschr60 = {
  72719. a: 6378166.0,
  72720. rf: 298.3,
  72721. ellipseName: "Fischer (Mercury Datum) 1960"
  72722. };
  72723. Ellipsoid_exports.fschr60m = {
  72724. a: 6378155.0,
  72725. rf: 298.3,
  72726. ellipseName: "Fischer 1960"
  72727. };
  72728. Ellipsoid_exports.fschr68 = {
  72729. a: 6378150.0,
  72730. rf: 298.3,
  72731. ellipseName: "Fischer 1968"
  72732. };
  72733. Ellipsoid_exports.helmert = {
  72734. a: 6378200.0,
  72735. rf: 298.3,
  72736. ellipseName: "Helmert 1906"
  72737. };
  72738. Ellipsoid_exports.hough = {
  72739. a: 6378270.0,
  72740. rf: 297.0,
  72741. ellipseName: "Hough"
  72742. };
  72743. Ellipsoid_exports.intl = {
  72744. a: 6378388.0,
  72745. rf: 297.0,
  72746. ellipseName: "International 1909 (Hayford)"
  72747. };
  72748. Ellipsoid_exports.kaula = {
  72749. a: 6378163.0,
  72750. rf: 298.24,
  72751. ellipseName: "Kaula 1961"
  72752. };
  72753. Ellipsoid_exports.lerch = {
  72754. a: 6378139.0,
  72755. rf: 298.257,
  72756. ellipseName: "Lerch 1979"
  72757. };
  72758. Ellipsoid_exports.mprts = {
  72759. a: 6397300.0,
  72760. rf: 191.0,
  72761. ellipseName: "Maupertius 1738"
  72762. };
  72763. Ellipsoid_exports.new_intl = {
  72764. a: 6378157.5,
  72765. b: 6356772.2,
  72766. ellipseName: "New International 1967"
  72767. };
  72768. Ellipsoid_exports.plessis = {
  72769. a: 6376523.0,
  72770. rf: 6355863.0,
  72771. ellipseName: "Plessis 1817 (France)"
  72772. };
  72773. Ellipsoid_exports.krass = {
  72774. a: 6378245.0,
  72775. rf: 298.3,
  72776. ellipseName: "Krassovsky, 1942"
  72777. };
  72778. Ellipsoid_exports.SEasia = {
  72779. a: 6378155.0,
  72780. b: 6356773.3205,
  72781. ellipseName: "Southeast Asia"
  72782. };
  72783. Ellipsoid_exports.walbeck = {
  72784. a: 6376896.0,
  72785. b: 6355834.8467,
  72786. ellipseName: "Walbeck"
  72787. };
  72788. Ellipsoid_exports.WGS60 = {
  72789. a: 6378165.0,
  72790. rf: 298.3,
  72791. ellipseName: "WGS 60"
  72792. };
  72793. Ellipsoid_exports.WGS66 = {
  72794. a: 6378145.0,
  72795. rf: 298.25,
  72796. ellipseName: "WGS 66"
  72797. };
  72798. Ellipsoid_exports.WGS7 = {
  72799. a: 6378135.0,
  72800. rf: 298.26,
  72801. ellipseName: "WGS 72"
  72802. };
  72803. var WGS84 = Ellipsoid_exports.WGS84 = {
  72804. a: 6378137.0,
  72805. rf: 298.257223563,
  72806. ellipseName: "WGS 84"
  72807. };
  72808. Ellipsoid_exports.sphere = {
  72809. a: 6370997.0,
  72810. b: 6370997.0,
  72811. ellipseName: "Normal Sphere (r=6370997)"
  72812. };
  72813. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/deriveConstants.js
  72814. function eccentricity(a, b, rf, R_A) {
  72815. var a2 = a * a; // used in geocentric
  72816. var b2 = b * b; // used in geocentric
  72817. var es = (a2 - b2) / a2; // e ^ 2
  72818. var e = 0;
  72819. if (R_A) {
  72820. a *= 1 - es * (SIXTH + es * (RA4 + es * RA6));
  72821. a2 = a * a;
  72822. es = 0;
  72823. } else {
  72824. e = Math.sqrt(es); // eccentricity
  72825. }
  72826. var ep2 = (a2 - b2) / b2; // used in geocentric
  72827. return {
  72828. es: es,
  72829. e: e,
  72830. ep2: ep2
  72831. };
  72832. }
  72833. function sphere(a, b, rf, ellps, sphere) {
  72834. if (!a) {
  72835. // do we have an ellipsoid?
  72836. var ellipse = match(Ellipsoid_exports, ellps);
  72837. if (!ellipse) {
  72838. ellipse = WGS84;
  72839. }
  72840. a = ellipse.a;
  72841. b = ellipse.b;
  72842. rf = ellipse.rf;
  72843. }
  72844. if (rf && !b) {
  72845. b = (1.0 - 1.0 / rf) * a;
  72846. }
  72847. if (rf === 0 || Math.abs(a - b) < EPSLN) {
  72848. sphere = true;
  72849. b = a;
  72850. }
  72851. return {
  72852. a: a,
  72853. b: b,
  72854. rf: rf,
  72855. sphere: sphere
  72856. };
  72857. }
  72858. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/constants/Datum.js
  72859. var Datum_exports = {};
  72860. Datum_exports.wgs84 = {
  72861. towgs84: "0,0,0",
  72862. ellipse: "WGS84",
  72863. datumName: "WGS84"
  72864. };
  72865. Datum_exports.ch1903 = {
  72866. towgs84: "674.374,15.056,405.346",
  72867. ellipse: "bessel",
  72868. datumName: "swiss"
  72869. };
  72870. Datum_exports.ggrs87 = {
  72871. towgs84: "-199.87,74.79,246.62",
  72872. ellipse: "GRS80",
  72873. datumName: "Greek_Geodetic_Reference_System_1987"
  72874. };
  72875. Datum_exports.nad83 = {
  72876. towgs84: "0,0,0",
  72877. ellipse: "GRS80",
  72878. datumName: "North_American_Datum_1983"
  72879. };
  72880. Datum_exports.nad27 = {
  72881. nadgrids: "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",
  72882. ellipse: "clrk66",
  72883. datumName: "North_American_Datum_1927"
  72884. };
  72885. Datum_exports.potsdam = {
  72886. towgs84: "606.0,23.0,413.0",
  72887. ellipse: "bessel",
  72888. datumName: "Potsdam Rauenberg 1950 DHDN"
  72889. };
  72890. Datum_exports.carthage = {
  72891. towgs84: "-263.0,6.0,431.0",
  72892. ellipse: "clark80",
  72893. datumName: "Carthage 1934 Tunisia"
  72894. };
  72895. Datum_exports.hermannskogel = {
  72896. towgs84: "653.0,-212.0,449.0",
  72897. ellipse: "bessel",
  72898. datumName: "Hermannskogel"
  72899. };
  72900. Datum_exports.osni52 = {
  72901. towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
  72902. ellipse: "airy",
  72903. datumName: "Irish National"
  72904. };
  72905. Datum_exports.ire65 = {
  72906. towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
  72907. ellipse: "mod_airy",
  72908. datumName: "Ireland 1965"
  72909. };
  72910. Datum_exports.rassadiran = {
  72911. towgs84: "-133.63,-157.5,-158.62",
  72912. ellipse: "intl",
  72913. datumName: "Rassadiran"
  72914. };
  72915. Datum_exports.nzgd49 = {
  72916. towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",
  72917. ellipse: "intl",
  72918. datumName: "New Zealand Geodetic Datum 1949"
  72919. };
  72920. Datum_exports.osgb36 = {
  72921. towgs84: "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",
  72922. ellipse: "airy",
  72923. datumName: "Airy 1830"
  72924. };
  72925. Datum_exports.s_jtsk = {
  72926. towgs84: "589,76,480",
  72927. ellipse: 'bessel',
  72928. datumName: 'S-JTSK (Ferro)'
  72929. };
  72930. Datum_exports.beduaram = {
  72931. towgs84: '-106,-87,188',
  72932. ellipse: 'clrk80',
  72933. datumName: 'Beduaram'
  72934. };
  72935. Datum_exports.gunung_segara = {
  72936. towgs84: '-403,684,41',
  72937. ellipse: 'bessel',
  72938. datumName: 'Gunung Segara Jakarta'
  72939. };
  72940. Datum_exports.rnb72 = {
  72941. towgs84: "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",
  72942. ellipse: "intl",
  72943. datumName: "Reseau National Belge 1972"
  72944. };
  72945. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/datum.js
  72946. function datum(datumCode, datum_params, a, b, es, ep2) {
  72947. var out = {};
  72948. if (datumCode === undefined || datumCode === 'none') {
  72949. out.datum_type = PJD_NODATUM;
  72950. } else {
  72951. out.datum_type = PJD_WGS84;
  72952. }
  72953. if (datum_params) {
  72954. out.datum_params = datum_params.map(parseFloat);
  72955. if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {
  72956. out.datum_type = PJD_3PARAM;
  72957. }
  72958. if (out.datum_params.length > 3) {
  72959. if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {
  72960. out.datum_type = PJD_7PARAM;
  72961. out.datum_params[3] *= SEC_TO_RAD;
  72962. out.datum_params[4] *= SEC_TO_RAD;
  72963. out.datum_params[5] *= SEC_TO_RAD;
  72964. out.datum_params[6] = out.datum_params[6] / 1000000.0 + 1.0;
  72965. }
  72966. }
  72967. }
  72968. out.a = a; //datum object also uses these values
  72969. out.b = b;
  72970. out.es = es;
  72971. out.ep2 = ep2;
  72972. return out;
  72973. }
  72974. /* harmony default export */ var lib_datum = (datum);
  72975. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/Proj.js
  72976. function Proj_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Proj_typeof = function _typeof(obj) { return typeof obj; }; } else { Proj_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Proj_typeof(obj); }
  72977. function Projection(srsCode, callback) {
  72978. if (!(this instanceof Projection)) {
  72979. return new Projection(srsCode);
  72980. }
  72981. callback = callback || function (error) {
  72982. if (error) {
  72983. throw error;
  72984. }
  72985. };
  72986. var json = parseCode(srsCode);
  72987. if (Proj_typeof(json) !== 'object') {
  72988. callback(srsCode);
  72989. return;
  72990. }
  72991. var ourProj = Projection.projections.get(json.projName);
  72992. if (!ourProj) {
  72993. callback(srsCode);
  72994. return;
  72995. }
  72996. if (json.datumCode && json.datumCode !== 'none') {
  72997. var datumDef = match(Datum_exports, json.datumCode);
  72998. if (datumDef) {
  72999. json.datum_params = datumDef.towgs84 ? datumDef.towgs84.split(',') : null;
  73000. json.ellps = datumDef.ellipse;
  73001. json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;
  73002. }
  73003. }
  73004. json.k0 = json.k0 || 1.0;
  73005. json.axis = json.axis || 'enu';
  73006. json.ellps = json.ellps || 'wgs84';
  73007. var sphere_ = sphere(json.a, json.b, json.rf, json.ellps, json.sphere);
  73008. var ecc = eccentricity(sphere_.a, sphere_.b, sphere_.rf, json.R_A);
  73009. var datumObj = json.datum || lib_datum(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2);
  73010. extend(this, json); // transfer everything over from the projection because we don't know what we'll need
  73011. extend(this, ourProj); // transfer all the methods from the projection
  73012. // copy the 4 things over we calulated in deriveConstants.sphere
  73013. this.a = sphere_.a;
  73014. this.b = sphere_.b;
  73015. this.rf = sphere_.rf;
  73016. this.sphere = sphere_.sphere; // copy the 3 things we calculated in deriveConstants.eccentricity
  73017. this.es = ecc.es;
  73018. this.e = ecc.e;
  73019. this.ep2 = ecc.ep2; // add in the datum object
  73020. this.datum = datumObj; // init the projection
  73021. this.init(); // legecy callback from back in the day when it went to spatialreference.org
  73022. callback(null, this);
  73023. }
  73024. Projection.projections = projections;
  73025. Projection.projections.start();
  73026. /* harmony default export */ var Proj = (Projection);
  73027. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/datumUtils.js
  73028. function compareDatums(source, dest) {
  73029. if (source.datum_type !== dest.datum_type) {
  73030. return false; // false, datums are not equal
  73031. } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) {
  73032. // the tolerance for es is to ensure that GRS80 and WGS84
  73033. // are considered identical
  73034. return false;
  73035. } else if (source.datum_type === PJD_3PARAM) {
  73036. 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];
  73037. } else if (source.datum_type === PJD_7PARAM) {
  73038. 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];
  73039. } else {
  73040. return true; // datums are equal
  73041. }
  73042. } // cs_compare_datums()
  73043. /*
  73044. * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates
  73045. * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),
  73046. * according to the current ellipsoid parameters.
  73047. *
  73048. * Latitude : Geodetic latitude in radians (input)
  73049. * Longitude : Geodetic longitude in radians (input)
  73050. * Height : Geodetic height, in meters (input)
  73051. * X : Calculated Geocentric X coordinate, in meters (output)
  73052. * Y : Calculated Geocentric Y coordinate, in meters (output)
  73053. * Z : Calculated Geocentric Z coordinate, in meters (output)
  73054. *
  73055. */
  73056. function geodeticToGeocentric(p, es, a) {
  73057. var Longitude = p.x;
  73058. var Latitude = p.y;
  73059. var Height = p.z ? p.z : 0; //Z value not always supplied
  73060. var Rn;
  73061. /* Earth radius at location */
  73062. var Sin_Lat;
  73063. /* Math.sin(Latitude) */
  73064. var Sin2_Lat;
  73065. /* Square of Math.sin(Latitude) */
  73066. var Cos_Lat;
  73067. /* Math.cos(Latitude) */
  73068. /*
  73069. ** Don't blow up if Latitude is just a little out of the value
  73070. ** range as it may just be a rounding issue. Also removed longitude
  73071. ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.
  73072. */
  73073. if (Latitude < -HALF_PI && Latitude > -1.001 * HALF_PI) {
  73074. Latitude = -HALF_PI;
  73075. } else if (Latitude > HALF_PI && Latitude < 1.001 * HALF_PI) {
  73076. Latitude = HALF_PI;
  73077. } else if (Latitude < -HALF_PI) {
  73078. /* Latitude out of range */
  73079. //..reportError('geocent:lat out of range:' + Latitude);
  73080. return {
  73081. x: -Infinity,
  73082. y: -Infinity,
  73083. z: p.z
  73084. };
  73085. } else if (Latitude > HALF_PI) {
  73086. /* Latitude out of range */
  73087. return {
  73088. x: Infinity,
  73089. y: Infinity,
  73090. z: p.z
  73091. };
  73092. }
  73093. if (Longitude > Math.PI) {
  73094. Longitude -= 2 * Math.PI;
  73095. }
  73096. Sin_Lat = Math.sin(Latitude);
  73097. Cos_Lat = Math.cos(Latitude);
  73098. Sin2_Lat = Sin_Lat * Sin_Lat;
  73099. Rn = a / Math.sqrt(1.0e0 - es * Sin2_Lat);
  73100. return {
  73101. x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),
  73102. y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),
  73103. z: (Rn * (1 - es) + Height) * Sin_Lat
  73104. };
  73105. } // cs_geodetic_to_geocentric()
  73106. function geocentricToGeodetic(p, es, a, b) {
  73107. /* local defintions and variables */
  73108. /* end-criterium of loop, accuracy of sin(Latitude) */
  73109. var genau = 1e-12;
  73110. var genau2 = genau * genau;
  73111. var maxiter = 30;
  73112. var P;
  73113. /* distance between semi-minor axis and location */
  73114. var RR;
  73115. /* distance between center and location */
  73116. var CT;
  73117. /* sin of geocentric latitude */
  73118. var ST;
  73119. /* cos of geocentric latitude */
  73120. var RX;
  73121. var RK;
  73122. var RN;
  73123. /* Earth radius at location */
  73124. var CPHI0;
  73125. /* cos of start or old geodetic latitude in iterations */
  73126. var SPHI0;
  73127. /* sin of start or old geodetic latitude in iterations */
  73128. var CPHI;
  73129. /* cos of searched geodetic latitude */
  73130. var SPHI;
  73131. /* sin of searched geodetic latitude */
  73132. var SDPHI;
  73133. /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */
  73134. var iter;
  73135. /* # of continous iteration, max. 30 is always enough (s.a.) */
  73136. var X = p.x;
  73137. var Y = p.y;
  73138. var Z = p.z ? p.z : 0.0; //Z value not always supplied
  73139. var Longitude;
  73140. var Latitude;
  73141. var Height;
  73142. P = Math.sqrt(X * X + Y * Y);
  73143. RR = Math.sqrt(X * X + Y * Y + Z * Z);
  73144. /* special cases for latitude and longitude */
  73145. if (P / a < genau) {
  73146. /* special case, if P=0. (X=0., Y=0.) */
  73147. Longitude = 0.0;
  73148. /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis
  73149. * of ellipsoid (=center of mass), Latitude becomes PI/2 */
  73150. if (RR / a < genau) {
  73151. Latitude = HALF_PI;
  73152. Height = -b;
  73153. return {
  73154. x: p.x,
  73155. y: p.y,
  73156. z: p.z
  73157. };
  73158. }
  73159. } else {
  73160. /* ellipsoidal (geodetic) longitude
  73161. * interval: -PI < Longitude <= +PI */
  73162. Longitude = Math.atan2(Y, X);
  73163. }
  73164. /* --------------------------------------------------------------
  73165. * Following iterative algorithm was developped by
  73166. * "Institut for Erdmessung", University of Hannover, July 1988.
  73167. * Internet: www.ife.uni-hannover.de
  73168. * Iterative computation of CPHI,SPHI and Height.
  73169. * Iteration of CPHI and SPHI to 10**-12 radian resp.
  73170. * 2*10**-7 arcsec.
  73171. * --------------------------------------------------------------
  73172. */
  73173. CT = Z / RR;
  73174. ST = P / RR;
  73175. RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST);
  73176. CPHI0 = ST * (1.0 - es) * RX;
  73177. SPHI0 = CT * RX;
  73178. iter = 0;
  73179. /* loop to find sin(Latitude) resp. Latitude
  73180. * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */
  73181. do {
  73182. iter++;
  73183. RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0);
  73184. /* ellipsoidal (geodetic) height */
  73185. Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0);
  73186. RK = es * RN / (RN + Height);
  73187. RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST);
  73188. CPHI = ST * (1.0 - RK) * RX;
  73189. SPHI = CT * RX;
  73190. SDPHI = SPHI * CPHI0 - CPHI * SPHI0;
  73191. CPHI0 = CPHI;
  73192. SPHI0 = SPHI;
  73193. } while (SDPHI * SDPHI > genau2 && iter < maxiter);
  73194. /* ellipsoidal (geodetic) latitude */
  73195. Latitude = Math.atan(SPHI / Math.abs(CPHI));
  73196. return {
  73197. x: Longitude,
  73198. y: Latitude,
  73199. z: Height
  73200. };
  73201. } // cs_geocentric_to_geodetic()
  73202. /****************************************************************/
  73203. // pj_geocentic_to_wgs84( p )
  73204. // p = point to transform in geocentric coordinates (x,y,z)
  73205. /** point object, nothing fancy, just allows values to be
  73206. passed back and forth by reference rather than by value.
  73207. Other point classes may be used as long as they have
  73208. x and y properties, which will get modified in the transform method.
  73209. */
  73210. function geocentricToWgs84(p, datum_type, datum_params) {
  73211. if (datum_type === PJD_3PARAM) {
  73212. // if( x[io] === HUGE_VAL )
  73213. // continue;
  73214. return {
  73215. x: p.x + datum_params[0],
  73216. y: p.y + datum_params[1],
  73217. z: p.z + datum_params[2]
  73218. };
  73219. } else if (datum_type === PJD_7PARAM) {
  73220. var Dx_BF = datum_params[0];
  73221. var Dy_BF = datum_params[1];
  73222. var Dz_BF = datum_params[2];
  73223. var Rx_BF = datum_params[3];
  73224. var Ry_BF = datum_params[4];
  73225. var Rz_BF = datum_params[5];
  73226. var M_BF = datum_params[6]; // if( x[io] === HUGE_VAL )
  73227. // continue;
  73228. return {
  73229. x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF,
  73230. y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF,
  73231. z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF
  73232. };
  73233. }
  73234. } // cs_geocentric_to_wgs84
  73235. /****************************************************************/
  73236. // pj_geocentic_from_wgs84()
  73237. // coordinate system definition,
  73238. // point to transform in geocentric coordinates (x,y,z)
  73239. function geocentricFromWgs84(p, datum_type, datum_params) {
  73240. if (datum_type === PJD_3PARAM) {
  73241. //if( x[io] === HUGE_VAL )
  73242. // continue;
  73243. return {
  73244. x: p.x - datum_params[0],
  73245. y: p.y - datum_params[1],
  73246. z: p.z - datum_params[2]
  73247. };
  73248. } else if (datum_type === PJD_7PARAM) {
  73249. var Dx_BF = datum_params[0];
  73250. var Dy_BF = datum_params[1];
  73251. var Dz_BF = datum_params[2];
  73252. var Rx_BF = datum_params[3];
  73253. var Ry_BF = datum_params[4];
  73254. var Rz_BF = datum_params[5];
  73255. var M_BF = datum_params[6];
  73256. var x_tmp = (p.x - Dx_BF) / M_BF;
  73257. var y_tmp = (p.y - Dy_BF) / M_BF;
  73258. var z_tmp = (p.z - Dz_BF) / M_BF; //if( x[io] === HUGE_VAL )
  73259. // continue;
  73260. return {
  73261. x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp,
  73262. y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp,
  73263. z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp
  73264. };
  73265. } //cs_geocentric_from_wgs84()
  73266. }
  73267. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/datum_transform.js
  73268. function checkParams(type) {
  73269. return type === PJD_3PARAM || type === PJD_7PARAM;
  73270. }
  73271. /* harmony default export */ function datum_transform(source, dest, point) {
  73272. // Short cut if the datums are identical.
  73273. if (compareDatums(source, dest)) {
  73274. return point; // in this case, zero is sucess,
  73275. // whereas cs_compare_datums returns 1 to indicate TRUE
  73276. // confusing, should fix this
  73277. } // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest
  73278. if (source.datum_type === PJD_NODATUM || dest.datum_type === PJD_NODATUM) {
  73279. return point;
  73280. } // If this datum requires grid shifts, then apply it to geodetic coordinates.
  73281. // Do we need to go through geocentric coordinates?
  73282. if (source.es === dest.es && source.a === dest.a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) {
  73283. return point;
  73284. } // Convert to geocentric coordinates.
  73285. point = geodeticToGeocentric(point, source.es, source.a); // Convert between datums
  73286. if (checkParams(source.datum_type)) {
  73287. point = geocentricToWgs84(point, source.datum_type, source.datum_params);
  73288. }
  73289. if (checkParams(dest.datum_type)) {
  73290. point = geocentricFromWgs84(point, dest.datum_type, dest.datum_params);
  73291. }
  73292. return geocentricToGeodetic(point, dest.es, dest.a, dest.b);
  73293. }
  73294. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/adjust_axis.js
  73295. /* harmony default export */ function adjust_axis(crs, denorm, point) {
  73296. var xin = point.x,
  73297. yin = point.y,
  73298. zin = point.z || 0.0;
  73299. var v, t, i;
  73300. var out = {};
  73301. for (i = 0; i < 3; i++) {
  73302. if (denorm && i === 2 && point.z === undefined) {
  73303. continue;
  73304. }
  73305. if (i === 0) {
  73306. v = xin;
  73307. if ("ew".indexOf(crs.axis[i]) !== -1) {
  73308. t = 'x';
  73309. } else {
  73310. t = 'y';
  73311. }
  73312. } else if (i === 1) {
  73313. v = yin;
  73314. if ("ns".indexOf(crs.axis[i]) !== -1) {
  73315. t = 'y';
  73316. } else {
  73317. t = 'x';
  73318. }
  73319. } else {
  73320. v = zin;
  73321. t = 'z';
  73322. }
  73323. switch (crs.axis[i]) {
  73324. case 'e':
  73325. case 'w':
  73326. case 'n':
  73327. case 's':
  73328. out[t] = v;
  73329. break;
  73330. case 'u':
  73331. if (point[t] !== undefined) {
  73332. out.z = v;
  73333. }
  73334. break;
  73335. case 'd':
  73336. if (point[t] !== undefined) {
  73337. out.z = -v;
  73338. }
  73339. break;
  73340. default:
  73341. //console.log("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+crs.projName);
  73342. return null;
  73343. }
  73344. }
  73345. return out;
  73346. }
  73347. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/toPoint.js
  73348. /* harmony default export */ function toPoint(array) {
  73349. var out = {
  73350. x: array[0],
  73351. y: array[1]
  73352. };
  73353. if (array.length > 2) {
  73354. out.z = array[2];
  73355. }
  73356. if (array.length > 3) {
  73357. out.m = array[3];
  73358. }
  73359. return out;
  73360. }
  73361. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/checkSanity.js
  73362. /* harmony default export */ function checkSanity(point) {
  73363. checkCoord(point.x);
  73364. checkCoord(point.y);
  73365. }
  73366. function checkCoord(num) {
  73367. if (typeof Number.isFinite === 'function') {
  73368. if (Number.isFinite(num)) {
  73369. return;
  73370. }
  73371. throw new TypeError('coordinates must be finite numbers');
  73372. }
  73373. if (typeof num !== 'number' || num !== num || !isFinite(num)) {
  73374. throw new TypeError('coordinates must be finite numbers');
  73375. }
  73376. }
  73377. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/transform.js
  73378. function checkNotWGS(source, dest) {
  73379. return (source.datum.datum_type === PJD_3PARAM || source.datum.datum_type === PJD_7PARAM) && dest.datumCode !== 'WGS84' || (dest.datum.datum_type === PJD_3PARAM || dest.datum.datum_type === PJD_7PARAM) && source.datumCode !== 'WGS84';
  73380. }
  73381. function transform(source, dest, point) {
  73382. var wgs84;
  73383. if (Array.isArray(point)) {
  73384. point = toPoint(point);
  73385. }
  73386. checkSanity(point); // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84
  73387. if (source.datum && dest.datum && checkNotWGS(source, dest)) {
  73388. wgs84 = new Proj('WGS84');
  73389. point = transform(source, wgs84, point);
  73390. source = wgs84;
  73391. } // DGR, 2010/11/12
  73392. if (source.axis !== 'enu') {
  73393. point = adjust_axis(source, false, point);
  73394. } // Transform source points to long/lat, if they aren't already.
  73395. if (source.projName === 'longlat') {
  73396. point = {
  73397. x: point.x * D2R,
  73398. y: point.y * D2R,
  73399. z: point.z || 0
  73400. };
  73401. } else {
  73402. if (source.to_meter) {
  73403. point = {
  73404. x: point.x * source.to_meter,
  73405. y: point.y * source.to_meter,
  73406. z: point.z || 0
  73407. };
  73408. }
  73409. point = source.inverse(point); // Convert Cartesian to longlat
  73410. if (!point) {
  73411. return;
  73412. }
  73413. } // Adjust for the prime meridian if necessary
  73414. if (source.from_greenwich) {
  73415. point.x += source.from_greenwich;
  73416. } // Convert datums if needed, and if possible.
  73417. point = datum_transform(source.datum, dest.datum, point); // Adjust for the prime meridian if necessary
  73418. if (dest.from_greenwich) {
  73419. point = {
  73420. x: point.x - dest.from_greenwich,
  73421. y: point.y,
  73422. z: point.z || 0
  73423. };
  73424. }
  73425. if (dest.projName === 'longlat') {
  73426. // convert radians to decimal degrees
  73427. point = {
  73428. x: point.x * R2D,
  73429. y: point.y * R2D,
  73430. z: point.z || 0
  73431. };
  73432. } else {
  73433. // else project
  73434. point = dest.forward(point);
  73435. if (dest.to_meter) {
  73436. point = {
  73437. x: point.x / dest.to_meter,
  73438. y: point.y / dest.to_meter,
  73439. z: point.z || 0
  73440. };
  73441. }
  73442. } // DGR, 2010/11/12
  73443. if (dest.axis !== 'enu') {
  73444. return adjust_axis(dest, true, point);
  73445. }
  73446. return point;
  73447. }
  73448. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/core.js
  73449. var wgs84 = Proj('WGS84');
  73450. function transformer(from, to, coords) {
  73451. var transformedArray, out, keys;
  73452. if (Array.isArray(coords)) {
  73453. transformedArray = transform(from, to, coords) || {
  73454. x: NaN,
  73455. y: NaN
  73456. };
  73457. if (coords.length > 2) {
  73458. if (typeof from.name !== 'undefined' && from.name === 'geocent' || typeof to.name !== 'undefined' && to.name === 'geocent') {
  73459. if (typeof transformedArray.z === 'number') {
  73460. return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3));
  73461. } else {
  73462. return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3));
  73463. }
  73464. } else {
  73465. return [transformedArray.x, transformedArray.y].concat(coords.splice(2));
  73466. }
  73467. } else {
  73468. return [transformedArray.x, transformedArray.y];
  73469. }
  73470. } else {
  73471. out = transform(from, to, coords);
  73472. keys = Object.keys(coords);
  73473. if (keys.length === 2) {
  73474. return out;
  73475. }
  73476. keys.forEach(function (key) {
  73477. if (typeof from.name !== 'undefined' && from.name === 'geocent' || typeof to.name !== 'undefined' && to.name === 'geocent') {
  73478. if (key === 'x' || key === 'y' || key === 'z') {
  73479. return;
  73480. }
  73481. } else {
  73482. if (key === 'x' || key === 'y') {
  73483. return;
  73484. }
  73485. }
  73486. out[key] = coords[key];
  73487. });
  73488. return out;
  73489. }
  73490. }
  73491. function checkProj(item) {
  73492. if (item instanceof Proj) {
  73493. return item;
  73494. }
  73495. if (item.oProj) {
  73496. return item.oProj;
  73497. }
  73498. return Proj(item);
  73499. }
  73500. function proj4(fromProj, toProj, coord) {
  73501. fromProj = checkProj(fromProj);
  73502. var single = false;
  73503. var obj;
  73504. if (typeof toProj === 'undefined') {
  73505. toProj = fromProj;
  73506. fromProj = wgs84;
  73507. single = true;
  73508. } else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) {
  73509. coord = toProj;
  73510. toProj = fromProj;
  73511. fromProj = wgs84;
  73512. single = true;
  73513. }
  73514. toProj = checkProj(toProj);
  73515. if (coord) {
  73516. return transformer(fromProj, toProj, coord);
  73517. } else {
  73518. obj = {
  73519. forward: function forward(coords) {
  73520. return transformer(fromProj, toProj, coords);
  73521. },
  73522. inverse: function inverse(coords) {
  73523. return transformer(toProj, fromProj, coords);
  73524. }
  73525. };
  73526. if (single) {
  73527. obj.oProj = toProj;
  73528. }
  73529. return obj;
  73530. }
  73531. }
  73532. /* harmony default export */ var core = (proj4);
  73533. ;// CONCATENATED MODULE: ./node_modules/mgrs/mgrs.js
  73534. /**
  73535. * UTM zones are grouped, and assigned to one of a group of 6
  73536. * sets.
  73537. *
  73538. * {int} @private
  73539. */
  73540. var NUM_100K_SETS = 6;
  73541. /**
  73542. * The column letters (for easting) of the lower left value, per
  73543. * set.
  73544. *
  73545. * {string} @private
  73546. */
  73547. var SET_ORIGIN_COLUMN_LETTERS = 'AJSAJS';
  73548. /**
  73549. * The row letters (for northing) of the lower left value, per
  73550. * set.
  73551. *
  73552. * {string} @private
  73553. */
  73554. var SET_ORIGIN_ROW_LETTERS = 'AFAFAF';
  73555. var A = 65; // A
  73556. var I = 73; // I
  73557. var O = 79; // O
  73558. var V = 86; // V
  73559. var Z = 90; // Z
  73560. /* harmony default export */ var mgrs = ({
  73561. forward: mgrs_forward,
  73562. inverse: mgrs_inverse,
  73563. toPoint: mgrs_toPoint
  73564. });
  73565. /**
  73566. * Conversion of lat/lon to MGRS.
  73567. *
  73568. * @param {object} ll Object literal with lat and lon properties on a
  73569. * WGS84 ellipsoid.
  73570. * @param {int} accuracy Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for
  73571. * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5.
  73572. * @return {string} the MGRS string for the given location and accuracy.
  73573. */
  73574. function mgrs_forward(ll, accuracy) {
  73575. accuracy = accuracy || 5; // default accuracy 1m
  73576. return encode(LLtoUTM({
  73577. lat: ll[1],
  73578. lon: ll[0]
  73579. }), accuracy);
  73580. }
  73581. ;
  73582. /**
  73583. * Conversion of MGRS to lat/lon.
  73584. *
  73585. * @param {string} mgrs MGRS string.
  73586. * @return {array} An array with left (longitude), bottom (latitude), right
  73587. * (longitude) and top (latitude) values in WGS84, representing the
  73588. * bounding box for the provided MGRS reference.
  73589. */
  73590. function mgrs_inverse(mgrs) {
  73591. var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
  73592. if (bbox.lat && bbox.lon) {
  73593. return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];
  73594. }
  73595. return [bbox.left, bbox.bottom, bbox.right, bbox.top];
  73596. }
  73597. ;
  73598. function mgrs_toPoint(mgrs) {
  73599. var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
  73600. if (bbox.lat && bbox.lon) {
  73601. return [bbox.lon, bbox.lat];
  73602. }
  73603. return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2];
  73604. }
  73605. ;
  73606. /**
  73607. * Conversion from degrees to radians.
  73608. *
  73609. * @private
  73610. * @param {number} deg the angle in degrees.
  73611. * @return {number} the angle in radians.
  73612. */
  73613. function degToRad(deg) {
  73614. return deg * (Math.PI / 180.0);
  73615. }
  73616. /**
  73617. * Conversion from radians to degrees.
  73618. *
  73619. * @private
  73620. * @param {number} rad the angle in radians.
  73621. * @return {number} the angle in degrees.
  73622. */
  73623. function radToDeg(rad) {
  73624. return 180.0 * (rad / Math.PI);
  73625. }
  73626. /**
  73627. * Converts a set of Longitude and Latitude co-ordinates to UTM
  73628. * using the WGS84 ellipsoid.
  73629. *
  73630. * @private
  73631. * @param {object} ll Object literal with lat and lon properties
  73632. * representing the WGS84 coordinate to be converted.
  73633. * @return {object} Object literal containing the UTM value with easting,
  73634. * northing, zoneNumber and zoneLetter properties, and an optional
  73635. * accuracy property in digits. Returns null if the conversion failed.
  73636. */
  73637. function LLtoUTM(ll) {
  73638. var Lat = ll.lat;
  73639. var Long = ll.lon;
  73640. var a = 6378137.0; //ellip.radius;
  73641. var eccSquared = 0.00669438; //ellip.eccsq;
  73642. var k0 = 0.9996;
  73643. var LongOrigin;
  73644. var eccPrimeSquared;
  73645. var N, T, C, A, M;
  73646. var LatRad = degToRad(Lat);
  73647. var LongRad = degToRad(Long);
  73648. var LongOriginRad;
  73649. var ZoneNumber; // (int)
  73650. ZoneNumber = Math.floor((Long + 180) / 6) + 1; //Make sure the longitude 180.00 is in Zone 60
  73651. if (Long === 180) {
  73652. ZoneNumber = 60;
  73653. } // Special zone for Norway
  73654. if (Lat >= 56.0 && Lat < 64.0 && Long >= 3.0 && Long < 12.0) {
  73655. ZoneNumber = 32;
  73656. } // Special zones for Svalbard
  73657. if (Lat >= 72.0 && Lat < 84.0) {
  73658. if (Long >= 0.0 && Long < 9.0) {
  73659. ZoneNumber = 31;
  73660. } else if (Long >= 9.0 && Long < 21.0) {
  73661. ZoneNumber = 33;
  73662. } else if (Long >= 21.0 && Long < 33.0) {
  73663. ZoneNumber = 35;
  73664. } else if (Long >= 33.0 && Long < 42.0) {
  73665. ZoneNumber = 37;
  73666. }
  73667. }
  73668. LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3; //+3 puts origin
  73669. // in middle of
  73670. // zone
  73671. LongOriginRad = degToRad(LongOrigin);
  73672. eccPrimeSquared = eccSquared / (1 - eccSquared);
  73673. N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad));
  73674. T = Math.tan(LatRad) * Math.tan(LatRad);
  73675. C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad);
  73676. A = Math.cos(LatRad) * (LongRad - LongOriginRad);
  73677. 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));
  73678. 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;
  73679. 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));
  73680. if (Lat < 0.0) {
  73681. UTMNorthing += 10000000.0; //10000000 meter offset for
  73682. // southern hemisphere
  73683. }
  73684. return {
  73685. northing: Math.round(UTMNorthing),
  73686. easting: Math.round(UTMEasting),
  73687. zoneNumber: ZoneNumber,
  73688. zoneLetter: getLetterDesignator(Lat)
  73689. };
  73690. }
  73691. /**
  73692. * Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience
  73693. * class where the Zone can be specified as a single string eg."60N" which
  73694. * is then broken down into the ZoneNumber and ZoneLetter.
  73695. *
  73696. * @private
  73697. * @param {object} utm An object literal with northing, easting, zoneNumber
  73698. * and zoneLetter properties. If an optional accuracy property is
  73699. * provided (in meters), a bounding box will be returned instead of
  73700. * latitude and longitude.
  73701. * @return {object} An object literal containing either lat and lon values
  73702. * (if no accuracy was provided), or top, right, bottom and left values
  73703. * for the bounding box calculated according to the provided accuracy.
  73704. * Returns null if the conversion failed.
  73705. */
  73706. function UTMtoLL(utm) {
  73707. var UTMNorthing = utm.northing;
  73708. var UTMEasting = utm.easting;
  73709. var zoneLetter = utm.zoneLetter;
  73710. var zoneNumber = utm.zoneNumber; // check the ZoneNummber is valid
  73711. if (zoneNumber < 0 || zoneNumber > 60) {
  73712. return null;
  73713. }
  73714. var k0 = 0.9996;
  73715. var a = 6378137.0; //ellip.radius;
  73716. var eccSquared = 0.00669438; //ellip.eccsq;
  73717. var eccPrimeSquared;
  73718. var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared));
  73719. var N1, T1, C1, R1, D, M;
  73720. var LongOrigin;
  73721. var mu, phi1Rad; // remove 500,000 meter offset for longitude
  73722. var x = UTMEasting - 500000.0;
  73723. var y = UTMNorthing; // We must know somehow if we are in the Northern or Southern
  73724. // hemisphere, this is the only time we use the letter So even
  73725. // if the Zone letter isn't exactly correct it should indicate
  73726. // the hemisphere correctly
  73727. if (zoneLetter < 'N') {
  73728. y -= 10000000.0; // remove 10,000,000 meter offset used
  73729. // for southern hemisphere
  73730. } // There are 60 zones with zone 1 being at West -180 to -174
  73731. LongOrigin = (zoneNumber - 1) * 6 - 180 + 3; // +3 puts origin
  73732. // in middle of
  73733. // zone
  73734. eccPrimeSquared = eccSquared / (1 - eccSquared);
  73735. M = y / k0;
  73736. mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256));
  73737. 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); // double phi1 = ProjMath.radToDeg(phi1Rad);
  73738. N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad));
  73739. T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad);
  73740. C1 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad);
  73741. R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5);
  73742. D = x / (N1 * k0);
  73743. 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);
  73744. lat = radToDeg(lat);
  73745. 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);
  73746. lon = LongOrigin + radToDeg(lon);
  73747. var result;
  73748. if (utm.accuracy) {
  73749. var topRight = UTMtoLL({
  73750. northing: utm.northing + utm.accuracy,
  73751. easting: utm.easting + utm.accuracy,
  73752. zoneLetter: utm.zoneLetter,
  73753. zoneNumber: utm.zoneNumber
  73754. });
  73755. result = {
  73756. top: topRight.lat,
  73757. right: topRight.lon,
  73758. bottom: lat,
  73759. left: lon
  73760. };
  73761. } else {
  73762. result = {
  73763. lat: lat,
  73764. lon: lon
  73765. };
  73766. }
  73767. return result;
  73768. }
  73769. /**
  73770. * Calculates the MGRS letter designator for the given latitude.
  73771. *
  73772. * @private
  73773. * @param {number} lat The latitude in WGS84 to get the letter designator
  73774. * for.
  73775. * @return {char} The letter designator.
  73776. */
  73777. function getLetterDesignator(lat) {
  73778. //This is here as an error flag to show that the Latitude is
  73779. //outside MGRS limits
  73780. var LetterDesignator = 'Z';
  73781. if (84 >= lat && lat >= 72) {
  73782. LetterDesignator = 'X';
  73783. } else if (72 > lat && lat >= 64) {
  73784. LetterDesignator = 'W';
  73785. } else if (64 > lat && lat >= 56) {
  73786. LetterDesignator = 'V';
  73787. } else if (56 > lat && lat >= 48) {
  73788. LetterDesignator = 'U';
  73789. } else if (48 > lat && lat >= 40) {
  73790. LetterDesignator = 'T';
  73791. } else if (40 > lat && lat >= 32) {
  73792. LetterDesignator = 'S';
  73793. } else if (32 > lat && lat >= 24) {
  73794. LetterDesignator = 'R';
  73795. } else if (24 > lat && lat >= 16) {
  73796. LetterDesignator = 'Q';
  73797. } else if (16 > lat && lat >= 8) {
  73798. LetterDesignator = 'P';
  73799. } else if (8 > lat && lat >= 0) {
  73800. LetterDesignator = 'N';
  73801. } else if (0 > lat && lat >= -8) {
  73802. LetterDesignator = 'M';
  73803. } else if (-8 > lat && lat >= -16) {
  73804. LetterDesignator = 'L';
  73805. } else if (-16 > lat && lat >= -24) {
  73806. LetterDesignator = 'K';
  73807. } else if (-24 > lat && lat >= -32) {
  73808. LetterDesignator = 'J';
  73809. } else if (-32 > lat && lat >= -40) {
  73810. LetterDesignator = 'H';
  73811. } else if (-40 > lat && lat >= -48) {
  73812. LetterDesignator = 'G';
  73813. } else if (-48 > lat && lat >= -56) {
  73814. LetterDesignator = 'F';
  73815. } else if (-56 > lat && lat >= -64) {
  73816. LetterDesignator = 'E';
  73817. } else if (-64 > lat && lat >= -72) {
  73818. LetterDesignator = 'D';
  73819. } else if (-72 > lat && lat >= -80) {
  73820. LetterDesignator = 'C';
  73821. }
  73822. return LetterDesignator;
  73823. }
  73824. /**
  73825. * Encodes a UTM location as MGRS string.
  73826. *
  73827. * @private
  73828. * @param {object} utm An object literal with easting, northing,
  73829. * zoneLetter, zoneNumber
  73830. * @param {number} accuracy Accuracy in digits (1-5).
  73831. * @return {string} MGRS string for the given UTM location.
  73832. */
  73833. function encode(utm, accuracy) {
  73834. // prepend with leading zeroes
  73835. var seasting = "00000" + utm.easting,
  73836. snorthing = "00000" + utm.northing;
  73837. return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);
  73838. }
  73839. /**
  73840. * Get the two letter 100k designator for a given UTM easting,
  73841. * northing and zone number value.
  73842. *
  73843. * @private
  73844. * @param {number} easting
  73845. * @param {number} northing
  73846. * @param {number} zoneNumber
  73847. * @return the two letter 100k designator for the given UTM location.
  73848. */
  73849. function get100kID(easting, northing, zoneNumber) {
  73850. var setParm = get100kSetForZone(zoneNumber);
  73851. var setColumn = Math.floor(easting / 100000);
  73852. var setRow = Math.floor(northing / 100000) % 20;
  73853. return getLetter100kID(setColumn, setRow, setParm);
  73854. }
  73855. /**
  73856. * Given a UTM zone number, figure out the MGRS 100K set it is in.
  73857. *
  73858. * @private
  73859. * @param {number} i An UTM zone number.
  73860. * @return {number} the 100k set the UTM zone is in.
  73861. */
  73862. function get100kSetForZone(i) {
  73863. var setParm = i % NUM_100K_SETS;
  73864. if (setParm === 0) {
  73865. setParm = NUM_100K_SETS;
  73866. }
  73867. return setParm;
  73868. }
  73869. /**
  73870. * Get the two-letter MGRS 100k designator given information
  73871. * translated from the UTM northing, easting and zone number.
  73872. *
  73873. * @private
  73874. * @param {number} column the column index as it relates to the MGRS
  73875. * 100k set spreadsheet, created from the UTM easting.
  73876. * Values are 1-8.
  73877. * @param {number} row the row index as it relates to the MGRS 100k set
  73878. * spreadsheet, created from the UTM northing value. Values
  73879. * are from 0-19.
  73880. * @param {number} parm the set block, as it relates to the MGRS 100k set
  73881. * spreadsheet, created from the UTM zone. Values are from
  73882. * 1-60.
  73883. * @return two letter MGRS 100k code.
  73884. */
  73885. function getLetter100kID(column, row, parm) {
  73886. // colOrigin and rowOrigin are the letters at the origin of the set
  73887. var index = parm - 1;
  73888. var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index);
  73889. var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index); // colInt and rowInt are the letters to build to return
  73890. var colInt = colOrigin + column - 1;
  73891. var rowInt = rowOrigin + row;
  73892. var rollover = false;
  73893. if (colInt > Z) {
  73894. colInt = colInt - Z + A - 1;
  73895. rollover = true;
  73896. }
  73897. if (colInt === I || colOrigin < I && colInt > I || (colInt > I || colOrigin < I) && rollover) {
  73898. colInt++;
  73899. }
  73900. if (colInt === O || colOrigin < O && colInt > O || (colInt > O || colOrigin < O) && rollover) {
  73901. colInt++;
  73902. if (colInt === I) {
  73903. colInt++;
  73904. }
  73905. }
  73906. if (colInt > Z) {
  73907. colInt = colInt - Z + A - 1;
  73908. }
  73909. if (rowInt > V) {
  73910. rowInt = rowInt - V + A - 1;
  73911. rollover = true;
  73912. } else {
  73913. rollover = false;
  73914. }
  73915. if (rowInt === I || rowOrigin < I && rowInt > I || (rowInt > I || rowOrigin < I) && rollover) {
  73916. rowInt++;
  73917. }
  73918. if (rowInt === O || rowOrigin < O && rowInt > O || (rowInt > O || rowOrigin < O) && rollover) {
  73919. rowInt++;
  73920. if (rowInt === I) {
  73921. rowInt++;
  73922. }
  73923. }
  73924. if (rowInt > V) {
  73925. rowInt = rowInt - V + A - 1;
  73926. }
  73927. var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt);
  73928. return twoLetter;
  73929. }
  73930. /**
  73931. * Decode the UTM parameters from a MGRS string.
  73932. *
  73933. * @private
  73934. * @param {string} mgrsString an UPPERCASE coordinate string is expected.
  73935. * @return {object} An object literal with easting, northing, zoneLetter,
  73936. * zoneNumber and accuracy (in meters) properties.
  73937. */
  73938. function decode(mgrsString) {
  73939. if (mgrsString && mgrsString.length === 0) {
  73940. throw "MGRSPoint coverting from nothing";
  73941. }
  73942. var length = mgrsString.length;
  73943. var hunK = null;
  73944. var sb = "";
  73945. var testChar;
  73946. var i = 0; // get Zone number
  73947. while (!/[A-Z]/.test(testChar = mgrsString.charAt(i))) {
  73948. if (i >= 2) {
  73949. throw "MGRSPoint bad conversion from: " + mgrsString;
  73950. }
  73951. sb += testChar;
  73952. i++;
  73953. }
  73954. var zoneNumber = parseInt(sb, 10);
  73955. if (i === 0 || i + 3 > length) {
  73956. // A good MGRS string has to be 4-5 digits long,
  73957. // ##AAA/#AAA at least.
  73958. throw "MGRSPoint bad conversion from: " + mgrsString;
  73959. }
  73960. var zoneLetter = mgrsString.charAt(i++); // Should we check the zone letter here? Why not.
  73961. if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') {
  73962. throw "MGRSPoint zone letter " + zoneLetter + " not handled: " + mgrsString;
  73963. }
  73964. hunK = mgrsString.substring(i, i += 2);
  73965. var set = get100kSetForZone(zoneNumber);
  73966. var east100k = getEastingFromChar(hunK.charAt(0), set);
  73967. var north100k = getNorthingFromChar(hunK.charAt(1), set); // We have a bug where the northing may be 2000000 too low.
  73968. // How
  73969. // do we know when to roll over?
  73970. while (north100k < getMinNorthing(zoneLetter)) {
  73971. north100k += 2000000;
  73972. } // calculate the char index for easting/northing separator
  73973. var remainder = length - i;
  73974. if (remainder % 2 !== 0) {
  73975. 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;
  73976. }
  73977. var sep = remainder / 2;
  73978. var sepEasting = 0.0;
  73979. var sepNorthing = 0.0;
  73980. var accuracyBonus, sepEastingString, sepNorthingString, easting, northing;
  73981. if (sep > 0) {
  73982. accuracyBonus = 100000.0 / Math.pow(10, sep);
  73983. sepEastingString = mgrsString.substring(i, i + sep);
  73984. sepEasting = parseFloat(sepEastingString) * accuracyBonus;
  73985. sepNorthingString = mgrsString.substring(i + sep);
  73986. sepNorthing = parseFloat(sepNorthingString) * accuracyBonus;
  73987. }
  73988. easting = sepEasting + east100k;
  73989. northing = sepNorthing + north100k;
  73990. return {
  73991. easting: easting,
  73992. northing: northing,
  73993. zoneLetter: zoneLetter,
  73994. zoneNumber: zoneNumber,
  73995. accuracy: accuracyBonus
  73996. };
  73997. }
  73998. /**
  73999. * Given the first letter from a two-letter MGRS 100k zone, and given the
  74000. * MGRS table set for the zone number, figure out the easting value that
  74001. * should be added to the other, secondary easting value.
  74002. *
  74003. * @private
  74004. * @param {char} e The first letter from a two-letter MGRS 100´k zone.
  74005. * @param {number} set The MGRS table set for the zone number.
  74006. * @return {number} The easting value for the given letter and set.
  74007. */
  74008. function getEastingFromChar(e, set) {
  74009. // colOrigin is the letter at the origin of the set for the
  74010. // column
  74011. var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1);
  74012. var eastingValue = 100000.0;
  74013. var rewindMarker = false;
  74014. while (curCol !== e.charCodeAt(0)) {
  74015. curCol++;
  74016. if (curCol === I) {
  74017. curCol++;
  74018. }
  74019. if (curCol === O) {
  74020. curCol++;
  74021. }
  74022. if (curCol > Z) {
  74023. if (rewindMarker) {
  74024. throw "Bad character: " + e;
  74025. }
  74026. curCol = A;
  74027. rewindMarker = true;
  74028. }
  74029. eastingValue += 100000.0;
  74030. }
  74031. return eastingValue;
  74032. }
  74033. /**
  74034. * Given the second letter from a two-letter MGRS 100k zone, and given the
  74035. * MGRS table set for the zone number, figure out the northing value that
  74036. * should be added to the other, secondary northing value. You have to
  74037. * remember that Northings are determined from the equator, and the vertical
  74038. * cycle of letters mean a 2000000 additional northing meters. This happens
  74039. * approx. every 18 degrees of latitude. This method does *NOT* count any
  74040. * additional northings. You have to figure out how many 2000000 meters need
  74041. * to be added for the zone letter of the MGRS coordinate.
  74042. *
  74043. * @private
  74044. * @param {char} n Second letter of the MGRS 100k zone
  74045. * @param {number} set The MGRS table set number, which is dependent on the
  74046. * UTM zone number.
  74047. * @return {number} The northing value for the given letter and set.
  74048. */
  74049. function getNorthingFromChar(n, set) {
  74050. if (n > 'V') {
  74051. throw "MGRSPoint given invalid Northing " + n;
  74052. } // rowOrigin is the letter at the origin of the set for the
  74053. // column
  74054. var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set - 1);
  74055. var northingValue = 0.0;
  74056. var rewindMarker = false;
  74057. while (curRow !== n.charCodeAt(0)) {
  74058. curRow++;
  74059. if (curRow === I) {
  74060. curRow++;
  74061. }
  74062. if (curRow === O) {
  74063. curRow++;
  74064. } // fixing a bug making whole application hang in this loop
  74065. // when 'n' is a wrong character
  74066. if (curRow > V) {
  74067. if (rewindMarker) {
  74068. // making sure that this loop ends
  74069. throw "Bad character: " + n;
  74070. }
  74071. curRow = A;
  74072. rewindMarker = true;
  74073. }
  74074. northingValue += 100000.0;
  74075. }
  74076. return northingValue;
  74077. }
  74078. /**
  74079. * The function getMinNorthing returns the minimum northing value of a MGRS
  74080. * zone.
  74081. *
  74082. * Ported from Geotrans' c Lattitude_Band_Value structure table.
  74083. *
  74084. * @private
  74085. * @param {char} zoneLetter The MGRS zone to get the min northing for.
  74086. * @return {number}
  74087. */
  74088. function getMinNorthing(zoneLetter) {
  74089. var northing;
  74090. switch (zoneLetter) {
  74091. case 'C':
  74092. northing = 1100000.0;
  74093. break;
  74094. case 'D':
  74095. northing = 2000000.0;
  74096. break;
  74097. case 'E':
  74098. northing = 2800000.0;
  74099. break;
  74100. case 'F':
  74101. northing = 3700000.0;
  74102. break;
  74103. case 'G':
  74104. northing = 4600000.0;
  74105. break;
  74106. case 'H':
  74107. northing = 5500000.0;
  74108. break;
  74109. case 'J':
  74110. northing = 6400000.0;
  74111. break;
  74112. case 'K':
  74113. northing = 7300000.0;
  74114. break;
  74115. case 'L':
  74116. northing = 8200000.0;
  74117. break;
  74118. case 'M':
  74119. northing = 9100000.0;
  74120. break;
  74121. case 'N':
  74122. northing = 0.0;
  74123. break;
  74124. case 'P':
  74125. northing = 800000.0;
  74126. break;
  74127. case 'Q':
  74128. northing = 1700000.0;
  74129. break;
  74130. case 'R':
  74131. northing = 2600000.0;
  74132. break;
  74133. case 'S':
  74134. northing = 3500000.0;
  74135. break;
  74136. case 'T':
  74137. northing = 4400000.0;
  74138. break;
  74139. case 'U':
  74140. northing = 5300000.0;
  74141. break;
  74142. case 'V':
  74143. northing = 6200000.0;
  74144. break;
  74145. case 'W':
  74146. northing = 7000000.0;
  74147. break;
  74148. case 'X':
  74149. northing = 7900000.0;
  74150. break;
  74151. default:
  74152. northing = -1.0;
  74153. }
  74154. if (northing >= 0.0) {
  74155. return northing;
  74156. } else {
  74157. throw "Invalid zone letter: " + zoneLetter;
  74158. }
  74159. }
  74160. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/Point.js
  74161. function lib_Point_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { lib_Point_typeof = function _typeof(obj) { return typeof obj; }; } else { lib_Point_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return lib_Point_typeof(obj); }
  74162. function lib_Point_Point(x, y, z) {
  74163. if (!(this instanceof lib_Point_Point)) {
  74164. return new lib_Point_Point(x, y, z);
  74165. }
  74166. if (Array.isArray(x)) {
  74167. this.x = x[0];
  74168. this.y = x[1];
  74169. this.z = x[2] || 0.0;
  74170. } else if (lib_Point_typeof(x) === 'object') {
  74171. this.x = x.x;
  74172. this.y = x.y;
  74173. this.z = x.z || 0.0;
  74174. } else if (typeof x === 'string' && typeof y === 'undefined') {
  74175. var coords = x.split(',');
  74176. this.x = parseFloat(coords[0], 10);
  74177. this.y = parseFloat(coords[1], 10);
  74178. this.z = parseFloat(coords[2], 10) || 0.0;
  74179. } else {
  74180. this.x = x;
  74181. this.y = y;
  74182. this.z = z || 0.0;
  74183. }
  74184. console.warn('proj4.Point will be removed in version 3, use proj4.toPoint');
  74185. }
  74186. lib_Point_Point.fromMGRS = function (mgrsStr) {
  74187. return new lib_Point_Point(mgrs_toPoint(mgrsStr));
  74188. };
  74189. lib_Point_Point.prototype.toMGRS = function (accuracy) {
  74190. return mgrs_forward([this.x, this.y], accuracy);
  74191. };
  74192. /* harmony default export */ var lib_Point = (lib_Point_Point);
  74193. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/pj_enfn.js
  74194. var C00 = 1;
  74195. var C02 = 0.25;
  74196. var C04 = 0.046875;
  74197. var C06 = 0.01953125;
  74198. var C08 = 0.01068115234375;
  74199. var C22 = 0.75;
  74200. var C44 = 0.46875;
  74201. var C46 = 0.01302083333333333333;
  74202. var C48 = 0.00712076822916666666;
  74203. var C66 = 0.36458333333333333333;
  74204. var C68 = 0.00569661458333333333;
  74205. var C88 = 0.3076171875;
  74206. /* harmony default export */ function pj_enfn(es) {
  74207. var en = [];
  74208. en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));
  74209. en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));
  74210. var t = es * es;
  74211. en[2] = t * (C44 - es * (C46 + es * C48));
  74212. t *= es;
  74213. en[3] = t * (C66 - es * C68);
  74214. en[4] = t * es * C88;
  74215. return en;
  74216. }
  74217. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/pj_mlfn.js
  74218. /* harmony default export */ function pj_mlfn(phi, sphi, cphi, en) {
  74219. cphi *= sphi;
  74220. sphi *= sphi;
  74221. return en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4])));
  74222. }
  74223. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/pj_inv_mlfn.js
  74224. var MAX_ITER = 20;
  74225. /* harmony default export */ function pj_inv_mlfn(arg, es, en) {
  74226. var k = 1 / (1 - es);
  74227. var phi = arg;
  74228. for (var i = MAX_ITER; i; --i) {
  74229. /* rarely goes over 2 iterations */
  74230. var s = Math.sin(phi);
  74231. var t = 1 - es * s * s; //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg;
  74232. //phi -= t * (t * Math.sqrt(t)) * k;
  74233. t = (pj_mlfn(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;
  74234. phi -= t;
  74235. if (Math.abs(t) < EPSLN) {
  74236. return phi;
  74237. }
  74238. } //..reportError("cass:pj_inv_mlfn: Convergence error");
  74239. return phi;
  74240. }
  74241. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/tmerc.js
  74242. // Heavily based on this tmerc projection implementation
  74243. // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/tmerc.js
  74244. function tmerc_init() {
  74245. this.x0 = this.x0 !== undefined ? this.x0 : 0;
  74246. this.y0 = this.y0 !== undefined ? this.y0 : 0;
  74247. this.long0 = this.long0 !== undefined ? this.long0 : 0;
  74248. this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;
  74249. if (this.es) {
  74250. this.en = pj_enfn(this.es);
  74251. this.ml0 = pj_mlfn(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);
  74252. }
  74253. }
  74254. /**
  74255. Transverse Mercator Forward - long/lat to x/y
  74256. long/lat in radians
  74257. */
  74258. function tmerc_forward(p) {
  74259. var lon = p.x;
  74260. var lat = p.y;
  74261. var delta_lon = adjust_lon(lon - this.long0);
  74262. var con;
  74263. var x, y;
  74264. var sin_phi = Math.sin(lat);
  74265. var cos_phi = Math.cos(lat);
  74266. if (!this.es) {
  74267. var b = cos_phi * Math.sin(delta_lon);
  74268. if (Math.abs(Math.abs(b) - 1) < EPSLN) {
  74269. return 93;
  74270. } else {
  74271. x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;
  74272. y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));
  74273. b = Math.abs(y);
  74274. if (b >= 1) {
  74275. if (b - 1 > EPSLN) {
  74276. return 93;
  74277. } else {
  74278. y = 0;
  74279. }
  74280. } else {
  74281. y = Math.acos(y);
  74282. }
  74283. if (lat < 0) {
  74284. y = -y;
  74285. }
  74286. y = this.a * this.k0 * (y - this.lat0) + this.y0;
  74287. }
  74288. } else {
  74289. var al = cos_phi * delta_lon;
  74290. var als = Math.pow(al, 2);
  74291. var c = this.ep2 * Math.pow(cos_phi, 2);
  74292. var cs = Math.pow(c, 2);
  74293. var tq = Math.abs(cos_phi) > EPSLN ? Math.tan(lat) : 0;
  74294. var t = Math.pow(tq, 2);
  74295. var ts = Math.pow(t, 2);
  74296. con = 1 - this.es * Math.pow(sin_phi, 2);
  74297. al = al / Math.sqrt(con);
  74298. var ml = pj_mlfn(lat, sin_phi, cos_phi, this.en);
  74299. 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;
  74300. 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;
  74301. }
  74302. p.x = x;
  74303. p.y = y;
  74304. return p;
  74305. }
  74306. /**
  74307. Transverse Mercator Inverse - x/y to long/lat
  74308. */
  74309. function tmerc_inverse(p) {
  74310. var con, phi;
  74311. var lat, lon;
  74312. var x = (p.x - this.x0) * (1 / this.a);
  74313. var y = (p.y - this.y0) * (1 / this.a);
  74314. if (!this.es) {
  74315. var f = Math.exp(x / this.k0);
  74316. var g = 0.5 * (f - 1 / f);
  74317. var temp = this.lat0 + y / this.k0;
  74318. var h = Math.cos(temp);
  74319. con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2)));
  74320. lat = Math.asin(con);
  74321. if (y < 0) {
  74322. lat = -lat;
  74323. }
  74324. if (g === 0 && h === 0) {
  74325. lon = 0;
  74326. } else {
  74327. lon = adjust_lon(Math.atan2(g, h) + this.long0);
  74328. }
  74329. } else {
  74330. // ellipsoidal form
  74331. con = this.ml0 + y / this.k0;
  74332. phi = pj_inv_mlfn(con, this.es, this.en);
  74333. if (Math.abs(phi) < HALF_PI) {
  74334. var sin_phi = Math.sin(phi);
  74335. var cos_phi = Math.cos(phi);
  74336. var tan_phi = Math.abs(cos_phi) > EPSLN ? Math.tan(phi) : 0;
  74337. var c = this.ep2 * Math.pow(cos_phi, 2);
  74338. var cs = Math.pow(c, 2);
  74339. var t = Math.pow(tan_phi, 2);
  74340. var ts = Math.pow(t, 2);
  74341. con = 1 - this.es * Math.pow(sin_phi, 2);
  74342. var d = x * Math.sqrt(con) / this.k0;
  74343. var ds = Math.pow(d, 2);
  74344. con = con * tan_phi;
  74345. 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))));
  74346. 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);
  74347. } else {
  74348. lat = HALF_PI * sign(y);
  74349. lon = 0;
  74350. }
  74351. }
  74352. p.x = lon;
  74353. p.y = lat;
  74354. return p;
  74355. }
  74356. var tmerc_names = ["Transverse_Mercator", "Transverse Mercator", "tmerc"];
  74357. /* harmony default export */ var tmerc = ({
  74358. init: tmerc_init,
  74359. forward: tmerc_forward,
  74360. inverse: tmerc_inverse,
  74361. names: tmerc_names
  74362. });
  74363. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/sinh.js
  74364. /* harmony default export */ function sinh(x) {
  74365. var r = Math.exp(x);
  74366. r = (r - 1 / r) / 2;
  74367. return r;
  74368. }
  74369. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/hypot.js
  74370. /* harmony default export */ function hypot(x, y) {
  74371. x = Math.abs(x);
  74372. y = Math.abs(y);
  74373. var a = Math.max(x, y);
  74374. var b = Math.min(x, y) / (a ? a : 1);
  74375. return a * Math.sqrt(1 + Math.pow(b, 2));
  74376. }
  74377. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/log1py.js
  74378. /* harmony default export */ function log1py(x) {
  74379. var y = 1 + x;
  74380. var z = y - 1;
  74381. return z === 0 ? x : x * Math.log(y) / z;
  74382. }
  74383. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/asinhy.js
  74384. /* harmony default export */ function asinhy(x) {
  74385. var y = Math.abs(x);
  74386. y = log1py(y * (1 + y / (hypot(1, y) + 1)));
  74387. return x < 0 ? -y : y;
  74388. }
  74389. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/gatg.js
  74390. /* harmony default export */ function gatg(pp, B) {
  74391. var cos_2B = 2 * Math.cos(2 * B);
  74392. var i = pp.length - 1;
  74393. var h1 = pp[i];
  74394. var h2 = 0;
  74395. var h;
  74396. while (--i >= 0) {
  74397. h = -h2 + cos_2B * h1 + pp[i];
  74398. h2 = h1;
  74399. h1 = h;
  74400. }
  74401. return B + h * Math.sin(2 * B);
  74402. }
  74403. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/clens.js
  74404. /* harmony default export */ function clens(pp, arg_r) {
  74405. var r = 2 * Math.cos(arg_r);
  74406. var i = pp.length - 1;
  74407. var hr1 = pp[i];
  74408. var hr2 = 0;
  74409. var hr;
  74410. while (--i >= 0) {
  74411. hr = -hr2 + r * hr1 + pp[i];
  74412. hr2 = hr1;
  74413. hr1 = hr;
  74414. }
  74415. return Math.sin(arg_r) * hr;
  74416. }
  74417. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/cosh.js
  74418. /* harmony default export */ function cosh(x) {
  74419. var r = Math.exp(x);
  74420. r = (r + 1 / r) / 2;
  74421. return r;
  74422. }
  74423. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/clens_cmplx.js
  74424. /* harmony default export */ function clens_cmplx(pp, arg_r, arg_i) {
  74425. var sin_arg_r = Math.sin(arg_r);
  74426. var cos_arg_r = Math.cos(arg_r);
  74427. var sinh_arg_i = sinh(arg_i);
  74428. var cosh_arg_i = cosh(arg_i);
  74429. var r = 2 * cos_arg_r * cosh_arg_i;
  74430. var i = -2 * sin_arg_r * sinh_arg_i;
  74431. var j = pp.length - 1;
  74432. var hr = pp[j];
  74433. var hi1 = 0;
  74434. var hr1 = 0;
  74435. var hi = 0;
  74436. var hr2;
  74437. var hi2;
  74438. while (--j >= 0) {
  74439. hr2 = hr1;
  74440. hi2 = hi1;
  74441. hr1 = hr;
  74442. hi1 = hi;
  74443. hr = -hr2 + r * hr1 - i * hi1 + pp[j];
  74444. hi = -hi2 + i * hr1 + r * hi1;
  74445. }
  74446. r = sin_arg_r * cosh_arg_i;
  74447. i = cos_arg_r * sinh_arg_i;
  74448. return [r * hr - i * hi, r * hi + i * hr];
  74449. }
  74450. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/etmerc.js
  74451. // Heavily based on this etmerc projection implementation
  74452. // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/etmerc.js
  74453. function etmerc_init() {
  74454. if (this.es === undefined || this.es <= 0) {
  74455. throw new Error('incorrect elliptical usage');
  74456. }
  74457. this.x0 = this.x0 !== undefined ? this.x0 : 0;
  74458. this.y0 = this.y0 !== undefined ? this.y0 : 0;
  74459. this.long0 = this.long0 !== undefined ? this.long0 : 0;
  74460. this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;
  74461. this.cgb = [];
  74462. this.cbg = [];
  74463. this.utg = [];
  74464. this.gtu = [];
  74465. var f = this.es / (1 + Math.sqrt(1 - this.es));
  74466. var n = f / (2 - f);
  74467. var np = n;
  74468. this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675))))));
  74469. this.cbg[0] = n * (-2 + n * (2 / 3 + n * (4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));
  74470. np = np * n;
  74471. this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));
  74472. this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * (-13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));
  74473. np = np * n;
  74474. this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));
  74475. this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));
  74476. np = np * n;
  74477. this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));
  74478. this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * (-24832 / 14175)));
  74479. np = np * n;
  74480. this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));
  74481. this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));
  74482. np = np * n;
  74483. this.cgb[5] = np * (601676 / 22275);
  74484. this.cbg[5] = np * (444337 / 155925);
  74485. np = Math.pow(n, 2);
  74486. this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));
  74487. this.utg[0] = n * (-0.5 + n * (2 / 3 + n * (-37 / 96 + n * (1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));
  74488. this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));
  74489. this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));
  74490. this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));
  74491. np = np * n;
  74492. this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720))));
  74493. this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));
  74494. np = np * n;
  74495. this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));
  74496. this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));
  74497. np = np * n;
  74498. this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));
  74499. this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));
  74500. np = np * n;
  74501. this.utg[5] = np * (-20648693 / 638668800);
  74502. this.gtu[5] = np * (212378941 / 319334400);
  74503. var Z = gatg(this.cbg, this.lat0);
  74504. this.Zb = -this.Qn * (Z + clens(this.gtu, 2 * Z));
  74505. }
  74506. function etmerc_forward(p) {
  74507. var Ce = adjust_lon(p.x - this.long0);
  74508. var Cn = p.y;
  74509. Cn = gatg(this.cbg, Cn);
  74510. var sin_Cn = Math.sin(Cn);
  74511. var cos_Cn = Math.cos(Cn);
  74512. var sin_Ce = Math.sin(Ce);
  74513. var cos_Ce = Math.cos(Ce);
  74514. Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn);
  74515. Ce = Math.atan2(sin_Ce * cos_Cn, hypot(sin_Cn, cos_Cn * cos_Ce));
  74516. Ce = asinhy(Math.tan(Ce));
  74517. var tmp = clens_cmplx(this.gtu, 2 * Cn, 2 * Ce);
  74518. Cn = Cn + tmp[0];
  74519. Ce = Ce + tmp[1];
  74520. var x;
  74521. var y;
  74522. if (Math.abs(Ce) <= 2.623395162778) {
  74523. x = this.a * (this.Qn * Ce) + this.x0;
  74524. y = this.a * (this.Qn * Cn + this.Zb) + this.y0;
  74525. } else {
  74526. x = Infinity;
  74527. y = Infinity;
  74528. }
  74529. p.x = x;
  74530. p.y = y;
  74531. return p;
  74532. }
  74533. function etmerc_inverse(p) {
  74534. var Ce = (p.x - this.x0) * (1 / this.a);
  74535. var Cn = (p.y - this.y0) * (1 / this.a);
  74536. Cn = (Cn - this.Zb) / this.Qn;
  74537. Ce = Ce / this.Qn;
  74538. var lon;
  74539. var lat;
  74540. if (Math.abs(Ce) <= 2.623395162778) {
  74541. var tmp = clens_cmplx(this.utg, 2 * Cn, 2 * Ce);
  74542. Cn = Cn + tmp[0];
  74543. Ce = Ce + tmp[1];
  74544. Ce = Math.atan(sinh(Ce));
  74545. var sin_Cn = Math.sin(Cn);
  74546. var cos_Cn = Math.cos(Cn);
  74547. var sin_Ce = Math.sin(Ce);
  74548. var cos_Ce = Math.cos(Ce);
  74549. Cn = Math.atan2(sin_Cn * cos_Ce, hypot(sin_Ce, cos_Ce * cos_Cn));
  74550. Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);
  74551. lon = adjust_lon(Ce + this.long0);
  74552. lat = gatg(this.cgb, Cn);
  74553. } else {
  74554. lon = Infinity;
  74555. lat = Infinity;
  74556. }
  74557. p.x = lon;
  74558. p.y = lat;
  74559. return p;
  74560. }
  74561. var etmerc_names = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc"];
  74562. /* harmony default export */ var etmerc = ({
  74563. init: etmerc_init,
  74564. forward: etmerc_forward,
  74565. inverse: etmerc_inverse,
  74566. names: etmerc_names
  74567. });
  74568. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/adjust_zone.js
  74569. /* harmony default export */ function adjust_zone(zone, lon) {
  74570. if (zone === undefined) {
  74571. zone = Math.floor((adjust_lon(lon) + Math.PI) * 30 / Math.PI) + 1;
  74572. if (zone < 0) {
  74573. return 0;
  74574. } else if (zone > 60) {
  74575. return 60;
  74576. }
  74577. }
  74578. return zone;
  74579. }
  74580. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/utm.js
  74581. var dependsOn = 'etmerc';
  74582. function utm_init() {
  74583. var zone = adjust_zone(this.zone, this.long0);
  74584. if (zone === undefined) {
  74585. throw new Error('unknown utm zone');
  74586. }
  74587. this.lat0 = 0;
  74588. this.long0 = (6 * Math.abs(zone) - 183) * D2R;
  74589. this.x0 = 500000;
  74590. this.y0 = this.utmSouth ? 10000000 : 0;
  74591. this.k0 = 0.9996;
  74592. etmerc.init.apply(this);
  74593. this.forward = etmerc.forward;
  74594. this.inverse = etmerc.inverse;
  74595. }
  74596. var utm_names = ["Universal Transverse Mercator System", "utm"];
  74597. /* harmony default export */ var utm = ({
  74598. init: utm_init,
  74599. names: utm_names,
  74600. dependsOn: dependsOn
  74601. });
  74602. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/srat.js
  74603. /* harmony default export */ function srat(esinp, exp) {
  74604. return Math.pow((1 - esinp) / (1 + esinp), exp);
  74605. }
  74606. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/gauss.js
  74607. var gauss_MAX_ITER = 20;
  74608. function gauss_init() {
  74609. var sphi = Math.sin(this.lat0);
  74610. var cphi = Math.cos(this.lat0);
  74611. cphi *= cphi;
  74612. this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi);
  74613. this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es));
  74614. this.phic0 = Math.asin(sphi / this.C);
  74615. this.ratexp = 0.5 * this.C * this.e;
  74616. 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));
  74617. }
  74618. function gauss_forward(p) {
  74619. var lon = p.x;
  74620. var lat = p.y;
  74621. 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;
  74622. p.x = this.C * lon;
  74623. return p;
  74624. }
  74625. function gauss_inverse(p) {
  74626. var DEL_TOL = 1e-14;
  74627. var lon = p.x / this.C;
  74628. var lat = p.y;
  74629. var num = Math.pow(Math.tan(0.5 * lat + FORTPI) / this.K, 1 / this.C);
  74630. for (var i = gauss_MAX_ITER; i > 0; --i) {
  74631. lat = 2 * Math.atan(num * srat(this.e * Math.sin(p.y), -0.5 * this.e)) - HALF_PI;
  74632. if (Math.abs(lat - p.y) < DEL_TOL) {
  74633. break;
  74634. }
  74635. p.y = lat;
  74636. }
  74637. /* convergence failed */
  74638. if (!i) {
  74639. return null;
  74640. }
  74641. p.x = lon;
  74642. p.y = lat;
  74643. return p;
  74644. }
  74645. var gauss_names = ["gauss"];
  74646. /* harmony default export */ var gauss = ({
  74647. init: gauss_init,
  74648. forward: gauss_forward,
  74649. inverse: gauss_inverse,
  74650. names: gauss_names
  74651. });
  74652. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/sterea.js
  74653. function sterea_init() {
  74654. gauss.init.apply(this);
  74655. if (!this.rc) {
  74656. return;
  74657. }
  74658. this.sinc0 = Math.sin(this.phic0);
  74659. this.cosc0 = Math.cos(this.phic0);
  74660. this.R2 = 2 * this.rc;
  74661. if (!this.title) {
  74662. this.title = "Oblique Stereographic Alternative";
  74663. }
  74664. }
  74665. function sterea_forward(p) {
  74666. var sinc, cosc, cosl, k;
  74667. p.x = adjust_lon(p.x - this.long0);
  74668. gauss.forward.apply(this, [p]);
  74669. sinc = Math.sin(p.y);
  74670. cosc = Math.cos(p.y);
  74671. cosl = Math.cos(p.x);
  74672. k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);
  74673. p.x = k * cosc * Math.sin(p.x);
  74674. p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);
  74675. p.x = this.a * p.x + this.x0;
  74676. p.y = this.a * p.y + this.y0;
  74677. return p;
  74678. }
  74679. function sterea_inverse(p) {
  74680. var sinc, cosc, lon, lat, rho;
  74681. p.x = (p.x - this.x0) / this.a;
  74682. p.y = (p.y - this.y0) / this.a;
  74683. p.x /= this.k0;
  74684. p.y /= this.k0;
  74685. if (rho = Math.sqrt(p.x * p.x + p.y * p.y)) {
  74686. var c = 2 * Math.atan2(rho, this.R2);
  74687. sinc = Math.sin(c);
  74688. cosc = Math.cos(c);
  74689. lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);
  74690. lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);
  74691. } else {
  74692. lat = this.phic0;
  74693. lon = 0;
  74694. }
  74695. p.x = lon;
  74696. p.y = lat;
  74697. gauss.inverse.apply(this, [p]);
  74698. p.x = adjust_lon(p.x + this.long0);
  74699. return p;
  74700. }
  74701. var sterea_names = ["Stereographic_North_Pole", "Oblique_Stereographic", "Polar_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
  74702. /* harmony default export */ var sterea = ({
  74703. init: sterea_init,
  74704. forward: sterea_forward,
  74705. inverse: sterea_inverse,
  74706. names: sterea_names
  74707. });
  74708. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/stere.js
  74709. function ssfn_(phit, sinphi, eccen) {
  74710. sinphi *= eccen;
  74711. return Math.tan(0.5 * (HALF_PI + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen);
  74712. }
  74713. function stere_init() {
  74714. this.coslat0 = Math.cos(this.lat0);
  74715. this.sinlat0 = Math.sin(this.lat0);
  74716. if (this.sphere) {
  74717. if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
  74718. this.k0 = 0.5 * (1 + sign(this.lat0) * Math.sin(this.lat_ts));
  74719. }
  74720. } else {
  74721. if (Math.abs(this.coslat0) <= EPSLN) {
  74722. if (this.lat0 > 0) {
  74723. //North pole
  74724. //trace('stere:north pole');
  74725. this.con = 1;
  74726. } else {
  74727. //South pole
  74728. //trace('stere:south pole');
  74729. this.con = -1;
  74730. }
  74731. }
  74732. this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));
  74733. if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
  74734. 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));
  74735. }
  74736. this.ms1 = msfnz(this.e, this.sinlat0, this.coslat0);
  74737. this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - HALF_PI;
  74738. this.cosX0 = Math.cos(this.X0);
  74739. this.sinX0 = Math.sin(this.X0);
  74740. }
  74741. } // Stereographic forward equations--mapping lat,long to x,y
  74742. function stere_forward(p) {
  74743. var lon = p.x;
  74744. var lat = p.y;
  74745. var sinlat = Math.sin(lat);
  74746. var coslat = Math.cos(lat);
  74747. var A, X, sinX, cosX, ts, rh;
  74748. var dlon = adjust_lon(lon - this.long0);
  74749. if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= EPSLN && Math.abs(lat + this.lat0) <= EPSLN) {
  74750. //case of the origine point
  74751. //trace('stere:this is the origin point');
  74752. p.x = NaN;
  74753. p.y = NaN;
  74754. return p;
  74755. }
  74756. if (this.sphere) {
  74757. //trace('stere:sphere case');
  74758. A = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon));
  74759. p.x = this.a * A * coslat * Math.sin(dlon) + this.x0;
  74760. p.y = this.a * A * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0;
  74761. return p;
  74762. } else {
  74763. X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - HALF_PI;
  74764. cosX = Math.cos(X);
  74765. sinX = Math.sin(X);
  74766. if (Math.abs(this.coslat0) <= EPSLN) {
  74767. ts = tsfnz(this.e, lat * this.con, this.con * sinlat);
  74768. rh = 2 * this.a * this.k0 * ts / this.cons;
  74769. p.x = this.x0 + rh * Math.sin(lon - this.long0);
  74770. p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0); //trace(p.toString());
  74771. return p;
  74772. } else if (Math.abs(this.sinlat0) < EPSLN) {
  74773. //Eq
  74774. //trace('stere:equateur');
  74775. A = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon));
  74776. p.y = A * sinX;
  74777. } else {
  74778. //other case
  74779. //trace('stere:normal case');
  74780. A = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon)));
  74781. p.y = A * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0;
  74782. }
  74783. p.x = A * cosX * Math.sin(dlon) + this.x0;
  74784. } //trace(p.toString());
  74785. return p;
  74786. } //* Stereographic inverse equations--mapping x,y to lat/long
  74787. function stere_inverse(p) {
  74788. p.x -= this.x0;
  74789. p.y -= this.y0;
  74790. var lon, lat, ts, ce, Chi;
  74791. var rh = Math.sqrt(p.x * p.x + p.y * p.y);
  74792. if (this.sphere) {
  74793. var c = 2 * Math.atan(rh / (2 * this.a * this.k0));
  74794. lon = this.long0;
  74795. lat = this.lat0;
  74796. if (rh <= EPSLN) {
  74797. p.x = lon;
  74798. p.y = lat;
  74799. return p;
  74800. }
  74801. lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);
  74802. if (Math.abs(this.coslat0) < EPSLN) {
  74803. if (this.lat0 > 0) {
  74804. lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
  74805. } else {
  74806. lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
  74807. }
  74808. } else {
  74809. 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)));
  74810. }
  74811. p.x = lon;
  74812. p.y = lat;
  74813. return p;
  74814. } else {
  74815. if (Math.abs(this.coslat0) <= EPSLN) {
  74816. if (rh <= EPSLN) {
  74817. lat = this.lat0;
  74818. lon = this.long0;
  74819. p.x = lon;
  74820. p.y = lat; //trace(p.toString());
  74821. return p;
  74822. }
  74823. p.x *= this.con;
  74824. p.y *= this.con;
  74825. ts = rh * this.cons / (2 * this.a * this.k0);
  74826. lat = this.con * phi2z(this.e, ts);
  74827. lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, -1 * p.y));
  74828. } else {
  74829. ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));
  74830. lon = this.long0;
  74831. if (rh <= EPSLN) {
  74832. Chi = this.X0;
  74833. } else {
  74834. Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);
  74835. 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)));
  74836. }
  74837. lat = -1 * phi2z(this.e, Math.tan(0.5 * (HALF_PI + Chi)));
  74838. }
  74839. }
  74840. p.x = lon;
  74841. p.y = lat; //trace(p.toString());
  74842. return p;
  74843. }
  74844. var stere_names = ["stere", "Stereographic_South_Pole", "Polar Stereographic (variant B)"];
  74845. /* harmony default export */ var stere = ({
  74846. init: stere_init,
  74847. forward: stere_forward,
  74848. inverse: stere_inverse,
  74849. names: stere_names,
  74850. ssfn_: ssfn_
  74851. });
  74852. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/somerc.js
  74853. /*
  74854. references:
  74855. Formules et constantes pour le Calcul pour la
  74856. projection cylindrique conforme à axe oblique et pour la transformation entre
  74857. des systèmes de référence.
  74858. http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf
  74859. */
  74860. function somerc_init() {
  74861. var phy0 = this.lat0;
  74862. this.lambda0 = this.long0;
  74863. var sinPhy0 = Math.sin(phy0);
  74864. var semiMajorAxis = this.a;
  74865. var invF = this.rf;
  74866. var flattening = 1 / invF;
  74867. var e2 = 2 * flattening - Math.pow(flattening, 2);
  74868. var e = this.e = Math.sqrt(e2);
  74869. this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2));
  74870. this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4));
  74871. this.b0 = Math.asin(sinPhy0 / this.alpha);
  74872. var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2));
  74873. var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2));
  74874. var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0));
  74875. this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;
  74876. }
  74877. function somerc_forward(p) {
  74878. var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));
  74879. var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));
  74880. var S = -this.alpha * (Sa1 + Sa2) + this.K; // spheric latitude
  74881. var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4); // spheric longitude
  74882. var I = this.alpha * (p.x - this.lambda0); // psoeudo equatorial rotation
  74883. var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I)));
  74884. var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I));
  74885. p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0;
  74886. p.x = this.R * rotI + this.x0;
  74887. return p;
  74888. }
  74889. function somerc_inverse(p) {
  74890. var Y = p.x - this.x0;
  74891. var X = p.y - this.y0;
  74892. var rotI = Y / this.R;
  74893. var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4);
  74894. var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI));
  74895. var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB)));
  74896. var lambda = this.lambda0 + I / this.alpha;
  74897. var S = 0;
  74898. var phy = b;
  74899. var prevPhy = -1000;
  74900. var iteration = 0;
  74901. while (Math.abs(phy - prevPhy) > 0.0000001) {
  74902. if (++iteration > 20) {
  74903. //...reportError("omercFwdInfinity");
  74904. return;
  74905. } //S = Math.log(Math.tan(Math.PI / 4 + phy / 2));
  74906. 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));
  74907. prevPhy = phy;
  74908. phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2;
  74909. }
  74910. p.x = lambda;
  74911. p.y = phy;
  74912. return p;
  74913. }
  74914. var somerc_names = ["somerc"];
  74915. /* harmony default export */ var somerc = ({
  74916. init: somerc_init,
  74917. forward: somerc_forward,
  74918. inverse: somerc_inverse,
  74919. names: somerc_names
  74920. });
  74921. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/omerc.js
  74922. /* Initialize the Oblique Mercator projection
  74923. ------------------------------------------*/
  74924. function omerc_init() {
  74925. this.no_off = this.no_off || false;
  74926. this.no_rot = this.no_rot || false;
  74927. if (isNaN(this.k0)) {
  74928. this.k0 = 1;
  74929. }
  74930. var sinlat = Math.sin(this.lat0);
  74931. var coslat = Math.cos(this.lat0);
  74932. var con = this.e * sinlat;
  74933. this.bl = Math.sqrt(1 + this.es / (1 - this.es) * Math.pow(coslat, 4));
  74934. this.al = this.a * this.bl * this.k0 * Math.sqrt(1 - this.es) / (1 - con * con);
  74935. var t0 = tsfnz(this.e, this.lat0, sinlat);
  74936. var dl = this.bl / coslat * Math.sqrt((1 - this.es) / (1 - con * con));
  74937. if (dl * dl < 1) {
  74938. dl = 1;
  74939. }
  74940. var fl;
  74941. var gl;
  74942. if (!isNaN(this.longc)) {
  74943. //Central point and azimuth method
  74944. if (this.lat0 >= 0) {
  74945. fl = dl + Math.sqrt(dl * dl - 1);
  74946. } else {
  74947. fl = dl - Math.sqrt(dl * dl - 1);
  74948. }
  74949. this.el = fl * Math.pow(t0, this.bl);
  74950. gl = 0.5 * (fl - 1 / fl);
  74951. this.gamma0 = Math.asin(Math.sin(this.alpha) / dl);
  74952. this.long0 = this.longc - Math.asin(gl * Math.tan(this.gamma0)) / this.bl;
  74953. } else {
  74954. //2 points method
  74955. var t1 = tsfnz(this.e, this.lat1, Math.sin(this.lat1));
  74956. var t2 = tsfnz(this.e, this.lat2, Math.sin(this.lat2));
  74957. if (this.lat0 >= 0) {
  74958. this.el = (dl + Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);
  74959. } else {
  74960. this.el = (dl - Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);
  74961. }
  74962. var hl = Math.pow(t1, this.bl);
  74963. var ll = Math.pow(t2, this.bl);
  74964. fl = this.el / hl;
  74965. gl = 0.5 * (fl - 1 / fl);
  74966. var jl = (this.el * this.el - ll * hl) / (this.el * this.el + ll * hl);
  74967. var pl = (ll - hl) / (ll + hl);
  74968. var dlon12 = adjust_lon(this.long1 - this.long2);
  74969. this.long0 = 0.5 * (this.long1 + this.long2) - Math.atan(jl * Math.tan(0.5 * this.bl * dlon12) / pl) / this.bl;
  74970. this.long0 = adjust_lon(this.long0);
  74971. var dlon10 = adjust_lon(this.long1 - this.long0);
  74972. this.gamma0 = Math.atan(Math.sin(this.bl * dlon10) / gl);
  74973. this.alpha = Math.asin(dl * Math.sin(this.gamma0));
  74974. }
  74975. if (this.no_off) {
  74976. this.uc = 0;
  74977. } else {
  74978. if (this.lat0 >= 0) {
  74979. this.uc = this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));
  74980. } else {
  74981. this.uc = -1 * this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));
  74982. }
  74983. }
  74984. }
  74985. /* Oblique Mercator forward equations--mapping lat,long to x,y
  74986. ----------------------------------------------------------*/
  74987. function omerc_forward(p) {
  74988. var lon = p.x;
  74989. var lat = p.y;
  74990. var dlon = adjust_lon(lon - this.long0);
  74991. var us, vs;
  74992. var con;
  74993. if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
  74994. if (lat > 0) {
  74995. con = -1;
  74996. } else {
  74997. con = 1;
  74998. }
  74999. vs = this.al / this.bl * Math.log(Math.tan(FORTPI + con * this.gamma0 * 0.5));
  75000. us = -1 * con * HALF_PI * this.al / this.bl;
  75001. } else {
  75002. var t = tsfnz(this.e, lat, Math.sin(lat));
  75003. var ql = this.el / Math.pow(t, this.bl);
  75004. var sl = 0.5 * (ql - 1 / ql);
  75005. var tl = 0.5 * (ql + 1 / ql);
  75006. var vl = Math.sin(this.bl * dlon);
  75007. var ul = (sl * Math.sin(this.gamma0) - vl * Math.cos(this.gamma0)) / tl;
  75008. if (Math.abs(Math.abs(ul) - 1) <= EPSLN) {
  75009. vs = Number.POSITIVE_INFINITY;
  75010. } else {
  75011. vs = 0.5 * this.al * Math.log((1 - ul) / (1 + ul)) / this.bl;
  75012. }
  75013. if (Math.abs(Math.cos(this.bl * dlon)) <= EPSLN) {
  75014. us = this.al * this.bl * dlon;
  75015. } else {
  75016. us = this.al * Math.atan2(sl * Math.cos(this.gamma0) + vl * Math.sin(this.gamma0), Math.cos(this.bl * dlon)) / this.bl;
  75017. }
  75018. }
  75019. if (this.no_rot) {
  75020. p.x = this.x0 + us;
  75021. p.y = this.y0 + vs;
  75022. } else {
  75023. us -= this.uc;
  75024. p.x = this.x0 + vs * Math.cos(this.alpha) + us * Math.sin(this.alpha);
  75025. p.y = this.y0 + us * Math.cos(this.alpha) - vs * Math.sin(this.alpha);
  75026. }
  75027. return p;
  75028. }
  75029. function omerc_inverse(p) {
  75030. var us, vs;
  75031. if (this.no_rot) {
  75032. vs = p.y - this.y0;
  75033. us = p.x - this.x0;
  75034. } else {
  75035. vs = (p.x - this.x0) * Math.cos(this.alpha) - (p.y - this.y0) * Math.sin(this.alpha);
  75036. us = (p.y - this.y0) * Math.cos(this.alpha) + (p.x - this.x0) * Math.sin(this.alpha);
  75037. us += this.uc;
  75038. }
  75039. var qp = Math.exp(-1 * this.bl * vs / this.al);
  75040. var sp = 0.5 * (qp - 1 / qp);
  75041. var tp = 0.5 * (qp + 1 / qp);
  75042. var vp = Math.sin(this.bl * us / this.al);
  75043. var up = (vp * Math.cos(this.gamma0) + sp * Math.sin(this.gamma0)) / tp;
  75044. var ts = Math.pow(this.el / Math.sqrt((1 + up) / (1 - up)), 1 / this.bl);
  75045. if (Math.abs(up - 1) < EPSLN) {
  75046. p.x = this.long0;
  75047. p.y = HALF_PI;
  75048. } else if (Math.abs(up + 1) < EPSLN) {
  75049. p.x = this.long0;
  75050. p.y = -1 * HALF_PI;
  75051. } else {
  75052. p.y = phi2z(this.e, ts);
  75053. p.x = adjust_lon(this.long0 - Math.atan2(sp * Math.cos(this.gamma0) - vp * Math.sin(this.gamma0), Math.cos(this.bl * us / this.al)) / this.bl);
  75054. }
  75055. return p;
  75056. }
  75057. var omerc_names = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "omerc"];
  75058. /* harmony default export */ var omerc = ({
  75059. init: omerc_init,
  75060. forward: omerc_forward,
  75061. inverse: omerc_inverse,
  75062. names: omerc_names
  75063. });
  75064. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/lcc.js
  75065. function lcc_init() {
  75066. // array of: r_maj,r_min,lat1,lat2,c_lon,c_lat,false_east,false_north
  75067. //double c_lat; /* center latitude */
  75068. //double c_lon; /* center longitude */
  75069. //double lat1; /* first standard parallel */
  75070. //double lat2; /* second standard parallel */
  75071. //double r_maj; /* major axis */
  75072. //double r_min; /* minor axis */
  75073. //double false_east; /* x offset in meters */
  75074. //double false_north; /* y offset in meters */
  75075. if (!this.lat2) {
  75076. this.lat2 = this.lat1;
  75077. } //if lat2 is not defined
  75078. if (!this.k0) {
  75079. this.k0 = 1;
  75080. }
  75081. this.x0 = this.x0 || 0;
  75082. this.y0 = this.y0 || 0; // Standard Parallels cannot be equal and on opposite sides of the equator
  75083. if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
  75084. return;
  75085. }
  75086. var temp = this.b / this.a;
  75087. this.e = Math.sqrt(1 - temp * temp);
  75088. var sin1 = Math.sin(this.lat1);
  75089. var cos1 = Math.cos(this.lat1);
  75090. var ms1 = msfnz(this.e, sin1, cos1);
  75091. var ts1 = tsfnz(this.e, this.lat1, sin1);
  75092. var sin2 = Math.sin(this.lat2);
  75093. var cos2 = Math.cos(this.lat2);
  75094. var ms2 = msfnz(this.e, sin2, cos2);
  75095. var ts2 = tsfnz(this.e, this.lat2, sin2);
  75096. var ts0 = tsfnz(this.e, this.lat0, Math.sin(this.lat0));
  75097. if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
  75098. this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);
  75099. } else {
  75100. this.ns = sin1;
  75101. }
  75102. if (isNaN(this.ns)) {
  75103. this.ns = sin1;
  75104. }
  75105. this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));
  75106. this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);
  75107. if (!this.title) {
  75108. this.title = "Lambert Conformal Conic";
  75109. }
  75110. } // Lambert Conformal conic forward equations--mapping lat,long to x,y
  75111. // -----------------------------------------------------------------
  75112. function lcc_forward(p) {
  75113. var lon = p.x;
  75114. var lat = p.y; // singular cases :
  75115. if (Math.abs(2 * Math.abs(lat) - Math.PI) <= EPSLN) {
  75116. lat = sign(lat) * (HALF_PI - 2 * EPSLN);
  75117. }
  75118. var con = Math.abs(Math.abs(lat) - HALF_PI);
  75119. var ts, rh1;
  75120. if (con > EPSLN) {
  75121. ts = tsfnz(this.e, lat, Math.sin(lat));
  75122. rh1 = this.a * this.f0 * Math.pow(ts, this.ns);
  75123. } else {
  75124. con = lat * this.ns;
  75125. if (con <= 0) {
  75126. return null;
  75127. }
  75128. rh1 = 0;
  75129. }
  75130. var theta = this.ns * adjust_lon(lon - this.long0);
  75131. p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;
  75132. p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;
  75133. return p;
  75134. } // Lambert Conformal Conic inverse equations--mapping x,y to lat/long
  75135. // -----------------------------------------------------------------
  75136. function lcc_inverse(p) {
  75137. var rh1, con, ts;
  75138. var lat, lon;
  75139. var x = (p.x - this.x0) / this.k0;
  75140. var y = this.rh - (p.y - this.y0) / this.k0;
  75141. if (this.ns > 0) {
  75142. rh1 = Math.sqrt(x * x + y * y);
  75143. con = 1;
  75144. } else {
  75145. rh1 = -Math.sqrt(x * x + y * y);
  75146. con = -1;
  75147. }
  75148. var theta = 0;
  75149. if (rh1 !== 0) {
  75150. theta = Math.atan2(con * x, con * y);
  75151. }
  75152. if (rh1 !== 0 || this.ns > 0) {
  75153. con = 1 / this.ns;
  75154. ts = Math.pow(rh1 / (this.a * this.f0), con);
  75155. lat = phi2z(this.e, ts);
  75156. if (lat === -9999) {
  75157. return null;
  75158. }
  75159. } else {
  75160. lat = -HALF_PI;
  75161. }
  75162. lon = adjust_lon(theta / this.ns + this.long0);
  75163. p.x = lon;
  75164. p.y = lat;
  75165. return p;
  75166. }
  75167. var lcc_names = ["Lambert Tangential Conformal Conic Projection", "Lambert_Conformal_Conic", "Lambert_Conformal_Conic_2SP", "lcc"];
  75168. /* harmony default export */ var lcc = ({
  75169. init: lcc_init,
  75170. forward: lcc_forward,
  75171. inverse: lcc_inverse,
  75172. names: lcc_names
  75173. });
  75174. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/krovak.js
  75175. function krovak_init() {
  75176. this.a = 6377397.155;
  75177. this.es = 0.006674372230614;
  75178. this.e = Math.sqrt(this.es);
  75179. if (!this.lat0) {
  75180. this.lat0 = 0.863937979737193;
  75181. }
  75182. if (!this.long0) {
  75183. this.long0 = 0.7417649320975901 - 0.308341501185665;
  75184. }
  75185. /* if scale not set default to 0.9999 */
  75186. if (!this.k0) {
  75187. this.k0 = 0.9999;
  75188. }
  75189. this.s45 = 0.785398163397448;
  75190. /* 45 */
  75191. this.s90 = 2 * this.s45;
  75192. this.fi0 = this.lat0;
  75193. this.e2 = this.es;
  75194. this.e = Math.sqrt(this.e2);
  75195. this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2));
  75196. this.uq = 1.04216856380474;
  75197. this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);
  75198. this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);
  75199. this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;
  75200. this.k1 = this.k0;
  75201. this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));
  75202. this.s0 = 1.37008346281555;
  75203. this.n = Math.sin(this.s0);
  75204. this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);
  75205. this.ad = this.s90 - this.uq;
  75206. }
  75207. /* ellipsoid */
  75208. /* calculate xy from lat/lon */
  75209. /* Constants, identical to inverse transform function */
  75210. function krovak_forward(p) {
  75211. var gfi, u, deltav, s, d, eps, ro;
  75212. var lon = p.x;
  75213. var lat = p.y;
  75214. var delta_lon = adjust_lon(lon - this.long0);
  75215. /* Transformation */
  75216. gfi = Math.pow((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat)), this.alfa * this.e / 2);
  75217. u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);
  75218. deltav = -delta_lon * this.alfa;
  75219. s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav));
  75220. d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s));
  75221. eps = this.n * d;
  75222. ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);
  75223. p.y = ro * Math.cos(eps) / 1;
  75224. p.x = ro * Math.sin(eps) / 1;
  75225. if (!this.czech) {
  75226. p.y *= -1;
  75227. p.x *= -1;
  75228. }
  75229. return p;
  75230. }
  75231. /* calculate lat/lon from xy */
  75232. function krovak_inverse(p) {
  75233. var u, deltav, s, d, eps, ro, fi1;
  75234. var ok;
  75235. /* Transformation */
  75236. /* revert y, x*/
  75237. var tmp = p.x;
  75238. p.x = p.y;
  75239. p.y = tmp;
  75240. if (!this.czech) {
  75241. p.y *= -1;
  75242. p.x *= -1;
  75243. }
  75244. ro = Math.sqrt(p.x * p.x + p.y * p.y);
  75245. eps = Math.atan2(p.y, p.x);
  75246. d = eps / Math.sin(this.s0);
  75247. s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45);
  75248. u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d));
  75249. deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u));
  75250. p.x = this.long0 - deltav / this.alfa;
  75251. fi1 = u;
  75252. ok = 0;
  75253. var iter = 0;
  75254. do {
  75255. 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);
  75256. if (Math.abs(fi1 - p.y) < 0.0000000001) {
  75257. ok = 1;
  75258. }
  75259. fi1 = p.y;
  75260. iter += 1;
  75261. } while (ok === 0 && iter < 15);
  75262. if (iter >= 15) {
  75263. return null;
  75264. }
  75265. return p;
  75266. }
  75267. var krovak_names = ["Krovak", "krovak"];
  75268. /* harmony default export */ var krovak = ({
  75269. init: krovak_init,
  75270. forward: krovak_forward,
  75271. inverse: krovak_inverse,
  75272. names: krovak_names
  75273. });
  75274. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/mlfn.js
  75275. /* harmony default export */ function mlfn(e0, e1, e2, e3, phi) {
  75276. return e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi);
  75277. }
  75278. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/e0fn.js
  75279. /* harmony default export */ function e0fn(x) {
  75280. return 1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x));
  75281. }
  75282. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/e1fn.js
  75283. /* harmony default export */ function e1fn(x) {
  75284. return 0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x));
  75285. }
  75286. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/e2fn.js
  75287. /* harmony default export */ function e2fn(x) {
  75288. return 0.05859375 * x * x * (1 + 0.75 * x);
  75289. }
  75290. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/e3fn.js
  75291. /* harmony default export */ function e3fn(x) {
  75292. return x * x * x * (35 / 3072);
  75293. }
  75294. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/gN.js
  75295. /* harmony default export */ function gN(a, e, sinphi) {
  75296. var temp = e * sinphi;
  75297. return a / Math.sqrt(1 - temp * temp);
  75298. }
  75299. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/adjust_lat.js
  75300. /* harmony default export */ function adjust_lat(x) {
  75301. return Math.abs(x) < HALF_PI ? x : x - sign(x) * Math.PI;
  75302. }
  75303. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/imlfn.js
  75304. /* harmony default export */ function imlfn(ml, e0, e1, e2, e3) {
  75305. var phi;
  75306. var dphi;
  75307. phi = ml / e0;
  75308. for (var i = 0; i < 15; i++) {
  75309. 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));
  75310. phi += dphi;
  75311. if (Math.abs(dphi) <= 0.0000000001) {
  75312. return phi;
  75313. }
  75314. } //..reportError("IMLFN-CONV:Latitude failed to converge after 15 iterations");
  75315. return NaN;
  75316. }
  75317. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/cass.js
  75318. function cass_init() {
  75319. if (!this.sphere) {
  75320. this.e0 = e0fn(this.es);
  75321. this.e1 = e1fn(this.es);
  75322. this.e2 = e2fn(this.es);
  75323. this.e3 = e3fn(this.es);
  75324. this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);
  75325. }
  75326. }
  75327. /* Cassini forward equations--mapping lat,long to x,y
  75328. -----------------------------------------------------------------------*/
  75329. function cass_forward(p) {
  75330. /* Forward equations
  75331. -----------------*/
  75332. var x, y;
  75333. var lam = p.x;
  75334. var phi = p.y;
  75335. lam = adjust_lon(lam - this.long0);
  75336. if (this.sphere) {
  75337. x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));
  75338. y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0);
  75339. } else {
  75340. //ellipsoid
  75341. var sinphi = Math.sin(phi);
  75342. var cosphi = Math.cos(phi);
  75343. var nl = gN(this.a, this.e, sinphi);
  75344. var tl = Math.tan(phi) * Math.tan(phi);
  75345. var al = lam * Math.cos(phi);
  75346. var asq = al * al;
  75347. var cl = this.es * cosphi * cosphi / (1 - this.es);
  75348. var ml = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);
  75349. x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120));
  75350. y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24);
  75351. }
  75352. p.x = x + this.x0;
  75353. p.y = y + this.y0;
  75354. return p;
  75355. }
  75356. /* Inverse equations
  75357. -----------------*/
  75358. function cass_inverse(p) {
  75359. p.x -= this.x0;
  75360. p.y -= this.y0;
  75361. var x = p.x / this.a;
  75362. var y = p.y / this.a;
  75363. var phi, lam;
  75364. if (this.sphere) {
  75365. var dd = y + this.lat0;
  75366. phi = Math.asin(Math.sin(dd) * Math.cos(x));
  75367. lam = Math.atan2(Math.tan(x), Math.cos(dd));
  75368. } else {
  75369. /* ellipsoid */
  75370. var ml1 = this.ml0 / this.a + y;
  75371. var phi1 = imlfn(ml1, this.e0, this.e1, this.e2, this.e3);
  75372. if (Math.abs(Math.abs(phi1) - HALF_PI) <= EPSLN) {
  75373. p.x = this.long0;
  75374. p.y = HALF_PI;
  75375. if (y < 0) {
  75376. p.y *= -1;
  75377. }
  75378. return p;
  75379. }
  75380. var nl1 = gN(this.a, this.e, Math.sin(phi1));
  75381. var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es);
  75382. var tl1 = Math.pow(Math.tan(phi1), 2);
  75383. var dl = x * this.a / nl1;
  75384. var dsq = dl * dl;
  75385. phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24);
  75386. lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);
  75387. }
  75388. p.x = adjust_lon(lam + this.long0);
  75389. p.y = adjust_lat(phi);
  75390. return p;
  75391. }
  75392. var cass_names = ["Cassini", "Cassini_Soldner", "cass"];
  75393. /* harmony default export */ var cass = ({
  75394. init: cass_init,
  75395. forward: cass_forward,
  75396. inverse: cass_inverse,
  75397. names: cass_names
  75398. });
  75399. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/qsfnz.js
  75400. /* harmony default export */ function qsfnz(eccent, sinphi) {
  75401. var con;
  75402. if (eccent > 1.0e-7) {
  75403. con = eccent * sinphi;
  75404. return (1 - eccent * eccent) * (sinphi / (1 - con * con) - 0.5 / eccent * Math.log((1 - con) / (1 + con)));
  75405. } else {
  75406. return 2 * sinphi;
  75407. }
  75408. }
  75409. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/laea.js
  75410. /*
  75411. reference
  75412. "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder,
  75413. The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.
  75414. */
  75415. var S_POLE = 1;
  75416. var N_POLE = 2;
  75417. var EQUIT = 3;
  75418. var OBLIQ = 4;
  75419. /* Initialize the Lambert Azimuthal Equal Area projection
  75420. ------------------------------------------------------*/
  75421. function laea_init() {
  75422. var t = Math.abs(this.lat0);
  75423. if (Math.abs(t - HALF_PI) < EPSLN) {
  75424. this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;
  75425. } else if (Math.abs(t) < EPSLN) {
  75426. this.mode = this.EQUIT;
  75427. } else {
  75428. this.mode = this.OBLIQ;
  75429. }
  75430. if (this.es > 0) {
  75431. var sinphi;
  75432. this.qp = qsfnz(this.e, 1);
  75433. this.mmf = 0.5 / (1 - this.es);
  75434. this.apa = authset(this.es);
  75435. switch (this.mode) {
  75436. case this.N_POLE:
  75437. this.dd = 1;
  75438. break;
  75439. case this.S_POLE:
  75440. this.dd = 1;
  75441. break;
  75442. case this.EQUIT:
  75443. this.rq = Math.sqrt(0.5 * this.qp);
  75444. this.dd = 1 / this.rq;
  75445. this.xmf = 1;
  75446. this.ymf = 0.5 * this.qp;
  75447. break;
  75448. case this.OBLIQ:
  75449. this.rq = Math.sqrt(0.5 * this.qp);
  75450. sinphi = Math.sin(this.lat0);
  75451. this.sinb1 = qsfnz(this.e, sinphi) / this.qp;
  75452. this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);
  75453. this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);
  75454. this.ymf = (this.xmf = this.rq) / this.dd;
  75455. this.xmf *= this.dd;
  75456. break;
  75457. }
  75458. } else {
  75459. if (this.mode === this.OBLIQ) {
  75460. this.sinph0 = Math.sin(this.lat0);
  75461. this.cosph0 = Math.cos(this.lat0);
  75462. }
  75463. }
  75464. }
  75465. /* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y
  75466. -----------------------------------------------------------------------*/
  75467. function laea_forward(p) {
  75468. /* Forward equations
  75469. -----------------*/
  75470. var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;
  75471. var lam = p.x;
  75472. var phi = p.y;
  75473. lam = adjust_lon(lam - this.long0);
  75474. if (this.sphere) {
  75475. sinphi = Math.sin(phi);
  75476. cosphi = Math.cos(phi);
  75477. coslam = Math.cos(lam);
  75478. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  75479. y = this.mode === this.EQUIT ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;
  75480. if (y <= EPSLN) {
  75481. return null;
  75482. }
  75483. y = Math.sqrt(2 / y);
  75484. x = y * cosphi * Math.sin(lam);
  75485. y *= this.mode === this.EQUIT ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;
  75486. } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
  75487. if (this.mode === this.N_POLE) {
  75488. coslam = -coslam;
  75489. }
  75490. if (Math.abs(phi + this.lat0) < EPSLN) {
  75491. return null;
  75492. }
  75493. y = FORTPI - phi * 0.5;
  75494. y = 2 * (this.mode === this.S_POLE ? Math.cos(y) : Math.sin(y));
  75495. x = y * Math.sin(lam);
  75496. y *= coslam;
  75497. }
  75498. } else {
  75499. sinb = 0;
  75500. cosb = 0;
  75501. b = 0;
  75502. coslam = Math.cos(lam);
  75503. sinlam = Math.sin(lam);
  75504. sinphi = Math.sin(phi);
  75505. q = qsfnz(this.e, sinphi);
  75506. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  75507. sinb = q / this.qp;
  75508. cosb = Math.sqrt(1 - sinb * sinb);
  75509. }
  75510. switch (this.mode) {
  75511. case this.OBLIQ:
  75512. b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;
  75513. break;
  75514. case this.EQUIT:
  75515. b = 1 + cosb * coslam;
  75516. break;
  75517. case this.N_POLE:
  75518. b = HALF_PI + phi;
  75519. q = this.qp - q;
  75520. break;
  75521. case this.S_POLE:
  75522. b = phi - HALF_PI;
  75523. q = this.qp + q;
  75524. break;
  75525. }
  75526. if (Math.abs(b) < EPSLN) {
  75527. return null;
  75528. }
  75529. switch (this.mode) {
  75530. case this.OBLIQ:
  75531. case this.EQUIT:
  75532. b = Math.sqrt(2 / b);
  75533. if (this.mode === this.OBLIQ) {
  75534. y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);
  75535. } else {
  75536. y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;
  75537. }
  75538. x = this.xmf * b * cosb * sinlam;
  75539. break;
  75540. case this.N_POLE:
  75541. case this.S_POLE:
  75542. if (q >= 0) {
  75543. x = (b = Math.sqrt(q)) * sinlam;
  75544. y = coslam * (this.mode === this.S_POLE ? b : -b);
  75545. } else {
  75546. x = y = 0;
  75547. }
  75548. break;
  75549. }
  75550. }
  75551. p.x = this.a * x + this.x0;
  75552. p.y = this.a * y + this.y0;
  75553. return p;
  75554. }
  75555. /* Inverse equations
  75556. -----------------*/
  75557. function laea_inverse(p) {
  75558. p.x -= this.x0;
  75559. p.y -= this.y0;
  75560. var x = p.x / this.a;
  75561. var y = p.y / this.a;
  75562. var lam, phi, cCe, sCe, q, rho, ab;
  75563. if (this.sphere) {
  75564. var cosz = 0,
  75565. rh,
  75566. sinz = 0;
  75567. rh = Math.sqrt(x * x + y * y);
  75568. phi = rh * 0.5;
  75569. if (phi > 1) {
  75570. return null;
  75571. }
  75572. phi = 2 * Math.asin(phi);
  75573. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  75574. sinz = Math.sin(phi);
  75575. cosz = Math.cos(phi);
  75576. }
  75577. switch (this.mode) {
  75578. case this.EQUIT:
  75579. phi = Math.abs(rh) <= EPSLN ? 0 : Math.asin(y * sinz / rh);
  75580. x *= sinz;
  75581. y = cosz * rh;
  75582. break;
  75583. case this.OBLIQ:
  75584. phi = Math.abs(rh) <= EPSLN ? this.lat0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh);
  75585. x *= sinz * this.cosph0;
  75586. y = (cosz - Math.sin(phi) * this.sinph0) * rh;
  75587. break;
  75588. case this.N_POLE:
  75589. y = -y;
  75590. phi = HALF_PI - phi;
  75591. break;
  75592. case this.S_POLE:
  75593. phi -= HALF_PI;
  75594. break;
  75595. }
  75596. lam = y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ) ? 0 : Math.atan2(x, y);
  75597. } else {
  75598. ab = 0;
  75599. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  75600. x /= this.dd;
  75601. y *= this.dd;
  75602. rho = Math.sqrt(x * x + y * y);
  75603. if (rho < EPSLN) {
  75604. p.x = this.long0;
  75605. p.y = this.lat0;
  75606. return p;
  75607. }
  75608. sCe = 2 * Math.asin(0.5 * rho / this.rq);
  75609. cCe = Math.cos(sCe);
  75610. x *= sCe = Math.sin(sCe);
  75611. if (this.mode === this.OBLIQ) {
  75612. ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho;
  75613. q = this.qp * ab;
  75614. y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe;
  75615. } else {
  75616. ab = y * sCe / rho;
  75617. q = this.qp * ab;
  75618. y = rho * cCe;
  75619. }
  75620. } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
  75621. if (this.mode === this.N_POLE) {
  75622. y = -y;
  75623. }
  75624. q = x * x + y * y;
  75625. if (!q) {
  75626. p.x = this.long0;
  75627. p.y = this.lat0;
  75628. return p;
  75629. }
  75630. ab = 1 - q / this.qp;
  75631. if (this.mode === this.S_POLE) {
  75632. ab = -ab;
  75633. }
  75634. }
  75635. lam = Math.atan2(x, y);
  75636. phi = authlat(Math.asin(ab), this.apa);
  75637. }
  75638. p.x = adjust_lon(this.long0 + lam);
  75639. p.y = phi;
  75640. return p;
  75641. }
  75642. /* determine latitude from authalic latitude */
  75643. var P00 = 0.33333333333333333333;
  75644. var P01 = 0.17222222222222222222;
  75645. var P02 = 0.10257936507936507936;
  75646. var P10 = 0.06388888888888888888;
  75647. var P11 = 0.06640211640211640211;
  75648. var P20 = 0.01641501294219154443;
  75649. function authset(es) {
  75650. var t;
  75651. var APA = [];
  75652. APA[0] = es * P00;
  75653. t = es * es;
  75654. APA[0] += t * P01;
  75655. APA[1] = t * P10;
  75656. t *= es;
  75657. APA[0] += t * P02;
  75658. APA[1] += t * P11;
  75659. APA[2] = t * P20;
  75660. return APA;
  75661. }
  75662. function authlat(beta, APA) {
  75663. var t = beta + beta;
  75664. return beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t);
  75665. }
  75666. var laea_names = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
  75667. /* harmony default export */ var laea = ({
  75668. init: laea_init,
  75669. forward: laea_forward,
  75670. inverse: laea_inverse,
  75671. names: laea_names,
  75672. S_POLE: S_POLE,
  75673. N_POLE: N_POLE,
  75674. EQUIT: EQUIT,
  75675. OBLIQ: OBLIQ
  75676. });
  75677. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/asinz.js
  75678. /* harmony default export */ function asinz(x) {
  75679. if (Math.abs(x) > 1) {
  75680. x = x > 1 ? 1 : -1;
  75681. }
  75682. return Math.asin(x);
  75683. }
  75684. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/aea.js
  75685. function aea_init() {
  75686. if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
  75687. return;
  75688. }
  75689. this.temp = this.b / this.a;
  75690. this.es = 1 - Math.pow(this.temp, 2);
  75691. this.e3 = Math.sqrt(this.es);
  75692. this.sin_po = Math.sin(this.lat1);
  75693. this.cos_po = Math.cos(this.lat1);
  75694. this.t1 = this.sin_po;
  75695. this.con = this.sin_po;
  75696. this.ms1 = msfnz(this.e3, this.sin_po, this.cos_po);
  75697. this.qs1 = qsfnz(this.e3, this.sin_po, this.cos_po);
  75698. this.sin_po = Math.sin(this.lat2);
  75699. this.cos_po = Math.cos(this.lat2);
  75700. this.t2 = this.sin_po;
  75701. this.ms2 = msfnz(this.e3, this.sin_po, this.cos_po);
  75702. this.qs2 = qsfnz(this.e3, this.sin_po, this.cos_po);
  75703. this.sin_po = Math.sin(this.lat0);
  75704. this.cos_po = Math.cos(this.lat0);
  75705. this.t3 = this.sin_po;
  75706. this.qs0 = qsfnz(this.e3, this.sin_po, this.cos_po);
  75707. if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
  75708. this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);
  75709. } else {
  75710. this.ns0 = this.con;
  75711. }
  75712. this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;
  75713. this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;
  75714. }
  75715. /* Albers Conical Equal Area forward equations--mapping lat,long to x,y
  75716. -------------------------------------------------------------------*/
  75717. function aea_forward(p) {
  75718. var lon = p.x;
  75719. var lat = p.y;
  75720. this.sin_phi = Math.sin(lat);
  75721. this.cos_phi = Math.cos(lat);
  75722. var qs = qsfnz(this.e3, this.sin_phi, this.cos_phi);
  75723. var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;
  75724. var theta = this.ns0 * adjust_lon(lon - this.long0);
  75725. var x = rh1 * Math.sin(theta) + this.x0;
  75726. var y = this.rh - rh1 * Math.cos(theta) + this.y0;
  75727. p.x = x;
  75728. p.y = y;
  75729. return p;
  75730. }
  75731. function aea_inverse(p) {
  75732. var rh1, qs, con, theta, lon, lat;
  75733. p.x -= this.x0;
  75734. p.y = this.rh - p.y + this.y0;
  75735. if (this.ns0 >= 0) {
  75736. rh1 = Math.sqrt(p.x * p.x + p.y * p.y);
  75737. con = 1;
  75738. } else {
  75739. rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);
  75740. con = -1;
  75741. }
  75742. theta = 0;
  75743. if (rh1 !== 0) {
  75744. theta = Math.atan2(con * p.x, con * p.y);
  75745. }
  75746. con = rh1 * this.ns0 / this.a;
  75747. if (this.sphere) {
  75748. lat = Math.asin((this.c - con * con) / (2 * this.ns0));
  75749. } else {
  75750. qs = (this.c - con * con) / this.ns0;
  75751. lat = this.phi1z(this.e3, qs);
  75752. }
  75753. lon = adjust_lon(theta / this.ns0 + this.long0);
  75754. p.x = lon;
  75755. p.y = lat;
  75756. return p;
  75757. }
  75758. /* Function to compute phi1, the latitude for the inverse of the
  75759. Albers Conical Equal-Area projection.
  75760. -------------------------------------------*/
  75761. function phi1z(eccent, qs) {
  75762. var sinphi, cosphi, con, com, dphi;
  75763. var phi = asinz(0.5 * qs);
  75764. if (eccent < EPSLN) {
  75765. return phi;
  75766. }
  75767. var eccnts = eccent * eccent;
  75768. for (var i = 1; i <= 25; i++) {
  75769. sinphi = Math.sin(phi);
  75770. cosphi = Math.cos(phi);
  75771. con = eccent * sinphi;
  75772. com = 1 - con * con;
  75773. dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con)));
  75774. phi = phi + dphi;
  75775. if (Math.abs(dphi) <= 1e-7) {
  75776. return phi;
  75777. }
  75778. }
  75779. return null;
  75780. }
  75781. var aea_names = ["Albers_Conic_Equal_Area", "Albers", "aea"];
  75782. /* harmony default export */ var aea = ({
  75783. init: aea_init,
  75784. forward: aea_forward,
  75785. inverse: aea_inverse,
  75786. names: aea_names,
  75787. phi1z: phi1z
  75788. });
  75789. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/gnom.js
  75790. /*
  75791. reference:
  75792. Wolfram Mathworld "Gnomonic Projection"
  75793. http://mathworld.wolfram.com/GnomonicProjection.html
  75794. Accessed: 12th November 2009
  75795. */
  75796. function gnom_init() {
  75797. /* Place parameters in static storage for common use
  75798. -------------------------------------------------*/
  75799. this.sin_p14 = Math.sin(this.lat0);
  75800. this.cos_p14 = Math.cos(this.lat0); // Approximation for projecting points to the horizon (infinity)
  75801. this.infinity_dist = 1000 * this.a;
  75802. this.rc = 1;
  75803. }
  75804. /* Gnomonic forward equations--mapping lat,long to x,y
  75805. ---------------------------------------------------*/
  75806. function gnom_forward(p) {
  75807. var sinphi, cosphi;
  75808. /* sin and cos value */
  75809. var dlon;
  75810. /* delta longitude value */
  75811. var coslon;
  75812. /* cos of longitude */
  75813. var ksp;
  75814. /* scale factor */
  75815. var g;
  75816. var x, y;
  75817. var lon = p.x;
  75818. var lat = p.y;
  75819. /* Forward equations
  75820. -----------------*/
  75821. dlon = adjust_lon(lon - this.long0);
  75822. sinphi = Math.sin(lat);
  75823. cosphi = Math.cos(lat);
  75824. coslon = Math.cos(dlon);
  75825. g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;
  75826. ksp = 1;
  75827. if (g > 0 || Math.abs(g) <= EPSLN) {
  75828. x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g;
  75829. y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g;
  75830. } else {
  75831. // Point is in the opposing hemisphere and is unprojectable
  75832. // We still need to return a reasonable point, so we project
  75833. // to infinity, on a bearing
  75834. // equivalent to the northern hemisphere equivalent
  75835. // This is a reasonable approximation for short shapes and lines that
  75836. // straddle the horizon.
  75837. x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon);
  75838. y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
  75839. }
  75840. p.x = x;
  75841. p.y = y;
  75842. return p;
  75843. }
  75844. function gnom_inverse(p) {
  75845. var rh;
  75846. /* Rho */
  75847. var sinc, cosc;
  75848. var c;
  75849. var lon, lat;
  75850. /* Inverse equations
  75851. -----------------*/
  75852. p.x = (p.x - this.x0) / this.a;
  75853. p.y = (p.y - this.y0) / this.a;
  75854. p.x /= this.k0;
  75855. p.y /= this.k0;
  75856. if (rh = Math.sqrt(p.x * p.x + p.y * p.y)) {
  75857. c = Math.atan2(rh, this.rc);
  75858. sinc = Math.sin(c);
  75859. cosc = Math.cos(c);
  75860. lat = asinz(cosc * this.sin_p14 + p.y * sinc * this.cos_p14 / rh);
  75861. lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);
  75862. lon = adjust_lon(this.long0 + lon);
  75863. } else {
  75864. lat = this.phic0;
  75865. lon = 0;
  75866. }
  75867. p.x = lon;
  75868. p.y = lat;
  75869. return p;
  75870. }
  75871. var gnom_names = ["gnom"];
  75872. /* harmony default export */ var gnom = ({
  75873. init: gnom_init,
  75874. forward: gnom_forward,
  75875. inverse: gnom_inverse,
  75876. names: gnom_names
  75877. });
  75878. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/common/iqsfnz.js
  75879. /* harmony default export */ function iqsfnz(eccent, q) {
  75880. var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent));
  75881. if (Math.abs(Math.abs(q) - temp) < 1.0E-6) {
  75882. if (q < 0) {
  75883. return -1 * HALF_PI;
  75884. } else {
  75885. return HALF_PI;
  75886. }
  75887. } //var phi = 0.5* q/(1-eccent*eccent);
  75888. var phi = Math.asin(0.5 * q);
  75889. var dphi;
  75890. var sin_phi;
  75891. var cos_phi;
  75892. var con;
  75893. for (var i = 0; i < 30; i++) {
  75894. sin_phi = Math.sin(phi);
  75895. cos_phi = Math.cos(phi);
  75896. con = eccent * sin_phi;
  75897. 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)));
  75898. phi += dphi;
  75899. if (Math.abs(dphi) <= 0.0000000001) {
  75900. return phi;
  75901. }
  75902. } //console.log("IQSFN-CONV:Latitude failed to converge after 30 iterations");
  75903. return NaN;
  75904. }
  75905. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/cea.js
  75906. /*
  75907. reference:
  75908. "Cartographic Projection Procedures for the UNIX Environment-
  75909. A User's Manual" by Gerald I. Evenden,
  75910. USGS Open File Report 90-284and Release 4 Interim Reports (2003)
  75911. */
  75912. function cea_init() {
  75913. //no-op
  75914. if (!this.sphere) {
  75915. this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
  75916. }
  75917. }
  75918. /* Cylindrical Equal Area forward equations--mapping lat,long to x,y
  75919. ------------------------------------------------------------*/
  75920. function cea_forward(p) {
  75921. var lon = p.x;
  75922. var lat = p.y;
  75923. var x, y;
  75924. /* Forward equations
  75925. -----------------*/
  75926. var dlon = adjust_lon(lon - this.long0);
  75927. if (this.sphere) {
  75928. x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
  75929. y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);
  75930. } else {
  75931. var qs = qsfnz(this.e, Math.sin(lat));
  75932. x = this.x0 + this.a * this.k0 * dlon;
  75933. y = this.y0 + this.a * qs * 0.5 / this.k0;
  75934. }
  75935. p.x = x;
  75936. p.y = y;
  75937. return p;
  75938. }
  75939. /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long
  75940. ------------------------------------------------------------*/
  75941. function cea_inverse(p) {
  75942. p.x -= this.x0;
  75943. p.y -= this.y0;
  75944. var lon, lat;
  75945. if (this.sphere) {
  75946. lon = adjust_lon(this.long0 + p.x / this.a / Math.cos(this.lat_ts));
  75947. lat = Math.asin(p.y / this.a * Math.cos(this.lat_ts));
  75948. } else {
  75949. lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a);
  75950. lon = adjust_lon(this.long0 + p.x / (this.a * this.k0));
  75951. }
  75952. p.x = lon;
  75953. p.y = lat;
  75954. return p;
  75955. }
  75956. var cea_names = ["cea"];
  75957. /* harmony default export */ var cea = ({
  75958. init: cea_init,
  75959. forward: cea_forward,
  75960. inverse: cea_inverse,
  75961. names: cea_names
  75962. });
  75963. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/eqc.js
  75964. function eqc_init() {
  75965. this.x0 = this.x0 || 0;
  75966. this.y0 = this.y0 || 0;
  75967. this.lat0 = this.lat0 || 0;
  75968. this.long0 = this.long0 || 0;
  75969. this.lat_ts = this.lat_ts || 0;
  75970. this.title = this.title || "Equidistant Cylindrical (Plate Carre)";
  75971. this.rc = Math.cos(this.lat_ts);
  75972. } // forward equations--mapping lat,long to x,y
  75973. // -----------------------------------------------------------------
  75974. function eqc_forward(p) {
  75975. var lon = p.x;
  75976. var lat = p.y;
  75977. var dlon = adjust_lon(lon - this.long0);
  75978. var dlat = adjust_lat(lat - this.lat0);
  75979. p.x = this.x0 + this.a * dlon * this.rc;
  75980. p.y = this.y0 + this.a * dlat;
  75981. return p;
  75982. } // inverse equations--mapping x,y to lat/long
  75983. // -----------------------------------------------------------------
  75984. function eqc_inverse(p) {
  75985. var x = p.x;
  75986. var y = p.y;
  75987. p.x = adjust_lon(this.long0 + (x - this.x0) / (this.a * this.rc));
  75988. p.y = adjust_lat(this.lat0 + (y - this.y0) / this.a);
  75989. return p;
  75990. }
  75991. var eqc_names = ["Equirectangular", "Equidistant_Cylindrical", "eqc"];
  75992. /* harmony default export */ var eqc = ({
  75993. init: eqc_init,
  75994. forward: eqc_forward,
  75995. inverse: eqc_inverse,
  75996. names: eqc_names
  75997. });
  75998. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/poly.js
  75999. var poly_MAX_ITER = 20;
  76000. function poly_init() {
  76001. /* Place parameters in static storage for common use
  76002. -------------------------------------------------*/
  76003. this.temp = this.b / this.a;
  76004. 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
  76005. this.e = Math.sqrt(this.es);
  76006. this.e0 = e0fn(this.es);
  76007. this.e1 = e1fn(this.es);
  76008. this.e2 = e2fn(this.es);
  76009. this.e3 = e3fn(this.es);
  76010. 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
  76011. }
  76012. /* Polyconic forward equations--mapping lat,long to x,y
  76013. ---------------------------------------------------*/
  76014. function poly_forward(p) {
  76015. var lon = p.x;
  76016. var lat = p.y;
  76017. var x, y, el;
  76018. var dlon = adjust_lon(lon - this.long0);
  76019. el = dlon * Math.sin(lat);
  76020. if (this.sphere) {
  76021. if (Math.abs(lat) <= EPSLN) {
  76022. x = this.a * dlon;
  76023. y = -1 * this.a * this.lat0;
  76024. } else {
  76025. x = this.a * Math.sin(el) / Math.tan(lat);
  76026. y = this.a * (adjust_lat(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));
  76027. }
  76028. } else {
  76029. if (Math.abs(lat) <= EPSLN) {
  76030. x = this.a * dlon;
  76031. y = -1 * this.ml0;
  76032. } else {
  76033. var nl = gN(this.a, this.e, Math.sin(lat)) / Math.tan(lat);
  76034. x = nl * Math.sin(el);
  76035. y = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));
  76036. }
  76037. }
  76038. p.x = x + this.x0;
  76039. p.y = y + this.y0;
  76040. return p;
  76041. }
  76042. /* Inverse equations
  76043. -----------------*/
  76044. function poly_inverse(p) {
  76045. var lon, lat, x, y, i;
  76046. var al, bl;
  76047. var phi, dphi;
  76048. x = p.x - this.x0;
  76049. y = p.y - this.y0;
  76050. if (this.sphere) {
  76051. if (Math.abs(y + this.a * this.lat0) <= EPSLN) {
  76052. lon = adjust_lon(x / this.a + this.long0);
  76053. lat = 0;
  76054. } else {
  76055. al = this.lat0 + y / this.a;
  76056. bl = x * x / this.a / this.a + al * al;
  76057. phi = al;
  76058. var tanphi;
  76059. for (i = poly_MAX_ITER; i; --i) {
  76060. tanphi = Math.tan(phi);
  76061. dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1);
  76062. phi += dphi;
  76063. if (Math.abs(dphi) <= EPSLN) {
  76064. lat = phi;
  76065. break;
  76066. }
  76067. }
  76068. lon = adjust_lon(this.long0 + Math.asin(x * Math.tan(phi) / this.a) / Math.sin(lat));
  76069. }
  76070. } else {
  76071. if (Math.abs(y + this.ml0) <= EPSLN) {
  76072. lat = 0;
  76073. lon = adjust_lon(this.long0 + x / this.a);
  76074. } else {
  76075. al = (this.ml0 + y) / this.a;
  76076. bl = x * x / this.a / this.a + al * al;
  76077. phi = al;
  76078. var cl, mln, mlnp, ma;
  76079. var con;
  76080. for (i = poly_MAX_ITER; i; --i) {
  76081. con = this.e * Math.sin(phi);
  76082. cl = Math.sqrt(1 - con * con) * Math.tan(phi);
  76083. mln = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);
  76084. mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi);
  76085. ma = mln / this.a;
  76086. 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);
  76087. phi -= dphi;
  76088. if (Math.abs(dphi) <= EPSLN) {
  76089. lat = phi;
  76090. break;
  76091. }
  76092. } //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);
  76093. cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);
  76094. lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));
  76095. }
  76096. }
  76097. p.x = lon;
  76098. p.y = lat;
  76099. return p;
  76100. }
  76101. var poly_names = ["Polyconic", "poly"];
  76102. /* harmony default export */ var poly = ({
  76103. init: poly_init,
  76104. forward: poly_forward,
  76105. inverse: poly_inverse,
  76106. names: poly_names
  76107. });
  76108. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/nzmg.js
  76109. /*
  76110. reference
  76111. Department of Land and Survey Technical Circular 1973/32
  76112. http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf
  76113. OSG Technical Report 4.1
  76114. http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf
  76115. */
  76116. /**
  76117. * iterations: Number of iterations to refine inverse transform.
  76118. * 0 -> km accuracy
  76119. * 1 -> m accuracy -- suitable for most mapping applications
  76120. * 2 -> mm accuracy
  76121. */
  76122. var iterations = 1;
  76123. function nzmg_init() {
  76124. this.A = [];
  76125. this.A[1] = 0.6399175073;
  76126. this.A[2] = -0.1358797613;
  76127. this.A[3] = 0.063294409;
  76128. this.A[4] = -0.02526853;
  76129. this.A[5] = 0.0117879;
  76130. this.A[6] = -0.0055161;
  76131. this.A[7] = 0.0026906;
  76132. this.A[8] = -0.001333;
  76133. this.A[9] = 0.00067;
  76134. this.A[10] = -0.00034;
  76135. this.B_re = [];
  76136. this.B_im = [];
  76137. this.B_re[1] = 0.7557853228;
  76138. this.B_im[1] = 0;
  76139. this.B_re[2] = 0.249204646;
  76140. this.B_im[2] = 0.003371507;
  76141. this.B_re[3] = -0.001541739;
  76142. this.B_im[3] = 0.041058560;
  76143. this.B_re[4] = -0.10162907;
  76144. this.B_im[4] = 0.01727609;
  76145. this.B_re[5] = -0.26623489;
  76146. this.B_im[5] = -0.36249218;
  76147. this.B_re[6] = -0.6870983;
  76148. this.B_im[6] = -1.1651967;
  76149. this.C_re = [];
  76150. this.C_im = [];
  76151. this.C_re[1] = 1.3231270439;
  76152. this.C_im[1] = 0;
  76153. this.C_re[2] = -0.577245789;
  76154. this.C_im[2] = -0.007809598;
  76155. this.C_re[3] = 0.508307513;
  76156. this.C_im[3] = -0.112208952;
  76157. this.C_re[4] = -0.15094762;
  76158. this.C_im[4] = 0.18200602;
  76159. this.C_re[5] = 1.01418179;
  76160. this.C_im[5] = 1.64497696;
  76161. this.C_re[6] = 1.9660549;
  76162. this.C_im[6] = 2.5127645;
  76163. this.D = [];
  76164. this.D[1] = 1.5627014243;
  76165. this.D[2] = 0.5185406398;
  76166. this.D[3] = -0.03333098;
  76167. this.D[4] = -0.1052906;
  76168. this.D[5] = -0.0368594;
  76169. this.D[6] = 0.007317;
  76170. this.D[7] = 0.01220;
  76171. this.D[8] = 0.00394;
  76172. this.D[9] = -0.0013;
  76173. }
  76174. /**
  76175. New Zealand Map Grid Forward - long/lat to x/y
  76176. long/lat in radians
  76177. */
  76178. function nzmg_forward(p) {
  76179. var n;
  76180. var lon = p.x;
  76181. var lat = p.y;
  76182. var delta_lat = lat - this.lat0;
  76183. var delta_lon = lon - this.long0; // 1. Calculate d_phi and d_psi ... // and d_lambda
  76184. // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians.
  76185. var d_phi = delta_lat / SEC_TO_RAD * 1E-5;
  76186. var d_lambda = delta_lon;
  76187. var d_phi_n = 1; // d_phi^0
  76188. var d_psi = 0;
  76189. for (n = 1; n <= 10; n++) {
  76190. d_phi_n = d_phi_n * d_phi;
  76191. d_psi = d_psi + this.A[n] * d_phi_n;
  76192. } // 2. Calculate theta
  76193. var th_re = d_psi;
  76194. var th_im = d_lambda; // 3. Calculate z
  76195. var th_n_re = 1;
  76196. var th_n_im = 0; // theta^0
  76197. var th_n_re1;
  76198. var th_n_im1;
  76199. var z_re = 0;
  76200. var z_im = 0;
  76201. for (n = 1; n <= 6; n++) {
  76202. th_n_re1 = th_n_re * th_re - th_n_im * th_im;
  76203. th_n_im1 = th_n_im * th_re + th_n_re * th_im;
  76204. th_n_re = th_n_re1;
  76205. th_n_im = th_n_im1;
  76206. z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;
  76207. z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;
  76208. } // 4. Calculate easting and northing
  76209. p.x = z_im * this.a + this.x0;
  76210. p.y = z_re * this.a + this.y0;
  76211. return p;
  76212. }
  76213. /**
  76214. New Zealand Map Grid Inverse - x/y to long/lat
  76215. */
  76216. function nzmg_inverse(p) {
  76217. var n;
  76218. var x = p.x;
  76219. var y = p.y;
  76220. var delta_x = x - this.x0;
  76221. var delta_y = y - this.y0; // 1. Calculate z
  76222. var z_re = delta_y / this.a;
  76223. var z_im = delta_x / this.a; // 2a. Calculate theta - first approximation gives km accuracy
  76224. var z_n_re = 1;
  76225. var z_n_im = 0; // z^0
  76226. var z_n_re1;
  76227. var z_n_im1;
  76228. var th_re = 0;
  76229. var th_im = 0;
  76230. for (n = 1; n <= 6; n++) {
  76231. z_n_re1 = z_n_re * z_re - z_n_im * z_im;
  76232. z_n_im1 = z_n_im * z_re + z_n_re * z_im;
  76233. z_n_re = z_n_re1;
  76234. z_n_im = z_n_im1;
  76235. th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;
  76236. th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;
  76237. } // 2b. Iterate to refine the accuracy of the calculation
  76238. // 0 iterations gives km accuracy
  76239. // 1 iteration gives m accuracy -- good enough for most mapping applications
  76240. // 2 iterations bives mm accuracy
  76241. for (var i = 0; i < this.iterations; i++) {
  76242. var th_n_re = th_re;
  76243. var th_n_im = th_im;
  76244. var th_n_re1;
  76245. var th_n_im1;
  76246. var num_re = z_re;
  76247. var num_im = z_im;
  76248. for (n = 2; n <= 6; n++) {
  76249. th_n_re1 = th_n_re * th_re - th_n_im * th_im;
  76250. th_n_im1 = th_n_im * th_re + th_n_re * th_im;
  76251. th_n_re = th_n_re1;
  76252. th_n_im = th_n_im1;
  76253. num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);
  76254. num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);
  76255. }
  76256. th_n_re = 1;
  76257. th_n_im = 0;
  76258. var den_re = this.B_re[1];
  76259. var den_im = this.B_im[1];
  76260. for (n = 2; n <= 6; n++) {
  76261. th_n_re1 = th_n_re * th_re - th_n_im * th_im;
  76262. th_n_im1 = th_n_im * th_re + th_n_re * th_im;
  76263. th_n_re = th_n_re1;
  76264. th_n_im = th_n_im1;
  76265. den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);
  76266. den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);
  76267. } // Complex division
  76268. var den2 = den_re * den_re + den_im * den_im;
  76269. th_re = (num_re * den_re + num_im * den_im) / den2;
  76270. th_im = (num_im * den_re - num_re * den_im) / den2;
  76271. } // 3. Calculate d_phi ... // and d_lambda
  76272. var d_psi = th_re;
  76273. var d_lambda = th_im;
  76274. var d_psi_n = 1; // d_psi^0
  76275. var d_phi = 0;
  76276. for (n = 1; n <= 9; n++) {
  76277. d_psi_n = d_psi_n * d_psi;
  76278. d_phi = d_phi + this.D[n] * d_psi_n;
  76279. } // 4. Calculate latitude and longitude
  76280. // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.
  76281. var lat = this.lat0 + d_phi * SEC_TO_RAD * 1E5;
  76282. var lon = this.long0 + d_lambda;
  76283. p.x = lon;
  76284. p.y = lat;
  76285. return p;
  76286. }
  76287. var nzmg_names = ["New_Zealand_Map_Grid", "nzmg"];
  76288. /* harmony default export */ var nzmg = ({
  76289. init: nzmg_init,
  76290. forward: nzmg_forward,
  76291. inverse: nzmg_inverse,
  76292. names: nzmg_names
  76293. });
  76294. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/mill.js
  76295. /*
  76296. reference
  76297. "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder,
  76298. The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.
  76299. */
  76300. /* Initialize the Miller Cylindrical projection
  76301. -------------------------------------------*/
  76302. function mill_init() {//no-op
  76303. }
  76304. /* Miller Cylindrical forward equations--mapping lat,long to x,y
  76305. ------------------------------------------------------------*/
  76306. function mill_forward(p) {
  76307. var lon = p.x;
  76308. var lat = p.y;
  76309. /* Forward equations
  76310. -----------------*/
  76311. var dlon = adjust_lon(lon - this.long0);
  76312. var x = this.x0 + this.a * dlon;
  76313. var y = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + lat / 2.5)) * 1.25;
  76314. p.x = x;
  76315. p.y = y;
  76316. return p;
  76317. }
  76318. /* Miller Cylindrical inverse equations--mapping x,y to lat/long
  76319. ------------------------------------------------------------*/
  76320. function mill_inverse(p) {
  76321. p.x -= this.x0;
  76322. p.y -= this.y0;
  76323. var lon = adjust_lon(this.long0 + p.x / this.a);
  76324. var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);
  76325. p.x = lon;
  76326. p.y = lat;
  76327. return p;
  76328. }
  76329. var mill_names = ["Miller_Cylindrical", "mill"];
  76330. /* harmony default export */ var mill = ({
  76331. init: mill_init,
  76332. forward: mill_forward,
  76333. inverse: mill_inverse,
  76334. names: mill_names
  76335. });
  76336. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/sinu.js
  76337. var sinu_MAX_ITER = 20;
  76338. function sinu_init() {
  76339. /* Place parameters in static storage for common use
  76340. -------------------------------------------------*/
  76341. if (!this.sphere) {
  76342. this.en = pj_enfn(this.es);
  76343. } else {
  76344. this.n = 1;
  76345. this.m = 0;
  76346. this.es = 0;
  76347. this.C_y = Math.sqrt((this.m + 1) / this.n);
  76348. this.C_x = this.C_y / (this.m + 1);
  76349. }
  76350. }
  76351. /* Sinusoidal forward equations--mapping lat,long to x,y
  76352. -----------------------------------------------------*/
  76353. function sinu_forward(p) {
  76354. var x, y;
  76355. var lon = p.x;
  76356. var lat = p.y;
  76357. /* Forward equations
  76358. -----------------*/
  76359. lon = adjust_lon(lon - this.long0);
  76360. if (this.sphere) {
  76361. if (!this.m) {
  76362. lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat;
  76363. } else {
  76364. var k = this.n * Math.sin(lat);
  76365. for (var i = sinu_MAX_ITER; i; --i) {
  76366. var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat));
  76367. lat -= V;
  76368. if (Math.abs(V) < EPSLN) {
  76369. break;
  76370. }
  76371. }
  76372. }
  76373. x = this.a * this.C_x * lon * (this.m + Math.cos(lat));
  76374. y = this.a * this.C_y * lat;
  76375. } else {
  76376. var s = Math.sin(lat);
  76377. var c = Math.cos(lat);
  76378. y = this.a * pj_mlfn(lat, s, c, this.en);
  76379. x = this.a * lon * c / Math.sqrt(1 - this.es * s * s);
  76380. }
  76381. p.x = x;
  76382. p.y = y;
  76383. return p;
  76384. }
  76385. function sinu_inverse(p) {
  76386. var lat, temp, lon, s;
  76387. p.x -= this.x0;
  76388. lon = p.x / this.a;
  76389. p.y -= this.y0;
  76390. lat = p.y / this.a;
  76391. if (this.sphere) {
  76392. lat /= this.C_y;
  76393. lon = lon / (this.C_x * (this.m + Math.cos(lat)));
  76394. if (this.m) {
  76395. lat = asinz((this.m * lat + Math.sin(lat)) / this.n);
  76396. } else if (this.n !== 1) {
  76397. lat = asinz(Math.sin(lat) / this.n);
  76398. }
  76399. lon = adjust_lon(lon + this.long0);
  76400. lat = adjust_lat(lat);
  76401. } else {
  76402. lat = pj_inv_mlfn(p.y / this.a, this.es, this.en);
  76403. s = Math.abs(lat);
  76404. if (s < HALF_PI) {
  76405. s = Math.sin(lat);
  76406. temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat)); //temp = this.long0 + p.x / (this.a * Math.cos(lat));
  76407. lon = adjust_lon(temp);
  76408. } else if (s - EPSLN < HALF_PI) {
  76409. lon = this.long0;
  76410. }
  76411. }
  76412. p.x = lon;
  76413. p.y = lat;
  76414. return p;
  76415. }
  76416. var sinu_names = ["Sinusoidal", "sinu"];
  76417. /* harmony default export */ var sinu = ({
  76418. init: sinu_init,
  76419. forward: sinu_forward,
  76420. inverse: sinu_inverse,
  76421. names: sinu_names
  76422. });
  76423. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/moll.js
  76424. function moll_init() {}
  76425. /* Mollweide forward equations--mapping lat,long to x,y
  76426. ----------------------------------------------------*/
  76427. function moll_forward(p) {
  76428. /* Forward equations
  76429. -----------------*/
  76430. var lon = p.x;
  76431. var lat = p.y;
  76432. var delta_lon = adjust_lon(lon - this.long0);
  76433. var theta = lat;
  76434. var con = Math.PI * Math.sin(lat);
  76435. /* Iterate using the Newton-Raphson method to find theta
  76436. -----------------------------------------------------*/
  76437. while (true) {
  76438. var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));
  76439. theta += delta_theta;
  76440. if (Math.abs(delta_theta) < EPSLN) {
  76441. break;
  76442. }
  76443. }
  76444. theta /= 2;
  76445. /* If the latitude is 90 deg, force the x coordinate to be "0 + false easting"
  76446. this is done here because of precision problems with "cos(theta)"
  76447. --------------------------------------------------------------------------*/
  76448. if (Math.PI / 2 - Math.abs(lat) < EPSLN) {
  76449. delta_lon = 0;
  76450. }
  76451. var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;
  76452. var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;
  76453. p.x = x;
  76454. p.y = y;
  76455. return p;
  76456. }
  76457. function moll_inverse(p) {
  76458. var theta;
  76459. var arg;
  76460. /* Inverse equations
  76461. -----------------*/
  76462. p.x -= this.x0;
  76463. p.y -= this.y0;
  76464. arg = p.y / (1.4142135623731 * this.a);
  76465. /* Because of division by zero problems, 'arg' can not be 1. Therefore
  76466. a number very close to one is used instead.
  76467. -------------------------------------------------------------------*/
  76468. if (Math.abs(arg) > 0.999999999999) {
  76469. arg = 0.999999999999;
  76470. }
  76471. theta = Math.asin(arg);
  76472. var lon = adjust_lon(this.long0 + p.x / (0.900316316158 * this.a * Math.cos(theta)));
  76473. if (lon < -Math.PI) {
  76474. lon = -Math.PI;
  76475. }
  76476. if (lon > Math.PI) {
  76477. lon = Math.PI;
  76478. }
  76479. arg = (2 * theta + Math.sin(2 * theta)) / Math.PI;
  76480. if (Math.abs(arg) > 1) {
  76481. arg = 1;
  76482. }
  76483. var lat = Math.asin(arg);
  76484. p.x = lon;
  76485. p.y = lat;
  76486. return p;
  76487. }
  76488. var moll_names = ["Mollweide", "moll"];
  76489. /* harmony default export */ var moll = ({
  76490. init: moll_init,
  76491. forward: moll_forward,
  76492. inverse: moll_inverse,
  76493. names: moll_names
  76494. });
  76495. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/eqdc.js
  76496. function eqdc_init() {
  76497. /* Place parameters in static storage for common use
  76498. -------------------------------------------------*/
  76499. // Standard Parallels cannot be equal and on opposite sides of the equator
  76500. if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
  76501. return;
  76502. }
  76503. this.lat2 = this.lat2 || this.lat1;
  76504. this.temp = this.b / this.a;
  76505. this.es = 1 - Math.pow(this.temp, 2);
  76506. this.e = Math.sqrt(this.es);
  76507. this.e0 = e0fn(this.es);
  76508. this.e1 = e1fn(this.es);
  76509. this.e2 = e2fn(this.es);
  76510. this.e3 = e3fn(this.es);
  76511. this.sinphi = Math.sin(this.lat1);
  76512. this.cosphi = Math.cos(this.lat1);
  76513. this.ms1 = msfnz(this.e, this.sinphi, this.cosphi);
  76514. this.ml1 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat1);
  76515. if (Math.abs(this.lat1 - this.lat2) < EPSLN) {
  76516. this.ns = this.sinphi;
  76517. } else {
  76518. this.sinphi = Math.sin(this.lat2);
  76519. this.cosphi = Math.cos(this.lat2);
  76520. this.ms2 = msfnz(this.e, this.sinphi, this.cosphi);
  76521. this.ml2 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat2);
  76522. this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);
  76523. }
  76524. this.g = this.ml1 + this.ms1 / this.ns;
  76525. this.ml0 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);
  76526. this.rh = this.a * (this.g - this.ml0);
  76527. }
  76528. /* Equidistant Conic forward equations--mapping lat,long to x,y
  76529. -----------------------------------------------------------*/
  76530. function eqdc_forward(p) {
  76531. var lon = p.x;
  76532. var lat = p.y;
  76533. var rh1;
  76534. /* Forward equations
  76535. -----------------*/
  76536. if (this.sphere) {
  76537. rh1 = this.a * (this.g - lat);
  76538. } else {
  76539. var ml = mlfn(this.e0, this.e1, this.e2, this.e3, lat);
  76540. rh1 = this.a * (this.g - ml);
  76541. }
  76542. var theta = this.ns * adjust_lon(lon - this.long0);
  76543. var x = this.x0 + rh1 * Math.sin(theta);
  76544. var y = this.y0 + this.rh - rh1 * Math.cos(theta);
  76545. p.x = x;
  76546. p.y = y;
  76547. return p;
  76548. }
  76549. /* Inverse equations
  76550. -----------------*/
  76551. function eqdc_inverse(p) {
  76552. p.x -= this.x0;
  76553. p.y = this.rh - p.y + this.y0;
  76554. var con, rh1, lat, lon;
  76555. if (this.ns >= 0) {
  76556. rh1 = Math.sqrt(p.x * p.x + p.y * p.y);
  76557. con = 1;
  76558. } else {
  76559. rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);
  76560. con = -1;
  76561. }
  76562. var theta = 0;
  76563. if (rh1 !== 0) {
  76564. theta = Math.atan2(con * p.x, con * p.y);
  76565. }
  76566. if (this.sphere) {
  76567. lon = adjust_lon(this.long0 + theta / this.ns);
  76568. lat = adjust_lat(this.g - rh1 / this.a);
  76569. p.x = lon;
  76570. p.y = lat;
  76571. return p;
  76572. } else {
  76573. var ml = this.g - rh1 / this.a;
  76574. lat = imlfn(ml, this.e0, this.e1, this.e2, this.e3);
  76575. lon = adjust_lon(this.long0 + theta / this.ns);
  76576. p.x = lon;
  76577. p.y = lat;
  76578. return p;
  76579. }
  76580. }
  76581. var eqdc_names = ["Equidistant_Conic", "eqdc"];
  76582. /* harmony default export */ var eqdc = ({
  76583. init: eqdc_init,
  76584. forward: eqdc_forward,
  76585. inverse: eqdc_inverse,
  76586. names: eqdc_names
  76587. });
  76588. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/vandg.js
  76589. /* Initialize the Van Der Grinten projection
  76590. ----------------------------------------*/
  76591. function vandg_init() {
  76592. //this.R = 6370997; //Radius of earth
  76593. this.R = this.a;
  76594. }
  76595. function vandg_forward(p) {
  76596. var lon = p.x;
  76597. var lat = p.y;
  76598. /* Forward equations
  76599. -----------------*/
  76600. var dlon = adjust_lon(lon - this.long0);
  76601. var x, y;
  76602. if (Math.abs(lat) <= EPSLN) {
  76603. x = this.x0 + this.R * dlon;
  76604. y = this.y0;
  76605. }
  76606. var theta = asinz(2 * Math.abs(lat / Math.PI));
  76607. if (Math.abs(dlon) <= EPSLN || Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
  76608. x = this.x0;
  76609. if (lat >= 0) {
  76610. y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta);
  76611. } else {
  76612. y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);
  76613. } // return(OK);
  76614. }
  76615. var al = 0.5 * Math.abs(Math.PI / dlon - dlon / Math.PI);
  76616. var asq = al * al;
  76617. var sinth = Math.sin(theta);
  76618. var costh = Math.cos(theta);
  76619. var g = costh / (sinth + costh - 1);
  76620. var gsq = g * g;
  76621. var m = g * (2 / sinth - 1);
  76622. var msq = m * m;
  76623. var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq);
  76624. if (dlon < 0) {
  76625. con = -con;
  76626. }
  76627. x = this.x0 + con; //con = Math.abs(con / (Math.PI * this.R));
  76628. var q = asq + g;
  76629. con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq);
  76630. if (lat >= 0) {
  76631. //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);
  76632. y = this.y0 + con;
  76633. } else {
  76634. //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);
  76635. y = this.y0 - con;
  76636. }
  76637. p.x = x;
  76638. p.y = y;
  76639. return p;
  76640. }
  76641. /* Van Der Grinten inverse equations--mapping x,y to lat/long
  76642. ---------------------------------------------------------*/
  76643. function vandg_inverse(p) {
  76644. var lon, lat;
  76645. var xx, yy, xys, c1, c2, c3;
  76646. var a1;
  76647. var m1;
  76648. var con;
  76649. var th1;
  76650. var d;
  76651. /* inverse equations
  76652. -----------------*/
  76653. p.x -= this.x0;
  76654. p.y -= this.y0;
  76655. con = Math.PI * this.R;
  76656. xx = p.x / con;
  76657. yy = p.y / con;
  76658. xys = xx * xx + yy * yy;
  76659. c1 = -Math.abs(yy) * (1 + xys);
  76660. c2 = c1 - 2 * yy * yy + xx * xx;
  76661. c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;
  76662. d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;
  76663. a1 = (c1 - c2 * c2 / 3 / c3) / c3;
  76664. m1 = 2 * Math.sqrt(-a1 / 3);
  76665. con = 3 * d / a1 / m1;
  76666. if (Math.abs(con) > 1) {
  76667. if (con >= 0) {
  76668. con = 1;
  76669. } else {
  76670. con = -1;
  76671. }
  76672. }
  76673. th1 = Math.acos(con) / 3;
  76674. if (p.y >= 0) {
  76675. lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;
  76676. } else {
  76677. lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;
  76678. }
  76679. if (Math.abs(xx) < EPSLN) {
  76680. lon = this.long0;
  76681. } else {
  76682. lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);
  76683. }
  76684. p.x = lon;
  76685. p.y = lat;
  76686. return p;
  76687. }
  76688. var vandg_names = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
  76689. /* harmony default export */ var vandg = ({
  76690. init: vandg_init,
  76691. forward: vandg_forward,
  76692. inverse: vandg_inverse,
  76693. names: vandg_names
  76694. });
  76695. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/aeqd.js
  76696. function aeqd_init() {
  76697. this.sin_p12 = Math.sin(this.lat0);
  76698. this.cos_p12 = Math.cos(this.lat0);
  76699. }
  76700. function aeqd_forward(p) {
  76701. var lon = p.x;
  76702. var lat = p.y;
  76703. var sinphi = Math.sin(p.y);
  76704. var cosphi = Math.cos(p.y);
  76705. var dlon = adjust_lon(lon - this.long0);
  76706. 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;
  76707. if (this.sphere) {
  76708. if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
  76709. //North Pole case
  76710. p.x = this.x0 + this.a * (HALF_PI - lat) * Math.sin(dlon);
  76711. p.y = this.y0 - this.a * (HALF_PI - lat) * Math.cos(dlon);
  76712. return p;
  76713. } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
  76714. //South Pole case
  76715. p.x = this.x0 + this.a * (HALF_PI + lat) * Math.sin(dlon);
  76716. p.y = this.y0 + this.a * (HALF_PI + lat) * Math.cos(dlon);
  76717. return p;
  76718. } else {
  76719. //default case
  76720. cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon);
  76721. c = Math.acos(cos_c);
  76722. kp = c ? c / Math.sin(c) : 1;
  76723. p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon);
  76724. p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon));
  76725. return p;
  76726. }
  76727. } else {
  76728. e0 = e0fn(this.es);
  76729. e1 = e1fn(this.es);
  76730. e2 = e2fn(this.es);
  76731. e3 = e3fn(this.es);
  76732. if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
  76733. //North Pole case
  76734. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  76735. Ml = this.a * mlfn(e0, e1, e2, e3, lat);
  76736. p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon);
  76737. p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon);
  76738. return p;
  76739. } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
  76740. //South Pole case
  76741. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  76742. Ml = this.a * mlfn(e0, e1, e2, e3, lat);
  76743. p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon);
  76744. p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon);
  76745. return p;
  76746. } else {
  76747. //Default case
  76748. tanphi = sinphi / cosphi;
  76749. Nl1 = gN(this.a, this.e, this.sin_p12);
  76750. Nl = gN(this.a, this.e, sinphi);
  76751. psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi));
  76752. Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon));
  76753. if (Az === 0) {
  76754. s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));
  76755. } else if (Math.abs(Math.abs(Az) - Math.PI) <= EPSLN) {
  76756. s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));
  76757. } else {
  76758. s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az));
  76759. }
  76760. G = this.e * this.sin_p12 / Math.sqrt(1 - this.es);
  76761. H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es);
  76762. GH = G * H;
  76763. Hs = H * H;
  76764. s2 = s * s;
  76765. s3 = s2 * s;
  76766. s4 = s3 * s;
  76767. s5 = s4 * s;
  76768. 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);
  76769. p.x = this.x0 + c * Math.sin(Az);
  76770. p.y = this.y0 + c * Math.cos(Az);
  76771. return p;
  76772. }
  76773. }
  76774. }
  76775. function aeqd_inverse(p) {
  76776. p.x -= this.x0;
  76777. p.y -= this.y0;
  76778. 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;
  76779. if (this.sphere) {
  76780. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  76781. if (rh > 2 * HALF_PI * this.a) {
  76782. return;
  76783. }
  76784. z = rh / this.a;
  76785. sinz = Math.sin(z);
  76786. cosz = Math.cos(z);
  76787. lon = this.long0;
  76788. if (Math.abs(rh) <= EPSLN) {
  76789. lat = this.lat0;
  76790. } else {
  76791. lat = asinz(cosz * this.sin_p12 + p.y * sinz * this.cos_p12 / rh);
  76792. con = Math.abs(this.lat0) - HALF_PI;
  76793. if (Math.abs(con) <= EPSLN) {
  76794. if (this.lat0 >= 0) {
  76795. lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
  76796. } else {
  76797. lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
  76798. }
  76799. } else {
  76800. /*con = cosz - this.sin_p12 * Math.sin(lat);
  76801. if ((Math.abs(con) < EPSLN) && (Math.abs(p.x) < EPSLN)) {
  76802. //no-op, just keep the lon value as is
  76803. } else {
  76804. var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));
  76805. lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));
  76806. }*/
  76807. lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));
  76808. }
  76809. }
  76810. p.x = lon;
  76811. p.y = lat;
  76812. return p;
  76813. } else {
  76814. e0 = e0fn(this.es);
  76815. e1 = e1fn(this.es);
  76816. e2 = e2fn(this.es);
  76817. e3 = e3fn(this.es);
  76818. if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
  76819. //North pole case
  76820. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  76821. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  76822. M = Mlp - rh;
  76823. lat = imlfn(M / this.a, e0, e1, e2, e3);
  76824. lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
  76825. p.x = lon;
  76826. p.y = lat;
  76827. return p;
  76828. } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
  76829. //South pole case
  76830. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  76831. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  76832. M = rh - Mlp;
  76833. lat = imlfn(M / this.a, e0, e1, e2, e3);
  76834. lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
  76835. p.x = lon;
  76836. p.y = lat;
  76837. return p;
  76838. } else {
  76839. //default case
  76840. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  76841. Az = Math.atan2(p.x, p.y);
  76842. N1 = gN(this.a, this.e, this.sin_p12);
  76843. cosAz = Math.cos(Az);
  76844. tmp = this.e * this.cos_p12 * cosAz;
  76845. A = -tmp * tmp / (1 - this.es);
  76846. B = 3 * this.es * (1 - A) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es);
  76847. D = rh / N1;
  76848. Ee = D - A * (1 + A) * Math.pow(D, 3) / 6 - B * (1 + 3 * A) * Math.pow(D, 4) / 24;
  76849. F = 1 - A * Ee * Ee / 2 - D * Ee * Ee * Ee / 6;
  76850. psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz);
  76851. lon = adjust_lon(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi)));
  76852. sinpsi = Math.sin(psi);
  76853. lat = Math.atan2((sinpsi - this.es * F * this.sin_p12) * Math.tan(psi), sinpsi * (1 - this.es));
  76854. p.x = lon;
  76855. p.y = lat;
  76856. return p;
  76857. }
  76858. }
  76859. }
  76860. var aeqd_names = ["Azimuthal_Equidistant", "aeqd"];
  76861. /* harmony default export */ var aeqd = ({
  76862. init: aeqd_init,
  76863. forward: aeqd_forward,
  76864. inverse: aeqd_inverse,
  76865. names: aeqd_names
  76866. });
  76867. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/ortho.js
  76868. function ortho_init() {
  76869. //double temp; /* temporary variable */
  76870. /* Place parameters in static storage for common use
  76871. -------------------------------------------------*/
  76872. this.sin_p14 = Math.sin(this.lat0);
  76873. this.cos_p14 = Math.cos(this.lat0);
  76874. }
  76875. /* Orthographic forward equations--mapping lat,long to x,y
  76876. ---------------------------------------------------*/
  76877. function ortho_forward(p) {
  76878. var sinphi, cosphi;
  76879. /* sin and cos value */
  76880. var dlon;
  76881. /* delta longitude value */
  76882. var coslon;
  76883. /* cos of longitude */
  76884. var ksp;
  76885. /* scale factor */
  76886. var g, x, y;
  76887. var lon = p.x;
  76888. var lat = p.y;
  76889. /* Forward equations
  76890. -----------------*/
  76891. dlon = adjust_lon(lon - this.long0);
  76892. sinphi = Math.sin(lat);
  76893. cosphi = Math.cos(lat);
  76894. coslon = Math.cos(dlon);
  76895. g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;
  76896. ksp = 1;
  76897. if (g > 0 || Math.abs(g) <= EPSLN) {
  76898. x = this.a * ksp * cosphi * Math.sin(dlon);
  76899. y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
  76900. }
  76901. p.x = x;
  76902. p.y = y;
  76903. return p;
  76904. }
  76905. function ortho_inverse(p) {
  76906. var rh;
  76907. /* height above ellipsoid */
  76908. var z;
  76909. /* angle */
  76910. var sinz, cosz;
  76911. /* sin of z and cos of z */
  76912. var con;
  76913. var lon, lat;
  76914. /* Inverse equations
  76915. -----------------*/
  76916. p.x -= this.x0;
  76917. p.y -= this.y0;
  76918. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  76919. z = asinz(rh / this.a);
  76920. sinz = Math.sin(z);
  76921. cosz = Math.cos(z);
  76922. lon = this.long0;
  76923. if (Math.abs(rh) <= EPSLN) {
  76924. lat = this.lat0;
  76925. p.x = lon;
  76926. p.y = lat;
  76927. return p;
  76928. }
  76929. lat = asinz(cosz * this.sin_p14 + p.y * sinz * this.cos_p14 / rh);
  76930. con = Math.abs(this.lat0) - HALF_PI;
  76931. if (Math.abs(con) <= EPSLN) {
  76932. if (this.lat0 >= 0) {
  76933. lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
  76934. } else {
  76935. lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
  76936. }
  76937. p.x = lon;
  76938. p.y = lat;
  76939. return p;
  76940. }
  76941. lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));
  76942. p.x = lon;
  76943. p.y = lat;
  76944. return p;
  76945. }
  76946. var ortho_names = ["ortho"];
  76947. /* harmony default export */ var ortho = ({
  76948. init: ortho_init,
  76949. forward: ortho_forward,
  76950. inverse: ortho_inverse,
  76951. names: ortho_names
  76952. });
  76953. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/qsc.js
  76954. // QSC projection rewritten from the original PROJ4
  76955. // https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c
  76956. /* constants */
  76957. var FACE_ENUM = {
  76958. FRONT: 1,
  76959. RIGHT: 2,
  76960. BACK: 3,
  76961. LEFT: 4,
  76962. TOP: 5,
  76963. BOTTOM: 6
  76964. };
  76965. var AREA_ENUM = {
  76966. AREA_0: 1,
  76967. AREA_1: 2,
  76968. AREA_2: 3,
  76969. AREA_3: 4
  76970. };
  76971. function qsc_init() {
  76972. this.x0 = this.x0 || 0;
  76973. this.y0 = this.y0 || 0;
  76974. this.lat0 = this.lat0 || 0;
  76975. this.long0 = this.long0 || 0;
  76976. this.lat_ts = this.lat_ts || 0;
  76977. this.title = this.title || "Quadrilateralized Spherical Cube";
  76978. /* Determine the cube face from the center of projection. */
  76979. if (this.lat0 >= HALF_PI - FORTPI / 2.0) {
  76980. this.face = FACE_ENUM.TOP;
  76981. } else if (this.lat0 <= -(HALF_PI - FORTPI / 2.0)) {
  76982. this.face = FACE_ENUM.BOTTOM;
  76983. } else if (Math.abs(this.long0) <= FORTPI) {
  76984. this.face = FACE_ENUM.FRONT;
  76985. } else if (Math.abs(this.long0) <= HALF_PI + FORTPI) {
  76986. this.face = this.long0 > 0.0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT;
  76987. } else {
  76988. this.face = FACE_ENUM.BACK;
  76989. }
  76990. /* Fill in useful values for the ellipsoid <-> sphere shift
  76991. * described in [LK12]. */
  76992. if (this.es !== 0) {
  76993. this.one_minus_f = 1 - (this.a - this.b) / this.a;
  76994. this.one_minus_f_squared = this.one_minus_f * this.one_minus_f;
  76995. }
  76996. } // QSC forward equations--mapping lat,long to x,y
  76997. // -----------------------------------------------------------------
  76998. function qsc_forward(p) {
  76999. var xy = {
  77000. x: 0,
  77001. y: 0
  77002. };
  77003. var lat, lon;
  77004. var theta, phi;
  77005. var t, mu;
  77006. /* nu; */
  77007. var area = {
  77008. value: 0
  77009. }; // move lon according to projection's lon
  77010. p.x -= this.long0;
  77011. /* Convert the geodetic latitude to a geocentric latitude.
  77012. * This corresponds to the shift from the ellipsoid to the sphere
  77013. * described in [LK12]. */
  77014. if (this.es !== 0) {
  77015. //if (P->es != 0) {
  77016. lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));
  77017. } else {
  77018. lat = p.y;
  77019. }
  77020. /* Convert the input lat, lon into theta, phi as used by QSC.
  77021. * This depends on the cube face and the area on it.
  77022. * For the top and bottom face, we can compute theta and phi
  77023. * directly from phi, lam. For the other faces, we must use
  77024. * unit sphere cartesian coordinates as an intermediate step. */
  77025. lon = p.x; //lon = lp.lam;
  77026. if (this.face === FACE_ENUM.TOP) {
  77027. phi = HALF_PI - lat;
  77028. if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {
  77029. area.value = AREA_ENUM.AREA_0;
  77030. theta = lon - HALF_PI;
  77031. } else if (lon > HALF_PI + FORTPI || lon <= -(HALF_PI + FORTPI)) {
  77032. area.value = AREA_ENUM.AREA_1;
  77033. theta = lon > 0.0 ? lon - SPI : lon + SPI;
  77034. } else if (lon > -(HALF_PI + FORTPI) && lon <= -FORTPI) {
  77035. area.value = AREA_ENUM.AREA_2;
  77036. theta = lon + HALF_PI;
  77037. } else {
  77038. area.value = AREA_ENUM.AREA_3;
  77039. theta = lon;
  77040. }
  77041. } else if (this.face === FACE_ENUM.BOTTOM) {
  77042. phi = HALF_PI + lat;
  77043. if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {
  77044. area.value = AREA_ENUM.AREA_0;
  77045. theta = -lon + HALF_PI;
  77046. } else if (lon < FORTPI && lon >= -FORTPI) {
  77047. area.value = AREA_ENUM.AREA_1;
  77048. theta = -lon;
  77049. } else if (lon < -FORTPI && lon >= -(HALF_PI + FORTPI)) {
  77050. area.value = AREA_ENUM.AREA_2;
  77051. theta = -lon - HALF_PI;
  77052. } else {
  77053. area.value = AREA_ENUM.AREA_3;
  77054. theta = lon > 0.0 ? -lon + SPI : -lon - SPI;
  77055. }
  77056. } else {
  77057. var q, r, s;
  77058. var sinlat, coslat;
  77059. var sinlon, coslon;
  77060. if (this.face === FACE_ENUM.RIGHT) {
  77061. lon = qsc_shift_lon_origin(lon, +HALF_PI);
  77062. } else if (this.face === FACE_ENUM.BACK) {
  77063. lon = qsc_shift_lon_origin(lon, +SPI);
  77064. } else if (this.face === FACE_ENUM.LEFT) {
  77065. lon = qsc_shift_lon_origin(lon, -HALF_PI);
  77066. }
  77067. sinlat = Math.sin(lat);
  77068. coslat = Math.cos(lat);
  77069. sinlon = Math.sin(lon);
  77070. coslon = Math.cos(lon);
  77071. q = coslat * coslon;
  77072. r = coslat * sinlon;
  77073. s = sinlat;
  77074. if (this.face === FACE_ENUM.FRONT) {
  77075. phi = Math.acos(q);
  77076. theta = qsc_fwd_equat_face_theta(phi, s, r, area);
  77077. } else if (this.face === FACE_ENUM.RIGHT) {
  77078. phi = Math.acos(r);
  77079. theta = qsc_fwd_equat_face_theta(phi, s, -q, area);
  77080. } else if (this.face === FACE_ENUM.BACK) {
  77081. phi = Math.acos(-q);
  77082. theta = qsc_fwd_equat_face_theta(phi, s, -r, area);
  77083. } else if (this.face === FACE_ENUM.LEFT) {
  77084. phi = Math.acos(-r);
  77085. theta = qsc_fwd_equat_face_theta(phi, s, q, area);
  77086. } else {
  77087. /* Impossible */
  77088. phi = theta = 0;
  77089. area.value = AREA_ENUM.AREA_0;
  77090. }
  77091. }
  77092. /* Compute mu and nu for the area of definition.
  77093. * For mu, see Eq. (3-21) in [OL76], but note the typos:
  77094. * compare with Eq. (3-14). For nu, see Eq. (3-38). */
  77095. mu = Math.atan(12 / SPI * (theta + Math.acos(Math.sin(theta) * Math.cos(FORTPI)) - HALF_PI));
  77096. t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));
  77097. /* Apply the result to the real area. */
  77098. if (area.value === AREA_ENUM.AREA_1) {
  77099. mu += HALF_PI;
  77100. } else if (area.value === AREA_ENUM.AREA_2) {
  77101. mu += SPI;
  77102. } else if (area.value === AREA_ENUM.AREA_3) {
  77103. mu += 1.5 * SPI;
  77104. }
  77105. /* Now compute x, y from mu and nu */
  77106. xy.x = t * Math.cos(mu);
  77107. xy.y = t * Math.sin(mu);
  77108. xy.x = xy.x * this.a + this.x0;
  77109. xy.y = xy.y * this.a + this.y0;
  77110. p.x = xy.x;
  77111. p.y = xy.y;
  77112. return p;
  77113. } // QSC inverse equations--mapping x,y to lat/long
  77114. // -----------------------------------------------------------------
  77115. function qsc_inverse(p) {
  77116. var lp = {
  77117. lam: 0,
  77118. phi: 0
  77119. };
  77120. var mu, nu, cosmu, tannu;
  77121. var tantheta, theta, cosphi, phi;
  77122. var t;
  77123. var area = {
  77124. value: 0
  77125. };
  77126. /* de-offset */
  77127. p.x = (p.x - this.x0) / this.a;
  77128. p.y = (p.y - this.y0) / this.a;
  77129. /* Convert the input x, y to the mu and nu angles as used by QSC.
  77130. * This depends on the area of the cube face. */
  77131. nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y));
  77132. mu = Math.atan2(p.y, p.x);
  77133. if (p.x >= 0.0 && p.x >= Math.abs(p.y)) {
  77134. area.value = AREA_ENUM.AREA_0;
  77135. } else if (p.y >= 0.0 && p.y >= Math.abs(p.x)) {
  77136. area.value = AREA_ENUM.AREA_1;
  77137. mu -= HALF_PI;
  77138. } else if (p.x < 0.0 && -p.x >= Math.abs(p.y)) {
  77139. area.value = AREA_ENUM.AREA_2;
  77140. mu = mu < 0.0 ? mu + SPI : mu - SPI;
  77141. } else {
  77142. area.value = AREA_ENUM.AREA_3;
  77143. mu += HALF_PI;
  77144. }
  77145. /* Compute phi and theta for the area of definition.
  77146. * The inverse projection is not described in the original paper, but some
  77147. * good hints can be found here (as of 2011-12-14):
  77148. * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302
  77149. * (search for "Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>") */
  77150. t = SPI / 12 * Math.tan(mu);
  77151. tantheta = Math.sin(t) / (Math.cos(t) - 1 / Math.sqrt(2));
  77152. theta = Math.atan(tantheta);
  77153. cosmu = Math.cos(mu);
  77154. tannu = Math.tan(nu);
  77155. cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta))));
  77156. if (cosphi < -1) {
  77157. cosphi = -1;
  77158. } else if (cosphi > +1) {
  77159. cosphi = +1;
  77160. }
  77161. /* Apply the result to the real area on the cube face.
  77162. * For the top and bottom face, we can compute phi and lam directly.
  77163. * For the other faces, we must use unit sphere cartesian coordinates
  77164. * as an intermediate step. */
  77165. if (this.face === FACE_ENUM.TOP) {
  77166. phi = Math.acos(cosphi);
  77167. lp.phi = HALF_PI - phi;
  77168. if (area.value === AREA_ENUM.AREA_0) {
  77169. lp.lam = theta + HALF_PI;
  77170. } else if (area.value === AREA_ENUM.AREA_1) {
  77171. lp.lam = theta < 0.0 ? theta + SPI : theta - SPI;
  77172. } else if (area.value === AREA_ENUM.AREA_2) {
  77173. lp.lam = theta - HALF_PI;
  77174. } else
  77175. /* area.value == AREA_ENUM.AREA_3 */
  77176. {
  77177. lp.lam = theta;
  77178. }
  77179. } else if (this.face === FACE_ENUM.BOTTOM) {
  77180. phi = Math.acos(cosphi);
  77181. lp.phi = phi - HALF_PI;
  77182. if (area.value === AREA_ENUM.AREA_0) {
  77183. lp.lam = -theta + HALF_PI;
  77184. } else if (area.value === AREA_ENUM.AREA_1) {
  77185. lp.lam = -theta;
  77186. } else if (area.value === AREA_ENUM.AREA_2) {
  77187. lp.lam = -theta - HALF_PI;
  77188. } else
  77189. /* area.value == AREA_ENUM.AREA_3 */
  77190. {
  77191. lp.lam = theta < 0.0 ? -theta - SPI : -theta + SPI;
  77192. }
  77193. } else {
  77194. /* Compute phi and lam via cartesian unit sphere coordinates. */
  77195. var q, r, s;
  77196. q = cosphi;
  77197. t = q * q;
  77198. if (t >= 1) {
  77199. s = 0;
  77200. } else {
  77201. s = Math.sqrt(1 - t) * Math.sin(theta);
  77202. }
  77203. t += s * s;
  77204. if (t >= 1) {
  77205. r = 0;
  77206. } else {
  77207. r = Math.sqrt(1 - t);
  77208. }
  77209. /* Rotate q,r,s into the correct area. */
  77210. if (area.value === AREA_ENUM.AREA_1) {
  77211. t = r;
  77212. r = -s;
  77213. s = t;
  77214. } else if (area.value === AREA_ENUM.AREA_2) {
  77215. r = -r;
  77216. s = -s;
  77217. } else if (area.value === AREA_ENUM.AREA_3) {
  77218. t = r;
  77219. r = s;
  77220. s = -t;
  77221. }
  77222. /* Rotate q,r,s into the correct cube face. */
  77223. if (this.face === FACE_ENUM.RIGHT) {
  77224. t = q;
  77225. q = -r;
  77226. r = t;
  77227. } else if (this.face === FACE_ENUM.BACK) {
  77228. q = -q;
  77229. r = -r;
  77230. } else if (this.face === FACE_ENUM.LEFT) {
  77231. t = q;
  77232. q = r;
  77233. r = -t;
  77234. }
  77235. /* Now compute phi and lam from the unit sphere coordinates. */
  77236. lp.phi = Math.acos(-s) - HALF_PI;
  77237. lp.lam = Math.atan2(r, q);
  77238. if (this.face === FACE_ENUM.RIGHT) {
  77239. lp.lam = qsc_shift_lon_origin(lp.lam, -HALF_PI);
  77240. } else if (this.face === FACE_ENUM.BACK) {
  77241. lp.lam = qsc_shift_lon_origin(lp.lam, -SPI);
  77242. } else if (this.face === FACE_ENUM.LEFT) {
  77243. lp.lam = qsc_shift_lon_origin(lp.lam, +HALF_PI);
  77244. }
  77245. }
  77246. /* Apply the shift from the sphere to the ellipsoid as described
  77247. * in [LK12]. */
  77248. if (this.es !== 0) {
  77249. var invert_sign;
  77250. var tanphi, xa;
  77251. invert_sign = lp.phi < 0 ? 1 : 0;
  77252. tanphi = Math.tan(lp.phi);
  77253. xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared);
  77254. lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa));
  77255. if (invert_sign) {
  77256. lp.phi = -lp.phi;
  77257. }
  77258. }
  77259. lp.lam += this.long0;
  77260. p.x = lp.lam;
  77261. p.y = lp.phi;
  77262. return p;
  77263. }
  77264. /* Helper function for forward projection: compute the theta angle
  77265. * and determine the area number. */
  77266. function qsc_fwd_equat_face_theta(phi, y, x, area) {
  77267. var theta;
  77268. if (phi < EPSLN) {
  77269. area.value = AREA_ENUM.AREA_0;
  77270. theta = 0.0;
  77271. } else {
  77272. theta = Math.atan2(y, x);
  77273. if (Math.abs(theta) <= FORTPI) {
  77274. area.value = AREA_ENUM.AREA_0;
  77275. } else if (theta > FORTPI && theta <= HALF_PI + FORTPI) {
  77276. area.value = AREA_ENUM.AREA_1;
  77277. theta -= HALF_PI;
  77278. } else if (theta > HALF_PI + FORTPI || theta <= -(HALF_PI + FORTPI)) {
  77279. area.value = AREA_ENUM.AREA_2;
  77280. theta = theta >= 0.0 ? theta - SPI : theta + SPI;
  77281. } else {
  77282. area.value = AREA_ENUM.AREA_3;
  77283. theta += HALF_PI;
  77284. }
  77285. }
  77286. return theta;
  77287. }
  77288. /* Helper function: shift the longitude. */
  77289. function qsc_shift_lon_origin(lon, offset) {
  77290. var slon = lon + offset;
  77291. if (slon < -SPI) {
  77292. slon += TWO_PI;
  77293. } else if (slon > +SPI) {
  77294. slon -= TWO_PI;
  77295. }
  77296. return slon;
  77297. }
  77298. var qsc_names = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
  77299. /* harmony default export */ var qsc = ({
  77300. init: qsc_init,
  77301. forward: qsc_forward,
  77302. inverse: qsc_inverse,
  77303. names: qsc_names
  77304. });
  77305. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/robin.js
  77306. // Robinson projection
  77307. // Based on https://github.com/OSGeo/proj.4/blob/master/src/PJ_robin.c
  77308. // Polynomial coeficients from http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039
  77309. 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]];
  77310. 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]];
  77311. var FXC = 0.8487;
  77312. var FYC = 1.3523;
  77313. var C1 = R2D / 5; // rad to 5-degree interval
  77314. var RC1 = 1 / C1;
  77315. var NODES = 18;
  77316. var poly3_val = function poly3_val(coefs, x) {
  77317. return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3]));
  77318. };
  77319. var poly3_der = function poly3_der(coefs, x) {
  77320. return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]);
  77321. };
  77322. function newton_rapshon(f_df, start, max_err, iters) {
  77323. var x = start;
  77324. for (; iters; --iters) {
  77325. var upd = f_df(x);
  77326. x -= upd;
  77327. if (Math.abs(upd) < max_err) {
  77328. break;
  77329. }
  77330. }
  77331. return x;
  77332. }
  77333. function robin_init() {
  77334. this.x0 = this.x0 || 0;
  77335. this.y0 = this.y0 || 0;
  77336. this.long0 = this.long0 || 0;
  77337. this.es = 0;
  77338. this.title = this.title || "Robinson";
  77339. }
  77340. function robin_forward(ll) {
  77341. var lon = adjust_lon(ll.x - this.long0);
  77342. var dphi = Math.abs(ll.y);
  77343. var i = Math.floor(dphi * C1);
  77344. if (i < 0) {
  77345. i = 0;
  77346. } else if (i >= NODES) {
  77347. i = NODES - 1;
  77348. }
  77349. dphi = R2D * (dphi - RC1 * i);
  77350. var xy = {
  77351. x: poly3_val(COEFS_X[i], dphi) * lon,
  77352. y: poly3_val(COEFS_Y[i], dphi)
  77353. };
  77354. if (ll.y < 0) {
  77355. xy.y = -xy.y;
  77356. }
  77357. xy.x = xy.x * this.a * FXC + this.x0;
  77358. xy.y = xy.y * this.a * FYC + this.y0;
  77359. return xy;
  77360. }
  77361. function robin_inverse(xy) {
  77362. var ll = {
  77363. x: (xy.x - this.x0) / (this.a * FXC),
  77364. y: Math.abs(xy.y - this.y0) / (this.a * FYC)
  77365. };
  77366. if (ll.y >= 1) {
  77367. // pathologic case
  77368. ll.x /= COEFS_X[NODES][0];
  77369. ll.y = xy.y < 0 ? -HALF_PI : HALF_PI;
  77370. } else {
  77371. // find table interval
  77372. var i = Math.floor(ll.y * NODES);
  77373. if (i < 0) {
  77374. i = 0;
  77375. } else if (i >= NODES) {
  77376. i = NODES - 1;
  77377. }
  77378. for (;;) {
  77379. if (COEFS_Y[i][0] > ll.y) {
  77380. --i;
  77381. } else if (COEFS_Y[i + 1][0] <= ll.y) {
  77382. ++i;
  77383. } else {
  77384. break;
  77385. }
  77386. } // linear interpolation in 5 degree interval
  77387. var coefs = COEFS_Y[i];
  77388. var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i + 1][0] - coefs[0]); // find t so that poly3_val(coefs, t) = ll.y
  77389. t = newton_rapshon(function (x) {
  77390. return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x);
  77391. }, t, EPSLN, 100);
  77392. ll.x /= poly3_val(COEFS_X[i], t);
  77393. ll.y = (5 * i + t) * D2R;
  77394. if (xy.y < 0) {
  77395. ll.y = -ll.y;
  77396. }
  77397. }
  77398. ll.x = adjust_lon(ll.x + this.long0);
  77399. return ll;
  77400. }
  77401. var robin_names = ["Robinson", "robin"];
  77402. /* harmony default export */ var robin = ({
  77403. init: robin_init,
  77404. forward: robin_forward,
  77405. inverse: robin_inverse,
  77406. names: robin_names
  77407. });
  77408. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/projections/geocent.js
  77409. function geocent_init() {
  77410. this.name = 'geocent';
  77411. }
  77412. function geocent_forward(p) {
  77413. var point = geodeticToGeocentric(p, this.es, this.a);
  77414. return point;
  77415. }
  77416. function geocent_inverse(p) {
  77417. var point = geocentricToGeodetic(p, this.es, this.a, this.b);
  77418. return point;
  77419. }
  77420. var geocent_names = ["Geocentric", 'geocentric', "geocent", "Geocent"];
  77421. /* harmony default export */ var geocent = ({
  77422. init: geocent_init,
  77423. forward: geocent_forward,
  77424. inverse: geocent_inverse,
  77425. names: geocent_names
  77426. });
  77427. ;// CONCATENATED MODULE: ./node_modules/proj4/projs.js
  77428. /* harmony default export */ function proj4_projs(proj4) {
  77429. proj4.Proj.projections.add(tmerc);
  77430. proj4.Proj.projections.add(etmerc);
  77431. proj4.Proj.projections.add(utm);
  77432. proj4.Proj.projections.add(sterea);
  77433. proj4.Proj.projections.add(stere);
  77434. proj4.Proj.projections.add(somerc);
  77435. proj4.Proj.projections.add(omerc);
  77436. proj4.Proj.projections.add(lcc);
  77437. proj4.Proj.projections.add(krovak);
  77438. proj4.Proj.projections.add(cass);
  77439. proj4.Proj.projections.add(laea);
  77440. proj4.Proj.projections.add(aea);
  77441. proj4.Proj.projections.add(gnom);
  77442. proj4.Proj.projections.add(cea);
  77443. proj4.Proj.projections.add(eqc);
  77444. proj4.Proj.projections.add(poly);
  77445. proj4.Proj.projections.add(nzmg);
  77446. proj4.Proj.projections.add(mill);
  77447. proj4.Proj.projections.add(sinu);
  77448. proj4.Proj.projections.add(moll);
  77449. proj4.Proj.projections.add(eqdc);
  77450. proj4.Proj.projections.add(vandg);
  77451. proj4.Proj.projections.add(aeqd);
  77452. proj4.Proj.projections.add(ortho);
  77453. proj4.Proj.projections.add(qsc);
  77454. proj4.Proj.projections.add(robin);
  77455. proj4.Proj.projections.add(geocent);
  77456. }
  77457. ;// CONCATENATED MODULE: ./node_modules/proj4/lib/index.js
  77458. core.defaultDatum = 'WGS84'; //default datum
  77459. core.Proj = Proj;
  77460. core.WGS84 = new core.Proj('WGS84');
  77461. core.Point = lib_Point;
  77462. core.toPoint = toPoint;
  77463. core.defs = lib_defs;
  77464. core.transform = transform;
  77465. core.mgrs = mgrs;
  77466. core.version = '__VERSION__';
  77467. proj4_projs(core);
  77468. /* harmony default export */ var lib = (core);
  77469. ;// CONCATENATED MODULE: ./src/openlayers/services/DataFlowService.js
  77470. function services_DataFlowService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_DataFlowService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_DataFlowService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_DataFlowService_typeof(obj); }
  77471. function services_DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  77472. function services_DataFlowService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  77473. function services_DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_DataFlowService_defineProperties(Constructor, staticProps); return Constructor; }
  77474. function services_DataFlowService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) services_DataFlowService_setPrototypeOf(subClass, superClass); }
  77475. function services_DataFlowService_setPrototypeOf(o, p) { services_DataFlowService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_DataFlowService_setPrototypeOf(o, p); }
  77476. function services_DataFlowService_createSuper(Derived) { var hasNativeReflectConstruct = services_DataFlowService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_DataFlowService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_DataFlowService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_DataFlowService_possibleConstructorReturn(this, result); }; }
  77477. function services_DataFlowService_possibleConstructorReturn(self, call) { if (call && (services_DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_DataFlowService_assertThisInitialized(self); }
  77478. function services_DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  77479. function services_DataFlowService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  77480. function services_DataFlowService_getPrototypeOf(o) { services_DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_DataFlowService_getPrototypeOf(o); }
  77481. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  77482. * This program are made available under the terms of the Apache License, Version 2.0
  77483. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  77484. /**
  77485. * @class ol.supermap.DataFlowService
  77486. * @category iServer DataFlow
  77487. * @classdesc 数据流服务。
  77488. * @extends {ol.supermap.ServiceBase}
  77489. * @example
  77490. * new ol.supermap.DataFlowService(url)
  77491. * .queryChart(param,function(result){
  77492. * //doSomething
  77493. * })
  77494. * @param {string} url - 与客户端交互的数据流服务地址。
  77495. * @param {Object} options - 参数。
  77496. * @param {string} [options.proxy] - 服务代理地址。
  77497. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  77498. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  77499. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  77500. * @param {Object} [options.headers] - 请求头。
  77501. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  77502. * @param {Object} [options.excludeField] - 排除字段。
  77503. */
  77504. var DataFlowService = /*#__PURE__*/function (_ServiceBase) {
  77505. services_DataFlowService_inherits(DataFlowService, _ServiceBase);
  77506. var _super = services_DataFlowService_createSuper(DataFlowService);
  77507. function DataFlowService(url, options) {
  77508. var _this;
  77509. services_DataFlowService_classCallCheck(this, DataFlowService);
  77510. options = options || {};
  77511. if (options.projection) {
  77512. options.prjCoordSys = options.projection;
  77513. }
  77514. _this = _super.call(this, url, options);
  77515. _this.dataFlow = new DataFlowService_DataFlowService(url, options);
  77516. _this.dataFlow.events.on({
  77517. "broadcastSocketConnected": _this._defaultEvent,
  77518. "broadcastSocketError": _this._defaultEvent,
  77519. "broadcastFailed": _this._defaultEvent,
  77520. "broadcastSucceeded": _this._defaultEvent,
  77521. "subscribeSocketConnected": _this._defaultEvent,
  77522. "subscribeSocketError": _this._defaultEvent,
  77523. "messageSucceeded": _this._defaultEvent,
  77524. "setFilterParamSucceeded": _this._defaultEvent,
  77525. scope: services_DataFlowService_assertThisInitialized(_this)
  77526. });
  77527. return _this;
  77528. }
  77529. /**
  77530. * @function ol.supermap.DataFlowService.prototype.initBroadcast
  77531. * @description 初始化广播。
  77532. * @returns {ol.supermap.DataFlowService}
  77533. */
  77534. services_DataFlowService_createClass(DataFlowService, [{
  77535. key: "initBroadcast",
  77536. value: function initBroadcast() {
  77537. this.dataFlow.initBroadcast();
  77538. return this;
  77539. }
  77540. /**
  77541. * @function ol.supermap.DataFlowService.prototype.broadcast
  77542. * @description 加载广播数据。
  77543. * @param {JSON} obj - JSON 格式的要素数据。
  77544. */
  77545. }, {
  77546. key: "broadcast",
  77547. value: function broadcast(obj) {
  77548. this.dataFlow.broadcast(obj);
  77549. }
  77550. /**
  77551. * @function ol.supermap.DataFlowService.prototype.initSubscribe
  77552. * @description 初始化订阅数据。
  77553. */
  77554. }, {
  77555. key: "initSubscribe",
  77556. value: function initSubscribe() {
  77557. this.dataFlow.initSubscribe();
  77558. return this;
  77559. }
  77560. /**
  77561. * @function ol.supermap.DataFlowService.prototype.setExcludeField
  77562. * @description 设置排除字段。
  77563. * @param {Object} excludeField - 排除字段。
  77564. */
  77565. }, {
  77566. key: "setExcludeField",
  77567. value: function setExcludeField(excludeField) {
  77568. this.dataFlow.setExcludeField(excludeField);
  77569. this.options.excludeField = excludeField;
  77570. return this;
  77571. }
  77572. /**
  77573. * @function ol.supermap.DataFlowService.prototype.setGeometry
  77574. * @description 设置添加的几何要素数据。
  77575. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  77576. */
  77577. }, {
  77578. key: "setGeometry",
  77579. value: function setGeometry(geometry) {
  77580. this.dataFlow.setGeometry(geometry);
  77581. this.options.geometry = geometry;
  77582. return this;
  77583. }
  77584. /**
  77585. * @function ol.supermap.DataFlowService.prototype.unSubscribe
  77586. * @description 结束订阅数据。
  77587. */
  77588. }, {
  77589. key: "unSubscribe",
  77590. value: function unSubscribe() {
  77591. this.dataFlow.unSubscribe();
  77592. }
  77593. /**
  77594. * @function ol.supermap.DataFlowService.prototype.unBroadcast
  77595. * @description 结束加载广播。
  77596. */
  77597. }, {
  77598. key: "unBroadcast",
  77599. value: function unBroadcast() {
  77600. this.dataFlow.unBroadcast();
  77601. }
  77602. }, {
  77603. key: "_defaultEvent",
  77604. value: function _defaultEvent(e) {
  77605. this.dispatchEvent({
  77606. type: e.eventType || e.type,
  77607. value: e
  77608. });
  77609. }
  77610. }]);
  77611. return DataFlowService;
  77612. }(ServiceBase);
  77613. ;// CONCATENATED MODULE: ./src/openlayers/overlay/DataFlow.js
  77614. function DataFlow_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DataFlow_typeof = function _typeof(obj) { return typeof obj; }; } else { DataFlow_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DataFlow_typeof(obj); }
  77615. function DataFlow_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  77616. function DataFlow_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  77617. function DataFlow_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataFlow_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataFlow_defineProperties(Constructor, staticProps); return Constructor; }
  77618. function DataFlow_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) DataFlow_setPrototypeOf(subClass, superClass); }
  77619. function DataFlow_setPrototypeOf(o, p) { DataFlow_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DataFlow_setPrototypeOf(o, p); }
  77620. function DataFlow_createSuper(Derived) { var hasNativeReflectConstruct = DataFlow_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DataFlow_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DataFlow_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DataFlow_possibleConstructorReturn(this, result); }; }
  77621. function DataFlow_possibleConstructorReturn(self, call) { if (call && (DataFlow_typeof(call) === "object" || typeof call === "function")) { return call; } return DataFlow_assertThisInitialized(self); }
  77622. function DataFlow_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  77623. function DataFlow_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  77624. function DataFlow_getPrototypeOf(o) { DataFlow_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataFlow_getPrototypeOf(o); }
  77625. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  77626. * This program are made available under the terms of the Apache License, Version 2.0
  77627. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  77628. /**
  77629. * @class ol.source.DataFlow
  77630. * @category iServer DataFlow
  77631. * @classdesc 数据流图层源。订阅SuperMap iServer 数据流服务,并将订阅得到的数据根据 `options.idField` 自动更新。与 {@link ol/layer/Vector} 结合使用可以实现SuperMap iServer 数据流上图、根据`options.idField`自动更新。
  77632. * @param {Object} opt_options - 参数。
  77633. * @param {string} opt_options.ws - SuperMap iServer 数据流服务地址,例如:http://localhost:8090/iserver/services/dataflowTest/dataflow。
  77634. * @param {string} [opt_options.idField = 'id'] - 要素属性中表示唯一标识的字段。
  77635. * @param {GeoJSONObject} [opt_options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  77636. * @param {Object} [opt_options.prjCoordSys] - 请求的地图的坐标参考系统。当此参数设置的坐标系统不同于地图的原有坐标系统时, 系统会进行动态投影,并返回动态投影后的地图瓦片。例如:{"epsgCode":3857}。
  77637. * @param {Object} [opt_options.excludeField] - 排除字段
  77638. * @extends {ol/source/Vector}
  77639. * @example
  77640. * var source = new ol.source.DataFlow({
  77641. * ws: urlDataFlow,
  77642. * idField:"objectId"
  77643. * });
  77644. * var layer = new ol.layer.Vector({
  77645. * source: source,
  77646. * });
  77647. *
  77648. */
  77649. var DataFlow = /*#__PURE__*/function (_VectorSource) {
  77650. DataFlow_inherits(DataFlow, _VectorSource);
  77651. var _super = DataFlow_createSuper(DataFlow);
  77652. function DataFlow(opt_options) {
  77653. var _this;
  77654. DataFlow_classCallCheck(this, DataFlow);
  77655. var options = opt_options ? opt_options : {};
  77656. _this = _super.call(this, options);
  77657. _this.idField = options.idField || "id";
  77658. _this.dataService = new DataFlowService(options.ws, {
  77659. geometry: options.geometry,
  77660. prjCoordSys: options.prjCoordSys,
  77661. excludeField: options.excludeField
  77662. }).initSubscribe();
  77663. var me = DataFlow_assertThisInitialized(_this);
  77664. me.dataService.on("subscribeSocketConnected", function (e) {
  77665. me.dispatchEvent({
  77666. type: "subscribeSucceeded",
  77667. value: e
  77668. });
  77669. });
  77670. me.dataService.on("messageSucceeded", function (msg) {
  77671. me._onMessageSuccessed(msg);
  77672. });
  77673. me.dataService.on("setFilterParamSucceeded", function (msg) {
  77674. me.dispatchEvent({
  77675. type: "setFilterParamSucceeded",
  77676. value: msg
  77677. });
  77678. });
  77679. _this.featureCache = {};
  77680. return _this;
  77681. } // /**
  77682. // * @function ol.source.DataFlow.prototype.setPrjCoordSys
  77683. // * @description 设置坐标参考系。
  77684. // * @param {Object} prjCoordSys - 参考系。
  77685. // */
  77686. // setPrjCoordSys(prjCoordSys) {
  77687. // this.dataService.setPrjCoordSys(prjCoordSys);
  77688. // this.prjCoordSys = prjCoordSys;
  77689. // return this;
  77690. // }
  77691. /**
  77692. * @function ol.source.DataFlow.prototype.setExcludeField
  77693. * @description 设置唯一字段。
  77694. * @param {Object} excludeField - 排除字段。
  77695. */
  77696. DataFlow_createClass(DataFlow, [{
  77697. key: "setExcludeField",
  77698. value: function setExcludeField(excludeField) {
  77699. this.dataService.setExcludeField(excludeField);
  77700. this.excludeField = excludeField;
  77701. return this;
  77702. }
  77703. /**
  77704. * @function ol.source.DataFlow.prototype.setGeometry
  77705. * @description 设置几何图形。
  77706. * @param {Object} geometry - 要素图形。
  77707. */
  77708. }, {
  77709. key: "setGeometry",
  77710. value: function setGeometry(geometry) {
  77711. this.dataService.setGeometry(geometry);
  77712. this.geometry = geometry;
  77713. return this;
  77714. }
  77715. }, {
  77716. key: "_onMessageSuccessed",
  77717. value: function _onMessageSuccessed(msg) {
  77718. //this.clear();
  77719. var feature = new (external_ol_format_GeoJSON_default())().readFeature(msg.value.featureResult);
  77720. var geoID = feature.get(this.idField);
  77721. if (geoID !== undefined && this.featureCache[geoID]) {
  77722. this.featureCache[geoID].setGeometry(feature.getGeometry());
  77723. this.featureCache[geoID].setProperties(feature.getProperties());
  77724. this.changed();
  77725. } else {
  77726. this.addFeature(feature);
  77727. this.featureCache[geoID] = feature;
  77728. }
  77729. this.dispatchEvent({
  77730. type: "dataupdated",
  77731. value: {
  77732. source: this,
  77733. data: feature
  77734. }
  77735. });
  77736. }
  77737. }]);
  77738. return DataFlow;
  77739. }((external_ol_source_Vector_default()));
  77740. ;// CONCATENATED MODULE: ./src/openlayers/overlay/theme/ThemeFeature.js
  77741. function ThemeFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  77742. function ThemeFeature_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  77743. function ThemeFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeFeature_defineProperties(Constructor, staticProps); return Constructor; }
  77744. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  77745. * This program are made available under the terms of the Apache License, Version 2.0
  77746. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  77747. /**
  77748. * @class ol.supermap.ThemeFeature
  77749. * @category Visualization Theme
  77750. * @classdesc 专题图要素类。
  77751. * @param {Object} geometry - 要量算的几何对象,支持 {@link ol/geom/Geometry} 和 GeoText 标签数组类型 geometry = [x,y,text]。
  77752. * @param {Object} [attributes] - 属性。
  77753. */
  77754. var ThemeFeature = /*#__PURE__*/function () {
  77755. function ThemeFeature(geometry, attributes) {
  77756. ThemeFeature_classCallCheck(this, ThemeFeature);
  77757. this.geometry = geometry;
  77758. this.attributes = attributes;
  77759. }
  77760. /**
  77761. * @function ol.supermap.ThemeFeature.prototype.toFeature
  77762. * @description 转为矢量要素。
  77763. */
  77764. ThemeFeature_createClass(ThemeFeature, [{
  77765. key: "toFeature",
  77766. value: function toFeature() {
  77767. var geometry = this.geometry;
  77768. if (geometry instanceof (external_ol_geom_Geometry_default())) {
  77769. //先把数据属性与要素合并
  77770. var featureOption = this.attributes;
  77771. featureOption.geometry = geometry;
  77772. var olFeature = new (external_ol_Feature_default())(featureOption);
  77773. return new GeoJSON().read(new (external_ol_format_GeoJSON_default())().writeFeature(olFeature), "Feature");
  77774. } else if (geometry.length === 3) {
  77775. geometry = new GeoText(geometry[0], geometry[1], geometry[2]);
  77776. return new Vector(geometry, this.attributes);
  77777. }
  77778. }
  77779. }]);
  77780. return ThemeFeature;
  77781. }();
  77782. ;// CONCATENATED MODULE: external "ol.source.ImageCanvas"
  77783. var external_ol_source_ImageCanvas_namespaceObject = ol.source.ImageCanvas;
  77784. var external_ol_source_ImageCanvas_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_ImageCanvas_namespaceObject);
  77785. ;// CONCATENATED MODULE: ./src/openlayers/overlay/theme/Theme.js
  77786. function Theme_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Theme_typeof = function _typeof(obj) { return typeof obj; }; } else { Theme_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Theme_typeof(obj); }
  77787. function theme_Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  77788. function theme_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); } }
  77789. function theme_Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) theme_Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) theme_Theme_defineProperties(Constructor, staticProps); return Constructor; }
  77790. function Theme_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Theme_setPrototypeOf(subClass, superClass); }
  77791. function Theme_setPrototypeOf(o, p) { Theme_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Theme_setPrototypeOf(o, p); }
  77792. function Theme_createSuper(Derived) { var hasNativeReflectConstruct = Theme_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Theme_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Theme_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Theme_possibleConstructorReturn(this, result); }; }
  77793. function Theme_possibleConstructorReturn(self, call) { if (call && (Theme_typeof(call) === "object" || typeof call === "function")) { return call; } return Theme_assertThisInitialized(self); }
  77794. function Theme_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  77795. function Theme_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  77796. function Theme_getPrototypeOf(o) { Theme_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Theme_getPrototypeOf(o); }
  77797. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  77798. * This program are made available under the terms of the Apache License, Version 2.0
  77799. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  77800. /**
  77801. * @class ol.source.Theme
  77802. * @category Visualization Theme
  77803. * @classdesc 专题图基类。
  77804. * @param {string} name - 专题图图层名称。
  77805. * @param {Object} opt_option - 参数。
  77806. * @param {ol/Map} opt_option.map - 当前 openlayers 的 Map 对象。
  77807. * @param {string} [opt_option.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  77808. * @param {number} [opt_option.opacity=1] - 图层透明度。
  77809. * @param {string} [opt_option.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  77810. * @param {ol/proj/Projection} [opt_option.projection] - 投影信息。
  77811. * @param {number} [opt_option.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。 必须是 1 或更高。
  77812. * @param {Array} [opt_option.resolutions] - 分辨率数组。
  77813. * @param {ol/source/State} [opt_option.state] - 资源状态。
  77814. * @param {(string|Object)} [opt_option.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  77815. * @extends {ol/source/ImageCanvas}
  77816. */
  77817. var theme_Theme_Theme = /*#__PURE__*/function (_ImageCanvasSource) {
  77818. Theme_inherits(Theme, _ImageCanvasSource);
  77819. var _super = Theme_createSuper(Theme);
  77820. function Theme(name, opt_options) {
  77821. var _this;
  77822. theme_Theme_classCallCheck(this, Theme);
  77823. var options = opt_options ? opt_options : {};
  77824. _this = _super.call(this, {
  77825. attributions: options.attributions || "Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>",
  77826. canvasFunction: canvasFunctionInternal_,
  77827. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  77828. projection: options.projection,
  77829. ratio: options.ratio,
  77830. resolutions: options.resolutions,
  77831. state: options.state
  77832. });
  77833. _this.id = options.id ? options.id : Util.createUniqueID("themeLayer_");
  77834. function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  77835. // eslint-disable-line no-unused-vars
  77836. var mapWidth = size[0] * pixelRatio;
  77837. var mapHeight = size[1] * pixelRatio;
  77838. if (!this.context) {
  77839. this.context = core_Util_Util.createCanvasContext2D(mapWidth, mapHeight);
  77840. }
  77841. if (!this.features) {
  77842. return this.context.canvas;
  77843. }
  77844. this.pixelRatio = pixelRatio;
  77845. var width = this.map.getSize()[0] * pixelRatio;
  77846. var height = this.map.getSize()[1] * pixelRatio;
  77847. this.offset = [(mapWidth - width) / 2 / pixelRatio, (mapHeight - height) / 2 / pixelRatio];
  77848. if (!this.notFirst) {
  77849. this.redrawThematicFeatures(extent);
  77850. this.notFirst = true;
  77851. }
  77852. this.div.id = this.id;
  77853. this.div.className = "themeLayer";
  77854. this.div.style.width = mapWidth + "px";
  77855. this.div.style.height = mapHeight + "px";
  77856. this.map.getViewport().appendChild(this.div);
  77857. this.renderer.resize();
  77858. this.map.getViewport().removeChild(this.div);
  77859. this.themeCanvas = this.renderer.painter.root.getElementsByTagName('canvas')[0];
  77860. this.themeCanvas.width = mapWidth;
  77861. this.themeCanvas.height = mapHeight;
  77862. this.themeCanvas.style.width = mapWidth + "px";
  77863. this.themeCanvas.style.height = mapHeight + "px";
  77864. this.themeCanvas.getContext('2d').clearRect(0, 0, mapWidth, mapHeight);
  77865. var highLightContext = this.renderer.painter._layers.hover.ctx;
  77866. var highlightCanvas = highLightContext.canvas;
  77867. var copyHighLightContext = core_Util_Util.createCanvasContext2D(mapWidth, mapHeight);
  77868. copyHighLightContext.drawImage(highlightCanvas, 0, 0, highlightCanvas.width, highlightCanvas.height, 0, 0, mapWidth, mapHeight);
  77869. this.redrawThematicFeatures(extent);
  77870. var canvas = this.context.canvas;
  77871. this.context.clearRect(0, 0, canvas.width, canvas.height);
  77872. canvas.width = mapWidth;
  77873. canvas.height = mapHeight;
  77874. canvas.style.width = mapWidth + "px";
  77875. canvas.style.height = mapHeight + "px";
  77876. this.context.drawImage(this.themeCanvas, 0, 0);
  77877. this.context.drawImage(copyHighLightContext.canvas, 0, 0);
  77878. return this.context.canvas;
  77879. }
  77880. _this.canvasFunctionInternal_ = canvasFunctionInternal_;
  77881. _this.EVENT_TYPES = ["loadstart", "loadend", "loadcancel", "visibilitychanged", "move", "moveend", "added", "removed", "tileloaded", "beforefeaturesadded", "featuresadded", "featuresremoved"];
  77882. _this.features = [];
  77883. _this.TFEvents = options.TFEvents || [];
  77884. _this.map = options.map;
  77885. var size = _this.map.getSize();
  77886. _this.div = document.createElement('div');
  77887. _this.map.getViewport().appendChild(_this.div);
  77888. _this.div.style.width = size[0] + "px";
  77889. _this.div.style.height = size[1] + "px";
  77890. _this.setOpacity(options.opacity);
  77891. _this.levelRenderer = new LevelRenderer();
  77892. _this.movingOffset = [0, 0];
  77893. _this.renderer = _this.levelRenderer.init(_this.div);
  77894. _this.map.getViewport().removeChild(_this.div);
  77895. _this.renderer.clear(); //处理用户预先(在图层添加到 map 前)监听的事件
  77896. _this.addTFEvents();
  77897. return _this;
  77898. }
  77899. /**
  77900. * @function ol.source.Theme.prototype.destroy
  77901. * @description 释放资源,将引用资源的属性置空。
  77902. */
  77903. theme_Theme_createClass(Theme, [{
  77904. key: "destroy",
  77905. value: function destroy() {
  77906. this.EVENT_TYPES = null;
  77907. this.isBaseLayer = null;
  77908. this.TFEvents = null;
  77909. this.destroyFeatures();
  77910. this.features = null;
  77911. if (this.renderer) {
  77912. this.renderer.dispose();
  77913. }
  77914. this.renderer = null;
  77915. this.levelRenderer = null;
  77916. this.movingOffset = null;
  77917. this.currentMousePosition = null;
  77918. }
  77919. /**
  77920. * @function ol.source.Theme.prototype.destroyFeatures
  77921. * @description 销毁某个要素。
  77922. * @param {SuperMap.Feature.Vector} features - 将被销毁的要素。
  77923. */
  77924. }, {
  77925. key: "destroyFeatures",
  77926. value: function destroyFeatures(features) {
  77927. var all = features == undefined;
  77928. if (all) {
  77929. features = this.features;
  77930. }
  77931. if (features) {
  77932. this.removeFeatures(features);
  77933. for (var i = features.length - 1; i >= 0; i--) {
  77934. features[i].destroy();
  77935. }
  77936. }
  77937. }
  77938. /**
  77939. * @function ol.source.Theme.prototype.setOpacity
  77940. * @description 设置图层的不透明度,取值[0-1]之间。
  77941. * @param {number} opacity - 不透明度。
  77942. */
  77943. }, {
  77944. key: "setOpacity",
  77945. value: function setOpacity(opacity) {
  77946. if (opacity !== this.opacity) {
  77947. this.opacity = opacity;
  77948. var element = this.div;
  77949. Util.modifyDOMElement(element, null, null, null, null, null, null, opacity);
  77950. if (this.map !== null) {
  77951. this.dispatchEvent({
  77952. type: 'changelayer',
  77953. value: {
  77954. layer: this,
  77955. property: "opacity"
  77956. }
  77957. });
  77958. }
  77959. }
  77960. }
  77961. /**
  77962. * @function ol.source.Theme.prototype.addFeatures
  77963. * @param {(ol.supermap.ThemeFeature|GeoJSONObject|ol/Feature)} features - 待转要素。
  77964. * @description 抽象方法,可实例化子类必须实现此方法。向专题图图层中添加数据,
  77965. * 专题图仅接收 SuperMap.Feature.Vector 类型数据,
  77966. * feature 将储存于 features 属性中,其存储形式为数组。
  77967. */
  77968. }, {
  77969. key: "addFeatures",
  77970. value: function addFeatures(features) {// eslint-disable-line no-unused-vars
  77971. }
  77972. /**
  77973. * @function ol.source.Theme.prototype.removeFeatures
  77974. * @param {Array.<SuperMap.Feature.Vector>} features - 要删除 feature 的数组。
  77975. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  77976. * 参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature,
  77977. * 如果无法确定 feature 数组,则可以调用 removeAllFeatures 来删除所有 feature。
  77978. * 如果要删除的 feature 数组中的元素特别多,推荐使用 removeAllFeatures,
  77979. * 删除所有 feature 后再重新添加。这样效率会更高。
  77980. */
  77981. }, {
  77982. key: "removeFeatures",
  77983. value: function removeFeatures(features) {
  77984. if (!features || features.length === 0) {
  77985. return;
  77986. }
  77987. if (features === this.features) {
  77988. return this.removeAllFeatures();
  77989. }
  77990. if (!Util.isArray(features)) {
  77991. features = [features];
  77992. }
  77993. var featuresFailRemoved = [];
  77994. for (var i = features.length - 1; i >= 0; i--) {
  77995. var feature = features[i]; //如果我们传入的feature在features数组中没有的话,则不进行删除,
  77996. //并将其放入未删除的数组中。
  77997. var findex = Util.indexOf(this.features, feature);
  77998. if (findex === -1) {
  77999. featuresFailRemoved.push(feature);
  78000. continue;
  78001. }
  78002. this.features.splice(findex, 1);
  78003. }
  78004. var drawFeatures = [];
  78005. for (var hex = 0, len = this.features.length; hex < len; hex++) {
  78006. feature = this.features[hex];
  78007. drawFeatures.push(feature);
  78008. }
  78009. this.features = [];
  78010. this.addFeatures(drawFeatures); //绘制专题要素
  78011. if (this.renderer) {
  78012. this.redrawThematicFeatures(this.map.getView().calculateExtent());
  78013. }
  78014. var succeed = featuresFailRemoved.length == 0 ? true : false;
  78015. this.dispatchEvent({
  78016. type: "featuresremoved",
  78017. value: {
  78018. features: featuresFailRemoved,
  78019. succeed: succeed
  78020. }
  78021. });
  78022. }
  78023. /**
  78024. * @function ol.source.Theme.prototype.removeAllFeatures
  78025. * @description 清除当前图层所有的矢量要素。
  78026. */
  78027. }, {
  78028. key: "removeAllFeatures",
  78029. value: function removeAllFeatures() {
  78030. if (this.renderer) {
  78031. this.renderer.clear();
  78032. }
  78033. this.features = [];
  78034. this.dispatchEvent({
  78035. type: 'featuresremoved',
  78036. value: {
  78037. features: [],
  78038. succeed: true
  78039. }
  78040. });
  78041. }
  78042. /**
  78043. * @function ol.source.Theme.prototype.getFeatures
  78044. * @description 查看当前图层中的有效数据。
  78045. * @returns {SuperMap.Feature.Vector} 用户加入图层的有效数据。
  78046. */
  78047. }, {
  78048. key: "getFeatures",
  78049. value: function getFeatures() {
  78050. var len = this.features.length;
  78051. var clonedFeatures = new Array(len);
  78052. for (var i = 0; i < len; ++i) {
  78053. clonedFeatures[i] = this.features[i]; //clonedFeatures[i] = this.features[i].clone();
  78054. }
  78055. return clonedFeatures;
  78056. }
  78057. /**
  78058. * @function ol.source.Theme.prototype.getFeatureBy
  78059. * @description 在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时,
  78060. * 返回此 feature(并且只返回第一个)。
  78061. * @param {string} property - feature 的某个属性名称。
  78062. * @param {string} value - property 所对应的值。
  78063. * @returns {SuperMap.Feature.Vector} 第一个匹配属性和值的矢量要素。
  78064. */
  78065. }, {
  78066. key: "getFeatureBy",
  78067. value: function getFeatureBy(property, value) {
  78068. var feature = null;
  78069. for (var id in this.features) {
  78070. if (this.features[id][property] === value) {
  78071. feature = this.features[id]; //feature = this.features[id].clone();
  78072. break;
  78073. }
  78074. }
  78075. return feature;
  78076. }
  78077. /**
  78078. * @function ol.source.Theme.prototype.getFeatureById
  78079. * @description 通过给定一个 ID,返回对应的矢量要素。
  78080. * @param {string} featureId - 矢量要素的属性 ID。
  78081. * @returns {SuperMap.Feature.Vector} 对应 ID 的 feature,如果不存在则返回 null。
  78082. */
  78083. }, {
  78084. key: "getFeatureById",
  78085. value: function getFeatureById(featureId) {
  78086. return this.getFeatureBy('id', featureId);
  78087. }
  78088. /**
  78089. * @function ol.source.Theme.prototype.getFeaturesByAttribute
  78090. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  78091. * @param {string} attrName - 属性的 key。
  78092. * @param {string} attrValue - 矢量要素的属性 ID。
  78093. * @returns {Array.<SuperMap.Feature.Vector>} 一个匹配的 feature 数组。
  78094. */
  78095. }, {
  78096. key: "getFeaturesByAttribute",
  78097. value: function getFeaturesByAttribute(attrName, attrValue) {
  78098. var feature,
  78099. foundFeatures = [];
  78100. for (var id in this.features) {
  78101. feature = this.features[id]; //feature = this.features[id].clone();
  78102. if (feature && feature.attributes) {
  78103. if (feature.attributes[attrName] === attrValue) {
  78104. foundFeatures.push(feature);
  78105. }
  78106. }
  78107. }
  78108. return foundFeatures;
  78109. }
  78110. /**
  78111. * @function ol.source.Theme.prototype.redrawThematicFeatures
  78112. * @description 抽象方法,可实例化子类必须实现此方法。重绘专题要素。
  78113. * @param {Array} extent - 当前级别下计算出的地图范围。
  78114. */
  78115. }, {
  78116. key: "redrawThematicFeatures",
  78117. value: function redrawThematicFeatures(extent) {//eslint-disable-line no-unused-vars
  78118. }
  78119. /**
  78120. * @function ol.source.Theme.prototype.on
  78121. * @description 添加专题要素事件监听。支持的事件包括: click、mousedown、mousemove、mouseout、mouseover、mouseup。
  78122. * @param {string} event - 事件名称。
  78123. * @param {RequestCallback} callback - 事件回调函数。
  78124. */
  78125. }, {
  78126. key: "on",
  78127. value: function on(event, callback) {
  78128. var cb = callback;
  78129. if (!this.renderer) {
  78130. var evn = [];
  78131. evn.push(event);
  78132. evn.push(cb);
  78133. this.TFEvents.push(evn);
  78134. } else {
  78135. this.renderer.on(event, cb);
  78136. }
  78137. }
  78138. /**
  78139. * @function ol.source.Theme.prototype.fire
  78140. * @description 添加专题要素事件监听。
  78141. * @param {string} type - 事件类型。
  78142. * @param {string} event - 事件名称。
  78143. */
  78144. }, {
  78145. key: "fire",
  78146. value: function fire(type, event) {
  78147. if (!this.offset) {
  78148. return;
  78149. }
  78150. event = event.originalEvent;
  78151. var x = this.getX(event);
  78152. var y = this.getY(event);
  78153. var rotation = -this.map.getView().getRotation();
  78154. var center = this.map.getPixelFromCoordinate(this.map.getView().getCenter());
  78155. var scaledP = this.scale([x, y], center, this.pixelRatio);
  78156. var rotatedP = this.rotate(scaledP, rotation, center);
  78157. var resultP = [rotatedP[0] + this.offset[0], rotatedP[1] + this.offset[1]];
  78158. var offsetEvent = document.createEvent('Event');
  78159. offsetEvent.initEvent('pointermove', true, true);
  78160. offsetEvent.offsetX = resultP[0];
  78161. offsetEvent.offsetY = resultP[1];
  78162. offsetEvent.layerX = resultP[0];
  78163. offsetEvent.layerY = resultP[1];
  78164. offsetEvent.clientX = resultP[0];
  78165. offsetEvent.clientY = resultP[1];
  78166. offsetEvent.x = x;
  78167. offsetEvent.y = y;
  78168. if (type === 'click') {
  78169. this.renderer.handler._clickHandler(offsetEvent);
  78170. }
  78171. if (type === 'dblclick') {
  78172. this.renderer.handler._dblclickHandler(offsetEvent);
  78173. }
  78174. if (type === 'onmousewheel') {
  78175. this.renderer.handler._mousewheelHandler(offsetEvent);
  78176. }
  78177. if (type === 'mousemove') {
  78178. this.renderer.handler._mousemoveHandler(offsetEvent);
  78179. this.changed();
  78180. }
  78181. if (type === 'onmouseout') {
  78182. this.renderer.handler._mouseoutHandler(offsetEvent);
  78183. }
  78184. if (type === 'onmousedown') {
  78185. this.renderer.handler._mousedownHandler(offsetEvent);
  78186. }
  78187. if (type === 'onmouseup') {
  78188. this.renderer.handler._mouseupHandler(offsetEvent);
  78189. }
  78190. }
  78191. }, {
  78192. key: "getX",
  78193. value: function getX(e) {
  78194. 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;
  78195. }
  78196. }, {
  78197. key: "getY",
  78198. value: function getY(e) {
  78199. 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;
  78200. }
  78201. /**
  78202. * @function ol.source.Theme.prototype.un
  78203. * @description 移除专题要素事件监听。
  78204. * @param {string} event - 事件名称。
  78205. * @param {RequestCallback} callback - 事件回调函数。
  78206. */
  78207. }, {
  78208. key: "un",
  78209. value: function un(event, callback) {
  78210. var cb = callback;
  78211. if (!this.renderer) {
  78212. var tfEs = this.TFEvents;
  78213. var len = tfEs.length;
  78214. var newtfEs = [];
  78215. for (var i = 0; i < len; i++) {
  78216. var tfEs_i = tfEs[i];
  78217. if (!(tfEs_i[0] === event && tfEs_i[1] === cb)) {
  78218. newtfEs.push(tfEs_i);
  78219. }
  78220. }
  78221. this.TFEvents = newtfEs;
  78222. } else {
  78223. this.renderer.un(event, cb);
  78224. }
  78225. }
  78226. /**
  78227. * @function ol.source.Theme.prototype.addTFEvents
  78228. * @description 将图层添加到地图上之前用户要求添加的事件监听添加到图层。
  78229. * @private
  78230. */
  78231. }, {
  78232. key: "addTFEvents",
  78233. value: function addTFEvents() {
  78234. var tfEs = this.TFEvents;
  78235. var len = tfEs.length;
  78236. for (var i = 0; i < len; i++) {
  78237. this.renderer.on(tfEs[i][0], tfEs[i][1]);
  78238. }
  78239. }
  78240. /**
  78241. * @function ol.source.Theme.prototype.getLocalXY
  78242. * @description 获取坐标系统。
  78243. * @param {Object} coordinate - 坐标位置。
  78244. */
  78245. }, {
  78246. key: "getLocalXY",
  78247. value: function getLocalXY(coordinate) {
  78248. var pixelP,
  78249. map = this.map;
  78250. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  78251. pixelP = map.getPixelFromCoordinate([coordinate.x, coordinate.y]);
  78252. }
  78253. if (coordinate instanceof LonLat) {
  78254. pixelP = map.getPixelFromCoordinate([coordinate.lon, coordinate.lat]);
  78255. }
  78256. var rotation = -map.getView().getRotation();
  78257. var center = map.getPixelFromCoordinate(map.getView().getCenter());
  78258. var rotatedP = pixelP;
  78259. if (this.pixelRatio) {
  78260. rotatedP = this.scale(pixelP, center, this.pixelRatio);
  78261. }
  78262. if (pixelP && center) {
  78263. rotatedP = this.rotate(rotatedP, rotation, center);
  78264. }
  78265. if (this.offset && rotatedP) {
  78266. return [rotatedP[0] + this.offset[0], rotatedP[1] + this.offset[1]];
  78267. }
  78268. return rotatedP;
  78269. }
  78270. /**
  78271. * @function ol.source.Theme.prototype.rotate
  78272. * @description 获取某像素坐标点 pixelP 绕中心 center 逆时针旋转 rotation 弧度后的像素点坐标。
  78273. * @param {number} pixelP - 像素坐标点位置。
  78274. * @param {number} rotation - 旋转角度。
  78275. * @param {number} center - 中心位置。
  78276. */
  78277. }, {
  78278. key: "rotate",
  78279. value: function rotate(pixelP, rotation, center) {
  78280. var x = Math.cos(rotation) * (pixelP[0] - center[0]) - Math.sin(rotation) * (pixelP[1] - center[1]) + center[0];
  78281. var y = Math.sin(rotation) * (pixelP[0] - center[0]) + Math.cos(rotation) * (pixelP[1] - center[1]) + center[1];
  78282. return [x, y];
  78283. }
  78284. /**
  78285. * @function ol.source.Theme.prototype.scale
  78286. * @description 获取某像素坐标点 pixelP 相对于中心 center 进行缩放 scaleRatio 倍后的像素点坐标。
  78287. * @param {Object} pixelP - 像素点。
  78288. * @param {Object} center - 中心点。
  78289. * @param {number} scaleRatio - 缩放倍数。
  78290. * @returns {Array.<number>} 返回数组形比例
  78291. */
  78292. }, {
  78293. key: "scale",
  78294. value: function scale(pixelP, center, scaleRatio) {
  78295. var x = (pixelP[0] - center[0]) * scaleRatio + center[0];
  78296. var y = (pixelP[1] - center[1]) * scaleRatio + center[1];
  78297. return [x, y];
  78298. }
  78299. /**
  78300. * @function ol.source.Theme.prototype.toiClientFeature
  78301. * @description 转为 iClient 要素。
  78302. * @param {(ol.supermap.ThemeFeature|GeoJSONObject|ol/Feature)} features - 待转要素。
  78303. * @returns {SuperMap.Feature.Vector} 转换后的 iClient 要素
  78304. */
  78305. }, {
  78306. key: "toiClientFeature",
  78307. value: function toiClientFeature(features) {
  78308. if (!Util.isArray(features)) {
  78309. features = [features];
  78310. }
  78311. var featuresTemp = [];
  78312. for (var i = 0; i < features.length; i++) {
  78313. if (features[i] instanceof ThemeFeature) {
  78314. //ol.supermap.ThemeFeature 类型
  78315. featuresTemp.push(features[i].toFeature());
  78316. continue;
  78317. } else if (features[i] instanceof (external_ol_Feature_default())) {
  78318. //ol/Feature 数据类型
  78319. //_toFeature 统一处理 ol/Feature 所有 geometry 类型
  78320. featuresTemp.push(this._toFeature(features[i]));
  78321. continue;
  78322. } else if (features[i] instanceof Vector) {
  78323. // 若是 GeometryVector 直接返回
  78324. featuresTemp.push(features[i]);
  78325. continue;
  78326. } else if (features[i].geometry && features[i].geometry.parts) {
  78327. //iServer服务器返回数据格式
  78328. featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
  78329. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  78330. //GeoJSON 规范数据类型
  78331. var format = new GeoJSON();
  78332. featuresTemp = featuresTemp.concat(format.read(features[i]));
  78333. } else {
  78334. throw new Error("features[".concat(i, "]'s type is not be supported."));
  78335. }
  78336. }
  78337. return featuresTemp;
  78338. }
  78339. /**
  78340. * @function ol.source.Theme.prototype.toFeature
  78341. * @deprecated
  78342. * @description 转为 iClient 要素,该方法将被弃用,由 {@link ol.source.Theme#toiClientFeature} 代替。
  78343. * @param {(ol.supermap.ThemeFeature|GeoJSONObject|ol/Feature)} features - 待转要素。
  78344. * @returns {SuperMap.Feature.Vector} 转换后的 iClient 要素
  78345. */
  78346. }, {
  78347. key: "toFeature",
  78348. value: function toFeature(features) {
  78349. return this.toiClientFeature(features);
  78350. } //统一处理 ol/feature所有 geometry 类型
  78351. }, {
  78352. key: "_toFeature",
  78353. value: function _toFeature(feature) {
  78354. var geoFeature = new (external_ol_format_GeoJSON_default())().writeFeature(feature);
  78355. return new GeoJSON().read(geoFeature, "Feature");
  78356. }
  78357. }]);
  78358. return Theme;
  78359. }((external_ol_source_ImageCanvas_default()));
  78360. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Graph.js
  78361. function overlay_Graph_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { overlay_Graph_typeof = function _typeof(obj) { return typeof obj; }; } else { overlay_Graph_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return overlay_Graph_typeof(obj); }
  78362. function overlay_Graph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78363. function overlay_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); } }
  78364. function overlay_Graph_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Graph_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Graph_defineProperties(Constructor, staticProps); return Constructor; }
  78365. function overlay_Graph_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Graph_get = Reflect.get; } else { overlay_Graph_get = function _get(target, property, receiver) { var base = overlay_Graph_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return overlay_Graph_get(target, property, receiver || target); }
  78366. function overlay_Graph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Graph_getPrototypeOf(object); if (object === null) break; } return object; }
  78367. function overlay_Graph_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) overlay_Graph_setPrototypeOf(subClass, superClass); }
  78368. function overlay_Graph_setPrototypeOf(o, p) { overlay_Graph_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Graph_setPrototypeOf(o, p); }
  78369. function overlay_Graph_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Graph_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Graph_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Graph_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Graph_possibleConstructorReturn(this, result); }; }
  78370. function overlay_Graph_possibleConstructorReturn(self, call) { if (call && (overlay_Graph_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Graph_assertThisInitialized(self); }
  78371. function overlay_Graph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  78372. function overlay_Graph_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  78373. function overlay_Graph_getPrototypeOf(o) { overlay_Graph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Graph_getPrototypeOf(o); }
  78374. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  78375. * This program are made available under the terms of the Apache License, Version 2.0
  78376. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78377. /**
  78378. * @class ol.source.Graph
  78379. * @category Visualization Theme
  78380. * @classdesc 统计专题图图层基类。
  78381. * @param {string} chartsType - 图表类别。
  78382. * @param {string} name - 图层名称。
  78383. * @param {Object} opt_options - 参数。
  78384. * @param {ol/Map} opt_options.map - 当前 Map 对象。
  78385. * @param {string} opt_options.chartsType - 图表类型。目前可用:"Bar","Bar3D","Line","Point","Pie","Ring"。
  78386. * @param {Object} opt_options.chartsSetting - 各类型图表的 chartsSetting 对象可设属性请参考具体图表模型类的注释中对 chartsSetting 对象可设属性的描述。chartsSetting 对象通常都具有以下几个基础可设属性。
  78387. * @param {number} opt_options.chartsSetting.width - 专题要素(图表)宽度。
  78388. * @param {number} opt_options.chartsSetting.height - 专题要素(图表)高度。
  78389. * @param {Array.<number>} opt_options.chartsSetting.codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  78390. * @param {number} [opt_options.chartsSetting.XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  78391. * @param {number} [opt_options.chartsSetting.YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  78392. * @param {Array.<number>} [opt_options.chartsSetting.dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox(由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值,长度为 4 的一维数组。
  78393. * @param {number} [opt_options.chartsSetting.decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  78394. * @param {string} opt_options.themeFields - 指定创建专题图字段。
  78395. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  78396. * @param {number} [opt_options.opacity = 1] - 图层透明度。
  78397. * @param {string} [opt_option.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  78398. * @param {ol/proj/Projection} [opt_options.projection] - {@link ol/proj/Projection} 投影信息。
  78399. * @param {number} [opt_options.ratio=1.5] - 视图比, 1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是 1 或更高。
  78400. * @param {Array.<number>} [opt_options.resolutions] - 分辨率数组。
  78401. * @param {boolean} [opt_options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  78402. * @param {ol/source/State} [opt_options.state] - 资源状态。
  78403. * @param {(string|Object)} [opt_option.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  78404. * @extends {ol.source.Theme}
  78405. */
  78406. var Graph_Graph = /*#__PURE__*/function (_Theme) {
  78407. overlay_Graph_inherits(Graph, _Theme);
  78408. var _super = overlay_Graph_createSuper(Graph);
  78409. function Graph(name, chartsType, opt_options) {
  78410. var _this;
  78411. overlay_Graph_classCallCheck(this, Graph);
  78412. _this = _super.call(this, name, opt_options);
  78413. _this.chartsSetting = opt_options.chartsSetting || {};
  78414. _this.themeFields = opt_options.themeFields || null;
  78415. _this.overlayWeightField = opt_options.overlayWeightField || null;
  78416. _this.isOverLay = opt_options.isOverLay === undefined ? true : opt_options.isOverLay;
  78417. _this.charts = opt_options.charts || [];
  78418. _this.cache = opt_options.cache || {};
  78419. _this.chartsType = chartsType;
  78420. return _this;
  78421. }
  78422. /**
  78423. * @function ol.source.Graph.prototype.destroy
  78424. * @description 释放资源,将引用资源的属性置空。
  78425. */
  78426. overlay_Graph_createClass(Graph, [{
  78427. key: "destroy",
  78428. value: function destroy() {
  78429. this.chartsType = null;
  78430. this.chartsSetting = null;
  78431. this.themeFields = null;
  78432. this.overlayWeightField = null;
  78433. this.isOverLay = null;
  78434. theme_Theme_Theme.prototype.destroy.apply(this, arguments); // charts cache 为缓存,需要在父类destory后置为null(父类destory中有方法会初始化缓存参数)
  78435. this.charts = null;
  78436. this.cache = null;
  78437. }
  78438. /**
  78439. * @function ol.source.Graph.prototype.setChartsType
  78440. * @description 设置图表类型,此函数可动态改变图表类型。在调用此函数前请通过 chartsSetting 为新类型的图表做相关配置。
  78441. * @param {string} chartsType - 图表类型。目前可用:"Bar","Bar3D","Line","Point","Pie","Ring"。
  78442. */
  78443. }, {
  78444. key: "setChartsType",
  78445. value: function setChartsType(chartsType) {
  78446. this.chartsType = chartsType;
  78447. this.redraw();
  78448. }
  78449. /**
  78450. * @function ol.source.Graph.prototype.addFeatures
  78451. * @description 向专题图图层中添加数据。
  78452. * @param {(SuperMap.ServerFeature|L.supermap.themeFeature)} features - 待添加的要素。
  78453. */
  78454. }, {
  78455. key: "addFeatures",
  78456. value: function addFeatures(features) {
  78457. var ret = this.dispatchEvent({
  78458. type: 'beforefeaturesadded',
  78459. value: {
  78460. features: features
  78461. }
  78462. });
  78463. if (ret === false) {
  78464. return;
  78465. } //转换 features 形式
  78466. this.features = this.toiClientFeature(features); //绘制专题要素
  78467. if (this.renderer) {
  78468. this.changed();
  78469. }
  78470. }
  78471. /**
  78472. * @function ol.source.Graph.prototype.redrawThematicFeatures
  78473. * @description 重绘所有专题要素。
  78474. * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
  78475. * 地图漫游时调用此方法进行图层刷新。
  78476. * @param {Object} extent - 重绘的范围。
  78477. *
  78478. */
  78479. }, {
  78480. key: "redrawThematicFeatures",
  78481. value: function redrawThematicFeatures(extent) {
  78482. //清除当前所有可视元素
  78483. this.renderer.clearAll();
  78484. var features = this.features;
  78485. for (var i = 0, len = features.length; i < len; i++) {
  78486. var feature = features[i]; // 要素范围判断
  78487. var feaBounds = feature.geometry.getBounds(); //剔除当前视图(地理)范围以外的数据
  78488. if (extent) {
  78489. var bounds = new Bounds(extent[0], extent[1], extent[2], extent[3]);
  78490. if (!bounds.intersectsBounds(feaBounds)) {
  78491. continue;
  78492. }
  78493. }
  78494. var cache = this.cache; // 用 feature id 做缓存标识
  78495. var cacheField = feature.id; // 数据对应的图表是否已缓存,没缓存则重新创建图表
  78496. if (cache[cacheField]) {
  78497. continue;
  78498. }
  78499. cache[cacheField] = cacheField;
  78500. var chart = this.createThematicFeature(feature); // 压盖处理权重值
  78501. if (chart && this.overlayWeightField) {
  78502. if (feature.attributes[this.overlayWeightField] && !isNaN(feature.attributes[this.overlayWeightField])) {
  78503. chart["__overlayWeight"] = feature.attributes[this.overlayWeightField];
  78504. }
  78505. }
  78506. if (chart) {
  78507. this.charts.push(chart);
  78508. }
  78509. }
  78510. this.drawCharts();
  78511. }
  78512. /**
  78513. * @function ol.source.Graph.prototype.createThematicFeature
  78514. * @description 向专题图图层中添加数据, 支持的 feature 类型为:iServer 返回的 feature JSON 对象。
  78515. * @param {SuperMap.ServerFeature} feature - 待添加的要素。
  78516. *
  78517. */
  78518. }, {
  78519. key: "createThematicFeature",
  78520. value: function createThematicFeature(feature) {
  78521. var thematicFeature; // 检查图表创建条件并创建图形
  78522. if (Theme_Theme[this.chartsType] && this.themeFields && this.chartsSetting) {
  78523. thematicFeature = new Theme_Theme[this.chartsType](feature, this, this.themeFields, this.chartsSetting);
  78524. } // thematicFeature 是否创建成功
  78525. if (!thematicFeature) {
  78526. return false;
  78527. } // 对专题要素执行图形装载
  78528. thematicFeature.assembleShapes();
  78529. return thematicFeature;
  78530. }
  78531. /**
  78532. * @function ol.source.Graph.prototype.drawCharts
  78533. * @description 绘制图表。包含压盖处理。
  78534. *
  78535. */
  78536. }, {
  78537. key: "drawCharts",
  78538. value: function drawCharts() {
  78539. // 判断 rendere r就绪
  78540. if (!this.renderer) {
  78541. return;
  78542. }
  78543. var charts = this.charts; // 图表权重值处理
  78544. if (this.overlayWeightField) {
  78545. charts.sort(function (cs, ce) {
  78546. if (typeof cs["__overlayWeight"] == "undefined" && typeof ce["__overlayWeight"] == "undefined") {
  78547. return 0;
  78548. } else if (typeof cs["__overlayWeight"] != "undefined" && typeof ce["__overlayWeight"] == "undefined") {
  78549. return -1;
  78550. } else if (typeof cs["__overlayWeight"] == "undefined" && typeof ce["__overlayWeight"] != "undefined") {
  78551. return 1;
  78552. } else if (typeof cs["__overlayWeight"] != "undefined" && typeof ce["__overlayWeight"] != "undefined") {
  78553. if (parseFloat(cs["__overlayWeight"]) < parseFloat(ce["__overlayWeight"])) {
  78554. return 1;
  78555. } else {
  78556. return -1;
  78557. }
  78558. }
  78559. return 0;
  78560. });
  78561. } // 不进行避让
  78562. if (!this.isOverLay) {
  78563. for (var m = 0, len_m = charts.length; m < len_m; m++) {
  78564. var chart_m = charts[m]; // 图形参考位置 (reSetLocation 会更新 chartBounds)
  78565. var shapeROP_m = chart_m.resetLocation(); // 添加图形
  78566. var shapes_m = chart_m.shapes;
  78567. for (var n = 0, slen_n = shapes_m.length; n < slen_n; n++) {
  78568. shapes_m[n].refOriginalPosition = shapeROP_m;
  78569. this.renderer.addShape(shapes_m[n]);
  78570. }
  78571. }
  78572. } else {
  78573. // 压盖判断所需 chartsBounds 集合
  78574. var chartsBounds = [];
  78575. var extent = this.map.getView().calculateExtent();
  78576. var mapBounds = new Bounds(extent[0], extent[1], extent[2], extent[3]); // 获取地图像素 bounds
  78577. var mapPxLT = this.getLocalXY(new LonLat(mapBounds.left, mapBounds.top));
  78578. var mapPxRB = this.getLocalXY(new LonLat(mapBounds.right, mapBounds.bottom));
  78579. var mBounds = new Bounds(mapPxLT[0], mapPxRB[1], mapPxRB[0], mapPxLT[1]); // 压盖处理 & 添加图形
  78580. for (var i = 0, len = charts.length; i < len; i++) {
  78581. var chart = charts[i]; // 图形参考位置 (reSetLocation 会更新 chartBounds)
  78582. var shapeROP = chart.resetLocation(); // 图表框
  78583. var cbs = chart.chartBounds;
  78584. var cBounds = [{
  78585. "x": cbs.left,
  78586. "y": cbs.top
  78587. }, {
  78588. "x": cbs.left,
  78589. "y": cbs.bottom
  78590. }, {
  78591. "x": cbs.right,
  78592. "y": cbs.bottom
  78593. }, {
  78594. "x": cbs.right,
  78595. "y": cbs.top
  78596. }, {
  78597. "x": cbs.left,
  78598. "y": cbs.top
  78599. }]; // 地图范围外不绘制
  78600. if (mBounds) {
  78601. if (!this.isChartInMap(mBounds, cBounds)) {
  78602. continue;
  78603. }
  78604. } // 是否压盖
  78605. var isOL = false;
  78606. if (i !== 0) {
  78607. for (var j = 0; j < chartsBounds.length; j++) {
  78608. //压盖判断
  78609. if (this.isQuadrilateralOverLap(cBounds, chartsBounds[j])) {
  78610. isOL = true;
  78611. break;
  78612. }
  78613. }
  78614. }
  78615. if (isOL) {
  78616. continue;
  78617. } else {
  78618. chartsBounds.push(cBounds);
  78619. } // 添加图形
  78620. var shapes = chart.shapes;
  78621. for (var _j = 0, slen = shapes.length; _j < slen; _j++) {
  78622. shapes[_j].refOriginalPosition = shapeROP;
  78623. this.renderer.addShape(shapes[_j]);
  78624. }
  78625. }
  78626. } // 绘制图形
  78627. this.renderer.render();
  78628. }
  78629. /**
  78630. * @function ol.source.Graph.prototype.getShapesByFeatureID
  78631. * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
  78632. * @param {number} featureID - 要素 ID。
  78633. */
  78634. }, {
  78635. key: "getShapesByFeatureID",
  78636. value: function getShapesByFeatureID(featureID) {
  78637. var list = [];
  78638. var shapeList = this.renderer.getAllShapes();
  78639. if (!featureID) {
  78640. return shapeList;
  78641. }
  78642. for (var i = 0, len = shapeList.length; i < len; i++) {
  78643. var si = shapeList[i];
  78644. if (si.refDataID && featureID === si.refDataID) {
  78645. list.push(si);
  78646. }
  78647. }
  78648. return list;
  78649. }
  78650. /**
  78651. * @function ol.source.Graph.prototype.isQuadrilateralOverLap
  78652. * @description 判断两个四边形是否有压盖。
  78653. * @param {Array.<Object>} quadrilateral - 四边形节点数组。
  78654. * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
  78655. */
  78656. }, {
  78657. key: "isQuadrilateralOverLap",
  78658. value: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
  78659. var quadLen = quadrilateral.length,
  78660. quad2Len = quadrilateral2.length;
  78661. if (quadLen !== 5 || quad2Len !== 5) {
  78662. return null;
  78663. } //不是四边形
  78664. var OverLap = false; //如果两四边形互不包含对方的节点,则两个四边形不相交
  78665. for (var i = 0; i < quadLen; i++) {
  78666. if (this.isPointInPoly(quadrilateral[i], quadrilateral2)) {
  78667. OverLap = true;
  78668. break;
  78669. }
  78670. }
  78671. for (var _i = 0; _i < quad2Len; _i++) {
  78672. if (this.isPointInPoly(quadrilateral2[_i], quadrilateral)) {
  78673. OverLap = true;
  78674. break;
  78675. }
  78676. } //加上两矩形十字相交的情况
  78677. for (var _i2 = 0; _i2 < quadLen - 1; _i2++) {
  78678. if (OverLap) {
  78679. break;
  78680. }
  78681. for (var j = 0; j < quad2Len - 1; j++) {
  78682. var isLineIn = Util.lineIntersection(quadrilateral[_i2], quadrilateral[_i2 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
  78683. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  78684. OverLap = true;
  78685. break;
  78686. }
  78687. }
  78688. }
  78689. return OverLap;
  78690. }
  78691. /**
  78692. * @function ol.source.Graph.prototype.isPointInPoly
  78693. * @description 判断一个点是否在多边形里面。(射线法)。
  78694. * @param {Object} pt - 需要判定的点对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  78695. * @param {Array.<Object>} poly - 多边形节点数组。
  78696. */
  78697. }, {
  78698. key: "isPointInPoly",
  78699. value: function isPointInPoly(pt, poly) {
  78700. for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
  78701. (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);
  78702. }
  78703. return isIn;
  78704. }
  78705. /**
  78706. * @function ol.source.Graph.prototype.isChartInMap
  78707. * @description 判断图表是否在地图里。
  78708. * @param {SuperMap.Bounds} mapPxBounds - 地图像素范围。
  78709. * @param {Array.<Object>} chartPxBounds - 图表范围的四边形节点数组。
  78710. */
  78711. }, {
  78712. key: "isChartInMap",
  78713. value: function isChartInMap(mapPxBounds, chartPxBounds) {
  78714. var mb = mapPxBounds;
  78715. var isIn = false;
  78716. for (var i = 0, len = chartPxBounds.length; i < len; i++) {
  78717. var cb = chartPxBounds[i];
  78718. if (cb.x >= mb.left && cb.x <= mb.right && cb.y >= mb.top && cb.y <= mb.bottom) {
  78719. isIn = true;
  78720. break;
  78721. }
  78722. }
  78723. return isIn;
  78724. }
  78725. /**
  78726. * @function ol.source.Graph.prototype.clearCache
  78727. * @description 清除缓存。
  78728. */
  78729. }, {
  78730. key: "clearCache",
  78731. value: function clearCache() {
  78732. this.cache = {};
  78733. this.charts = [];
  78734. }
  78735. /**
  78736. * @function ol.source.Graph.prototype.removeFeatures
  78737. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature。
  78738. * @param {SuperMap.Feature.Vector} features - 要删除的要素。
  78739. */
  78740. }, {
  78741. key: "removeFeatures",
  78742. value: function removeFeatures(features) {
  78743. this.clearCache();
  78744. overlay_Graph_get(overlay_Graph_getPrototypeOf(Graph.prototype), "removeFeatures", this).call(this, features);
  78745. }
  78746. /**
  78747. * @function ol.source.Graph.prototype.removeAllFeatures
  78748. * @description 移除所有的要素
  78749. */
  78750. }, {
  78751. key: "removeAllFeatures",
  78752. value: function removeAllFeatures() {
  78753. this.clearCache();
  78754. overlay_Graph_get(overlay_Graph_getPrototypeOf(Graph.prototype), "removeAllFeatures", this).call(this);
  78755. }
  78756. /**
  78757. * @function ol.source.Graph.prototype.redraw
  78758. * @description 重绘该图层
  78759. */
  78760. }, {
  78761. key: "redraw",
  78762. value: function redraw() {
  78763. this.clearCache();
  78764. if (this.renderer) {
  78765. this.redrawThematicFeatures(this.map.getView().calculateExtent());
  78766. return true;
  78767. }
  78768. return false;
  78769. }
  78770. /**
  78771. * @function ol.source.Graph.prototype.clear
  78772. * @description 清除的内容包括数据(features) 、专题要素、缓存。
  78773. */
  78774. }, {
  78775. key: "clear",
  78776. value: function clear() {
  78777. if (this.renderer) {
  78778. this.renderer.clearAll();
  78779. this.renderer.refresh();
  78780. }
  78781. this.removeAllFeatures();
  78782. this.clearCache();
  78783. }
  78784. }, {
  78785. key: "canvasFunctionInternal_",
  78786. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  78787. // eslint-disable-line no-unused-vars
  78788. return theme_Theme_Theme.prototype.canvasFunctionInternal_.apply(this, arguments);
  78789. }
  78790. }]);
  78791. return Graph;
  78792. }(theme_Theme_Theme);
  78793. ;// CONCATENATED MODULE: external "ol.style.RegularShape"
  78794. var external_ol_style_RegularShape_namespaceObject = ol.style.RegularShape;
  78795. var external_ol_style_RegularShape_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_RegularShape_namespaceObject);
  78796. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/CloverShape.js
  78797. function CloverShape_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { CloverShape_typeof = function _typeof(obj) { return typeof obj; }; } else { CloverShape_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return CloverShape_typeof(obj); }
  78798. function CloverShape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78799. function CloverShape_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  78800. function CloverShape_createClass(Constructor, protoProps, staticProps) { if (protoProps) CloverShape_defineProperties(Constructor.prototype, protoProps); if (staticProps) CloverShape_defineProperties(Constructor, staticProps); return Constructor; }
  78801. function CloverShape_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) CloverShape_setPrototypeOf(subClass, superClass); }
  78802. function CloverShape_setPrototypeOf(o, p) { CloverShape_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CloverShape_setPrototypeOf(o, p); }
  78803. function CloverShape_createSuper(Derived) { var hasNativeReflectConstruct = CloverShape_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = CloverShape_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = CloverShape_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return CloverShape_possibleConstructorReturn(this, result); }; }
  78804. function CloverShape_possibleConstructorReturn(self, call) { if (call && (CloverShape_typeof(call) === "object" || typeof call === "function")) { return call; } return CloverShape_assertThisInitialized(self); }
  78805. function CloverShape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  78806. function CloverShape_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  78807. function CloverShape_getPrototypeOf(o) { CloverShape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CloverShape_getPrototypeOf(o); }
  78808. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  78809. * This program are made available under the terms of the Apache License, Version 2.0
  78810. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78811. /**
  78812. * @class ol.style.CloverShape
  78813. * @category Visualization Graphic
  78814. * @classdesc 三叶草要素风格。
  78815. * @extends {ol/style/RegularShape}
  78816. * @param {Object} options - 三叶草形要素风格参数。
  78817. * @param {number} [options.angle=30] - 三叶草每个扇叶的圆心角,单位弧度。
  78818. * @param {number} [options.count=3] - 扇叶数量。
  78819. * @param {ol/style/Fill} [options.fill] - 填充样式。
  78820. * @param {number} [options.strokeOpacity] - 透明度。
  78821. * @param {number} [options.fillOpacity] - 填充透明度。
  78822. * @param {number} [options.radius] - 半径。
  78823. * @param {ol/style/Stroke} [options.stroke] - 边框样式。
  78824. * @param {string} [options.stroke.color='#3388ff'] - 边框颜色。
  78825. * @param {number} [options.stroke.width=1] - 边框宽度。
  78826. */
  78827. var CloverShape = /*#__PURE__*/function (_RegularShape) {
  78828. CloverShape_inherits(CloverShape, _RegularShape);
  78829. var _super = CloverShape_createSuper(CloverShape);
  78830. function CloverShape(options) {
  78831. var _this;
  78832. CloverShape_classCallCheck(this, CloverShape);
  78833. if (options.stroke) {
  78834. options.stroke.color = options.stroke.getColor() || "#3388ff";
  78835. options.stroke.width = options.stroke.getWidth() || 1;
  78836. } else {
  78837. options.stroke = new (external_ol_style_Stroke_default())({
  78838. color: "#3388ff",
  78839. width: 1
  78840. });
  78841. }
  78842. if (options.fill) {
  78843. options.fill.color = options.fill.getColor() || "#66ccff";
  78844. } else {
  78845. options.fill = new (external_ol_style_Fill_default())({
  78846. color: "#66ccff"
  78847. });
  78848. }
  78849. _this = _super.call(this, {
  78850. angle: options.angle || 60,
  78851. stroke: options.stroke,
  78852. fill: options.fill,
  78853. radius: options.radius || 10,
  78854. rotation: options.rotation || 0
  78855. });
  78856. _this.count_ = options.count || 3;
  78857. _this.strokeOpacity = options.strokeOpacity || 1;
  78858. _this.fillOpacity = options.fillOpacity || 1;
  78859. _this._canvas = _this.getImage();
  78860. _this._ctx = _this._canvas.getContext('2d');
  78861. _this._render();
  78862. return _this;
  78863. }
  78864. CloverShape_createClass(CloverShape, [{
  78865. key: "_render",
  78866. value: function _render() {
  78867. //起始角度
  78868. var sAngle = 0;
  78869. var eAngle = this.getAngle();
  78870. this.spaceAngle = 360 / this.count_ - this.getAngle();
  78871. if (this.spaceAngle < 0) {
  78872. return;
  78873. }
  78874. this._ctx.translate(0, 0);
  78875. this._ctx.beginPath();
  78876. for (var i = 0; i < this.count_; i++) {
  78877. this._drawSector(this._ctx, this.getAnchor()[0], this.getAnchor()[1], this.getRadius(), sAngle, eAngle);
  78878. sAngle = eAngle + this.spaceAngle;
  78879. eAngle = sAngle + this.getAngle();
  78880. }
  78881. this._fillStroke();
  78882. this._ctx.closePath();
  78883. }
  78884. /**
  78885. * @function ol.style.CloverShape.prototype.drawSector
  78886. * @description 绘制扇形。
  78887. * @param {CanvasRenderingContext2D} ctx - context 对象
  78888. * @param {number} x - 中心点 x。
  78889. * @param {number} y - 中心点 y。
  78890. * @param {number} r - 中心点 r。
  78891. * @param {number} sAngle - 扇叶起始角度。
  78892. * @param {number} eAngle - 扇叶终止角度。
  78893. */
  78894. }, {
  78895. key: "_drawSector",
  78896. value: function _drawSector(ctx, x, y, r, sAngle, eAngle) {
  78897. //角度转换
  78898. sAngle = sAngle / 180 * Math.PI;
  78899. eAngle = eAngle / 180 * Math.PI;
  78900. ctx.moveTo(x, y);
  78901. ctx.lineTo(x + r * Math.cos(sAngle), y + r * Math.sin(sAngle));
  78902. ctx.arc(x, y, r, sAngle, eAngle);
  78903. ctx.lineTo(x, y);
  78904. }
  78905. }, {
  78906. key: "_fillStroke",
  78907. value: function _fillStroke() {
  78908. if (this.getFill()) {
  78909. this._ctx.globalAlpha = this.fillOpacity;
  78910. this._ctx.fillStyle = this.getFill().color;
  78911. this._ctx.fill();
  78912. }
  78913. if (this.getStroke() && this.weight !== 0) {
  78914. this._ctx.globalAlpha = this.strokeOpacity;
  78915. this._ctx.lineWidth = this.getStroke().width;
  78916. this._ctx.strokeStyle = this.getStroke().color;
  78917. this._ctx.lineCap = this.getStroke().lineCap;
  78918. this._ctx.lineJoin = this.getStroke().lineJoin;
  78919. this._ctx.stroke();
  78920. }
  78921. }
  78922. /**
  78923. * @function ol.style.CloverShape.prototype.getCount
  78924. * @description 获取扇叶数量。
  78925. */
  78926. }, {
  78927. key: "getCount",
  78928. value: function getCount() {
  78929. return this.count_;
  78930. }
  78931. /**
  78932. * @function ol.style.CloverShape.prototype.getSpaceAngle
  78933. * @description 获取扇叶间隔角度。
  78934. */
  78935. }, {
  78936. key: "getSpaceAngle",
  78937. value: function getSpaceAngle() {
  78938. return this.spaceAngle;
  78939. }
  78940. }]);
  78941. return CloverShape;
  78942. }((external_ol_style_RegularShape_default()));
  78943. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/HitCloverShape.js
  78944. function HitCloverShape_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { HitCloverShape_typeof = function _typeof(obj) { return typeof obj; }; } else { HitCloverShape_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return HitCloverShape_typeof(obj); }
  78945. function HitCloverShape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78946. function HitCloverShape_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  78947. function HitCloverShape_createClass(Constructor, protoProps, staticProps) { if (protoProps) HitCloverShape_defineProperties(Constructor.prototype, protoProps); if (staticProps) HitCloverShape_defineProperties(Constructor, staticProps); return Constructor; }
  78948. function HitCloverShape_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) HitCloverShape_setPrototypeOf(subClass, superClass); }
  78949. function HitCloverShape_setPrototypeOf(o, p) { HitCloverShape_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HitCloverShape_setPrototypeOf(o, p); }
  78950. function HitCloverShape_createSuper(Derived) { var hasNativeReflectConstruct = HitCloverShape_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HitCloverShape_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HitCloverShape_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HitCloverShape_possibleConstructorReturn(this, result); }; }
  78951. function HitCloverShape_possibleConstructorReturn(self, call) { if (call && (HitCloverShape_typeof(call) === "object" || typeof call === "function")) { return call; } return HitCloverShape_assertThisInitialized(self); }
  78952. function HitCloverShape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  78953. function HitCloverShape_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  78954. function HitCloverShape_getPrototypeOf(o) { HitCloverShape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HitCloverShape_getPrototypeOf(o); }
  78955. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  78956. * This program are made available under the terms of the Apache License, Version 2.0
  78957. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78958. /**
  78959. * @class ol.style.HitCloverShape
  78960. * @category Visualization Graphic
  78961. * @classdesc 三叶草要素高亮风格。
  78962. * @extends {ol.style.CloverShape}
  78963. * @param {Object} options - 三叶草形要素风格参数。
  78964. * @param {number} options.sAngle - 扇叶起始角度。
  78965. * @param {number} options.eAngle - 扇叶终止角度。
  78966. * @param {number} [options.angle = 30] - 三叶草每个扇叶的圆心角,单位弧度。
  78967. * @param {ol/style/Fill} [options.fill] - 填充样式。
  78968. * @param {ol/style/Stroke} [options.stroke] - 边框样式。
  78969. * @param {number} [options.strokeOpacity] - 透明度。
  78970. * @param {number} [options.fillOpacity] - 填充透明度。
  78971. * @param {number} [options.radius] - 半径。
  78972. */
  78973. var HitCloverShape = /*#__PURE__*/function (_CloverShape) {
  78974. HitCloverShape_inherits(HitCloverShape, _CloverShape);
  78975. var _super = HitCloverShape_createSuper(HitCloverShape);
  78976. function HitCloverShape(options) {
  78977. var _this;
  78978. HitCloverShape_classCallCheck(this, HitCloverShape);
  78979. _this = _super.call(this, options);
  78980. _this.sAngle = options.sAngle;
  78981. _this.eAngle = options.eAngle;
  78982. _this._render();
  78983. return _this;
  78984. }
  78985. HitCloverShape_createClass(HitCloverShape, [{
  78986. key: "_render",
  78987. value: function _render() {
  78988. // draw the circle on the canvas
  78989. this._ctx.clearRect(0, 0, this.getImage().width, this.getImage().height); // reset transform
  78990. this._ctx.setTransform(1, 0, 0, 1, 0, 0);
  78991. this._ctx.translate(0, 0);
  78992. this._ctx.beginPath();
  78993. this._drawSector(this._ctx, this.getAnchor()[0], this.getAnchor()[1], this.getRadius(), this.sAngle, this.eAngle);
  78994. this._fillStroke();
  78995. this._ctx.closePath();
  78996. }
  78997. /**
  78998. * @function ol.style.HitCloverShape.prototype.getSAngle
  78999. * @description 获取扇叶起始角度。
  79000. */
  79001. }, {
  79002. key: "getSAngle",
  79003. value: function getSAngle() {
  79004. return this.sAngle;
  79005. }
  79006. /**
  79007. * @function ol.style.HitCloverShape.prototype.getEAngle
  79008. * @description 获取扇叶终止角度。
  79009. */
  79010. }, {
  79011. key: "getEAngle",
  79012. value: function getEAngle() {
  79013. return this.eAngle;
  79014. }
  79015. }]);
  79016. return HitCloverShape;
  79017. }(CloverShape);
  79018. ;// CONCATENATED MODULE: external "ol.Object"
  79019. var external_ol_Object_namespaceObject = ol.Object;
  79020. var external_ol_Object_default = /*#__PURE__*/__webpack_require__.n(external_ol_Object_namespaceObject);
  79021. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/WebGLRenderer.js
  79022. function WebGLRenderer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { WebGLRenderer_typeof = function _typeof(obj) { return typeof obj; }; } else { WebGLRenderer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return WebGLRenderer_typeof(obj); }
  79023. function WebGLRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79024. function WebGLRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79025. function WebGLRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebGLRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebGLRenderer_defineProperties(Constructor, staticProps); return Constructor; }
  79026. function WebGLRenderer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) WebGLRenderer_setPrototypeOf(subClass, superClass); }
  79027. function WebGLRenderer_setPrototypeOf(o, p) { WebGLRenderer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebGLRenderer_setPrototypeOf(o, p); }
  79028. function WebGLRenderer_createSuper(Derived) { var hasNativeReflectConstruct = WebGLRenderer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WebGLRenderer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WebGLRenderer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WebGLRenderer_possibleConstructorReturn(this, result); }; }
  79029. function WebGLRenderer_possibleConstructorReturn(self, call) { if (call && (WebGLRenderer_typeof(call) === "object" || typeof call === "function")) { return call; } return WebGLRenderer_assertThisInitialized(self); }
  79030. function WebGLRenderer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79031. function WebGLRenderer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  79032. function WebGLRenderer_getPrototypeOf(o) { WebGLRenderer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebGLRenderer_getPrototypeOf(o); }
  79033. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  79034. * This program are made available under the terms of the Apache License, Version 2.0
  79035. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79036. var emptyFunc = function emptyFunc() {
  79037. return false;
  79038. };
  79039. var CSS_TRANSFORM = function () {
  79040. var div = document.createElement('div');
  79041. var props = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'];
  79042. for (var i = 0; i < props.length; i++) {
  79043. var prop = props[i];
  79044. if (div.style[prop] !== undefined) {
  79045. return prop;
  79046. }
  79047. }
  79048. return props[0];
  79049. }();
  79050. /**
  79051. * @private
  79052. * @class GraphicWebGLRenderer
  79053. * @classdesc 高效率点图层 webgl 渲染器。
  79054. * @category Visualization Graphic
  79055. * @extends {ol/Object}
  79056. * @param {ol.source.Graphic} layer - 高效率点图层。
  79057. * @param {Object} options - 图层参数。
  79058. * @param {number} options.width - 地图宽度。
  79059. * @param {number} options.height - 地图高度。
  79060. * @param {HTMLElement} options.container - 放置渲染器的父元素。
  79061. * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 颜色,目前只支持 rgba 数组。
  79062. * @param {number} [options.radius=10] - 半径。
  79063. * @param {number} [options.opacity=0.8] - 不透明度。
  79064. * @param {Array} [options.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
  79065. * @param {number} [options.radiusScale = 1] - 点放大倍数。
  79066. * @param {number} [options.radiusMinPixels = 0] - 半径最小值(像素)。
  79067. * @param {number} [options.radiusMaxPixels = Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  79068. * @param {number} [options.strokeWidth = 1] - 边框大小。
  79069. * @param {boolean} [options.outline = false] - 是否显示边框。
  79070. * @param {function} [options.onClick] - 点击事件。
  79071. * @param {function} [options.onHover] - 悬停事件。
  79072. */
  79073. var GraphicWebGLRenderer = /*#__PURE__*/function (_BaseObject) {
  79074. WebGLRenderer_inherits(GraphicWebGLRenderer, _BaseObject);
  79075. var _super = WebGLRenderer_createSuper(GraphicWebGLRenderer);
  79076. function GraphicWebGLRenderer(layer, options) {
  79077. var _this;
  79078. WebGLRenderer_classCallCheck(this, GraphicWebGLRenderer);
  79079. _this = _super.call(this);
  79080. _this.layer = layer;
  79081. _this.map = layer.map;
  79082. var opt = options || {};
  79083. Util.extend(WebGLRenderer_assertThisInitialized(_this), opt);
  79084. var pixelRatio = _this.pixelRatio = window ? window.devicePixelRatio : 1;
  79085. _this.width = _this.map.getSize()[0] * pixelRatio;
  79086. _this.height = _this.map.getSize()[1] * pixelRatio;
  79087. _this.center = _this.map.getView().getCenter();
  79088. _this._initContainer();
  79089. _this._registerEvents();
  79090. return _this;
  79091. }
  79092. WebGLRenderer_createClass(GraphicWebGLRenderer, [{
  79093. key: "_registerEvents",
  79094. value: function _registerEvents() {
  79095. var map = this.map;
  79096. var view = map.getView();
  79097. map.on('change:size', this._resizeEvent.bind(this), this);
  79098. view.on('change:resolution', this._moveEndEvent.bind(this), this);
  79099. view.on('change:center', this._moveEvent.bind(this), this);
  79100. view.on('change:rotation', this._moveEndEvent.bind(this), this);
  79101. map.on('moveend', this._moveEndEvent.bind(this), this);
  79102. }
  79103. }, {
  79104. key: "_resizeEvent",
  79105. value: function _resizeEvent() {
  79106. this._resize();
  79107. this._clearAndRedraw();
  79108. }
  79109. }, {
  79110. key: "_moveEvent",
  79111. value: function _moveEvent() {
  79112. var oldCenterPixel = this.map.getPixelFromCoordinate(this.center);
  79113. var newCenterPixel = this.map.getPixelFromCoordinate(this.map.getView().getCenter());
  79114. var offset = [oldCenterPixel[0] - newCenterPixel[0], oldCenterPixel[1] - newCenterPixel[1]];
  79115. this._canvas.style[CSS_TRANSFORM] = 'translate(' + Math.round(offset[0]) + 'px,' + Math.round(offset[1]) + 'px)';
  79116. }
  79117. }, {
  79118. key: "_moveEndEvent",
  79119. value: function _moveEndEvent() {
  79120. this._canvas.style[CSS_TRANSFORM] = 'translate(0,0)';
  79121. this.center = this.map.getView().getCenter();
  79122. this._clearAndRedraw();
  79123. }
  79124. }, {
  79125. key: "_clearAndRedraw",
  79126. value: function _clearAndRedraw() {
  79127. this._clearBuffer();
  79128. this.layer.changed();
  79129. }
  79130. }, {
  79131. key: "_resize",
  79132. value: function _resize() {
  79133. var size = this.map.getSize();
  79134. var width = size[0] * this.pixelRatio;
  79135. var height = size[1] * this.pixelRatio;
  79136. this._canvas.width = width;
  79137. this._canvas.height = height;
  79138. this._canvas.style.width = width + 'px';
  79139. this._canvas.style.height = height + 'px';
  79140. }
  79141. }, {
  79142. key: "_clearBuffer",
  79143. value: function _clearBuffer() {
  79144. if (!this.deckGL) {
  79145. return;
  79146. }
  79147. var lm = this.deckGL.layerManager;
  79148. lm && lm.context.gl.clear(lm.context.gl.COLOR_BUFFER_BIT);
  79149. return this;
  79150. }
  79151. /**
  79152. * @private
  79153. * @function GraphicWebGLRenderer.prototype.getCanvas
  79154. * @description 返回画布。
  79155. * @returns {HTMLCanvasElement} canvas 对象。
  79156. */
  79157. }, {
  79158. key: "getCanvas",
  79159. value: function getCanvas() {
  79160. return this._canvas;
  79161. }
  79162. /**
  79163. * @private
  79164. * @function GraphicWebGLRenderer.prototype.update
  79165. * @description 更新图层,数据或者样式改变后调用。
  79166. */
  79167. }, {
  79168. key: "update",
  79169. value: function update(graphics) {
  79170. if (graphics && graphics.length > -1) {
  79171. this._data = graphics;
  79172. }
  79173. if (!this._renderLayer) {
  79174. return;
  79175. }
  79176. this._renderLayer.setChangeFlags({
  79177. dataChanged: true,
  79178. propsChanged: true,
  79179. viewportChanged: true,
  79180. updateTriggersChanged: true
  79181. });
  79182. this._refreshData();
  79183. var state = this._getLayerState();
  79184. state.data = this._data || [];
  79185. this._renderLayer.setNeedsRedraw(true);
  79186. this._renderLayer.setState(state);
  79187. }
  79188. /**
  79189. * @private
  79190. * @function GraphicWebGLRenderer.prototype.drawGraphics
  79191. * @description 绘制点要素。
  79192. */
  79193. }, {
  79194. key: "drawGraphics",
  79195. value: function drawGraphics(graphics) {
  79196. this._data = graphics ? graphics : this._data ? this._data : [];
  79197. if (!this._renderLayer) {
  79198. this._createInnerRender();
  79199. }
  79200. this._clearBuffer();
  79201. this._draw();
  79202. }
  79203. }, {
  79204. key: "_initContainer",
  79205. value: function _initContainer() {
  79206. this._canvas = this._createCanvas(this.width, this.height);
  79207. this._layerContainer = this.container;
  79208. this._wrapper = document.createElement('div');
  79209. this._wrapper.className = "deck-wrapper";
  79210. this._wrapper.style.position = "absolute";
  79211. this._wrapper.style.top = "0";
  79212. this._wrapper.style.left = "0";
  79213. this._wrapper.appendChild(this._canvas);
  79214. this._layerContainer && this._layerContainer.appendChild(this._wrapper);
  79215. }
  79216. }, {
  79217. key: "_createCanvas",
  79218. value: function _createCanvas(width, height) {
  79219. var canvas = document.createElement('canvas');
  79220. canvas.oncontextmenu = emptyFunc;
  79221. canvas.width = width;
  79222. canvas.height = height;
  79223. canvas.style.width = width + "px";
  79224. canvas.style.height = height + "px";
  79225. return canvas;
  79226. }
  79227. }, {
  79228. key: "_createInnerRender",
  79229. value: function _createInnerRender() {
  79230. var me = this;
  79231. var state = this._getLayerState();
  79232. var color = state.color,
  79233. radius = state.radius,
  79234. opacity = state.opacity,
  79235. highlightColor = state.highlightColor,
  79236. radiusScale = state.radiusScale,
  79237. radiusMinPixels = state.radiusMinPixels,
  79238. radiusMaxPixels = state.radiusMaxPixels,
  79239. strokeWidth = state.strokeWidth,
  79240. outline = state.outline;
  79241. radius = this._pixelToMeter(radius);
  79242. var innerLayerOptions = {
  79243. id: 'scatter-plot',
  79244. data: [],
  79245. pickable: Boolean(this.onClick) || Boolean(this.onHover),
  79246. autoHighlight: true,
  79247. color: color,
  79248. opacity: opacity,
  79249. radius: radius,
  79250. radiusScale: radiusScale,
  79251. highlightColor: highlightColor,
  79252. radiusMinPixels: radiusMinPixels,
  79253. radiusMaxPixels: radiusMaxPixels,
  79254. strokeWidth: strokeWidth,
  79255. outline: outline,
  79256. getPosition: function getPosition(point) {
  79257. if (!point) {
  79258. return [0, 0, 0];
  79259. }
  79260. var geometry = point.getGeometry();
  79261. var coordinates = geometry && geometry.getCoordinates();
  79262. coordinates = me._project(coordinates);
  79263. return coordinates && [coordinates[0], coordinates[1], 0];
  79264. },
  79265. getColor: function getColor(point) {
  79266. var defaultStyle = me._getLayerDefaultStyle();
  79267. var style = point && point.getStyle();
  79268. return style && style.getColor() || defaultStyle.color;
  79269. },
  79270. getRadius: function getRadius(point) {
  79271. var defaultStyle = me._getLayerDefaultStyle();
  79272. var style = point && point.getStyle();
  79273. return style && style.getRadius() || defaultStyle.radius;
  79274. },
  79275. updateTriggers: {
  79276. getColor: [color],
  79277. getRadius: [radius]
  79278. }
  79279. };
  79280. var _self = this;
  79281. if (this.onClick) {
  79282. innerLayerOptions.onClick = function () {
  79283. _self._canvas.style.cursor = "pointer";
  79284. _self.onClick.apply(_self, arguments);
  79285. };
  79286. }
  79287. if (this.onHover) {
  79288. innerLayerOptions.onHover = function () {
  79289. _self._canvas.style.cursor = "pointer";
  79290. _self.onHover.apply(_self, arguments);
  79291. };
  79292. }
  79293. me._renderLayer = new window.DeckGL.ScatterplotLayer(innerLayerOptions);
  79294. }
  79295. }, {
  79296. key: "_getLayerDefaultStyle",
  79297. value: function _getLayerDefaultStyle() {
  79298. var _this$_getLayerState = this._getLayerState(),
  79299. color = _this$_getLayerState.color,
  79300. opacity = _this$_getLayerState.opacity,
  79301. radius = _this$_getLayerState.radius,
  79302. radiusScale = _this$_getLayerState.radiusScale,
  79303. radiusMinPixels = _this$_getLayerState.radiusMinPixels,
  79304. radiusMaxPixels = _this$_getLayerState.radiusMaxPixels,
  79305. strokeWidth = _this$_getLayerState.strokeWidth,
  79306. outline = _this$_getLayerState.outline;
  79307. radius = this._pixelToMeter(radius);
  79308. return {
  79309. color: color,
  79310. opacity: opacity,
  79311. radius: radius,
  79312. radiusScale: radiusScale,
  79313. radiusMinPixels: radiusMinPixels,
  79314. radiusMaxPixels: radiusMaxPixels,
  79315. strokeWidth: strokeWidth,
  79316. outline: outline
  79317. };
  79318. }
  79319. }, {
  79320. key: "_getLayerState",
  79321. value: function _getLayerState() {
  79322. var state = this.layer.getLayerState();
  79323. var view = this.map.getView();
  79324. var projection = view.getProjection().getCode();
  79325. var center = external_ol_proj_namespaceObject.transform([state.longitude, state.latitude], projection, 'EPSG:4326');
  79326. state.longitude = center[0];
  79327. state.latitude = center[1];
  79328. state.zoom = state.zoom - 1;
  79329. return state;
  79330. }
  79331. }, {
  79332. key: "_draw",
  79333. value: function _draw() {
  79334. this._refreshData();
  79335. var state = this._getLayerState();
  79336. state.data = this._data || [];
  79337. var deckOptions = {};
  79338. for (var key in state) {
  79339. deckOptions[key] = state[key];
  79340. }
  79341. this._renderLayer.setNeedsRedraw(true);
  79342. deckOptions.layers = [this._renderLayer];
  79343. deckOptions.canvas = this._canvas;
  79344. if (this.onBeforeRender) {
  79345. deckOptions.onBeforeRender = this.onBeforeRender.bind(this);
  79346. }
  79347. if (this.onAfterRender) {
  79348. deckOptions.onAfterRender = this.onAfterRender.bind(this);
  79349. }
  79350. if (!this.deckGL) {
  79351. this.deckGL = new window.DeckGL.experimental.DeckGLJS(deckOptions);
  79352. } else {
  79353. this.deckGL.setProps(deckOptions);
  79354. }
  79355. }
  79356. }, {
  79357. key: "_refreshData",
  79358. value: function _refreshData() {
  79359. var graphics = this._data || [];
  79360. var sGraphics = !core_Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics); //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  79361. if (!this._renderLayer.props.data) {
  79362. this._renderLayer.props.data = [];
  79363. }
  79364. this._renderLayer.props.data.length = 0;
  79365. for (var j = 0; j < sGraphics.length; j++) {
  79366. this._renderLayer.props.data.push(sGraphics[j]);
  79367. }
  79368. this._data = this._renderLayer.props.data;
  79369. }
  79370. }, {
  79371. key: "_project",
  79372. value: function _project(coordinates) {
  79373. var view = this.map.getView();
  79374. var projection = view.getProjection().getCode();
  79375. if ("EPSG:4326" === projection) {
  79376. return coordinates;
  79377. }
  79378. return external_ol_proj_namespaceObject.transform(coordinates, projection, 'EPSG:4326');
  79379. }
  79380. }, {
  79381. key: "_pixelToMeter",
  79382. value: function _pixelToMeter(pixel) {
  79383. var view = this.map.getView();
  79384. var projection = view.getProjection();
  79385. var unit = projection.getUnits() || 'degrees';
  79386. if (unit === 'degrees') {
  79387. unit = REST_Unit.DEGREE;
  79388. }
  79389. if (unit === 'm') {
  79390. unit = REST_Unit.METER;
  79391. }
  79392. var res = view.getResolution();
  79393. if (unit === REST_Unit.DEGREE) {
  79394. var meterRes = res * (Math.PI * 6378137 / 180);
  79395. return pixel * meterRes;
  79396. } else {
  79397. return pixel * res;
  79398. }
  79399. }
  79400. }]);
  79401. return GraphicWebGLRenderer;
  79402. }((external_ol_Object_default()));
  79403. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/CanvasRenderer.js
  79404. function CanvasRenderer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { CanvasRenderer_typeof = function _typeof(obj) { return typeof obj; }; } else { CanvasRenderer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return CanvasRenderer_typeof(obj); }
  79405. function CanvasRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79406. function CanvasRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79407. function CanvasRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) CanvasRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) CanvasRenderer_defineProperties(Constructor, staticProps); return Constructor; }
  79408. function CanvasRenderer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) CanvasRenderer_setPrototypeOf(subClass, superClass); }
  79409. function CanvasRenderer_setPrototypeOf(o, p) { CanvasRenderer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CanvasRenderer_setPrototypeOf(o, p); }
  79410. function CanvasRenderer_createSuper(Derived) { var hasNativeReflectConstruct = CanvasRenderer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = CanvasRenderer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = CanvasRenderer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return CanvasRenderer_possibleConstructorReturn(this, result); }; }
  79411. function CanvasRenderer_possibleConstructorReturn(self, call) { if (call && (CanvasRenderer_typeof(call) === "object" || typeof call === "function")) { return call; } return CanvasRenderer_assertThisInitialized(self); }
  79412. function CanvasRenderer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79413. function CanvasRenderer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  79414. function CanvasRenderer_getPrototypeOf(o) { CanvasRenderer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CanvasRenderer_getPrototypeOf(o); }
  79415. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  79416. * This program are made available under the terms of the Apache License, Version 2.0
  79417. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79418. //获取某像素坐标点pixelP相对于中心center进行缩放scaleRatio倍后的像素点坐标。
  79419. function scale(pixelP, center, scaleRatio) {
  79420. var x = (pixelP[0] - center[0]) * scaleRatio + center[0];
  79421. var y = (pixelP[1] - center[1]) * scaleRatio + center[1];
  79422. return [x, y];
  79423. }
  79424. /**
  79425. * @private
  79426. * @class GraphicCanvasRenderer
  79427. * @classdesc 高效率点图层 canvas 渲染器。
  79428. * @category Visualization Graphic
  79429. * @extends {ol/Object}
  79430. * @param {ol.source.Graphic} layer - 高效率点图层。
  79431. * @param {Object} options - 图层参数。
  79432. * @param {number} options.width - 地图宽度。
  79433. * @param {number} options.height - 地图高度。
  79434. * @param {HTMLElement} options.container - 放置渲染器的父元素。
  79435. * @param {Array.<number>} [options.colo=[0, 0, 0, 255]] - 颜色,目前只支持rgba数组。默认[0, 0, 0, 255],
  79436. * @param {number} [options.radius=10] - 半径。
  79437. * @param {number} [options.opacity=0.8] - 不透明度。
  79438. * @param {Array} [options.highlightColor] - 高亮颜色,目前只支持rgba数组。
  79439. * @param {number} [options.radiusScale] - 点放大倍数。
  79440. * @param {number} [options.radiusMinPixels] - 半径最小值(像素)。
  79441. * @param {number} [options.radiusMaxPixels] - 半径最大值(像素)。
  79442. * @param {number} [options.strokeWidth] - 边框大小。
  79443. * @param {boolean} [options.outline] - 是否显示边框。
  79444. * @param {function} [options.onClick] - 点击事件。
  79445. * @param {function} [options.onHover] - 悬停事件。
  79446. */
  79447. var GraphicCanvasRenderer = /*#__PURE__*/function (_olObject) {
  79448. CanvasRenderer_inherits(GraphicCanvasRenderer, _olObject);
  79449. var _super = CanvasRenderer_createSuper(GraphicCanvasRenderer);
  79450. function GraphicCanvasRenderer(layer, options) {
  79451. var _this;
  79452. CanvasRenderer_classCallCheck(this, GraphicCanvasRenderer);
  79453. _this = _super.call(this);
  79454. _this.layer = layer;
  79455. _this.map = layer.map;
  79456. var opt = options || {};
  79457. Util.extend(CanvasRenderer_assertThisInitialized(_this), opt);
  79458. _this.highLightStyle = _this.layer.highLightStyle;
  79459. _this.mapWidth = _this.size[0];
  79460. _this.mapHeight = _this.size[1];
  79461. _this.width = _this.map.getSize()[0];
  79462. _this.height = _this.map.getSize()[1];
  79463. _this.context = core_Util_Util.createCanvasContext2D(_this.mapWidth, _this.mapHeight);
  79464. _this.context.scale(_this.pixelRatio, _this.pixelRatio);
  79465. _this.canvas = _this.context.canvas;
  79466. _this.canvas.style.width = _this.width + 'px';
  79467. _this.canvas.style.height = _this.height + 'px';
  79468. _this._registerEvents();
  79469. return _this;
  79470. }
  79471. CanvasRenderer_createClass(GraphicCanvasRenderer, [{
  79472. key: "_registerEvents",
  79473. value: function _registerEvents() {
  79474. this.map.on('change:size', this._resizeEvent.bind(this), this);
  79475. }
  79476. }, {
  79477. key: "_resizeEvent",
  79478. value: function _resizeEvent() {
  79479. this._resize();
  79480. this._clearAndRedraw();
  79481. }
  79482. }, {
  79483. key: "_resize",
  79484. value: function _resize() {
  79485. var size = this.map.getSize();
  79486. var width = size[0];
  79487. var height = size[1];
  79488. var xRatio = width / this.width;
  79489. var yRatio = height / this.height;
  79490. this.width = width;
  79491. this.height = height;
  79492. this.mapWidth = this.mapWidth * xRatio;
  79493. this.mapHeight = this.mapHeight * yRatio;
  79494. this.canvas.width = this.mapWidth;
  79495. this.canvas.height = this.mapHeight;
  79496. this.canvas.style.width = this.width + 'px';
  79497. this.canvas.style.height = this.height + 'px';
  79498. }
  79499. }, {
  79500. key: "_clearAndRedraw",
  79501. value: function _clearAndRedraw() {
  79502. this._clearBuffer();
  79503. this.layer.changed();
  79504. }
  79505. }, {
  79506. key: "update",
  79507. value: function update() {
  79508. this.layer.changed();
  79509. }
  79510. }, {
  79511. key: "_clearBuffer",
  79512. value: function _clearBuffer() {}
  79513. /**
  79514. * @private
  79515. * @function GraphicCanvasRenderer.prototype.getCanvas
  79516. * @description 返回画布。
  79517. * @returns {HTMLCanvasElement} canvas 对象。
  79518. */
  79519. }, {
  79520. key: "getCanvas",
  79521. value: function getCanvas() {
  79522. return this.canvas;
  79523. }
  79524. /**
  79525. * @private
  79526. * @function GraphicCanvasRenderer.prototype.drawGraphics
  79527. * @description 绘制点要素。
  79528. */
  79529. }, {
  79530. key: "drawGraphics",
  79531. value: function drawGraphics(graphics) {
  79532. this.graphics_ = graphics || [];
  79533. var mapWidth = this.mapWidth / this.pixelRatio;
  79534. var mapHeight = this.mapHeight / this.pixelRatio;
  79535. var vectorContext = external_ol_render_namespaceObject.toContext(this.context, {
  79536. size: [mapWidth, mapHeight],
  79537. pixelRatio: this.pixelRatio
  79538. });
  79539. var defaultStyle = this.layer._getDefaultStyle();
  79540. var me = this,
  79541. layer = me.layer,
  79542. map = layer.map;
  79543. graphics.map(function (graphic) {
  79544. var style = graphic.getStyle() || defaultStyle;
  79545. if (me.selected === graphic) {
  79546. var defaultHighLightStyle = style;
  79547. if (style instanceof external_ol_style_namespaceObject.Circle) {
  79548. defaultHighLightStyle = new external_ol_style_namespaceObject.Circle({
  79549. radius: style.getRadius(),
  79550. fill: new external_ol_style_namespaceObject.Fill({
  79551. color: 'rgba(0, 153, 255, 1)'
  79552. }),
  79553. stroke: style.getStroke(),
  79554. snapToPixel: core_Util_Util.getOlVersion() === '4' ? style.getSnapToPixel() : null
  79555. });
  79556. } else if (style instanceof external_ol_style_namespaceObject.RegularShape) {
  79557. defaultHighLightStyle = new external_ol_style_namespaceObject.RegularShape({
  79558. radius: style.getRadius(),
  79559. radius2: style.getRadius2(),
  79560. points: style.getPoints(),
  79561. angle: style.getAngle(),
  79562. snapToPixel: core_Util_Util.getOlVersion() === '4' ? style.getSnapToPixel() : null,
  79563. rotation: style.getRotation(),
  79564. rotateWithView: style.getRotateWithView(),
  79565. fill: new external_ol_style_namespaceObject.Fill({
  79566. color: 'rgba(0, 153, 255, 1)'
  79567. }),
  79568. stroke: style.getStroke()
  79569. });
  79570. }
  79571. style = me.highLightStyle || defaultHighLightStyle;
  79572. }
  79573. vectorContext.setStyle(new external_ol_style_namespaceObject.Style({
  79574. image: style
  79575. }));
  79576. var geometry = graphic.getGeometry();
  79577. var coordinate = geometry.getCoordinates();
  79578. var center = map.getView().getCenter();
  79579. var mapCenterPx = map.getPixelFromCoordinate(center);
  79580. var resolution = map.getView().getResolution();
  79581. var x = (coordinate[0] - center[0]) / resolution;
  79582. var y = (center[1] - coordinate[1]) / resolution;
  79583. var scaledP = [x + mapCenterPx[0], y + mapCenterPx[1]];
  79584. scaledP = scale(scaledP, mapCenterPx, 1); //处理放大或缩小级别*/
  79585. var result = [scaledP[0] + me.offset[0], scaledP[1] + me.offset[1]];
  79586. var pixelGeometry = new (external_ol_geom_Point_default())(result);
  79587. vectorContext.drawGeometry(pixelGeometry);
  79588. return graphic;
  79589. });
  79590. }
  79591. }]);
  79592. return GraphicCanvasRenderer;
  79593. }((external_ol_Object_default()));
  79594. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/Graphic.js
  79595. function Graphic_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Graphic_typeof = function _typeof(obj) { return typeof obj; }; } else { Graphic_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Graphic_typeof(obj); }
  79596. function Graphic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79597. function Graphic_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79598. function Graphic_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graphic_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graphic_defineProperties(Constructor, staticProps); return Constructor; }
  79599. function Graphic_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Graphic_setPrototypeOf(subClass, superClass); }
  79600. function Graphic_setPrototypeOf(o, p) { Graphic_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Graphic_setPrototypeOf(o, p); }
  79601. function Graphic_createSuper(Derived) { var hasNativeReflectConstruct = Graphic_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Graphic_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Graphic_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Graphic_possibleConstructorReturn(this, result); }; }
  79602. function Graphic_possibleConstructorReturn(self, call) { if (call && (Graphic_typeof(call) === "object" || typeof call === "function")) { return call; } return Graphic_assertThisInitialized(self); }
  79603. function Graphic_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79604. function Graphic_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  79605. function Graphic_getPrototypeOf(o) { Graphic_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Graphic_getPrototypeOf(o); }
  79606. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  79607. * This program are made available under the terms of the Apache License, Version 2.0
  79608. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79609. /**
  79610. * @class ol.Graphic
  79611. * @category Visualization Graphic
  79612. * @classdesc 高效率点图层点要素类。
  79613. * @param {ol/geom/Point} geometry - 几何对象。
  79614. * @param {Object} [attributes] - 要素属性。
  79615. * @extends {ol/Object}
  79616. */
  79617. var Graphic_Graphic = /*#__PURE__*/function (_BaseObject) {
  79618. Graphic_inherits(Graphic, _BaseObject);
  79619. var _super = Graphic_createSuper(Graphic);
  79620. function Graphic(geometry, attributes) {
  79621. var _this;
  79622. Graphic_classCallCheck(this, Graphic);
  79623. _this = _super.call(this);
  79624. if (geometry instanceof (external_ol_geom_Geometry_default())) {
  79625. _this.geometry_ = geometry;
  79626. }
  79627. _this.attributes = attributes;
  79628. _this.setStyle();
  79629. return _this;
  79630. }
  79631. /**
  79632. * @function ol.Graphic.prototype.clone
  79633. * @description 克隆当前要素。
  79634. * @returns {ol.Graphic} 克隆后的要素。
  79635. */
  79636. Graphic_createClass(Graphic, [{
  79637. key: "clone",
  79638. value: function clone() {
  79639. var clone = new Graphic();
  79640. clone.setId(this.id);
  79641. clone.setGeometry(this.geometry_);
  79642. clone.setAttributes(this.attributes);
  79643. clone.setStyle(this.style_);
  79644. return clone;
  79645. }
  79646. /**
  79647. * @function ol.Graphic.prototype.getId
  79648. * @description 获取当前 ID。
  79649. * @returns {string} id
  79650. */
  79651. }, {
  79652. key: "getId",
  79653. value: function getId() {
  79654. return this.id;
  79655. }
  79656. /**
  79657. * @function ol.Graphic.prototype.setId
  79658. * @description 设置当前要素 ID。
  79659. * @param {string} id - 要素 ID。
  79660. */
  79661. }, {
  79662. key: "setId",
  79663. value: function setId(id) {
  79664. this.id = id;
  79665. }
  79666. /**
  79667. * @function ol.Graphic.prototype.getGeometry
  79668. * @description 获取当前要素几何信息。
  79669. * @returns {ol/geom/Point} 要素几何信息。
  79670. */
  79671. }, {
  79672. key: "getGeometry",
  79673. value: function getGeometry() {
  79674. return this.geometry_;
  79675. }
  79676. /**
  79677. * @function ol.Graphic.prototype.setGeometry
  79678. * @description 设置当前要素几何信息。
  79679. * @param {ol/geom/Point} geometry - 要素几何信息。
  79680. */
  79681. }, {
  79682. key: "setGeometry",
  79683. value: function setGeometry(geometry) {
  79684. this.geometry_ = geometry;
  79685. }
  79686. /**
  79687. * @function ol.Graphic.prototype.setAttributes
  79688. * @description 设置要素属性。
  79689. * @param {Object} attributes - 属性对象。
  79690. */
  79691. }, {
  79692. key: "setAttributes",
  79693. value: function setAttributes(attributes) {
  79694. this.attributes = attributes;
  79695. }
  79696. /**
  79697. * @function ol.Graphic.prototype.getAttributes
  79698. * @description 获取要素属性。
  79699. * @returns {Object} 要素属性。
  79700. */
  79701. }, {
  79702. key: "getAttributes",
  79703. value: function getAttributes() {
  79704. return this.attributes;
  79705. }
  79706. /**
  79707. * @function ol.Graphic.prototype.getStyle
  79708. * @description 获取样式。
  79709. * @returns {ol/style/Image} ol/style/Image 子类样式对象。
  79710. */
  79711. }, {
  79712. key: "getStyle",
  79713. value: function getStyle() {
  79714. return this.style_;
  79715. }
  79716. /**
  79717. * @function ol.Graphic.prototype.setStyle
  79718. * @description 设置样式。
  79719. * @param {ol/style/Image} style - 样式,ol/style/Image 子类样式对象。
  79720. */
  79721. }, {
  79722. key: "setStyle",
  79723. value: function setStyle(style) {
  79724. if (!this.style && !style) {
  79725. return;
  79726. }
  79727. this.style_ = style;
  79728. this.styleFunction_ = !style ? undefined : Graphic.createStyleFunction(new (external_ol_style_Style_default())({
  79729. image: style
  79730. }));
  79731. this.changed();
  79732. }
  79733. /**
  79734. * @function ol.Graphic.prototype.getStyleFunction
  79735. * @description 获取样式函数。
  79736. * @returns {Function} 样式函数。
  79737. */
  79738. }, {
  79739. key: "getStyleFunction",
  79740. value: function getStyleFunction() {
  79741. return this.styleFunction_;
  79742. }
  79743. /**
  79744. * @function ol.Graphic.createStyleFunction
  79745. * @description 新建样式函数。
  79746. * @param {Object} obj - 对象参数。
  79747. */
  79748. }, {
  79749. key: "destroy",
  79750. /**
  79751. * @function ol.Graphic.prototype.destroy
  79752. * @description 清除参数值。
  79753. */
  79754. value: function destroy() {
  79755. this.id = null;
  79756. this.geometry_ = null;
  79757. this.attributes = null;
  79758. this.style_ = null;
  79759. }
  79760. }], [{
  79761. key: "createStyleFunction",
  79762. value: function createStyleFunction(obj) {
  79763. var styleFunction;
  79764. if (typeof obj === 'function') {
  79765. if (obj.length == 2) {
  79766. styleFunction = function styleFunction(resolution) {
  79767. return obj(this, resolution);
  79768. };
  79769. } else {
  79770. styleFunction = obj;
  79771. }
  79772. } else {
  79773. var styles;
  79774. if (Array.isArray(obj)) {
  79775. styles = obj;
  79776. } else {
  79777. styles = [obj];
  79778. }
  79779. styleFunction = function styleFunction() {
  79780. return styles;
  79781. };
  79782. }
  79783. return styleFunction;
  79784. }
  79785. }]);
  79786. return Graphic;
  79787. }((external_ol_Object_default()));
  79788. ;// CONCATENATED MODULE: external "ol.extent"
  79789. var external_ol_extent_namespaceObject = ol.extent;
  79790. ;// CONCATENATED MODULE: external "ol.geom.Polygon"
  79791. var external_ol_geom_Polygon_namespaceObject = ol.geom.Polygon;
  79792. var external_ol_geom_Polygon_default = /*#__PURE__*/__webpack_require__.n(external_ol_geom_Polygon_namespaceObject);
  79793. ;// CONCATENATED MODULE: external "ol.layer.Image"
  79794. var external_ol_layer_Image_namespaceObject = ol.layer.Image;
  79795. var external_ol_layer_Image_default = /*#__PURE__*/__webpack_require__.n(external_ol_layer_Image_namespaceObject);
  79796. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Graphic.js
  79797. function overlay_Graphic_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { overlay_Graphic_typeof = function _typeof(obj) { return typeof obj; }; } else { overlay_Graphic_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return overlay_Graphic_typeof(obj); }
  79798. function overlay_Graphic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79799. function overlay_Graphic_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79800. function overlay_Graphic_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Graphic_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Graphic_defineProperties(Constructor, staticProps); return Constructor; }
  79801. function overlay_Graphic_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) overlay_Graphic_setPrototypeOf(subClass, superClass); }
  79802. function overlay_Graphic_setPrototypeOf(o, p) { overlay_Graphic_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Graphic_setPrototypeOf(o, p); }
  79803. function overlay_Graphic_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Graphic_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Graphic_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Graphic_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Graphic_possibleConstructorReturn(this, result); }; }
  79804. function overlay_Graphic_possibleConstructorReturn(self, call) { if (call && (overlay_Graphic_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Graphic_assertThisInitialized(self); }
  79805. function overlay_Graphic_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79806. function overlay_Graphic_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  79807. function overlay_Graphic_getPrototypeOf(o) { overlay_Graphic_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Graphic_getPrototypeOf(o); }
  79808. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  79809. * This program are made available under the terms of the Apache License, Version 2.0
  79810. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79811. var defaultProps = {
  79812. color: [0, 0, 0, 255],
  79813. opacity: 0.8,
  79814. radius: 10,
  79815. radiusScale: 1,
  79816. radiusMinPixels: 0,
  79817. radiusMaxPixels: Number.MAX_SAFE_INTEGER,
  79818. strokeWidth: 1,
  79819. outline: false
  79820. };
  79821. var Renderer = ['canvas', 'webgl'];
  79822. /**
  79823. * @class ol.source.Graphic
  79824. * @category Visualization Graphic
  79825. * @classdesc 高效率点图层源。
  79826. * @param {Object} options - 图形参数。
  79827. * @param {ol/map} options.map - openlayers 地图对象。
  79828. * @param {ol/Graphic} options.graphics - 高效率点图层点要素。
  79829. * @param {string} [options.render ='canvas'] - 指定使用的渲染器。可选值:"webgl","canvas"(webgl 渲染目前只支持散点)。
  79830. * @param {boolean} [options.isHighLight=true] - 事件响应是否支持要素高亮。
  79831. * @param {ol/style} [options.highLightStyle=defaultHighLightStyle] - 高亮风格。
  79832. * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 要素颜色。
  79833. * @param {Array.<number>} [options.highlightColor] - webgl 渲染时要素高亮颜色。
  79834. * @param {number} [options.opacity=0.8] - 要素透明度。
  79835. * @param {number} [options.radius=10] - 要素半径,单位像素。
  79836. * @param {number} [options.radiusScale=1] - webgl 渲染时的要素放大倍数。
  79837. * @param {number} [options.radiusMinPixels=0] - webgl 渲染时的要素半径最小值(像素)。
  79838. * @param {number} [options.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - webgl 渲染时的要素半径最大值(像素)。
  79839. * @param {number} [options.strokeWidth=1] - 边框大小。
  79840. * @param {boolean} [options.outline=false] - 是否显示边框。
  79841. * @param {function} [options.onHover] - 图层鼠标悬停响应事件(只有 webgl 渲染时有用)。
  79842. * @param {function} [options.onClick] - 图层鼠标点击响应事件(webgl、canvas 渲染时都有用)。
  79843. * @extends {ol/source/ImageCanvas}
  79844. */
  79845. var Graphic = /*#__PURE__*/function (_ImageCanvasSource) {
  79846. overlay_Graphic_inherits(Graphic, _ImageCanvasSource);
  79847. var _super = overlay_Graphic_createSuper(Graphic);
  79848. function Graphic(options) {
  79849. var _this;
  79850. overlay_Graphic_classCallCheck(this, Graphic);
  79851. _this = _super.call(this, {
  79852. attributions: options.attributions,
  79853. canvasFunction: canvasFunctionInternal_,
  79854. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  79855. projection: options.projection,
  79856. ratio: options.ratio,
  79857. resolutions: options.resolutions,
  79858. state: options.state
  79859. });
  79860. _this.graphics = [].concat(options.graphics);
  79861. _this.map = options.map;
  79862. Util.extend(overlay_Graphic_assertThisInitialized(_this), options);
  79863. _this.render = options.render || Renderer[0];
  79864. if (!core_Util_Util.supportWebGL2()) {
  79865. _this.render = Renderer[0];
  79866. }
  79867. _this.highLightStyle = options.highLightStyle; //是否支持高亮,默认支持
  79868. _this.isHighLight = typeof options.isHighLight === 'undefined' ? true : options.isHighLight;
  79869. _this.hitGraphicLayer = null;
  79870. _this._forEachFeatureAtCoordinate = _forEachFeatureAtCoordinate;
  79871. var me = overlay_Graphic_assertThisInitialized(_this);
  79872. if (options.onClick) {
  79873. me.map.on('click', function (e) {
  79874. if (me.renderer instanceof GraphicWebGLRenderer) {
  79875. return;
  79876. }
  79877. var features = me.map.getFeaturesAtPixel(e.pixel) || [];
  79878. for (var index = 0; index < features.length; index++) {
  79879. var graphic = features[index];
  79880. if (me.graphics.indexOf(graphic) > -1) {
  79881. options.onClick(graphic, e);
  79882. if (me.isHighLight) {
  79883. me._highLight(graphic.getGeometry().getCoordinates(), new (external_ol_style_Style_default())({
  79884. image: graphic.getStyle()
  79885. }).getImage(), graphic, e.pixel);
  79886. }
  79887. break;
  79888. }
  79889. }
  79890. });
  79891. } //eslint-disable-next-line no-unused-vars
  79892. function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  79893. var mapWidth = size[0] / pixelRatio;
  79894. var mapHeight = size[1] / pixelRatio;
  79895. var width = me.map.getSize()[0];
  79896. var height = me.map.getSize()[1];
  79897. if (!me.renderer) {
  79898. me.renderer = createRenderer(size, pixelRatio);
  79899. }
  79900. me.renderer.mapWidth = mapWidth;
  79901. me.renderer.mapHeight = mapHeight;
  79902. me.renderer.pixelRatio = pixelRatio;
  79903. me.renderer.offset = [(mapWidth - width) / 2, (mapHeight - height) / 2];
  79904. var graphics = this.getGraphicsInExtent(extent);
  79905. me.renderer._clearBuffer();
  79906. me.renderer.selected = this.selected;
  79907. me.renderer.drawGraphics(graphics);
  79908. return me.renderer.getCanvas();
  79909. }
  79910. function createRenderer(size, pixelRatio) {
  79911. var renderer;
  79912. if (me.render === Renderer[0]) {
  79913. renderer = new GraphicCanvasRenderer(me, {
  79914. size: size,
  79915. pixelRatio: pixelRatio
  79916. });
  79917. } else {
  79918. var optDefault = Util.extend({}, defaultProps);
  79919. var opt = Util.extend(optDefault, {
  79920. color: me.color,
  79921. opacity: me.opacity,
  79922. radius: me.radius,
  79923. radiusScale: me.radiusScale,
  79924. radiusMinPixels: me.radiusMinPixels,
  79925. radiusMaxPixels: me.radiusMaxPixels,
  79926. strokeWidth: me.strokeWidth,
  79927. outline: me.outline,
  79928. onClick: me.onClick,
  79929. onHover: me.onHover
  79930. });
  79931. opt = Util.extend(me, opt);
  79932. opt.pixelRatio = pixelRatio;
  79933. opt.container = me.map.getViewport().getElementsByClassName('ol-overlaycontainer')[0];
  79934. opt.onBeforeRender = function () {
  79935. return false;
  79936. };
  79937. opt.onAfterRender = function () {
  79938. return false;
  79939. };
  79940. renderer = new GraphicWebGLRenderer(me, opt);
  79941. }
  79942. return renderer;
  79943. }
  79944. /**
  79945. * @private
  79946. * @function ol.source.Graphic.prototype._forEachFeatureAtCoordinate
  79947. * @description 获取在视图上的要素。
  79948. * @param {string} coordinate -坐标。
  79949. * @param {number} resolution -分辨率。
  79950. * @param {RequestCallback} callback -回调函数。
  79951. * @param {ol/Pixel} evtPixel - 当前选中的屏幕像素坐标。
  79952. */
  79953. function _forEachFeatureAtCoordinate(coordinate, resolution, callback, evtPixel, e) {
  79954. var graphics = me.getGraphicsInExtent(); // FIX 无法高亮元素
  79955. me._highLightClose();
  79956. for (var i = graphics.length - 1; i >= 0; i--) {
  79957. var style = graphics[i].getStyle();
  79958. if (!style) {
  79959. return;
  79960. } //已经被高亮的graphics 不被选选中
  79961. if (style instanceof HitCloverShape) {
  79962. continue;
  79963. }
  79964. var center = graphics[i].getGeometry().getCoordinates();
  79965. var image = new (external_ol_style_Style_default())({
  79966. image: style
  79967. }).getImage();
  79968. var contain = false; //icl-1047 当只有一个叶片的时候,判断是否选中的逻辑处理的更准确一点
  79969. if (image instanceof CloverShape && image.getCount() === 1) {
  79970. var ratation = image.getRotation() * 180 / Math.PI;
  79971. var angle = Number.parseFloat(image.getAngle());
  79972. var r = image.getRadius() * resolution; //if(image.getAngle() )
  79973. var geo = null;
  79974. if (angle > 355) {
  79975. geo = new (external_ol_style_Circle_default())(center, r);
  79976. } else {
  79977. var coors = [];
  79978. coors.push(center);
  79979. var perAngle = angle / 8;
  79980. for (var index = 0; index < 8; index++) {
  79981. var radian = (ratation + index * perAngle) / 180 * Math.PI;
  79982. coors.push([center[0] + r * Math.cos(radian), center[1] - r * Math.sin(radian)]);
  79983. }
  79984. coors.push(center);
  79985. geo = new (external_ol_geom_Polygon_default())([coors]);
  79986. }
  79987. if (geo.intersectsCoordinate(this.map.getCoordinateFromPixel(evtPixel))) {
  79988. contain = true;
  79989. }
  79990. } else {
  79991. var extent = [];
  79992. extent[0] = center[0] - image.getAnchor()[0] * resolution;
  79993. extent[2] = center[0] + image.getAnchor()[0] * resolution;
  79994. extent[1] = center[1] - image.getAnchor()[1] * resolution;
  79995. extent[3] = center[1] + image.getAnchor()[1] * resolution;
  79996. if (external_ol_extent_namespaceObject.containsCoordinate(extent, coordinate)) {
  79997. contain = true;
  79998. }
  79999. }
  80000. if (contain === true) {
  80001. if (callback) {
  80002. callback(graphics[i], e);
  80003. }
  80004. continue;
  80005. } // if (me.isHighLight) {
  80006. // // me._highLightClose();
  80007. // }
  80008. }
  80009. return undefined;
  80010. }
  80011. return _this;
  80012. }
  80013. /**
  80014. * @function ol.source.Graphic.prototype.setGraphics
  80015. * @description 设置绘制的点要素,会覆盖之前的所有要素。
  80016. * @param {Array.<ol.Graphic>} graphics - 点要素对象数组。
  80017. */
  80018. overlay_Graphic_createClass(Graphic, [{
  80019. key: "setGraphics",
  80020. value: function setGraphics(graphics) {
  80021. this.graphics = this.graphics || [];
  80022. this.graphics.length = 0;
  80023. var sGraphics = !core_Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics);
  80024. this.graphics = [].concat(sGraphics);
  80025. this.update();
  80026. }
  80027. /**
  80028. * @function ol.source.Graphic.prototype.addGraphics
  80029. * @description 追加点要素,不会覆盖之前的要素。
  80030. * @param {Array.<ol.Graphic>} graphics - 点要素对象数组。
  80031. */
  80032. }, {
  80033. key: "addGraphics",
  80034. value: function addGraphics(graphics) {
  80035. this.graphics = this.graphics || [];
  80036. var sGraphics = !core_Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics);
  80037. this.graphics = this.graphics.concat(sGraphics);
  80038. this.update();
  80039. }
  80040. /**
  80041. * @function ol.source.Graphic.prototype.getGraphicBy
  80042. * @description 在 Vector 的要素数组 graphics 里面遍历每一个 graphic,当 graphic[property]===value 时,返回此 graphic(并且只返回第一个)。
  80043. * @param {string} property - graphic 的某个属性名称。
  80044. * @param {string} value - property 所对应的值。
  80045. * @returns {ol.Graphic} 一个匹配的 graphic。
  80046. */
  80047. }, {
  80048. key: "getGraphicBy",
  80049. value: function getGraphicBy(property, value) {
  80050. var graphic = null;
  80051. for (var index in this.graphics) {
  80052. if (this.graphics[index][property] === value) {
  80053. graphic = this.graphics[index];
  80054. break;
  80055. }
  80056. }
  80057. return graphic;
  80058. }
  80059. /**
  80060. * @function ol.source.Graphic.prototype.getGraphicById
  80061. * @description 通过给定一个 id,返回对应的矢量要素。
  80062. * @param {string} graphicId - 矢量要素的属性 id
  80063. * @returns {ol.Graphic} 一个匹配的 graphic。
  80064. */
  80065. }, {
  80066. key: "getGraphicById",
  80067. value: function getGraphicById(graphicId) {
  80068. return this.getGraphicBy('id', graphicId);
  80069. }
  80070. /**
  80071. * @function ol.source.Graphic.prototype.getGraphicsByAttribute
  80072. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  80073. * @param {string} attrName - graphic 的某个属性名称。
  80074. * @param {string} attrValue - property 所对应的值。
  80075. * @returns {Array.<ol.Graphic>} 一个匹配的 graphic 数组。
  80076. */
  80077. }, {
  80078. key: "getGraphicsByAttribute",
  80079. value: function getGraphicsByAttribute(attrName, attrValue) {
  80080. var graphic,
  80081. foundgraphics = [];
  80082. for (var index in this.graphics) {
  80083. graphic = this.graphics[index];
  80084. if (graphic && graphic.attributes) {
  80085. if (graphic.attributes[attrName] === attrValue) {
  80086. foundgraphics.push(graphic);
  80087. }
  80088. }
  80089. }
  80090. return foundgraphics;
  80091. }
  80092. /**
  80093. * @function ol.source.Graphic.prototype.removeGraphics
  80094. * @description 删除要素数组,默认将删除所有要素。
  80095. * @param {Array.<ol.Graphic>} [graphics] - 删除的 graphics 数组。
  80096. */
  80097. }, {
  80098. key: "removeGraphics",
  80099. value: function removeGraphics() {
  80100. var graphics = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  80101. //当 graphics 为 null 、为空数组,或 === this.graphics,则清除所有要素
  80102. if (!graphics || graphics.length === 0 || graphics === this.graphics) {
  80103. this.graphics.length = 0;
  80104. this.update();
  80105. return;
  80106. }
  80107. if (!Util.isArray(graphics)) {
  80108. graphics = [graphics];
  80109. }
  80110. for (var i = graphics.length - 1; i >= 0; i--) {
  80111. var graphic = graphics[i]; //如果我们传入的grapchic在graphics数组中没有的话,则不进行删除,
  80112. //并将其放入未删除的数组中。
  80113. var findex = Util.indexOf(this.graphics, graphic);
  80114. if (findex === -1) {
  80115. continue;
  80116. }
  80117. this.graphics.splice(findex, 1);
  80118. } //删除完成后重新设置 setGraphics,以更新
  80119. this.update();
  80120. }
  80121. /**
  80122. * @function ol.source.Graphic.prototype.clear
  80123. * @description 释放图层资源。
  80124. */
  80125. }, {
  80126. key: "clear",
  80127. value: function clear() {
  80128. this.removeGraphics();
  80129. }
  80130. /**
  80131. * @function ol.source.Graphic.prototype.update
  80132. * @description 更新图层。
  80133. */
  80134. }, {
  80135. key: "update",
  80136. value: function update() {
  80137. this.renderer.update(this.graphics, this._getDefaultStyle());
  80138. }
  80139. }, {
  80140. key: "_getDefaultStyle",
  80141. value: function _getDefaultStyle() {
  80142. var target = {};
  80143. if (this.color) {
  80144. target.fill = new (external_ol_style_Fill_default())({
  80145. color: this.toRGBA(this.color)
  80146. });
  80147. }
  80148. if (this.radius) {
  80149. target.radius = this.radius;
  80150. }
  80151. if (this.outline) {
  80152. target.stroke = new (external_ol_style_Fill_default())({
  80153. color: this.toRGBA(this.color),
  80154. width: this.strokeWidth
  80155. });
  80156. }
  80157. return new (external_ol_style_Circle_default())(target);
  80158. }
  80159. }, {
  80160. key: "toRGBA",
  80161. value: function toRGBA(colorArray) {
  80162. return "rgba(".concat(colorArray[0], ",").concat(colorArray[1], ",").concat(colorArray[2], ",").concat((colorArray[3] || 255) / 255, ")");
  80163. }
  80164. /**
  80165. * @function ol.source.Graphic.prototype.setStyle
  80166. * @description 设置图层要素整体样式(接口仅在 webgl 渲染时有用)。
  80167. * @param {Object} styleOptions - 样式对象。
  80168. * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
  80169. * @param {number} [styleOptions.radius=10] - 点半径。
  80170. * @param {number} [styleOptions.opacity=0.8] - 不透明度。
  80171. * @param {Array} [styleOptions.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
  80172. * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
  80173. * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
  80174. * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  80175. * @param {number} [styleOptions.strokeWidth=1] - 边框大小。
  80176. * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
  80177. */
  80178. }, {
  80179. key: "setStyle",
  80180. value: function setStyle(styleOptions) {
  80181. var self = this;
  80182. var styleOpt = {
  80183. color: self.color,
  80184. radius: self.radius,
  80185. opacity: self.opacity,
  80186. highlightColor: self.highlightColor,
  80187. radiusScale: self.radiusScale,
  80188. radiusMinPixels: self.radiusMinPixels,
  80189. radiusMaxPixels: self.radiusMaxPixels,
  80190. strokeWidth: self.strokeWidth,
  80191. outline: self.outline
  80192. };
  80193. Util.extend(self, Util.extend(styleOpt, styleOptions));
  80194. self.update();
  80195. }
  80196. /**
  80197. * @function ol.source.Graphic.prototype.getLayerState
  80198. * @description 获取当前地图及图层状态。
  80199. * @returns {Object} 地图及图层状态,包含地图状态信息和本图层相关状态。
  80200. */
  80201. }, {
  80202. key: "getLayerState",
  80203. value: function getLayerState() {
  80204. var map = this.map;
  80205. var width = map.getSize()[0];
  80206. var height = map.getSize()[1];
  80207. var view = map.getView();
  80208. var center = view.getCenter();
  80209. var longitude = center[0];
  80210. var latitude = center[1];
  80211. var zoom = view.getZoom();
  80212. var maxZoom = view.getMaxZoom();
  80213. var rotationRadians = view.getRotation();
  80214. var rotation = -rotationRadians * 180 / Math.PI;
  80215. var mapViewport = {
  80216. longitude: longitude,
  80217. latitude: latitude,
  80218. zoom: zoom,
  80219. maxZoom: maxZoom,
  80220. pitch: 0,
  80221. bearing: rotation
  80222. };
  80223. var state = {};
  80224. for (var key in mapViewport) {
  80225. state[key] = mapViewport[key];
  80226. }
  80227. state.width = width;
  80228. state.height = height;
  80229. state.color = this.color;
  80230. state.radius = this.radius;
  80231. state.opacity = this.opacity;
  80232. state.highlightColor = this.highlightColor;
  80233. state.radiusScale = this.radiusScale;
  80234. state.radiusMinPixels = this.radiusMinPixels;
  80235. state.radiusMaxPixels = this.radiusMaxPixels;
  80236. state.strokeWidth = this.strokeWidth;
  80237. state.outline = this.outline;
  80238. return state;
  80239. }
  80240. /**
  80241. * @function ol.source.Graphic.prototype._highLightClose
  80242. * @description 关闭高亮要素显示。
  80243. * @private
  80244. */
  80245. }, {
  80246. key: "_highLightClose",
  80247. value: function _highLightClose() {
  80248. this.selected = null;
  80249. if (this.hitGraphicLayer) {
  80250. this.map.removeLayer(this.hitGraphicLayer);
  80251. this.hitGraphicLayer = null;
  80252. }
  80253. this.changed();
  80254. }
  80255. /**
  80256. * @function ol.source.Graphic.prototype._highLight
  80257. * @description 高亮显示选中要素。
  80258. * @param {Array.<number>} center - 中心点。
  80259. * @param {ol/style/Style} image - 点样式。
  80260. * @param {ol.Graphic} selectGraphic - 高效率点图层点要素。
  80261. * @param {ol/Pixel} evtPixel - 当前选中的屏幕像素坐标。
  80262. * @private
  80263. */
  80264. }, {
  80265. key: "_highLight",
  80266. value: function _highLight(center, image, selectGraphic, evtPixel) {
  80267. if (selectGraphic.getStyle() instanceof CloverShape) {
  80268. if (this.hitGraphicLayer) {
  80269. this.map.removeLayer(this.hitGraphicLayer);
  80270. this.hitGraphicLayer = null;
  80271. }
  80272. var pixel = this.map.getPixelFromCoordinate([center[0], center[1]]); //点击点与中心点的角度
  80273. evtPixel = evtPixel || [0, 0];
  80274. var angle = Math.atan2(evtPixel[1] - pixel[1], evtPixel[0] - pixel[0]) / Math.PI * 180;
  80275. angle = angle > 0 ? angle : 360 + angle; //确定扇叶
  80276. var index = Math.ceil(angle / (image.getAngle() + image.getSpaceAngle())); //扇叶的起始角度
  80277. var sAngle = (index - 1) * (image.getAngle() + image.getSpaceAngle()); //渲染参数
  80278. var opts = {
  80279. stroke: new (external_ol_style_Stroke_default())({
  80280. color: '#ff0000',
  80281. width: 1
  80282. }),
  80283. fill: new (external_ol_style_Fill_default())({
  80284. color: '#0099ff'
  80285. }),
  80286. radius: image.getRadius(),
  80287. angle: image.getAngle(),
  80288. eAngle: sAngle + image.getAngle(),
  80289. sAngle: sAngle,
  80290. rotation: image.getRotation()
  80291. };
  80292. if (this.highLightStyle && this.highLightStyle instanceof HitCloverShape) {
  80293. opts.stroke = this.highLightStyle.getStroke();
  80294. opts.fill = this.highLightStyle.getFill();
  80295. opts.radius = this.highLightStyle.getRadius();
  80296. opts.angle = this.highLightStyle.getAngle();
  80297. }
  80298. var hitGraphic = new Graphic_Graphic(new (external_ol_geom_Point_default())(center));
  80299. hitGraphic.setStyle(new HitCloverShape(opts));
  80300. this.hitGraphicLayer = new (external_ol_layer_Image_default())({
  80301. source: new Graphic({
  80302. map: this.map,
  80303. graphics: [hitGraphic]
  80304. })
  80305. });
  80306. this.map.addLayer(this.hitGraphicLayer);
  80307. } else {
  80308. this.selected = selectGraphic;
  80309. this.changed();
  80310. }
  80311. }
  80312. /**
  80313. * @function ol.source.Graphic.prototype.getGraphicsInExtent
  80314. * @description 在指定范围中获取几何要素面积。
  80315. * @param {Object} extent - 长度范围。
  80316. */
  80317. }, {
  80318. key: "getGraphicsInExtent",
  80319. value: function getGraphicsInExtent(extent) {
  80320. var graphics = [];
  80321. if (!extent) {
  80322. this.graphics.map(function (graphic) {
  80323. graphics.push(graphic);
  80324. return graphic;
  80325. });
  80326. return graphics;
  80327. }
  80328. this.graphics.map(function (graphic) {
  80329. if (external_ol_extent_namespaceObject.containsExtent(extent, graphic.getGeometry().getExtent())) {
  80330. graphics.push(graphic);
  80331. }
  80332. return graphic;
  80333. });
  80334. return graphics;
  80335. }
  80336. }]);
  80337. return Graphic;
  80338. }((external_ol_source_ImageCanvas_default()));
  80339. ;// CONCATENATED MODULE: ./src/openlayers/overlay/theme/GeoFeature.js
  80340. function GeoFeature_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoFeature_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoFeature_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoFeature_typeof(obj); }
  80341. function GeoFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80342. function GeoFeature_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  80343. function GeoFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoFeature_defineProperties(Constructor, staticProps); return Constructor; }
  80344. function GeoFeature_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GeoFeature_setPrototypeOf(subClass, superClass); }
  80345. function GeoFeature_setPrototypeOf(o, p) { GeoFeature_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoFeature_setPrototypeOf(o, p); }
  80346. function GeoFeature_createSuper(Derived) { var hasNativeReflectConstruct = GeoFeature_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoFeature_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoFeature_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoFeature_possibleConstructorReturn(this, result); }; }
  80347. function GeoFeature_possibleConstructorReturn(self, call) { if (call && (GeoFeature_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoFeature_assertThisInitialized(self); }
  80348. function GeoFeature_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  80349. function GeoFeature_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  80350. function GeoFeature_getPrototypeOf(o) { GeoFeature_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoFeature_getPrototypeOf(o); }
  80351. /* Copyright© 2000 - 2021 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. * @class ol.source.GeoFeature
  80356. * @category Visualization Theme
  80357. * @classdesc 地理几何专题要素型专题图层基类。
  80358. * @param {string} name - 图层名称。
  80359. * @param {Object} opt_options - 参数。
  80360. * @param {ol/Map} opt_options.map - 当前 OpenLayers Map 对象。
  80361. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  80362. * @param {number} [opt_options.opacity=1] - 图层透明度。
  80363. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  80364. * @param {ol/proj/Projection} [opt_options.projection] - 投影信息。
  80365. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。 必须是 1 或更高。
  80366. * @param {Array} [opt_options.resolutions] - 分辨率数组。
  80367. * @param {ol/source/State} [opt_option.state] - 资源状态。
  80368. * @param {Object} [opt_options.style] - 专题图样式。
  80369. * @param {Object} [opt_options.styleGroups] - 各专题类型样式组。
  80370. * @param {boolean} [opt_options.isHoverAble=false] - 是否开启 hover 事件。
  80371. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  80372. * @param {(string|Object)} [opt_option.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  80373. * @extends {Theme}
  80374. */
  80375. var GeoFeature = /*#__PURE__*/function (_Theme) {
  80376. GeoFeature_inherits(GeoFeature, _Theme);
  80377. var _super = GeoFeature_createSuper(GeoFeature);
  80378. function GeoFeature(name, opt_options) {
  80379. var _this;
  80380. GeoFeature_classCallCheck(this, GeoFeature);
  80381. _this = _super.call(this, name, opt_options);
  80382. _this.cache = opt_options.cache || {};
  80383. _this.cacheFields = opt_options.cacheFields || [];
  80384. _this.style = opt_options.style || {};
  80385. _this.maxCacheCount = opt_options.maxCacheCount || 0;
  80386. _this.isCustomSetMaxCacheCount = opt_options.isCustomSetMaxCacheCount === undefined ? false : opt_options.isCustomSetMaxCacheCount;
  80387. _this.nodesClipPixel = opt_options.nodesClipPixel || 2;
  80388. _this.isHoverAble = opt_options.isHoverAble === undefined ? false : opt_options.isHoverAble;
  80389. _this.isMultiHover = opt_options.isMultiHover === undefined ? false : opt_options.isMultiHover;
  80390. _this.isClickAble = opt_options.isClickAble === undefined ? true : opt_options.isClickAble;
  80391. _this.highlightStyle = opt_options.highlightStyle || null;
  80392. _this.isAllowFeatureStyle = opt_options.isAllowFeatureStyle === undefined ? false : opt_options.isAllowFeatureStyle;
  80393. return _this;
  80394. }
  80395. /**
  80396. * @function ol.source.GeoFeature.prototype.destroy
  80397. * @description 释放资源,将引用资源的属性置空。
  80398. */
  80399. GeoFeature_createClass(GeoFeature, [{
  80400. key: "destroy",
  80401. value: function destroy() {
  80402. this.maxCacheCount = null;
  80403. this.isCustomSetMaxCacheCount = null;
  80404. this.nodesClipPixel = null;
  80405. this.isHoverAble = null;
  80406. this.isMultiHover = null;
  80407. this.isClickAble = null;
  80408. this.cache = null;
  80409. this.cacheFields = null;
  80410. this.style = null;
  80411. this.highlightStyle = null;
  80412. this.isAllowFeatureStyle = null;
  80413. }
  80414. /**
  80415. * @function ol.source.GeoFeature.prototype.addFeatures
  80416. * @description 添加要素。
  80417. * @param {SuperMap.ServerFeature|GeoJSONObject|ol/Feature} features - 要素对象。
  80418. */
  80419. }, {
  80420. key: "addFeatures",
  80421. value: function addFeatures(features) {
  80422. this.dispatchEvent({
  80423. type: 'beforefeaturesadded',
  80424. value: {
  80425. features: features
  80426. }
  80427. }); //转换 features 形式
  80428. this.features = this.toiClientFeature(features);
  80429. if (!this.isCustomSetMaxCacheCount) {
  80430. this.maxCacheCount = this.features.length * 5;
  80431. } //绘制专题要素
  80432. if (this.renderer) {
  80433. this.changed();
  80434. }
  80435. }
  80436. /**
  80437. * @function ol.source.GeoFeature.prototype.removeFeatures
  80438. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  80439. * @param {SuperMap.Feature.Vector} features - 要删除的要素对象。
  80440. */
  80441. }, {
  80442. key: "removeFeatures",
  80443. value: function removeFeatures(features) {
  80444. // eslint-disable-line no-unused-vars
  80445. this.clearCache();
  80446. theme_Theme_Theme.prototype.removeFeatures.apply(this, arguments);
  80447. }
  80448. /**
  80449. * @function ol.source.GeoFeature.prototype.removeAllFeatures
  80450. * @description 清除当前图层所有的矢量要素。
  80451. */
  80452. }, {
  80453. key: "removeAllFeatures",
  80454. value: function removeAllFeatures() {
  80455. this.clearCache();
  80456. theme_Theme_Theme.prototype.removeAllFeatures.apply(this, arguments);
  80457. }
  80458. /**
  80459. * @function ol.source.GeoFeature.prototype.redrawThematicFeatures
  80460. * @description 重绘所有专题要素。
  80461. * @param {Object} extent - 视图范围数据。
  80462. */
  80463. }, {
  80464. key: "redrawThematicFeatures",
  80465. value: function redrawThematicFeatures(extent) {
  80466. //获取高亮专题要素对应的用户 id
  80467. var hoverone = this.renderer.getHoverOne();
  80468. var hoverFid = null;
  80469. if (hoverone && hoverone.refDataID) {
  80470. hoverFid = hoverone.refDataID;
  80471. } //清除当前所有可视元素
  80472. this.renderer.clearAll();
  80473. var features = this.features;
  80474. var cache = this.cache;
  80475. var cacheFields = this.cacheFields;
  80476. var cmZoom = this.map.getView().getZoom();
  80477. var maxCC = this.maxCacheCount;
  80478. for (var i = 0, len = features.length; i < len; i++) {
  80479. var feature = features[i];
  80480. if (!feature.geometry) {
  80481. continue;
  80482. }
  80483. var feaBounds = feature.geometry.getBounds(); //剔除当前视图(地理)范围以外的数据
  80484. if (extent) {
  80485. var bounds = new Bounds(extent[0], extent[1], extent[2], extent[3]);
  80486. if (!bounds.intersectsBounds(feaBounds)) {
  80487. continue;
  80488. }
  80489. } //缓存字段
  80490. var fields = feature.id + "_zoom_" + cmZoom.toString();
  80491. var thematicFeature; //判断专题要素缓存是否存在
  80492. if (cache[fields]) {
  80493. cache[fields].updateAndAddShapes();
  80494. } else {
  80495. //如果专题要素缓存不存在,创建专题要素
  80496. thematicFeature = this.createThematicFeature(features[i]); //检查 thematicFeature 是否有可视化图形
  80497. if (thematicFeature.getShapesCount() < 1) {
  80498. continue;
  80499. } //加入缓存
  80500. cache[fields] = thematicFeature;
  80501. cacheFields.push(fields); //缓存数量限制
  80502. if (cacheFields.length > maxCC) {
  80503. var fieldsTemp = cacheFields[0];
  80504. cacheFields.splice(0, 1);
  80505. delete cache[fieldsTemp];
  80506. }
  80507. }
  80508. }
  80509. this.renderer.render(); //地图漫游后,重新高亮图形
  80510. if (hoverFid && this.isHoverAble && this.isMultiHover) {
  80511. var hShapes = this.getShapesByFeatureID(hoverFid);
  80512. this.renderer.updateHoverShapes(hShapes);
  80513. }
  80514. }
  80515. /**
  80516. * @function ol.source.GeoFeature.prototype.createThematicFeature
  80517. * @description 创建专题要素。
  80518. * @param {Object} feature - 要素对象。
  80519. */
  80520. }, {
  80521. key: "createThematicFeature",
  80522. value: function createThematicFeature(feature) {
  80523. var style = Util.copyAttributesWithClip(this.style);
  80524. if (feature.style && this.isAllowFeatureStyle === true) {
  80525. style = Util.copyAttributesWithClip(feature.style);
  80526. } //创建专题要素时的可选参数
  80527. var options = {};
  80528. options.nodesClipPixel = this.nodesClipPixel;
  80529. options.isHoverAble = this.isHoverAble;
  80530. options.isMultiHover = this.isMultiHover;
  80531. options.isClickAble = this.isClickAble;
  80532. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(Vector)
  80533. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  80534. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  80535. this.renderer.addShape(thematicFeature.shapes[m]);
  80536. }
  80537. return thematicFeature;
  80538. }
  80539. }, {
  80540. key: "canvasFunctionInternal_",
  80541. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  80542. // eslint-disable-line no-unused-vars
  80543. return theme_Theme_Theme.prototype.canvasFunctionInternal_.apply(this, arguments);
  80544. }
  80545. /**
  80546. * @function ol.source.GeoFeature.prototype.clearCache
  80547. * @description 清除缓存。
  80548. */
  80549. }, {
  80550. key: "clearCache",
  80551. value: function clearCache() {
  80552. this.cache = {};
  80553. this.cacheFields = [];
  80554. }
  80555. /**
  80556. * @function ol.source.GeoFeature.prototype.clear
  80557. * @description 清除的内容包括数据(features)、专题要素、缓存。
  80558. */
  80559. }, {
  80560. key: "clear",
  80561. value: function clear() {
  80562. this.renderer.clearAll();
  80563. this.renderer.refresh();
  80564. this.removeAllFeatures();
  80565. this.clearCache();
  80566. }
  80567. /**
  80568. * @function ol.source.GeoFeature.prototype.getCacheCount
  80569. * @description 获取当前缓存数量。
  80570. * @returns {number} 返回当前缓存数量。
  80571. */
  80572. }, {
  80573. key: "getCacheCount",
  80574. value: function getCacheCount() {
  80575. return this.cacheFields.length;
  80576. }
  80577. /**
  80578. * @function ol.source.GeoFeature.prototype.setMaxCacheCount
  80579. * @param {number} cacheCount - 缓存总数。
  80580. * @description 设置最大缓存条数。
  80581. */
  80582. }, {
  80583. key: "setMaxCacheCount",
  80584. value: function setMaxCacheCount(cacheCount) {
  80585. if (!isNaN(cacheCount)) {
  80586. this.maxCacheCount = cacheCount;
  80587. this.isCustomSetMaxCacheCount = true;
  80588. }
  80589. }
  80590. /**
  80591. * @function ol.source.GeoFeature.prototype.setMaxCacheCount
  80592. * @param {number} featureID - 要素 ID。
  80593. * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
  80594. */
  80595. }, {
  80596. key: "getShapesByFeatureID",
  80597. value: function getShapesByFeatureID(featureID) {
  80598. var list = [];
  80599. var shapeList = this.renderer.getAllShapes();
  80600. if (!featureID) {
  80601. return shapeList;
  80602. }
  80603. for (var i = 0, len = shapeList.length; i < len; i++) {
  80604. var si = shapeList[i];
  80605. if (si.refDataID && featureID === si.refDataID) {
  80606. list.push(si);
  80607. }
  80608. }
  80609. return list;
  80610. }
  80611. }]);
  80612. return GeoFeature;
  80613. }(theme_Theme_Theme);
  80614. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Label.js
  80615. function overlay_Label_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { overlay_Label_typeof = function _typeof(obj) { return typeof obj; }; } else { overlay_Label_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return overlay_Label_typeof(obj); }
  80616. function overlay_Label_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80617. function overlay_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); } }
  80618. function overlay_Label_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Label_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Label_defineProperties(Constructor, staticProps); return Constructor; }
  80619. function overlay_Label_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Label_get = Reflect.get; } else { overlay_Label_get = function _get(target, property, receiver) { var base = overlay_Label_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return overlay_Label_get(target, property, receiver || target); }
  80620. function overlay_Label_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Label_getPrototypeOf(object); if (object === null) break; } return object; }
  80621. function overlay_Label_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) overlay_Label_setPrototypeOf(subClass, superClass); }
  80622. function overlay_Label_setPrototypeOf(o, p) { overlay_Label_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Label_setPrototypeOf(o, p); }
  80623. function overlay_Label_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Label_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Label_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Label_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Label_possibleConstructorReturn(this, result); }; }
  80624. function overlay_Label_possibleConstructorReturn(self, call) { if (call && (overlay_Label_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Label_assertThisInitialized(self); }
  80625. function overlay_Label_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  80626. function overlay_Label_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  80627. function overlay_Label_getPrototypeOf(o) { overlay_Label_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Label_getPrototypeOf(o); }
  80628. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  80629. * This program are made available under the terms of the Apache License, Version 2.0
  80630. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80631. /**
  80632. * @class ol.source.Label
  80633. * @category Visualization Theme
  80634. * @classdesc 标签专题图图层源。
  80635. * @param {string} name - 名称。
  80636. * @param {Object} opt_options - 参数。
  80637. * @param {ol/Map} opt_options.map - 当前 Map 对象。
  80638. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  80639. * @param {number} [opt_options.opacity=1] - 图层透明度。
  80640. * @param {string|Object} [opt_options.attributions] - 版权信息。
  80641. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  80642. * @param {ol/proj/Projection} [opt_options.projection] - 投影信息。
  80643. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是1或更高。
  80644. * @param {Array.<number>} [opt_options.resolutions] - 分辨率数组。
  80645. * @param {ol/source/State} [opt_options.state] - 资源状态。
  80646. * @param {string} [opt_options.themeField] - 指定创建专题图字段。
  80647. * @param {Object} [opt_options.style] - 专题图样式。
  80648. * @param {Object} [opt_options.styleGroups] - 各专题类型样式组。
  80649. * @param {boolean} [opt_options.isHoverAble = false] - 是否开启 hover 事件。
  80650. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  80651. * @extends {GeoFeature}
  80652. */
  80653. var Label_Label = /*#__PURE__*/function (_GeoFeature) {
  80654. overlay_Label_inherits(Label, _GeoFeature);
  80655. var _super = overlay_Label_createSuper(Label);
  80656. function Label(name, opt_options) {
  80657. var _this;
  80658. overlay_Label_classCallCheck(this, Label);
  80659. _this = _super.call(this, name, opt_options);
  80660. _this.isOverLay = opt_options.isOverLay != null ? opt_options.isOverLay : true;
  80661. _this.isAvoid = opt_options.isAvoid != null ? opt_options.isAvoid : true;
  80662. _this.style = opt_options.style;
  80663. _this.themeField = opt_options.themeField;
  80664. _this.styleGroups = opt_options.styleGroups;
  80665. _this.defaultStyle = {
  80666. //默认文本样式
  80667. fontColor: "#000000",
  80668. fontOpacity: 1,
  80669. fontSize: "12px",
  80670. fontStyle: "normal",
  80671. fontWeight: "normal",
  80672. labelAlign: "cm",
  80673. labelXOffset: 0,
  80674. labelYOffset: 0,
  80675. labelRotation: 0,
  80676. //默认背景框样式
  80677. fill: false,
  80678. fillColor: "#ee9900",
  80679. fillOpacity: 0.4,
  80680. stroke: false,
  80681. strokeColor: "#ee9900",
  80682. strokeOpacity: 1,
  80683. strokeWidth: 1,
  80684. strokeLinecap: "round",
  80685. strokeDashstyle: "solid",
  80686. //对用户隐藏但必须保持此值的属性
  80687. //cursor: "pointer",
  80688. labelSelect: true,
  80689. //用 _isGeoTextStrategyStyle 标记此style,携带此类style的要素特指GeoText策略中的标签要素
  80690. _isGeoTextStrategyStyle: true
  80691. }; //获取标签像素 bounds 的方式。0 - 表示通过文本类容和文本风格计算获取像素范围,现在支持中文、英文; 1 - 表示通过绘制的文本标签获取像素范围,支持各个语种的文字范围获取,但性能消耗较大(尤其是采用SVG渲染)。默认值为0。
  80692. _this.getPxBoundsMode = 0;
  80693. _this.labelFeatures = [];
  80694. return _this;
  80695. }
  80696. /**
  80697. * @function ol.source.Label.prototype.destroy
  80698. * @description 释放资源,将引用资源的属性置空。
  80699. */
  80700. overlay_Label_createClass(Label, [{
  80701. key: "destroy",
  80702. value: function destroy() {
  80703. this.style = null;
  80704. this.themeField = null;
  80705. this.styleGroups = null;
  80706. overlay_Label_get(overlay_Label_getPrototypeOf(Label.prototype), "destroy", this).call(this);
  80707. }
  80708. /**
  80709. * @function ol.source.Label.prototype.createThematicFeature
  80710. * @description 创建专题要素。
  80711. * @param {SuperMap.Feature.Vector} feature - 矢量要素。
  80712. * @returns {SuperMap.Feature.Theme.Vector} 专题图矢量要素。
  80713. */
  80714. }, {
  80715. key: "createThematicFeature",
  80716. value: function createThematicFeature(feature) {
  80717. //赋 style
  80718. var style = this.getStyleByData(feature); //创建专题要素时的可选参数
  80719. var options = {};
  80720. options.nodesClipPixel = this.nodesClipPixel;
  80721. options.isHoverAble = this.isHoverAble;
  80722. options.isMultiHover = this.isMultiHover;
  80723. options.isClickAble = this.isClickAble;
  80724. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(Vector)
  80725. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  80726. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  80727. this.renderer.addShape(thematicFeature.shapes[m]);
  80728. }
  80729. return thematicFeature;
  80730. }
  80731. /**
  80732. * @function ol.source.Label.prototype.redrawThematicFeatures
  80733. * @description 重绘所有专题要素。
  80734. * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
  80735. * 地图漫游时调用此方法进行图层刷新。
  80736. * @param {Array.<number>} bounds - 重绘范围。
  80737. */
  80738. }, {
  80739. key: "redrawThematicFeatures",
  80740. value: function redrawThematicFeatures(bounds) {
  80741. if (this.features.length > 0 && this.labelFeatures.length === 0) {
  80742. var feats = this.setLabelsStyle(this.features);
  80743. for (var i = 0, len = feats.length; i < len; i++) {
  80744. this.labelFeatures.push(feats[i]);
  80745. }
  80746. }
  80747. this.features = this.getDrawnLabels(this.labelFeatures);
  80748. overlay_Label_get(overlay_Label_getPrototypeOf(Label.prototype), "redrawThematicFeatures", this).call(this, bounds);
  80749. }
  80750. /**
  80751. * @function ol.source.Label.prototype.removeFeatures
  80752. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  80753. * @param {SuperMap.Feature.Vector} features - 要删除的要素对象。
  80754. */
  80755. }, {
  80756. key: "removeFeatures",
  80757. value: function removeFeatures(features) {
  80758. // eslint-disable-line no-unused-vars
  80759. this.labelFeatures = [];
  80760. overlay_Label_get(overlay_Label_getPrototypeOf(Label.prototype), "removeFeatures", this).call(this, arguments);
  80761. }
  80762. /**
  80763. * @function ol.source.Label.prototype.removeAllFeatures
  80764. * @description 清除当前图层所有的矢量要素。
  80765. */
  80766. }, {
  80767. key: "removeAllFeatures",
  80768. value: function removeAllFeatures() {
  80769. this.labelFeatures = [];
  80770. overlay_Label_get(overlay_Label_getPrototypeOf(Label.prototype), "removeAllFeatures", this).call(this, arguments);
  80771. }
  80772. /**
  80773. * @function ol.source.Label.prototype.getDrawnLabels
  80774. * @description 获取经(压盖)处理后将要绘制在图层上的标签要素。
  80775. * @param {Array.<SuperMap.Feature.Vector>} labelFeatures - 所有标签要素的数组。
  80776. * @returns {Array.<SuperMap.Feature.Vector>} 最终要绘制的标签要素数组。
  80777. */
  80778. }, {
  80779. key: "getDrawnLabels",
  80780. value: function getDrawnLabels(labelFeatures) {
  80781. var feas = [],
  80782. //最终要绘制的标签要素集
  80783. fea,
  80784. //最终要绘制的标签要素
  80785. fi,
  80786. //临时标签要素,用户的第i个标签
  80787. labelsB = [],
  80788. //不产生压盖的标签要素范围集
  80789. styTmp,
  80790. //用于临时存储要素style的变量
  80791. feaSty,
  80792. //标签要素最终的style
  80793. // styleTemp用于屏蔽文本style中带有偏移性质style属性,偏移已经在计算bounds的过程中参与了运算,
  80794. // 所以在最终按照bounds来绘制标签时,需屏蔽style中带有偏移性质属性,否则文本的偏移量将扩大一倍。
  80795. styleTemp = {
  80796. labelAlign: "cm",
  80797. labelXOffset: 0,
  80798. labelYOffset: 0
  80799. };
  80800. var map = this.map;
  80801. var mapSize = map.getSize();
  80802. mapSize = {
  80803. x: mapSize[0],
  80804. y: mapSize[1]
  80805. };
  80806. var zoom = map.getView().getZoom(); //对用户的每个标签要素进行处理与判断
  80807. for (var i = 0, len = labelFeatures.length; i < len; i++) {
  80808. fi = labelFeatures[i]; //检查fi的style在避让中是否被改变,如果改变,重新设置要素的style
  80809. if (fi.isStyleChange) {
  80810. fi = this.setStyle(fi);
  80811. } //标签最终的中心点像素位置 (偏移后)
  80812. var loc = this.getLabelPxLocation(fi); //过滤掉地图范围外的标签 (偏移后)
  80813. if (loc.x >= 0 && loc.x <= mapSize.x && loc.y >= 0 && loc.y <= mapSize.y) {
  80814. //根据当前地图缩放级别过滤标签
  80815. if (fi.style.minZoomLevel > -1) {
  80816. if (zoom <= fi.style.minZoomLevel) {
  80817. continue;
  80818. }
  80819. }
  80820. if (fi.style.maxZoomLevel > -1) {
  80821. if (zoom > fi.style.maxZoomLevel) {
  80822. continue;
  80823. }
  80824. } //计算标签bounds
  80825. var boundsQuad = null;
  80826. if (fi.isStyleChange) {
  80827. fi.isStyleChange = null;
  80828. boundsQuad = this.calculateLabelBounds(fi, loc);
  80829. } else {
  80830. if (fi.geometry.bsInfo.w && fi.geometry.bsInfo.h) {
  80831. //使用calculateLabelBounds2可以提高bounds的计算效率,尤其是在getPxBoundsMode = 1时
  80832. boundsQuad = this.calculateLabelBounds2(fi, loc);
  80833. } else {
  80834. boundsQuad = this.calculateLabelBounds(fi, loc);
  80835. }
  80836. } //避让处理 -start
  80837. var mapViewBounds = new Bounds(0, mapSize.y, mapSize.x, 0),
  80838. //地图像素范围
  80839. quadlen = boundsQuad.length;
  80840. if (this.isAvoid) {
  80841. var avoidInfo = this.getAvoidInfo(mapViewBounds, boundsQuad); //避让信息
  80842. if (avoidInfo) {
  80843. //横向(x方向)上的避让
  80844. if (avoidInfo.aspectW === "left") {
  80845. fi.style.labelXOffset += avoidInfo.offsetX;
  80846. for (var j = 0; j < quadlen; j++) {
  80847. boundsQuad[j].x += avoidInfo.offsetX;
  80848. }
  80849. } else if (avoidInfo.aspectW === "right") {
  80850. fi.style.labelXOffset += -avoidInfo.offsetX;
  80851. for (var _j = 0; _j < quadlen; _j++) {
  80852. boundsQuad[_j].x += -avoidInfo.offsetX;
  80853. }
  80854. } //纵向(y方向)上的避让
  80855. if (avoidInfo.aspectH === "top") {
  80856. fi.style.labelYOffset += avoidInfo.offsetY;
  80857. for (var _j2 = 0; _j2 < quadlen; _j2++) {
  80858. boundsQuad[_j2].y += avoidInfo.offsetY;
  80859. }
  80860. } else if (avoidInfo.aspectH === "bottom") {
  80861. fi.style.labelYOffset += -avoidInfo.offsetY;
  80862. for (var _j3 = 0; _j3 < quadlen; _j3++) {
  80863. boundsQuad[_j3].y += -avoidInfo.offsetY;
  80864. }
  80865. } //如果style发生变化,记录下来
  80866. fi.isStyleChange = true;
  80867. }
  80868. } //避让处理 -end
  80869. //压盖处理 -start
  80870. if (this.isOverLay) {
  80871. //是否压盖
  80872. var isOL = false;
  80873. if (i != 0) {
  80874. for (var _j4 = 0; _j4 < labelsB.length; _j4++) {
  80875. //压盖判断
  80876. if (this.isQuadrilateralOverLap(boundsQuad, labelsB[_j4])) {
  80877. isOL = true;
  80878. break;
  80879. }
  80880. }
  80881. }
  80882. if (isOL) {
  80883. continue;
  80884. } else {
  80885. labelsB.push(boundsQuad);
  80886. }
  80887. } //压盖处理 -end
  80888. //将标签像素范围转为地理范围
  80889. var geoBs = [];
  80890. for (var _j5 = 0; _j5 < quadlen - 1; _j5++) {
  80891. geoBs.push(map.getCoordinateFromPixel([boundsQuad[_j5].x, boundsQuad[_j5].y]));
  80892. } //屏蔽有偏移性质的style属性,偏移量在算bounds时已经加入计算
  80893. var bounds = new Bounds(geoBs[3][0], geoBs[3][1], geoBs[1][0], [geoBs[1][1]]);
  80894. var center = bounds.getCenterLonLat();
  80895. var label = new GeoText(center.lon, center.lat, fi.attributes[this.themeField]);
  80896. label.calculateBounds();
  80897. styTmp = Util.cloneObject(fi.style);
  80898. feaSty = Util.cloneObject(Util.copyAttributes(styTmp, styleTemp));
  80899. fea = new Vector(label, fi.attributes, feaSty); //赋予id
  80900. fea.id = fi.id;
  80901. fea.fid = fi.fid;
  80902. feas.push(fea);
  80903. }
  80904. } //返回最终要绘制的标签要素
  80905. return feas;
  80906. }
  80907. /**
  80908. * @function ol.source.Label.prototype.getStyleByData
  80909. * @description 根据用户数据(feature)设置专题要素的 Style。
  80910. * @param {SuperMap.Feature.Vector} feat - 矢量要素对象。
  80911. * @returns {Array.<SuperMap.ThemeStyle>} 专题要素的 Style。
  80912. */
  80913. }, {
  80914. key: "getStyleByData",
  80915. value: function getStyleByData(feat) {
  80916. var feature = feat;
  80917. feature.style = Util.copyAttributes(feature.style, this.defaultStyle); //将style赋给标签
  80918. if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
  80919. this.style.fontSize = "12px";
  80920. }
  80921. feature.style = Util.copyAttributes(feature.style, this.style);
  80922. if (this.themeField && this.styleGroups && feature.attributes) {
  80923. var Sf = this.themeField;
  80924. var attributes = feature.attributes;
  80925. var groups = this.styleGroups;
  80926. var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
  80927. var attr = null; //属性值
  80928. for (var property in attributes) {
  80929. if (Sf === property) {
  80930. isSfInAttrs = true;
  80931. attr = attributes[property];
  80932. break;
  80933. }
  80934. } //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
  80935. if (isSfInAttrs) {
  80936. for (var i = 0, len = groups.length; i < len; i++) {
  80937. if (attr >= groups[i].start && attr < groups[i].end) {
  80938. var sty1 = groups[i].style;
  80939. if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
  80940. sty1.fontSize = "12px";
  80941. }
  80942. feature.style = Util.copyAttributes(feature.style, sty1);
  80943. }
  80944. }
  80945. }
  80946. feature.style.label = feature.attributes[this.themeField];
  80947. }
  80948. return feature.style;
  80949. }
  80950. /**
  80951. * @function ol.source.Label.prototype.setLabelsStyle
  80952. * @description 设置标签要素的 Style。
  80953. * @param {Array.<SuperMap.Feature.Vector>} labelFeatures - 需要设置 Style 的标签要素数组。
  80954. * @returns {Array.<SuperMap.Feature.Vector>} 赋予 Style 后的标签要素数组。
  80955. */
  80956. }, {
  80957. key: "setLabelsStyle",
  80958. value: function setLabelsStyle(labelFeatures) {
  80959. var fea,
  80960. labelFeas = [];
  80961. for (var i = 0, len = labelFeatures.length; i < len; i++) {
  80962. var feature = labelFeatures[i];
  80963. if (feature.geometry.CLASS_NAME === "SuperMap.Geometry.GeoText") {
  80964. //设置标签的Style
  80965. if (feature.geometry.bsInfo.w || feature.geometry.bsInfo.h) {
  80966. feature.geometry.bsInfo.w = null;
  80967. feature.geometry.bsInfo.h = null;
  80968. feature.geometry.labelWTmp = null;
  80969. }
  80970. fea = this.setStyle(feature); //为标签要素指定图层
  80971. fea.layer = this.layer;
  80972. labelFeas.push(fea);
  80973. } else {
  80974. return labelFeatures;
  80975. }
  80976. }
  80977. return labelFeas;
  80978. }
  80979. /**
  80980. * @function ol.source.Label.prototype.setStyle
  80981. * @description 设置标签要素的 Style。
  80982. * @param {SuperMap.Feature.Vector} feat - 需要赋予 style 的要素。
  80983. */
  80984. }, {
  80985. key: "setStyle",
  80986. value: function setStyle(feat) {
  80987. var feature = feat;
  80988. feature.style = Util.copyAttributes(feature.style, this.defaultStyle); //将style赋给标签
  80989. if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
  80990. this.style.fontSize = "12px";
  80991. }
  80992. feature.style = Util.copyAttributes(feature.style, this.style);
  80993. if (this.groupField && this.styleGroups && feature.attributes) {
  80994. var Sf = this.groupField;
  80995. var attributes = feature.attributes;
  80996. var groups = this.styleGroups;
  80997. var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
  80998. var attr = null; //属性值
  80999. for (var property in attributes) {
  81000. if (Sf === property) {
  81001. isSfInAttrs = true;
  81002. attr = attributes[property];
  81003. break;
  81004. }
  81005. } //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
  81006. if (isSfInAttrs) {
  81007. for (var i = 0, len = groups.length; i < len; i++) {
  81008. if (attr >= groups[i].start && attr < groups[i].end) {
  81009. var sty1 = groups[i].style;
  81010. if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
  81011. sty1.fontSize = "12px";
  81012. }
  81013. feature.style = Util.copyAttributes(feature.style, sty1);
  81014. }
  81015. }
  81016. }
  81017. } //将文本内容赋到标签要素的style上
  81018. feature.style.label = feature.geometry.text;
  81019. return feature;
  81020. }
  81021. /**
  81022. * @function ol.source.Label.prototype.getLabelPxLocation
  81023. * @description 获取标签要素的像素坐标。
  81024. * @param {SuperMap.Feature.Vector} feature - 标签要素。
  81025. * @returns {Object} 标签位置,例如:{"x":1,"y":1}。
  81026. */
  81027. }, {
  81028. key: "getLabelPxLocation",
  81029. value: function getLabelPxLocation(feature) {
  81030. var geoText = feature.geometry;
  81031. var styleTmp = feature.style; //将标签的地理位置转为像素位置
  81032. var locationTmp = geoText.getCentroid();
  81033. var locTmp = this.map.getPixelFromCoordinate([locationTmp.x, locationTmp.y]);
  81034. var loc = new (external_ol_geom_Point_default())([locTmp[0], locTmp[1]]); //偏移处理
  81035. if (styleTmp.labelXOffset || styleTmp.labelYOffset) {
  81036. var xOffset = isNaN(styleTmp.labelXOffset) ? 0 : styleTmp.labelXOffset;
  81037. var yOffset = isNaN(styleTmp.labelYOffset) ? 0 : styleTmp.labelYOffset;
  81038. loc.translate(xOffset, -yOffset);
  81039. }
  81040. return {
  81041. x: loc.getCoordinates()[0],
  81042. y: loc.getCoordinates()[1]
  81043. };
  81044. }
  81045. /**
  81046. * @function ol.source.Label.prototype.calculateLabelBounds
  81047. * @description 获得标签要素的最终范围。
  81048. * @param {SuperMap.Feature.Vector} feature - 需要计算bounds的标签要素数。
  81049. * @param {Object} loc - 标签位置,例如:{"x":1,"y":1}。
  81050. * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  81051. */
  81052. }, {
  81053. key: "calculateLabelBounds",
  81054. value: function calculateLabelBounds(feature, loc) {
  81055. var geoText = feature.geometry; //标签范围(未旋转前)
  81056. var labB = null;
  81057. var labelInfo = null; //获取bounds的方式
  81058. if (this.getPxBoundsMode == 0) {
  81059. labB = geoText.getLabelPxBoundsByText(loc, feature.style);
  81060. } else if (this.getPxBoundsMode === 1) {
  81061. //canvas
  81062. labelInfo = this.getLabelInfo(feature.geometry.getCentroid(), feature.style);
  81063. labB = geoText.getLabelPxBoundsByLabel(loc, labelInfo.w, labelInfo.h, feature.style);
  81064. } else {
  81065. return null;
  81066. } //旋转Bounds
  81067. var boundsQuad = [];
  81068. if (feature.style.labelRotation % 180 == 0) {
  81069. boundsQuad = [{
  81070. "x": labB.left,
  81071. "y": labB.top
  81072. }, {
  81073. "x": labB.right,
  81074. "y": labB.top
  81075. }, {
  81076. "x": labB.right,
  81077. "y": labB.bottom
  81078. }, {
  81079. "x": labB.left,
  81080. "y": labB.bottom
  81081. }, {
  81082. "x": labB.left,
  81083. "y": labB.top
  81084. }];
  81085. } else {
  81086. boundsQuad = this.rotationBounds(labB, loc, feature.style.labelRotation);
  81087. } //重置GeoText的bounds
  81088. geoText.bounds = new Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
  81089. return boundsQuad;
  81090. }
  81091. /**
  81092. * @function ol.source.Label.prototype.calculateLabelBounds2
  81093. * @description 获得标签要素的最终范围的另一种算法(通过记录下的标签宽高),提高计算 bounds 的效率。
  81094. * @param {SuperMap.Feature.Vector} feature - 需要计算 bounds 的标签要素数。
  81095. * @param {Object} loc - 标签位置,例如:{"x":1,"y":1}。
  81096. * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  81097. */
  81098. }, {
  81099. key: "calculateLabelBounds2",
  81100. value: function calculateLabelBounds2(feature, loc) {
  81101. var labB, left, bottom, top, right;
  81102. var labelSize = feature.geometry.bsInfo;
  81103. var style = feature.style;
  81104. var locationPx = Util.cloneObject(loc); //处理文字对齐
  81105. if (style.labelAlign && style.labelAlign !== "cm") {
  81106. switch (style.labelAlign) {
  81107. case "lt":
  81108. locationPx.x += labelSize.w / 2;
  81109. locationPx.y += labelSize.h / 2;
  81110. break;
  81111. case "lm":
  81112. locationPx.x += labelSize.w / 2;
  81113. break;
  81114. case "lb":
  81115. locationPx.x += labelSize.w / 2;
  81116. locationPx.y -= labelSize.h / 2;
  81117. break;
  81118. case "ct":
  81119. locationPx.y += labelSize.h / 2;
  81120. break;
  81121. case "cb":
  81122. locationPx.y -= labelSize.h / 2;
  81123. break;
  81124. case "rt":
  81125. locationPx.x -= labelSize.w / 2;
  81126. locationPx.y += labelSize.h / 2;
  81127. break;
  81128. case "rm":
  81129. locationPx.x -= labelSize.w / 2;
  81130. break;
  81131. case "rb":
  81132. locationPx.x -= labelSize.w / 2;
  81133. locationPx.y -= labelSize.h / 2;
  81134. break;
  81135. default:
  81136. break;
  81137. }
  81138. }
  81139. left = locationPx.x - labelSize.w / 2;
  81140. bottom = locationPx.y + labelSize.h / 2; //处理斜体字
  81141. if (style.fontStyle && style.fontStyle === "italic") {
  81142. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  81143. } else {
  81144. right = locationPx.x + labelSize.w / 2;
  81145. }
  81146. top = locationPx.y - labelSize.h / 2;
  81147. labB = new Bounds(left, bottom, right, top); //旋转Bounds
  81148. var boundsQuad = [];
  81149. if (style.labelRotation % 180 == 0) {
  81150. boundsQuad = [{
  81151. "x": labB.left,
  81152. "y": labB.top
  81153. }, {
  81154. "x": labB.right,
  81155. "y": labB.top
  81156. }, {
  81157. "x": labB.right,
  81158. "y": labB.bottom
  81159. }, {
  81160. "x": labB.left,
  81161. "y": labB.bottom
  81162. }, {
  81163. "x": labB.left,
  81164. "y": labB.top
  81165. }];
  81166. } else {
  81167. boundsQuad = this.rotationBounds(labB, loc, style.labelRotation);
  81168. } //重置GeoText的bounds
  81169. feature.geometry.bounds = new Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
  81170. return boundsQuad;
  81171. }
  81172. /**
  81173. * @function ol.source.Label.prototype.getLabelInfo
  81174. * @description 根据当前位置获取绘制后的标签信息,包括标签的宽,高和行数等。
  81175. * @returns {Object} 绘制后的标签信息。
  81176. */
  81177. }, {
  81178. key: "getLabelInfo",
  81179. value: function getLabelInfo(location, style) {
  81180. var LABEL_ALIGN = {
  81181. "l": "left",
  81182. "r": "right",
  81183. "t": "top",
  81184. "b": "bottom"
  81185. },
  81186. LABEL_FACTOR = {
  81187. "l": 0,
  81188. "r": -1,
  81189. "t": 0,
  81190. "b": -1
  81191. };
  81192. style = Util.extend({
  81193. fontColor: "#000000",
  81194. labelAlign: "cm"
  81195. }, style);
  81196. var pt = this.getLocalXY(location);
  81197. var labelWidth = 0;
  81198. if (style.labelXOffset || style.labelYOffset) {
  81199. var xOffset = isNaN(style.labelXOffset) ? 0 : style.labelXOffset;
  81200. var yOffset = isNaN(style.labelYOffset) ? 0 : style.labelYOffset;
  81201. pt[0] += xOffset;
  81202. pt[1] -= yOffset;
  81203. }
  81204. var canvas = document.createElement('canvas');
  81205. canvas.globalAlpha = 0;
  81206. canvas.lineWidth = 1;
  81207. var ctx = canvas.getContext("2d");
  81208. ctx.fillStyle = style.fontColor;
  81209. ctx.globalAlpha = style.fontOpacity || 1.0;
  81210. 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(" ");
  81211. var labelRows = style.label.split('\n');
  81212. var numRows = labelRows.length;
  81213. var vfactor, lineHeight, labelWidthTmp;
  81214. if (ctx.fillText) {
  81215. // HTML5
  81216. ctx.font = fontStyle;
  81217. ctx.textAlign = LABEL_ALIGN[style.labelAlign[0]] || "center";
  81218. ctx.textBaseline = LABEL_ALIGN[style.labelAlign[1]] || "middle";
  81219. vfactor = LABEL_FACTOR[style.labelAlign[1]];
  81220. if (vfactor == null) {
  81221. vfactor = -.5;
  81222. }
  81223. lineHeight = ctx.measureText('Mg').height || ctx.measureText('xx').width;
  81224. pt[1] += lineHeight * vfactor * (numRows - 1);
  81225. for (var i = 0; i < numRows; i++) {
  81226. labelWidthTmp = ctx.measureText(labelRows[i]).width;
  81227. if (labelWidth < labelWidthTmp) {
  81228. labelWidth = labelWidthTmp;
  81229. }
  81230. }
  81231. } else if (ctx.mozDrawText) {
  81232. // Mozilla pre-Gecko1.9.1 (<FF3.1)
  81233. ctx.mozTextStyle = fontStyle;
  81234. vfactor = LABEL_FACTOR[style.labelAlign[1]];
  81235. if (vfactor == null) {
  81236. vfactor = -.5;
  81237. }
  81238. lineHeight = ctx.mozMeasureText('xx');
  81239. pt[1] += lineHeight * (1 + vfactor * numRows);
  81240. for (var _i = 0; _i < numRows; _i++) {
  81241. labelWidthTmp = ctx.measureText(labelRows[_i]).width;
  81242. if (labelWidth < labelWidthTmp) {
  81243. labelWidth = labelWidthTmp;
  81244. }
  81245. }
  81246. }
  81247. var labelInfo = {}; //标签信息
  81248. if (labelWidth) {
  81249. labelInfo.w = labelWidth; //标签的宽
  81250. } else {
  81251. return null;
  81252. }
  81253. labelInfo.h = style.fontSize; //一行标签的高
  81254. labelInfo.rows = labelRows.length; //标签的行数
  81255. return labelInfo;
  81256. }
  81257. /**
  81258. * @function ol.source.Label.prototype.rotationBounds
  81259. * @description 旋转 bounds。
  81260. * @param {SuperMap.Bounds} bounds - 要旋转的 bounds。
  81261. * @param {Object} rotationCenterPoi - 旋转中心点对象,此对象含有属性 x(横坐标),属性 y(纵坐标)。
  81262. * @param {number} angle - 旋转角度(顺时针)。
  81263. * @returns {Array.<Object>} bounds 旋转后形成的多边形节点数组。是一个四边形,形如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  81264. */
  81265. }, {
  81266. key: "rotationBounds",
  81267. value: function rotationBounds(bounds, rotationCenterPoi, angle) {
  81268. var ltPoi = new (external_ol_geom_Point_default())([bounds.left, bounds.top]);
  81269. var rtPoi = new (external_ol_geom_Point_default())([bounds.right, bounds.top]);
  81270. var rbPoi = new (external_ol_geom_Point_default())([bounds.right, bounds.bottom]);
  81271. var lbPoi = new (external_ol_geom_Point_default())([bounds.left, bounds.bottom]);
  81272. var ver = [];
  81273. ver.push(this.getRotatedLocation(ltPoi.getCoordinates()[0], ltPoi.getCoordinates()[1], rotationCenterPoi.x, rotationCenterPoi.y, angle));
  81274. ver.push(this.getRotatedLocation(rtPoi.getCoordinates()[0], rtPoi.getCoordinates()[1], rotationCenterPoi.x, rotationCenterPoi.y, angle));
  81275. ver.push(this.getRotatedLocation(rbPoi.getCoordinates()[0], rbPoi.getCoordinates()[1], rotationCenterPoi.x, rotationCenterPoi.y, angle));
  81276. ver.push(this.getRotatedLocation(lbPoi.getCoordinates()[0], lbPoi.getCoordinates()[1], rotationCenterPoi.x, rotationCenterPoi.y, angle)); //bounds旋转后形成的多边形节点数组
  81277. var quad = [];
  81278. for (var i = 0; i < ver.length; i++) {
  81279. quad.push({
  81280. "x": ver[i].x,
  81281. "y": ver[i].y
  81282. });
  81283. }
  81284. quad.push({
  81285. "x": ver[0].x,
  81286. "y": ver[0].y
  81287. });
  81288. return quad;
  81289. }
  81290. /**
  81291. * @function ol.source.Label.prototype.getRotatedLocation
  81292. * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)。
  81293. * @param {number} x - 旋转点横坐标。
  81294. * @param {number} y - 旋转点纵坐标。
  81295. * @param {number} rx - 旋转中心点横坐标。
  81296. * @param {number} ry - 旋转中心点纵坐标。
  81297. * @param {number} angle - 旋转角度
  81298. * @returns {Object} 旋转后的坐标位置对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  81299. */
  81300. }, {
  81301. key: "getRotatedLocation",
  81302. value: function getRotatedLocation(x, y, rx, ry, angle) {
  81303. var loc = {},
  81304. x0,
  81305. y0;
  81306. y = -y;
  81307. ry = -ry;
  81308. angle = -angle; //顺时针旋转
  81309. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  81310. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  81311. loc.x = x0;
  81312. loc.y = -y0;
  81313. return loc;
  81314. }
  81315. /**
  81316. * @function ol.source.Label.prototype.getAvoidInfo
  81317. * @description 获取避让的信息。
  81318. * @param {SuperMap.Bounds} bounds - 地图像素范围。
  81319. * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  81320. * @returns {Object} 避让的信息。
  81321. */
  81322. }, {
  81323. key: "getAvoidInfo",
  81324. value: function getAvoidInfo(bounds, quadrilateral) {
  81325. if (quadrilateral.length !== 5) {
  81326. return null;
  81327. } //不是四边形
  81328. //将bound序列化为点数组形式
  81329. var bounddQuad = [{
  81330. "x": bounds.left,
  81331. "y": bounds.top
  81332. }, {
  81333. "x": bounds.right,
  81334. "y": bounds.top
  81335. }, {
  81336. "x": bounds.right,
  81337. "y": bounds.bottom
  81338. }, {
  81339. "x": bounds.left,
  81340. "y": bounds.bottom
  81341. }, {
  81342. "x": bounds.left,
  81343. "y": bounds.top
  81344. }];
  81345. var isIntersection = false,
  81346. bqLen = bounddQuad.length,
  81347. quadLen = quadrilateral.length;
  81348. var offsetX = 0,
  81349. offsetY = 0,
  81350. aspectH = "",
  81351. aspectW = "";
  81352. for (var i = 0; i < bqLen - 1; i++) {
  81353. for (var j = 0; j < quadLen - 1; j++) {
  81354. var isLineIn = Util.lineIntersection(bounddQuad[i], bounddQuad[i + 1], quadrilateral[j], quadrilateral[j + 1]);
  81355. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  81356. //设置避让信息
  81357. setInfo(quadrilateral[j]);
  81358. setInfo(quadrilateral[j + 1]);
  81359. isIntersection = true;
  81360. }
  81361. }
  81362. }
  81363. if (isIntersection) {
  81364. //组织避让操作所需的信息
  81365. return {
  81366. "aspectW": aspectW,
  81367. "aspectH": aspectH,
  81368. "offsetX": offsetX,
  81369. "offsetY": offsetY
  81370. };
  81371. } else {
  81372. return null;
  81373. } //内部函数:设置避让信息
  81374. //参数:vec-{Object} quadrilateral四边形单个节点。如:{"x":1,"y":1}。
  81375. function setInfo(vec) {
  81376. //四边形不在bounds内的节点
  81377. if (!bounds.contains(vec.x, vec.y)) {
  81378. //bounds的Top边
  81379. if (vec.y < bounds.top) {
  81380. var oY = Math.abs(bounds.top - vec.y);
  81381. if (oY > offsetY) {
  81382. offsetY = oY;
  81383. aspectH = "top";
  81384. }
  81385. } //bounds的Bottom边
  81386. if (vec.y > bounds.bottom) {
  81387. var _oY = Math.abs(vec.y - bounds.bottom);
  81388. if (_oY > offsetY) {
  81389. offsetY = _oY;
  81390. aspectH = "bottom";
  81391. }
  81392. } //bounds的left边
  81393. if (vec.x < bounds.left) {
  81394. var oX = Math.abs(bounds.left - vec.x);
  81395. if (oX > offsetX) {
  81396. offsetX = oX;
  81397. aspectW = "left";
  81398. }
  81399. } //bounds的right边
  81400. if (vec.x > bounds.right) {
  81401. var _oX = Math.abs(vec.x - bounds.right);
  81402. if (_oX > offsetX) {
  81403. offsetX = _oX;
  81404. aspectW = "right";
  81405. }
  81406. }
  81407. }
  81408. }
  81409. }
  81410. /**
  81411. * @function ol.source.Label.prototype.isQuadrilateralOverLap
  81412. * @description 判断两个四边形是否有压盖。
  81413. * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  81414. * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
  81415. * @returns {boolean} 是否压盖,true 表示压盖。
  81416. */
  81417. }, {
  81418. key: "isQuadrilateralOverLap",
  81419. value: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
  81420. var quadLen = quadrilateral.length,
  81421. quad2Len = quadrilateral2.length;
  81422. if (quadLen !== 5 || quad2Len !== 5) {
  81423. return null;
  81424. } //不是四边形
  81425. var OverLap = false; //如果两四边形互不包含对方的节点,则两个四边形不相交
  81426. for (var i = 0; i < quadLen; i++) {
  81427. if (this.isPointInPoly(quadrilateral[i], quadrilateral2)) {
  81428. OverLap = true;
  81429. break;
  81430. }
  81431. }
  81432. for (var _i2 = 0; _i2 < quad2Len; _i2++) {
  81433. if (this.isPointInPoly(quadrilateral2[_i2], quadrilateral)) {
  81434. OverLap = true;
  81435. break;
  81436. }
  81437. } //加上两矩形十字相交的情况
  81438. for (var _i3 = 0; _i3 < quadLen - 1; _i3++) {
  81439. if (OverLap) {
  81440. break;
  81441. }
  81442. for (var j = 0; j < quad2Len - 1; j++) {
  81443. var isLineIn = Util.lineIntersection(quadrilateral[_i3], quadrilateral[_i3 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
  81444. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  81445. OverLap = true;
  81446. break;
  81447. }
  81448. }
  81449. }
  81450. return OverLap;
  81451. }
  81452. /**
  81453. * @function ol.source.Label.prototype.isPointInPoly
  81454. * @description 判断一个点是否在多边形里面(射线法)。
  81455. * @param {Object} pt - 需要判定的点对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  81456. * @param {Array.<Object>} poly - 多边形节点数组。例如一个四边形:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  81457. * @returns {boolean} 点是否在多边形内。
  81458. */
  81459. }, {
  81460. key: "isPointInPoly",
  81461. value: function isPointInPoly(pt, poly) {
  81462. for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
  81463. (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);
  81464. }
  81465. return isIn;
  81466. }
  81467. }, {
  81468. key: "canvasFunctionInternal_",
  81469. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  81470. // eslint-disable-line no-unused-vars
  81471. return overlay_Label_get(overlay_Label_getPrototypeOf(Label.prototype), "canvasFunctionInternal_", this).apply(this, arguments);
  81472. }
  81473. }]);
  81474. return Label;
  81475. }(GeoFeature);
  81476. ;// CONCATENATED MODULE: ./src/openlayers/overlay/mapv/MapvCanvasLayer.js
  81477. function MapvCanvasLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  81478. function MapvCanvasLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  81479. function MapvCanvasLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapvCanvasLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapvCanvasLayer_defineProperties(Constructor, staticProps); return Constructor; }
  81480. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  81481. * This program are made available under the terms of the Apache License, Version 2.0
  81482. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81483. /**
  81484. * @class ol.supermap.MapvCanvasLayer
  81485. * @classdesc Mapv 渲染器。
  81486. * @private
  81487. * @param {Object} options - 参数。
  81488. * @param {number} options.width - 画布宽。
  81489. * @param {number} options.height - 画布高。
  81490. * @param {string} [options.paneName='mapPane'] - 窗口名。
  81491. * @param {string} [options.context='2d'] - 内容。
  81492. * @param {number} [options.zIndex=2] - 层级。
  81493. * @param {string} [options.mixBlendMode] - 最小混合模式。
  81494. */
  81495. var MapvCanvasLayer = /*#__PURE__*/function () {
  81496. function MapvCanvasLayer(options) {
  81497. MapvCanvasLayer_classCallCheck(this, MapvCanvasLayer);
  81498. this.options = options || {};
  81499. this.enableMassClear = this.options.enableMassClear;
  81500. this._map = options.map;
  81501. this.paneName = this.options.paneName || 'mapPane';
  81502. this.context = this.options.context || '2d';
  81503. this.zIndex = this.options.zIndex || 2;
  81504. this.mixBlendMode = this.options.mixBlendMode || null;
  81505. this.width = options.width;
  81506. this.height = options.height;
  81507. this.initialize();
  81508. }
  81509. MapvCanvasLayer_createClass(MapvCanvasLayer, [{
  81510. key: "initialize",
  81511. value: function initialize() {
  81512. var canvas = this.canvas = document.createElement("canvas");
  81513. canvas.style.cssText = "position:absolute;" + "left:0;" + "top:0;" + "z-index:" + this.zIndex + ";user-select:none;";
  81514. canvas.style.mixBlendMode = this.mixBlendMode;
  81515. canvas.className = "mapvClass";
  81516. var global$2 = typeof window === 'undefined' ? {} : window;
  81517. var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio || 1;
  81518. canvas.width = parseInt(this.width) * devicePixelRatio;
  81519. canvas.height = parseInt(this.height) * devicePixelRatio;
  81520. if (this.context === '2d') {
  81521. canvas.getContext(this.context).scale(devicePixelRatio, devicePixelRatio);
  81522. }
  81523. canvas.style.width = this.width + "px";
  81524. canvas.style.height = this.height + "px";
  81525. if (this.context === 'webgl') {
  81526. this.canvas.getContext(this.context).viewport(0, 0, canvas.width, canvas.height);
  81527. }
  81528. }
  81529. /**
  81530. * @function ol.supermap.MapvCanvasLayer.prototype.draw
  81531. * @description 生成地图。
  81532. */
  81533. }, {
  81534. key: "draw",
  81535. value: function draw() {
  81536. this.options.update && this.options.update.call(this);
  81537. }
  81538. /**
  81539. * @function ol.supermap.MapvCanvasLayer.prototype.resize
  81540. * @param {number} mapWidth - 地图宽度。
  81541. * @param {number} mapHeight - 地图高度。
  81542. * @description 调整地图大小。
  81543. */
  81544. }, {
  81545. key: "resize",
  81546. value: function resize(mapWidth, mapHeight) {
  81547. var global$2 = typeof window === 'undefined' ? {} : window;
  81548. var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio || 1;
  81549. this.canvas.width = mapWidth * devicePixelRatio;
  81550. this.canvas.height = mapHeight * devicePixelRatio;
  81551. if (this.context === '2d') {
  81552. this.canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio);
  81553. }
  81554. this.canvas.style.width = mapWidth + "px";
  81555. this.canvas.style.height = mapHeight + "px";
  81556. if (this.context === 'webgl') {
  81557. this.canvas.getContext(this.context).viewport(0, 0, this.canvas.width, this.canvas.height);
  81558. }
  81559. }
  81560. /**
  81561. * @function ol.supermap.MapvCanvasLayer.prototype.getContainer
  81562. * @description 获取容器。
  81563. * @returns {Element} 包含 Mapv 图层的 DOM 对象。
  81564. */
  81565. }, {
  81566. key: "getContainer",
  81567. value: function getContainer() {
  81568. return this.canvas;
  81569. }
  81570. /**
  81571. * @function ol.supermap.MapvCanvasLayer.prototype.setZIndex
  81572. * @param {number} zIndex - 层级参数。
  81573. * @description 设置图层层级。
  81574. */
  81575. }, {
  81576. key: "setZIndex",
  81577. value: function setZIndex(zIndex) {
  81578. this.canvas.style.zIndex = zIndex;
  81579. }
  81580. /**
  81581. * @function ol.supermap.MapvCanvasLayer.prototype.getZIndex
  81582. * @description 获取图层层级。
  81583. */
  81584. }, {
  81585. key: "getZIndex",
  81586. value: function getZIndex() {
  81587. return this.zIndex;
  81588. }
  81589. }]);
  81590. return MapvCanvasLayer;
  81591. }();
  81592. ;// CONCATENATED MODULE: external "function(){try{return mapv}catch(e){return {}}}()"
  81593. var external_function_try_return_mapv_catch_e_return_namespaceObject = function(){try{return mapv}catch(e){return {}}}();
  81594. ;// CONCATENATED MODULE: external "ol.interaction.Pointer"
  81595. var external_ol_interaction_Pointer_namespaceObject = ol.interaction.Pointer;
  81596. var external_ol_interaction_Pointer_default = /*#__PURE__*/__webpack_require__.n(external_ol_interaction_Pointer_namespaceObject);
  81597. ;// CONCATENATED MODULE: ./src/openlayers/overlay/mapv/MapvLayer.js
  81598. function MapvLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MapvLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { MapvLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MapvLayer_typeof(obj); }
  81599. function MapvLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  81600. function MapvLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  81601. function MapvLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapvLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapvLayer_defineProperties(Constructor, staticProps); return Constructor; }
  81602. function MapvLayer_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { MapvLayer_get = Reflect.get; } else { MapvLayer_get = function _get(target, property, receiver) { var base = MapvLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return MapvLayer_get(target, property, receiver || target); }
  81603. function MapvLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapvLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  81604. function MapvLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MapvLayer_setPrototypeOf(subClass, superClass); }
  81605. function MapvLayer_setPrototypeOf(o, p) { MapvLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapvLayer_setPrototypeOf(o, p); }
  81606. function MapvLayer_createSuper(Derived) { var hasNativeReflectConstruct = MapvLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MapvLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MapvLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MapvLayer_possibleConstructorReturn(this, result); }; }
  81607. function MapvLayer_possibleConstructorReturn(self, call) { if (call && (MapvLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return MapvLayer_assertThisInitialized(self); }
  81608. function MapvLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  81609. function MapvLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  81610. function MapvLayer_getPrototypeOf(o) { MapvLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapvLayer_getPrototypeOf(o); }
  81611. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  81612. * This program are made available under the terms of the Apache License, Version 2.0
  81613. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81614. var BaiduMapLayer = external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer ? external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer.__proto__ : Function;
  81615. /**
  81616. * @class MapvLayer
  81617. * @classdesc MapV 图层类。
  81618. * @private
  81619. * @param {Object} map - 地图。
  81620. * @param {Mapv.DataSet} [dataSet] - 数据集。
  81621. * @param {Object} options - 参数。
  81622. * @param {number} mapWidth - 地图宽度。
  81623. * @param {number} mapHeight - 地图高度。
  81624. * @param {Object} source - 资源。
  81625. * @param {number} options.width - 画布宽。
  81626. * @param {number} options.height - 画布高。
  81627. * @param {string} [options.paneName='mapPane'] - 窗口名。
  81628. * @param {string} [options.context] - 内容。
  81629. * @param {number} [options.zIndex] - 层级。
  81630. * @param {string} [options.mixBlendMode] - 最小混合模式。
  81631. * @extends {Mapv.BaiduMapLayer}
  81632. */
  81633. var MapvLayer = /*#__PURE__*/function (_BaiduMapLayer) {
  81634. MapvLayer_inherits(MapvLayer, _BaiduMapLayer);
  81635. var _super = MapvLayer_createSuper(MapvLayer);
  81636. function MapvLayer(map, dataSet, options, mapWidth, mapHeight, source) {
  81637. var _this;
  81638. MapvLayer_classCallCheck(this, MapvLayer);
  81639. _this = _super.call(this, map, dataSet, options);
  81640. _this.dataSet = dataSet;
  81641. _this.mapWidth = mapWidth;
  81642. _this.mapHeight = mapHeight;
  81643. var self = MapvLayer_assertThisInitialized(_this);
  81644. options = options || {};
  81645. _this.source = source;
  81646. self.animator = null;
  81647. self.map = map;
  81648. self.init(options);
  81649. self.argCheck(options);
  81650. _this.canvasLayer = new MapvCanvasLayer({
  81651. map: map,
  81652. context: _this.context,
  81653. paneName: options.paneName,
  81654. mixBlendMode: options.mixBlendMode,
  81655. enableMassClear: options.enableMassClear,
  81656. zIndex: options.zIndex,
  81657. width: mapWidth,
  81658. height: mapHeight,
  81659. update: function update() {
  81660. self._canvasUpdate();
  81661. }
  81662. });
  81663. _this.clickEvent = _this.clickEvent.bind(MapvLayer_assertThisInitialized(_this));
  81664. _this.mousemoveEvent = _this.mousemoveEvent.bind(MapvLayer_assertThisInitialized(_this));
  81665. map.on('movestart', _this.moveStartEvent.bind(MapvLayer_assertThisInitialized(_this)));
  81666. map.on('moveend', _this.moveEndEvent.bind(MapvLayer_assertThisInitialized(_this)));
  81667. map.getView().on('change:center', _this.zoomEvent.bind(MapvLayer_assertThisInitialized(_this)));
  81668. map.getView().on('change:size', _this.sizeEvent.bind(MapvLayer_assertThisInitialized(_this)));
  81669. map.on('pointerdrag', _this.dragEvent.bind(MapvLayer_assertThisInitialized(_this)));
  81670. _this.bindEvent();
  81671. return _this;
  81672. }
  81673. /**
  81674. * @function MapvLayer.prototype.init
  81675. * @param {Object} options - 参数。
  81676. * @description 初始化参数。
  81677. */
  81678. MapvLayer_createClass(MapvLayer, [{
  81679. key: "init",
  81680. value: function init(options) {
  81681. var self = this;
  81682. self.options = options;
  81683. this.initDataRange(options);
  81684. this.context = self.options.context || '2d';
  81685. if (self.options.zIndex) {
  81686. this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
  81687. }
  81688. this.initAnimator();
  81689. }
  81690. /**
  81691. * @function MapvLayer.prototype.clickEvent
  81692. * @param {Object} e - 事件参数。
  81693. * @description 点击事件。
  81694. */
  81695. }, {
  81696. key: "clickEvent",
  81697. value: function clickEvent(e) {
  81698. var pixel = e.pixel;
  81699. MapvLayer_get(MapvLayer_getPrototypeOf(MapvLayer.prototype), "clickEvent", this).call(this, {
  81700. x: pixel[0] + this.offset[0],
  81701. y: pixel[1] + this.offset[1]
  81702. }, e);
  81703. }
  81704. /**
  81705. * @function MapvLayer.prototype.mousemoveEvent
  81706. * @param {Object} e - 事件参数。
  81707. * @description 鼠标移动事件。
  81708. */
  81709. }, {
  81710. key: "mousemoveEvent",
  81711. value: function mousemoveEvent(e) {
  81712. var pixel = e.pixel;
  81713. MapvLayer_get(MapvLayer_getPrototypeOf(MapvLayer.prototype), "mousemoveEvent", this).call(this, {
  81714. x: pixel[0],
  81715. y: pixel[1]
  81716. }, e);
  81717. }
  81718. /**
  81719. * @function MapvLayer.prototype.dragEvent
  81720. * @description 鼠标拖动事件。
  81721. */
  81722. }, {
  81723. key: "dragEvent",
  81724. value: function dragEvent() {
  81725. this.clear(this.getContext());
  81726. }
  81727. /**
  81728. * @function MapvLayer.prototype.zoomEvent
  81729. * @description 缩放事件。
  81730. */
  81731. }, {
  81732. key: "zoomEvent",
  81733. value: function zoomEvent() {
  81734. this.clear(this.getContext());
  81735. }
  81736. /**
  81737. * @function MapvLayer.prototype.sizeEvent
  81738. * @description 地图窗口大小发生变化时触发。
  81739. */
  81740. }, {
  81741. key: "sizeEvent",
  81742. value: function sizeEvent() {
  81743. this.canvasLayer.resize();
  81744. }
  81745. /**
  81746. * @function MapvLayer.prototype.moveStartEvent
  81747. * @description 开始移动事件。
  81748. */
  81749. }, {
  81750. key: "moveStartEvent",
  81751. value: function moveStartEvent() {
  81752. var animationOptions = this.options.animation;
  81753. if (this.isEnabledTime() && this.animator) {
  81754. this.steps.step = animationOptions.stepsRange.start;
  81755. }
  81756. }
  81757. /**
  81758. * @function MapvLayer.prototype.moveEndEvent
  81759. * @description 结束移动事件。
  81760. */
  81761. }, {
  81762. key: "moveEndEvent",
  81763. value: function moveEndEvent() {
  81764. this.canvasLayer.draw();
  81765. }
  81766. /**
  81767. * @function MapvLayer.prototype.bindEvent
  81768. * @description 绑定事件。
  81769. */
  81770. }, {
  81771. key: "bindEvent",
  81772. value: function bindEvent() {
  81773. var me = this;
  81774. var map = me.map;
  81775. if (me.options.methods) {
  81776. if (me.options.methods.click) {
  81777. map.on('click', me.clickEvent);
  81778. }
  81779. if (me.options.methods.mousemove) {
  81780. me.pointerInteraction = new (external_ol_interaction_Pointer_default())();
  81781. me.pointerInteraction.handleMoveEvent_ = function (event) {
  81782. me.mousemoveEvent(event);
  81783. };
  81784. map.addInteraction(me.pointerInteraction);
  81785. }
  81786. }
  81787. }
  81788. /**
  81789. * @function MapvLayer.prototype.unbindEvent
  81790. * @description 解除绑定事件。
  81791. */
  81792. }, {
  81793. key: "unbindEvent",
  81794. value: function unbindEvent() {
  81795. var map = this.map;
  81796. if (this.options.methods) {
  81797. if (this.options.methods.click) {
  81798. map.un('click', this.clickEvent);
  81799. }
  81800. if (this.options.methods.mousemove) {
  81801. map.removeInteraction(this.pointerInteraction);
  81802. }
  81803. }
  81804. }
  81805. /**
  81806. * @function MapvLayer.prototype.addData
  81807. * @description 添加数据。
  81808. * @param {Object} data - 待添加的数据。
  81809. * @param {Object} options - 待添加的数据信息。
  81810. */
  81811. }, {
  81812. key: "addData",
  81813. value: function addData(data, options) {
  81814. var _data = data;
  81815. if (data && data.get) {
  81816. _data = data.get();
  81817. }
  81818. this.dataSet.add(_data);
  81819. this.update({
  81820. options: options
  81821. });
  81822. }
  81823. /**
  81824. * @function MapvLayer.prototype.update
  81825. * @description 更新图层。
  81826. * @param {Object} opt - 待更新的数据。
  81827. * @param {Object} opt.data - mapv 数据集。
  81828. */
  81829. }, {
  81830. key: "update",
  81831. value: function update(opt) {
  81832. var update = opt || {};
  81833. var _data = update.data;
  81834. if (_data && _data.get) {
  81835. _data = _data.get();
  81836. }
  81837. if (_data != undefined) {
  81838. this.dataSet.set(_data);
  81839. }
  81840. MapvLayer_get(MapvLayer_getPrototypeOf(MapvLayer.prototype), "update", this).call(this, {
  81841. options: update.options
  81842. });
  81843. }
  81844. }, {
  81845. key: "draw",
  81846. value: function draw() {
  81847. this.canvasLayer.draw();
  81848. }
  81849. /**
  81850. * @function MapvLayer.prototype.getData
  81851. * @description 获取数据。
  81852. */
  81853. }, {
  81854. key: "getData",
  81855. value: function getData() {
  81856. return this.dataSet;
  81857. }
  81858. /**
  81859. * @function MapvLayer.prototype.removeData
  81860. * @description 删除符合过滤条件的数据。
  81861. * @param {function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  81862. */
  81863. }, {
  81864. key: "removeData",
  81865. value: function removeData(_filter) {
  81866. if (!this.dataSet) {
  81867. return;
  81868. }
  81869. var newData = this.dataSet.get({
  81870. filter: function filter(data) {
  81871. return _filter != null && typeof _filter === "function" ? !_filter(data) : true;
  81872. }
  81873. });
  81874. this.dataSet.set(newData);
  81875. this.update({
  81876. options: null
  81877. });
  81878. }
  81879. /**
  81880. * @function MapvLayer.prototype.clearData
  81881. * @description 清除数据。
  81882. */
  81883. }, {
  81884. key: "clearData",
  81885. value: function clearData() {
  81886. this.dataSet && this.dataSet.clear();
  81887. this.update({
  81888. options: null
  81889. });
  81890. }
  81891. }, {
  81892. key: "_canvasUpdate",
  81893. value: function _canvasUpdate(time) {
  81894. if (!this.canvasLayer) {
  81895. return;
  81896. }
  81897. var self = this;
  81898. var animationOptions = self.options.animation;
  81899. var map = self.map;
  81900. var context = self.canvasLayer.canvas.getContext(self.context);
  81901. if (self.isEnabledTime()) {
  81902. if (time === undefined) {
  81903. self.clear(context);
  81904. return;
  81905. }
  81906. if (!self.context || self.context === '2d') {
  81907. context.save();
  81908. context.globalCompositeOperation = 'destination-out';
  81909. context.fillStyle = 'rgba(0, 0, 0, .1)';
  81910. context.fillRect(0, 0, context.canvas.width, context.canvas.height);
  81911. context.restore();
  81912. }
  81913. } else {
  81914. this.clear(context);
  81915. }
  81916. if (!self.context || self.context === '2d') {
  81917. for (var key in self.options) {
  81918. context[key] = self.options[key];
  81919. }
  81920. } else {
  81921. context.clear(context.COLOR_BUFFER_BIT);
  81922. }
  81923. var ext = map.getView().calculateExtent();
  81924. var topLeftPx = map.getPixelFromCoordinate([ext[0], ext[3]]);
  81925. self._mapCenter = map.getView().getCenter();
  81926. self._mapCenterPx = map.getPixelFromCoordinate(self._mapCenter);
  81927. self._reselutions = map.getView().getResolution();
  81928. self._rotation = -map.getView().getRotation();
  81929. var zoomUnit = self._reselutions;
  81930. var scaleRatio = 1;
  81931. if (this.context != '2d') {
  81932. var global$2 = typeof window === 'undefined' ? {} : window;
  81933. var devicePixelRatio = global$2.devicePixelRatio || 1;
  81934. scaleRatio = devicePixelRatio;
  81935. }
  81936. var dataGetOptions = {
  81937. transferCoordinate: function transferCoordinate(coordinate) {
  81938. var x = (coordinate[0] - self._mapCenter[0]) / self._reselutions,
  81939. y = (self._mapCenter[1] - coordinate[1]) / self._reselutions;
  81940. var scaledP = [x + self._mapCenterPx[0], y + self._mapCenterPx[1]];
  81941. scaledP = scale(scaledP, self._mapCenterPx, 1);
  81942. /*//有旋转量的时候处理旋转
  81943. if (self._rotation !== 0) {
  81944. var rotatedP = rotate(scaledP, self._rotation, self._mapCenterPx);
  81945. return [rotatedP[0] + self.offset[0], rotatedP[1] + self.offset[1]];
  81946. }
  81947. //处理放大或缩小级别*/
  81948. return [(scaledP[0] + self.offset[0]) * scaleRatio, (scaledP[1] + self.offset[1]) * scaleRatio];
  81949. }
  81950. }; // //获取某像素坐标点pixelP绕中心center逆时针旋转rotation弧度后的像素点坐标。
  81951. // function rotate(pixelP, rotation, center) {
  81952. // var x = Math.cos(rotation) * (pixelP[0] - center[0]) - Math.sin(rotation) * (pixelP[1] - center[1]) + center[0];
  81953. // var y = Math.sin(rotation) * (pixelP[0] - center[0]) + Math.cos(rotation) * (pixelP[1] - center[1]) + center[1];
  81954. // return [x, y];
  81955. // }
  81956. //获取某像素坐标点pixelP相对于中心center进行缩放scaleRatio倍后的像素点坐标。
  81957. function scale(pixelP, center, scaleRatio) {
  81958. var x = (pixelP[0] - center[0]) * scaleRatio + center[0];
  81959. var y = (pixelP[1] - center[1]) * scaleRatio + center[1];
  81960. return [x, y];
  81961. }
  81962. if (time !== undefined) {
  81963. dataGetOptions.filter = function (item) {
  81964. var trails = animationOptions.trails || 10;
  81965. return time && item.time > time - trails && item.time < time;
  81966. };
  81967. }
  81968. if (self.isEnabledTime() && !self.notFirst) {
  81969. self.canvasLayer.resize(self.mapWidth, self.mapHeight);
  81970. self.notFirst = true;
  81971. }
  81972. var data = self.dataSet.get(dataGetOptions);
  81973. self.processData(data); // 兼容unit为'm'的情况
  81974. if (self.options.unit === 'm') {
  81975. if (self.options.size) {
  81976. self.options._size = self.options.size / zoomUnit;
  81977. }
  81978. if (self.options.width) {
  81979. self.options._width = self.options.width / zoomUnit;
  81980. }
  81981. if (self.options.height) {
  81982. self.options._height = self.options.height / zoomUnit;
  81983. }
  81984. } else {
  81985. self.options._size = self.options.size;
  81986. self.options._height = self.options.height;
  81987. self.options._width = self.options.width;
  81988. }
  81989. var pixel = map.getPixelFromCoordinate([0, 0]);
  81990. pixel = [pixel[0] - topLeftPx[0], pixel[1] - topLeftPx[1]];
  81991. this.drawContext(context, data, self.options, {
  81992. x: pixel[0],
  81993. y: pixel[1]
  81994. });
  81995. if (self.isEnabledTime()) {
  81996. this.source.changed();
  81997. }
  81998. self.options.updateCallback && self.options.updateCallback(time);
  81999. }
  82000. }, {
  82001. key: "isEnabledTime",
  82002. value: function isEnabledTime() {
  82003. var animationOptions = this.options.animation;
  82004. return animationOptions && !(animationOptions.enabled === false);
  82005. }
  82006. }, {
  82007. key: "argCheck",
  82008. value: function argCheck(options) {
  82009. if (options.draw === 'heatmap') {
  82010. if (options.strokeStyle) {
  82011. console.warn('[heatmap] options.strokeStyle is discard, pleause use options.strength [eg: options.strength = 0.1]');
  82012. }
  82013. }
  82014. }
  82015. }, {
  82016. key: "getContext",
  82017. value: function getContext() {
  82018. return this.canvasLayer.canvas.getContext(this.context);
  82019. }
  82020. }, {
  82021. key: "clear",
  82022. value: function clear(context) {
  82023. context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  82024. }
  82025. }]);
  82026. return MapvLayer;
  82027. }(BaiduMapLayer);
  82028. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Mapv.js
  82029. function Mapv_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Mapv_typeof = function _typeof(obj) { return typeof obj; }; } else { Mapv_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Mapv_typeof(obj); }
  82030. function Mapv_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82031. function Mapv_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  82032. function Mapv_createClass(Constructor, protoProps, staticProps) { if (protoProps) Mapv_defineProperties(Constructor.prototype, protoProps); if (staticProps) Mapv_defineProperties(Constructor, staticProps); return Constructor; }
  82033. function Mapv_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Mapv_setPrototypeOf(subClass, superClass); }
  82034. function Mapv_setPrototypeOf(o, p) { Mapv_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Mapv_setPrototypeOf(o, p); }
  82035. function Mapv_createSuper(Derived) { var hasNativeReflectConstruct = Mapv_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Mapv_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Mapv_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Mapv_possibleConstructorReturn(this, result); }; }
  82036. function Mapv_possibleConstructorReturn(self, call) { if (call && (Mapv_typeof(call) === "object" || typeof call === "function")) { return call; } return Mapv_assertThisInitialized(self); }
  82037. function Mapv_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82038. function Mapv_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  82039. function Mapv_getPrototypeOf(o) { Mapv_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Mapv_getPrototypeOf(o); }
  82040. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  82041. * This program are made available under the terms of the Apache License, Version 2.0
  82042. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82043. /**
  82044. * @class ol.source.Mapv
  82045. * @category Visualization MapV
  82046. * @classdesc MapV 图层源。
  82047. * @param {Object} opt_options - 参数。
  82048. * @param {ol/Map} opt_options.map - 当前 Map 对象。
  82049. * @param {Mapv.DataSet} opt_options.dataSet - MapV 的数据集。
  82050. * @param {Object} opt_options.mapvOptions - MapV 的配置对象。
  82051. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  82052. * @param {ol/proj/Projection} [opt_option.projection] - 投影信息。
  82053. * @param {number} [opt_option.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。 必须是 1 或更高。
  82054. * @param {Array} [opt_option.resolutions] - 分辨率数组。
  82055. * @param {ol/source/State} [opt_option.state] - 资源状态。
  82056. * @param {(string|Object)} [opt_option.attributions='© 2018 百度 MapV with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  82057. * @extends {ol/source/ImageCanvas}
  82058. */
  82059. var Mapv = /*#__PURE__*/function (_ImageCanvasSource) {
  82060. Mapv_inherits(Mapv, _ImageCanvasSource);
  82061. var _super = Mapv_createSuper(Mapv);
  82062. function Mapv(opt_options) {
  82063. var _this;
  82064. Mapv_classCallCheck(this, Mapv);
  82065. var options = opt_options ? opt_options : {};
  82066. _this = _super.call(this, {
  82067. attributions: options.attributions || "© 2018 百度 MapV with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>",
  82068. canvasFunction: canvasFunctionInternal_,
  82069. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  82070. projection: options.projection,
  82071. ratio: options.ratio,
  82072. resolutions: options.resolutions,
  82073. state: options.state
  82074. });
  82075. _this.map = opt_options.map;
  82076. _this.dataSet = opt_options.dataSet;
  82077. _this.mapvOptions = opt_options.mapvOptions;
  82078. function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  82079. // eslint-disable-line no-unused-vars
  82080. var mapWidth = size[0] / pixelRatio;
  82081. var mapHeight = size[1] / pixelRatio;
  82082. var width = this.map.getSize()[0];
  82083. var height = this.map.getSize()[1];
  82084. if (!this.layer) {
  82085. this.layer = new MapvLayer(this.map, this.dataSet, this.mapvOptions, mapWidth, mapHeight, this);
  82086. }
  82087. this.layer.pixelRatio = pixelRatio;
  82088. this.layer.offset = [(mapWidth - width) / 2, (mapHeight - height) / 2];
  82089. if (!this.rotate) {
  82090. this.rotate = this.map.getView().getRotation();
  82091. } else {
  82092. if (this.rotate !== this.map.getView().getRotation()) {
  82093. this.layer.canvasLayer.resize(mapWidth, mapHeight);
  82094. this.rotate = this.map.getView().getRotation();
  82095. }
  82096. }
  82097. var canvas = this.layer.canvasLayer.canvas;
  82098. if (!this.layer.isEnabledTime()) {
  82099. this.layer.canvasLayer.resize(mapWidth, mapHeight);
  82100. this.layer.canvasLayer.draw();
  82101. }
  82102. if (!this.context) {
  82103. this.context = core_Util_Util.createCanvasContext2D(mapWidth, mapHeight);
  82104. }
  82105. var canvas2 = this.context.canvas;
  82106. this.context.clearRect(0, 0, canvas2.width, canvas2.height);
  82107. canvas2.width = size[0];
  82108. canvas2.height = size[1];
  82109. canvas2.style.width = size[0] + "px";
  82110. canvas2.style.height = size[1] + "px";
  82111. this.context.drawImage(canvas, 0, 0);
  82112. if (this.resolution !== resolution || JSON.stringify(this.extent) !== JSON.stringify(extent)) {
  82113. this.resolution = resolution;
  82114. this.extent = extent;
  82115. }
  82116. return this.context.canvas;
  82117. }
  82118. return _this;
  82119. }
  82120. /**
  82121. * @function ol.source.Mapv.prototype.addData
  82122. * @description 追加数据。
  82123. * @param {Object} data - 要追加的数据。
  82124. * @param {Object} options - 要追加的值。
  82125. */
  82126. Mapv_createClass(Mapv, [{
  82127. key: "addData",
  82128. value: function addData(data, options) {
  82129. this.layer.addData(data, options);
  82130. }
  82131. /**
  82132. * @function ol.source.Mapv.prototype.getData
  82133. * @description 获取数据。
  82134. * @returns {mapv.DataSet} MapV 数据集。
  82135. */
  82136. }, {
  82137. key: "getData",
  82138. value: function getData() {
  82139. if (this.layer) {
  82140. this.dataSet = this.layer.getData();
  82141. }
  82142. return this.dataSet;
  82143. }
  82144. /**
  82145. * @function ol.source.Mapv.prototype.removeData
  82146. * @description 删除符合过滤条件的数据。
  82147. * @param {function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  82148. * @example
  82149. * filter=function(data){
  82150. * if(data.id=="1"){
  82151. * return true
  82152. * }
  82153. * return false;
  82154. * }
  82155. */
  82156. }, {
  82157. key: "removeData",
  82158. value: function removeData(filter) {
  82159. this.layer && this.layer.removeData(filter);
  82160. }
  82161. /**
  82162. * @function ol.source.Mapv.prototype.clearData
  82163. * @description 清除数据。
  82164. */
  82165. }, {
  82166. key: "clearData",
  82167. value: function clearData() {
  82168. this.layer.clearData();
  82169. }
  82170. /**
  82171. * @function ol.source.Mapv.prototype.update
  82172. * @description 更新数据。
  82173. * @param {Object} options - 待更新的数据。
  82174. * @param {Object} options.data - mapv 数据集。
  82175. */
  82176. }, {
  82177. key: "update",
  82178. value: function update(options) {
  82179. this.layer.update(options);
  82180. this.changed();
  82181. }
  82182. }]);
  82183. return Mapv;
  82184. }((external_ol_source_ImageCanvas_default()));
  82185. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Range.js
  82186. function Range_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Range_typeof = function _typeof(obj) { return typeof obj; }; } else { Range_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Range_typeof(obj); }
  82187. function Range_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82188. function Range_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  82189. function Range_createClass(Constructor, protoProps, staticProps) { if (protoProps) Range_defineProperties(Constructor.prototype, protoProps); if (staticProps) Range_defineProperties(Constructor, staticProps); return Constructor; }
  82190. function Range_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Range_setPrototypeOf(subClass, superClass); }
  82191. function Range_setPrototypeOf(o, p) { Range_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Range_setPrototypeOf(o, p); }
  82192. function Range_createSuper(Derived) { var hasNativeReflectConstruct = Range_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Range_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Range_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Range_possibleConstructorReturn(this, result); }; }
  82193. function Range_possibleConstructorReturn(self, call) { if (call && (Range_typeof(call) === "object" || typeof call === "function")) { return call; } return Range_assertThisInitialized(self); }
  82194. function Range_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82195. function Range_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  82196. function Range_getPrototypeOf(o) { Range_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Range_getPrototypeOf(o); }
  82197. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  82198. * This program are made available under the terms of the Apache License, Version 2.0
  82199. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82200. /**
  82201. * @class ol.source.Range
  82202. * @category Visualization Theme
  82203. * @classdesc 分段专题图图层源。
  82204. * @param {string} name - 名称
  82205. * @param {Object} opt_options - 参数。
  82206. * @param {ol/Map} opt_options.map - 当前map对象。
  82207. * @param {string} opt_options.themeField - 指定创建专题图字段。
  82208. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  82209. * @param {number} [opt_options.opacity = 1] - 图层透明度。
  82210. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  82211. * @param {ol/proj/Projection} [opt_options.projection] - 投影信息。
  82212. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是 1 或更高。
  82213. * @param {Array} [opt_options.resolutions] - 分辨率数组。
  82214. * @param {ol/source/State} [opt_options.state] - 资源状态。
  82215. * @param {Object} [opt_options.style] - 专题图样式。
  82216. * @param {Object} [opt_options.styleGroups] - 各专题类型样式组。
  82217. * @param {boolean} [opt_options.isHoverAble = false] - 是否开启 hover 事件。
  82218. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  82219. * @param {(string|Object)} [opt_option.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  82220. * @extends {GeoFeature}
  82221. */
  82222. var Range = /*#__PURE__*/function (_GeoFeature) {
  82223. Range_inherits(Range, _GeoFeature);
  82224. var _super = Range_createSuper(Range);
  82225. function Range(name, opt_options) {
  82226. var _this;
  82227. Range_classCallCheck(this, Range);
  82228. _this = _super.call(this, name, opt_options);
  82229. _this.style = opt_options.style;
  82230. _this.isHoverAble = opt_options.isHoverAble;
  82231. _this.highlightStyle = opt_options.highlightStyle;
  82232. _this.themeField = opt_options.themeField;
  82233. _this.styleGroups = opt_options.styleGroups;
  82234. return _this;
  82235. }
  82236. /**
  82237. * @function ol.source.Range.prototype.destroy
  82238. * @description 释放资源,将引用资源的属性置空。
  82239. */
  82240. Range_createClass(Range, [{
  82241. key: "destroy",
  82242. value: function destroy() {
  82243. this.style = null;
  82244. this.themeField = null;
  82245. this.styleGroups = null;
  82246. GeoFeature.prototype.destroy.apply(this, arguments);
  82247. }
  82248. /**
  82249. * @private
  82250. * @function ol.source.Range.prototype.createThematicFeature
  82251. * @description 创建专题图要素。
  82252. * @param {Object} feature - 要创建的专题图形要素。
  82253. */
  82254. }, {
  82255. key: "createThematicFeature",
  82256. value: function createThematicFeature(feature) {
  82257. //赋 style
  82258. var style = this.getStyleByData(feature); //创建专题要素时的可选参数
  82259. var options = {};
  82260. options.nodesClipPixel = this.nodesClipPixel;
  82261. options.isHoverAble = this.isHoverAble;
  82262. options.isMultiHover = this.isMultiHover;
  82263. options.isClickAble = this.isClickAble;
  82264. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(ThemeVector)
  82265. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  82266. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  82267. this.renderer.addShape(thematicFeature.shapes[m]);
  82268. }
  82269. return thematicFeature;
  82270. }
  82271. /**
  82272. * @private
  82273. * @function ol.source.Range.prototype.getStyleByData
  82274. * @description 通过数据获取 style。
  82275. * @param {Object} fea - 要素数据。
  82276. */
  82277. }, {
  82278. key: "getStyleByData",
  82279. value: function getStyleByData(fea) {
  82280. var style = {};
  82281. var feature = fea;
  82282. style = Util.copyAttributesWithClip(style, this.style);
  82283. if (this.themeField && this.styleGroups && this.styleGroups.length > 0 && feature.attributes) {
  82284. var Sf = this.themeField;
  82285. var Attrs = feature.attributes;
  82286. var Gro = this.styleGroups;
  82287. var isSfInAttrs = false; //指定的 themeField 是否是 feature 的属性字段之一
  82288. var attr = null; //属性值
  82289. for (var property in Attrs) {
  82290. if (Sf === property) {
  82291. isSfInAttrs = true;
  82292. attr = Attrs[property];
  82293. break;
  82294. }
  82295. } //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
  82296. if (isSfInAttrs) {
  82297. for (var i = 0, len = Gro.length; i < len; i++) {
  82298. if (attr >= Gro[i].start && attr < Gro[i].end) {
  82299. //feature.style = SuperMap.Util.copyAttributes(feature.style, this.defaultStyle);
  82300. var sty1 = Gro[i].style;
  82301. style = Util.copyAttributesWithClip(style, sty1);
  82302. }
  82303. }
  82304. }
  82305. }
  82306. if (feature.style && this.isAllowFeatureStyle === true) {
  82307. style = Util.copyAttributesWithClip(feature.style);
  82308. }
  82309. return style;
  82310. }
  82311. }, {
  82312. key: "canvasFunctionInternal_",
  82313. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  82314. // eslint-disable-line no-unused-vars
  82315. return GeoFeature.prototype.canvasFunctionInternal_.apply(this, arguments);
  82316. }
  82317. }]);
  82318. return Range;
  82319. }(GeoFeature);
  82320. ;// CONCATENATED MODULE: ./src/openlayers/overlay/RankSymbol.js
  82321. function overlay_RankSymbol_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { overlay_RankSymbol_typeof = function _typeof(obj) { return typeof obj; }; } else { overlay_RankSymbol_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return overlay_RankSymbol_typeof(obj); }
  82322. function overlay_RankSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82323. function overlay_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); } }
  82324. function overlay_RankSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_RankSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_RankSymbol_defineProperties(Constructor, staticProps); return Constructor; }
  82325. function overlay_RankSymbol_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) overlay_RankSymbol_setPrototypeOf(subClass, superClass); }
  82326. function overlay_RankSymbol_setPrototypeOf(o, p) { overlay_RankSymbol_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_RankSymbol_setPrototypeOf(o, p); }
  82327. function overlay_RankSymbol_createSuper(Derived) { var hasNativeReflectConstruct = overlay_RankSymbol_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_RankSymbol_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_RankSymbol_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_RankSymbol_possibleConstructorReturn(this, result); }; }
  82328. function overlay_RankSymbol_possibleConstructorReturn(self, call) { if (call && (overlay_RankSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_RankSymbol_assertThisInitialized(self); }
  82329. function overlay_RankSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82330. function overlay_RankSymbol_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  82331. function overlay_RankSymbol_getPrototypeOf(o) { overlay_RankSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_RankSymbol_getPrototypeOf(o); }
  82332. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  82333. * This program are made available under the terms of the Apache License, Version 2.0
  82334. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82335. /**
  82336. * @class ol.source.RankSymbol
  82337. * @category Visualization Theme
  82338. * @classdesc 等级符号专题图图层源。
  82339. * @param {string} name - 专题图层名。
  82340. * @param {string} symbolType - 标志类型。
  82341. * @param {Object} opt_options - 参数。
  82342. * @param {ol/Map} opt_options.map - 当前 Map 对象。
  82343. * @param {string} opt_options.themeFields - 指定创建专题图字段。
  82344. * @param {Object} opt_options.symbolSetting - 符号 Circle 配置对象 symbolSetting(<SuperMap.Layer.RankSymbol::setting>)。
  82345. * @param {Array.<number>} opt_options.symbolSetting.codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  82346. * @param {number} [opt_options.symbolSetting.maxR] - 圆形的最大半径。
  82347. * @param {number} [opt_options.symbolSetting.minR] - 圆形的最小半径。
  82348. * @param {string} [opt_options.symbolSetting.fillColor] - 圆形的填充色,如:fillColor: "#FFB980"。
  82349. * @param {Object} [opt_options.symbolSetting.circleStyle] - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
  82350. * @param {number} [opt_options.symbolSetting.decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  82351. * @param {Object} [opt_options.symbolSetting.circleHoverStyle] - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
  82352. * @param {boolean} [opt_options.symbolSetting.circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  82353. * @param {boolean} [opt_options.symbolSetting.circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  82354. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  82355. * @param {number} [opt_options.opacity=1] - 图层透明度。
  82356. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  82357. * @param {ol/proj/Projection} [opt_options.projection] - 投影信息。
  82358. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。 必须是 1 或更高。
  82359. * @param {Array} [opt_options.resolutions] - 分辨率数组。
  82360. * @param {ol/source/State} [opt_options.state] - 资源状态。
  82361. * @param {boolean} [opt_options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  82362. * @param {(string|Object)} [opt_option.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  82363. * @extends {Graph}
  82364. */
  82365. var RankSymbol_RankSymbol = /*#__PURE__*/function (_Graph) {
  82366. overlay_RankSymbol_inherits(RankSymbol, _Graph);
  82367. var _super = overlay_RankSymbol_createSuper(RankSymbol);
  82368. function RankSymbol(name, symbolType, opt_options) {
  82369. var _this;
  82370. overlay_RankSymbol_classCallCheck(this, RankSymbol);
  82371. _this = _super.call(this, name, symbolType, opt_options);
  82372. _this.symbolType = symbolType;
  82373. _this.symbolSetting = opt_options.symbolSetting;
  82374. _this.themeField = opt_options.themeField;
  82375. return _this;
  82376. }
  82377. /**
  82378. * @function ol.source.RankSymbol.prototype.destroy
  82379. * @description 释放资源,将引用资源的属性置空。
  82380. */
  82381. overlay_RankSymbol_createClass(RankSymbol, [{
  82382. key: "destroy",
  82383. value: function destroy() {
  82384. this.symbolType = null;
  82385. this.symbolSetting = null;
  82386. this.themeField = null;
  82387. Graph_Graph.prototype.destroy.apply(this, arguments);
  82388. }
  82389. /**
  82390. * @function ol.source.RankSymbol.prototype.setSymbolType
  82391. * @description 设置标志符号。
  82392. * @param {string} symbolType - 符号类型。
  82393. */
  82394. }, {
  82395. key: "setSymbolType",
  82396. value: function setSymbolType(symbolType) {
  82397. this.symbolType = symbolType;
  82398. this.redraw();
  82399. }
  82400. /**
  82401. * @private
  82402. * @function ol.source.RankSymbol.prototype.createThematicFeature
  82403. * @description 创建专题图形要素。
  82404. * @param {Object} feature - 要创建的专题图形要素。
  82405. */
  82406. }, {
  82407. key: "createThematicFeature",
  82408. value: function createThematicFeature(feature) {
  82409. var thematicFeature; // 检查图形创建条件并创建图形
  82410. if (Theme_Theme[this.symbolType] && this.themeField && this.symbolSetting) {
  82411. thematicFeature = new Theme_Theme[this.symbolType](feature, this, [this.themeField], this.symbolSetting);
  82412. } // thematicFeature 是否创建成功
  82413. if (!thematicFeature) {
  82414. return false;
  82415. } // 对专题要素执行图形装载
  82416. thematicFeature.assembleShapes();
  82417. return thematicFeature;
  82418. }
  82419. }, {
  82420. key: "canvasFunctionInternal_",
  82421. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  82422. // eslint-disable-line no-unused-vars
  82423. return Graph_Graph.prototype.canvasFunctionInternal_.apply(this, arguments);
  82424. }
  82425. }]);
  82426. return RankSymbol;
  82427. }(Graph_Graph);
  82428. ;// CONCATENATED MODULE: external "function(){try{return turf}catch(e){return {}}}()"
  82429. var external_function_try_return_turf_catch_e_return_namespaceObject = function(){try{return turf}catch(e){return {}}}();
  82430. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Turf.js
  82431. function Turf_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Turf_typeof = function _typeof(obj) { return typeof obj; }; } else { Turf_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Turf_typeof(obj); }
  82432. function Turf_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82433. function Turf_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  82434. function Turf_createClass(Constructor, protoProps, staticProps) { if (protoProps) Turf_defineProperties(Constructor.prototype, protoProps); if (staticProps) Turf_defineProperties(Constructor, staticProps); return Constructor; }
  82435. function Turf_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Turf_setPrototypeOf(subClass, superClass); }
  82436. function Turf_setPrototypeOf(o, p) { Turf_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Turf_setPrototypeOf(o, p); }
  82437. function Turf_createSuper(Derived) { var hasNativeReflectConstruct = Turf_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Turf_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Turf_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Turf_possibleConstructorReturn(this, result); }; }
  82438. function Turf_possibleConstructorReturn(self, call) { if (call && (Turf_typeof(call) === "object" || typeof call === "function")) { return call; } return Turf_assertThisInitialized(self); }
  82439. function Turf_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82440. function Turf_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  82441. function Turf_getPrototypeOf(o) { Turf_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Turf_getPrototypeOf(o); }
  82442. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  82443. * This program are made available under the terms of the Apache License, Version 2.0
  82444. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82445. /**
  82446. * @class ol.source.Turf
  82447. * @category Visualization Turf
  82448. * @classdesc Turf.js 图层源。
  82449. * @param {Object} opt_options - 参数。
  82450. * @extends {ol/source/Vector}
  82451. */
  82452. var Turf = /*#__PURE__*/function (_VectorSource) {
  82453. Turf_inherits(Turf, _VectorSource);
  82454. var _super = Turf_createSuper(Turf);
  82455. function Turf(opt_options) {
  82456. var _this;
  82457. Turf_classCallCheck(this, Turf);
  82458. var options = opt_options ? opt_options : {};
  82459. _this = _super.call(this, {
  82460. attributions: options.attributions || "<span>© <a href='https://turfjs.org/' target='_blank'>turfjs</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>",
  82461. features: options.features,
  82462. format: options.format,
  82463. extent: options.extent,
  82464. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  82465. projection: options.projection,
  82466. wrapX: options.wrapX
  82467. });
  82468. _this.turfMap = {
  82469. "Measurement.along": ["line", "distance", "units"],
  82470. "Measurement.area": ["geojson"],
  82471. "Measurement.bbox": ["geojson"],
  82472. "Measurement.bboxPolygon": ["bbox"],
  82473. "Measurement.bearing": ["start", "end", "final"],
  82474. "Measurement.center": ["geojson", "properties"],
  82475. "Measurement.centerOfMass": ["geojson", "properties"],
  82476. "Measurement.centroid": ["geojson", "properties"],
  82477. "Measurement.destination": ["origin", "distance", "bearing", "units"],
  82478. "Measurement.distance": ["from", "to", "units"],
  82479. "Measurement.envelope": ["geojson"],
  82480. "Measurement.length": ["geojson", "units"],
  82481. "Measurement.midpoint": ["point1", "point2"],
  82482. "Measurement.pointOnFeature": ["geojson"],
  82483. "Measurement.polygonTangents": ["point", "polygon"],
  82484. "Measurement.rhumbBearing": ["start", "end", "final"],
  82485. "Measurement.rhumbDestination": ["origin", "distance", "bearing", "units"],
  82486. "Measurement.rhumbDistance": ["from", "to", "units"],
  82487. "Measurement.square": ["bbox"],
  82488. "Measurement.greatCircle": ["start", "end", "properties", "npoints", "offset"],
  82489. "CoordinateMutation.cleanCoords": ["geojson", "mutate"],
  82490. "CoordinateMutation.flip": ["geojson", "mutate"],
  82491. "CoordinateMutation.rewind": ["geojson", "reverse", "mutate"],
  82492. "CoordinateMutation.round": ["num", "precision"],
  82493. "CoordinateMutation.truncate": ["geojson", "precision", "coordinates", "mutate"],
  82494. "Transformation.bboxClip": ["feature", "bbox"],
  82495. "Transformation.bezierSpline": ["line", "resolution", "sharpness"],
  82496. "Transformation.buffer": ["geojson", "radius", "units", "steps"],
  82497. "Transformation.circle": ["center", "radius", "steps", "units", "properties"],
  82498. "Transformation.clone": ["geojson"],
  82499. "Transformation.concave": ["points", "maxEdge", "units"],
  82500. "Transformation.convex": ["geojson", "concavity"],
  82501. "Transformation.difference": ["polygon1", "polygon2"],
  82502. "Transformation.dissolve": ["featureCollection", "propertyName"],
  82503. "Transformation.intersect": ["poly1", "poly2"],
  82504. "Transformation.lineOffset": ["geojson", "distance", "units"],
  82505. "Transformation.simplify": ["feature", "tolerance", "highQuality"],
  82506. "Transformation.tesselate": ["poly"],
  82507. "Transformation.transformRotate": ["geojson", "angle", "pivot", "mutate"],
  82508. "Transformation.transformTranslate": ["geojson", "distance", "direction", "units", "zTranslation", "mutate"],
  82509. "Transformation.transformScale": ["geojson", "factor", "origin", "mutate"],
  82510. "Transformation.union": ["A"],
  82511. "Transformation.voronoi": ["points", "bbox"],
  82512. "featureConversion.combine": ["fc"],
  82513. "featureConversion.explode": ["geojson"],
  82514. "featureConversion.flatten": ["geojson"],
  82515. "featureConversion.lineStringToPolygon": ["lines", "properties", "autoComplete", "orderCoords"],
  82516. "featureConversion.polygonize": ["geojson"],
  82517. "featureConversion.polygonToLineString": ["polygon", "properties"],
  82518. "Misc.kinks": ["featureIn"],
  82519. "Misc.lineArc": ["center", "radius", "bearing1", "bearing2", "steps", "units"],
  82520. "Misc.lineChunk": ["geojson", "segmentLength", "units", "reverse"],
  82521. "Misc.lineIntersect": ["line1", "line2"],
  82522. "Misc.lineOverlap": ["line1", "line2"],
  82523. "Misc.lineSegment": ["geojson"],
  82524. "Misc.lineSlice": ["startPt", "stopPt", "line"],
  82525. "Misc.lineSliceAlong": ["line", "startDist", "stopDist", "units"],
  82526. "Misc.lineSplit": ["line", "splitter"],
  82527. "Misc.mask": ["polygon", "mask"],
  82528. "Misc.pointOnLine": ["lines", "pt", "units"],
  82529. "Misc.sector": ["center", "radius", "bearing1", "bearing2", "steps", "units"],
  82530. "Misc.shortestPath": ["start", "end", "obstacles", "units", "resolution"],
  82531. "Misc.unkinkPolygon": ["geojson"],
  82532. "Helper.featureCollection": ["features", "bbox", "id"],
  82533. "Helper.feature": ["geometry", "properties", "bbox", "id"],
  82534. "Helper.geometryCollection": ["geometries", "properties", "bbox", "id"],
  82535. "Helper.lineString": ["coordinates", "properties", "bbox", "id"],
  82536. "Helper.multiLineString": ["coordinates", "properties", "bbox", "id"],
  82537. "Helper.multiPoint": ["coordinates", "properties", "bbox", "id"],
  82538. "Helper.multiPolygon": ["coordinates", "properties", "bbox", "id"],
  82539. "Helper.point": ["coordinates", "properties", "bbox", "id"],
  82540. "Helper.polygon": ["coordinates", "properties", "bbox", "id"],
  82541. "Data.sample": ["featurecollection", "num"],
  82542. "Interpolation.interpolate": ["points", "cellSize", "gridType", "property", "units", "weight"],
  82543. "Interpolation.isobands": ["pointGrid", "breaks", "zProperty", "commonProperties", "breaksProperties"],
  82544. "Interpolation.isolines": ["pointGrid", "breaks", "zProperty", "commonProperties", "breaksProperties"],
  82545. "Interpolation.planepoint": ["point", "triangle"],
  82546. "Interpolation.tin": ["points", "z"],
  82547. "Joins.pointsWithinPolygon": ["points", "polygons"],
  82548. "Joins.tag": ["points", "polygons", "field", "outField", "mask", "properties"],
  82549. "Grids.hexGrid": ["bbox", "cellSide", "units", "triangles"],
  82550. "Grids.pointGrid": ["bbox", "cellSide", "units", "mask", "properties"],
  82551. "Grids.squareGrid": ["bbox", "cellSide", "units", "mask", "properties"],
  82552. "Grids.triangleGrid": ["bbox", "cellSide", "units", "mask", "properties"],
  82553. "Classification.nearestPoint": ["targetPoint", "points"],
  82554. "Aggregation.collect": ["polygons", "points", "inProperty", "outProperty"],
  82555. "Aggregation.clustersDbscan": ["points", "maxDistance", "units", "minPoints", "mutate"],
  82556. "Aggregation.clustersKmeans": ["points", "numberOfClusters", "mutate"],
  82557. "Meta.coordAll": ["geojson"],
  82558. "Meta.coordEach": ["geojson", "callback", "excludeWrapCoord"],
  82559. "Meta.coordReduce": ["geojson", "callback", "initialValue", "excludeWrapCoord"],
  82560. "Meta.featureEach": ["geojson", "callback"],
  82561. "Meta.featureReduce": ["geojson", "callback", "initialValue"],
  82562. "Meta.flattenEach": ["geojson", "callback"],
  82563. "Meta.flattenReduce": ["geojson", "callback", "initialValue"],
  82564. "Meta.getCoord": ["coord"],
  82565. "Meta.getCoords": ["coords"],
  82566. "Meta.getGeom": ["geojson"],
  82567. "Meta.getGeomType": ["geojson", "name"],
  82568. "Meta.geomEach": ["geojson", "callback"],
  82569. "Meta.geomReduce": ["geojson", "callback", "initialValue"],
  82570. "Meta.propEach": ["geojson", "callback"],
  82571. "Meta.propReduce": ["geojson", "callback", "initialValue"],
  82572. "Meta.segmentEach": ["geojson", "callback"],
  82573. "Meta.segmentReduce": ["geojson", "callback", "initialValue"],
  82574. "Meta.getCluster": ["geojson", "filter"],
  82575. "Meta.clusterEach": ["geojson", "property", "callback"],
  82576. "Meta.clusterReduce": ["geojson", "property", "callback", "initialValue"],
  82577. "Assertions.collectionOf": ["featureCollection", "type", "name"],
  82578. "Assertions.containsNumber": ["coordinates"],
  82579. "Assertions.geojsonType": ["value", "type", "name"],
  82580. "Assertions.featureOf": ["feature", "type", "name"],
  82581. "Booleans.booleanClockwise": ["line"],
  82582. "Booleans.booleanContains": ["feature1", "feature2"],
  82583. "Booleans.booleanCrosses": ["feature1", "feature2"],
  82584. "Booleans.booleanDisjoint": ["feature1", "feature2"],
  82585. "Booleans.booleanEqual": ["feature1", "feature2"],
  82586. "Booleans.booleanOverlap": ["feature1", "feature2"],
  82587. "Booleans.booleanParallel": ["feature1", "feature2"],
  82588. "Booleans.booleanPointInPolygon": ["point", "polygon", "ignoreBoundary"],
  82589. "Booleans.booleanPointOnLine": ["point", "linestring", "ignoreEndVertices"],
  82590. "UnitConversion.bearingToAngle": ["bearing"],
  82591. "UnitConversion.convertArea": ["area", "originalUnit", "finalUnit"],
  82592. "UnitConversion.convertLength": ["length", "originalUnit", "finalUnit"],
  82593. "UnitConversion.degreesToradians": ["degrees"],
  82594. "UnitConversion.lengthToRadians": ["distance", "units"],
  82595. "UnitConversion.lengthToDegrees": ["distance", "units"],
  82596. "UnitConversion.radiansToLength": ["radians", "units"],
  82597. "UnitConversion.radiansToDegrees": ["radians"],
  82598. "UnitConversion.toMercator": ["geojson", "mutate"],
  82599. "UnitConversion.toWgs84": ["geojson", "mutate"]
  82600. }; // 5.0.0 及以上版本参数配置
  82601. _this.turfOptionMap = {
  82602. "Measurement.along": ["line", "distance", {
  82603. units: ""
  82604. }],
  82605. "Measurement.bboxPolygon": ["bbox", {
  82606. properties: "",
  82607. id: ""
  82608. }],
  82609. "Measurement.bearing": ["start", "end", {
  82610. "final": ""
  82611. }],
  82612. "Measurement.center": ["geojson", {
  82613. properties: ""
  82614. }],
  82615. "Measurement.destination": ["origin", "distance", "bearing", {
  82616. units: "",
  82617. properties: ""
  82618. }],
  82619. "Measurement.distance": ["from", "to", {
  82620. units: ""
  82621. }],
  82622. "Measurement.length": ["geojson", {
  82623. units: ""
  82624. }],
  82625. "Measurement.rhumbBearing": ["start", "end", {
  82626. "final": ""
  82627. }],
  82628. "Measurement.rhumbDestination": ["origin", "distance", "bearing", {
  82629. units: "",
  82630. properties: ""
  82631. }],
  82632. "Measurement.rhumbDistance": ["from", "to", {
  82633. units: ""
  82634. }],
  82635. "Measurement.greatCircle": ["start", "end", {
  82636. properties: "",
  82637. npoints: "",
  82638. offset: ""
  82639. }],
  82640. "CoordinateMutation.cleanCoords": ["geojson", {
  82641. mutate: ""
  82642. }],
  82643. "CoordinateMutation.flip": ["geojson", {
  82644. mutate: ""
  82645. }],
  82646. "CoordinateMutation.rewind": ["geojson", {
  82647. mutate: "",
  82648. reverse: ""
  82649. }],
  82650. "CoordinateMutation.truncate": ["geojson", {
  82651. precision: "",
  82652. coordinates: "",
  82653. mutate: ""
  82654. }],
  82655. "Transformation.bezierSpline": ["line", {
  82656. resolution: "",
  82657. sharpness: ""
  82658. }],
  82659. "Transformation.buffer": ["geojson", "radius", {
  82660. units: "",
  82661. steps: ""
  82662. }],
  82663. "Transformation.circle": ["center", "radius", {
  82664. units: "",
  82665. steps: "",
  82666. properties: ""
  82667. }],
  82668. "Transformation.concave": ["points", {
  82669. maxEdge: "",
  82670. units: ""
  82671. }],
  82672. "Transformation.convex": ["geojson", {
  82673. concavity: ""
  82674. }],
  82675. "Transformation.dissolve": ["featureCollection", {
  82676. propertyName: ""
  82677. }],
  82678. "Transformation.lineOffset": ["geojson", "distance", {
  82679. units: ""
  82680. }],
  82681. "Transformation.simplify": ["geojson", {
  82682. tolerance: "",
  82683. highQuality: ""
  82684. }],
  82685. "Transformation.transformRotate": ["geojson", "angle", {
  82686. pivot: "",
  82687. mutate: ""
  82688. }],
  82689. "Transformation.transformTranslate": ["geojson", "distance", "direction", {
  82690. units: "",
  82691. zTranslation: "",
  82692. mutate: ""
  82693. }],
  82694. "Transformation.transformScale": ["geojson", "factor", {
  82695. origin: "",
  82696. mutate: ""
  82697. }],
  82698. "Transformation.voronoi": ["points", {
  82699. bbox: ""
  82700. }],
  82701. "featureConversion.lineStringToPolygon": ["lines", {
  82702. properties: "",
  82703. autoComplete: "",
  82704. orderCoords: ""
  82705. }],
  82706. "featureConversion.polygonToLineString": ["polygon", {
  82707. properties: ""
  82708. }],
  82709. "Misc.lineArc": ["center", "radius", "bearing1", "bearing2", {
  82710. steps: "",
  82711. units: ""
  82712. }],
  82713. "Misc.lineChunk": ["geojson", "segmentLength", {
  82714. units: "",
  82715. reverse: ""
  82716. }],
  82717. "Misc.lineOverlap": ["line1", "line2", {
  82718. tolerance: ""
  82719. }],
  82720. "Misc.lineSliceAlong": ["line", "startDist", "stopDist", {
  82721. units: ""
  82722. }],
  82723. "Misc.pointOnLine": ["lines", "pt", {
  82724. units: ""
  82725. }],
  82726. "Misc.sector": ["center", "radius", "bearing1", "bearing2", {
  82727. units: "",
  82728. steps: "",
  82729. properties: ""
  82730. }],
  82731. "Misc.shortestPath": ["start", "end", {
  82732. obstacles: "",
  82733. units: "",
  82734. resolution: ""
  82735. }],
  82736. "Helper.feature": ["geometry", "properties", {
  82737. bbox: "",
  82738. id: ""
  82739. }],
  82740. "Helper.geometryCollection": ["geometries", "properties", {
  82741. bbox: "",
  82742. id: ""
  82743. }],
  82744. "Helper.lineString": ["coordinates", "properties", {
  82745. bbox: "",
  82746. id: ""
  82747. }],
  82748. "Helper.multiLineString": ["coordinates", "properties", {
  82749. bbox: "",
  82750. id: ""
  82751. }],
  82752. "Helper.multiPoint": ["coordinates", "properties", {
  82753. bbox: "",
  82754. id: ""
  82755. }],
  82756. "Helper.multiPolygon": ["coordinates", "properties", {
  82757. bbox: "",
  82758. id: ""
  82759. }],
  82760. "Helper.point": ["coordinates", "properties", {
  82761. bbox: "",
  82762. id: ""
  82763. }],
  82764. "Helper.polygon": ["coordinates", "properties", {
  82765. bbox: "",
  82766. id: ""
  82767. }],
  82768. "Interpolation.interpolate": ["points", "cellSize", {
  82769. gridType: "",
  82770. property: "",
  82771. units: "",
  82772. weight: ""
  82773. }],
  82774. "Interpolation.isobands": ["pointGrid", "breaks", {
  82775. zProperty: "",
  82776. commonProperties: "",
  82777. breaksProperties: ""
  82778. }],
  82779. "Interpolation.isolines": ["pointGrid", "breaks", {
  82780. zProperty: "",
  82781. commonProperties: "",
  82782. breaksProperties: ""
  82783. }],
  82784. "Grids.hexGrid": ["bbox", "cellSide", {
  82785. units: "",
  82786. triangles: "",
  82787. properties: "",
  82788. mask: ""
  82789. }],
  82790. "Grids.pointGrid": ["bbox", "cellSide", {
  82791. units: "",
  82792. mask: "",
  82793. properties: ""
  82794. }],
  82795. "Grids.squareGrid": ["bbox", "cellSide", {
  82796. units: "",
  82797. mask: "",
  82798. properties: ""
  82799. }],
  82800. "Grids.triangleGrid": ["bbox", "cellSide", {
  82801. units: "",
  82802. mask: "",
  82803. properties: ""
  82804. }],
  82805. "Aggregation.clustersDbscan": ["points", "maxDistance", {
  82806. units: "",
  82807. minPoints: "",
  82808. mutate: ""
  82809. }],
  82810. "Aggregation.clustersKmeans": ["points", {
  82811. numberOfClusters: "",
  82812. mutate: ""
  82813. }],
  82814. "Booleans.booleanPointInPolygon": ["point", "polygon", {
  82815. ignoreBoundary: ""
  82816. }],
  82817. "Booleans.booleanPointOnLine": ["point", "linestring", {
  82818. ignoreEndVertices: ""
  82819. }],
  82820. "UnitConversion.toMercator": ["geojson", {
  82821. mutate: ""
  82822. }],
  82823. "UnitConversion.toWgs84": ["geojson", {
  82824. mutate: ""
  82825. }]
  82826. };
  82827. return _this;
  82828. }
  82829. /**
  82830. * @function ol.source.turf.prototype.process
  82831. * @description 执行 Turf.js 提供的相关空间分析方法。
  82832. * @param {string} type - Turf.js 提供的空间分析方法名。
  82833. * @param {Object} args - Turf.js 提供的空间分析方法对应的参数对象。
  82834. * @param {function} callback - 空间分析完成执行的回调函数,返回执行的结果。
  82835. * @param {boolean} addFeaturesToMap - 是否添加到 Map。
  82836. */
  82837. Turf_createClass(Turf, [{
  82838. key: "process",
  82839. value: function process(type, args, callback, addFeaturesToMap) {
  82840. var result; // 兼容版本4到5
  82841. try {
  82842. result = external_function_try_return_turf_catch_e_return_namespaceObject[type.split('.')[1]].apply(this, this.parse(type, args));
  82843. } catch (e) {
  82844. result = external_function_try_return_turf_catch_e_return_namespaceObject[type.split('.')[1]].apply(this, this.parseOption(type, args));
  82845. }
  82846. var features = null;
  82847. try {
  82848. features = new (external_ol_format_GeoJSON_default())().readFeatures(result);
  82849. } catch (e) {
  82850. if (callback) {
  82851. callback(result);
  82852. }
  82853. return;
  82854. }
  82855. addFeaturesToMap = addFeaturesToMap == null ? true : addFeaturesToMap;
  82856. if (addFeaturesToMap) {
  82857. this.addFeatures(features);
  82858. }
  82859. if (callback) {
  82860. callback(result);
  82861. }
  82862. }
  82863. }, {
  82864. key: "parse",
  82865. value: function parse(type, args) {
  82866. if (type === 'Transformation.union') {
  82867. return args['A'];
  82868. }
  82869. var result = [];
  82870. var tempArgs = this.turfMap[type];
  82871. if (tempArgs) {
  82872. tempArgs.map(function (key) {
  82873. result.push(args[key]);
  82874. return args[key];
  82875. });
  82876. }
  82877. return result;
  82878. }
  82879. }, {
  82880. key: "parseOption",
  82881. value: function parseOption(type, args) {
  82882. var result = [];
  82883. var tempArgs = this.turfOptionMap[type];
  82884. tempArgs.map(function (key) {
  82885. if (key instanceof Object) {
  82886. var options = key;
  82887. Object.keys(options).forEach(function (k) {
  82888. options[k] = args[k];
  82889. });
  82890. result.push(options);
  82891. } else {
  82892. result.push(args[key]);
  82893. }
  82894. return args;
  82895. });
  82896. return result;
  82897. }
  82898. }]);
  82899. return Turf;
  82900. }((external_ol_source_Vector_default()));
  82901. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Unique.js
  82902. function Unique_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Unique_typeof = function _typeof(obj) { return typeof obj; }; } else { Unique_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Unique_typeof(obj); }
  82903. function Unique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82904. function Unique_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  82905. function Unique_createClass(Constructor, protoProps, staticProps) { if (protoProps) Unique_defineProperties(Constructor.prototype, protoProps); if (staticProps) Unique_defineProperties(Constructor, staticProps); return Constructor; }
  82906. function Unique_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) Unique_setPrototypeOf(subClass, superClass); }
  82907. function Unique_setPrototypeOf(o, p) { Unique_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Unique_setPrototypeOf(o, p); }
  82908. function Unique_createSuper(Derived) { var hasNativeReflectConstruct = Unique_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Unique_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Unique_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Unique_possibleConstructorReturn(this, result); }; }
  82909. function Unique_possibleConstructorReturn(self, call) { if (call && (Unique_typeof(call) === "object" || typeof call === "function")) { return call; } return Unique_assertThisInitialized(self); }
  82910. function Unique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82911. function Unique_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  82912. function Unique_getPrototypeOf(o) { Unique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Unique_getPrototypeOf(o); }
  82913. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  82914. * This program are made available under the terms of the Apache License, Version 2.0
  82915. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82916. /**
  82917. * @class ol.source.Unique
  82918. * @category Visualization Theme
  82919. * @classdesc 单值专题图图层源。
  82920. * @param {string} name - 图层名称
  82921. * @param {Object} opt_options - 参数。
  82922. * @param {ol/Map} opt_options.map - 当前 Map 对象。
  82923. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层ID。
  82924. * @param {number} [opt_options.opacity=1] - 图层透明度。
  82925. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  82926. * @param {ol/proj/Projection} [opt_options.projection] - 投影信息。
  82927. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是1 或更高。
  82928. * @param {Array} [opt_options.resolutions] - 分辨率数组。
  82929. * @param {ol/source/State} [opt_options.state] - 资源状态。
  82930. * @param {string} [opt_options.themeField] - 指定创建专题图字段。
  82931. * @param {Object} [opt_options.style] - 专题图样式。
  82932. * @param {Object} [opt_options.styleGroups] - 各专题类型样式组。
  82933. * @param {boolean} [opt_options.isHoverAble=false] - 是否开启 hover 事件。
  82934. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  82935. * @param {(string|Object)} [opt_option.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  82936. * @extends {GeoFeature}
  82937. */
  82938. var Unique = /*#__PURE__*/function (_GeoFeature) {
  82939. Unique_inherits(Unique, _GeoFeature);
  82940. var _super = Unique_createSuper(Unique);
  82941. function Unique(name, opt_options) {
  82942. var _this;
  82943. Unique_classCallCheck(this, Unique);
  82944. _this = _super.call(this, name, opt_options);
  82945. _this.themeField = opt_options.themeField;
  82946. _this.style = opt_options.style;
  82947. _this.styleGroups = opt_options.styleGroups;
  82948. _this.isHoverAble = opt_options.isHoverAble;
  82949. _this.highlightStyle = opt_options.highlightStyle;
  82950. return _this;
  82951. }
  82952. /**
  82953. * @function ol.source.Unique.prototype.destroy
  82954. * @description 释放资源,将引用资源的属性置空。
  82955. */
  82956. Unique_createClass(Unique, [{
  82957. key: "destroy",
  82958. value: function destroy() {
  82959. this.style = null;
  82960. this.themeField = null;
  82961. this.styleGroups = null;
  82962. GeoFeature.prototype.destroy.apply(this, arguments);
  82963. }
  82964. /**
  82965. * @private
  82966. * @function ol.source.Unique.prototype.createThematicFeature
  82967. * @description 创建专题要素。
  82968. * @param {Object} feature - 要素。
  82969. */
  82970. }, {
  82971. key: "createThematicFeature",
  82972. value: function createThematicFeature(feature) {
  82973. var style = this.getStyleByData(feature); //创建专题要素时的可选参数
  82974. var options = {};
  82975. options.nodesClipPixel = this.nodesClipPixel;
  82976. options.isHoverAble = this.isHoverAble;
  82977. options.isMultiHover = this.isMultiHover;
  82978. options.isClickAble = this.isClickAble;
  82979. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(ThemeVector)
  82980. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  82981. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  82982. this.renderer.addShape(thematicFeature.shapes[m]);
  82983. }
  82984. return thematicFeature;
  82985. }
  82986. /**
  82987. * @private
  82988. * @function ol.source.Unique.prototype.getStyleByData
  82989. * @description 根据用户数据(feature)设置专题要素的 Style。
  82990. * @param {Object} fea - 用户要素数据。
  82991. */
  82992. }, {
  82993. key: "getStyleByData",
  82994. value: function getStyleByData(fea) {
  82995. var style = {};
  82996. var feature = fea;
  82997. style = Util.copyAttributesWithClip(style, this.style);
  82998. if (this.themeField && this.styleGroups && this.styleGroups.length > 0 && feature.attributes) {
  82999. var tf = this.themeField;
  83000. var Attrs = feature.attributes;
  83001. var Gro = this.styleGroups;
  83002. var isSfInAttrs = false; //指定的 themeField 是否是 feature 的属性字段之一
  83003. var attr = null; //属性值
  83004. for (var property in Attrs) {
  83005. if (tf === property) {
  83006. isSfInAttrs = true;
  83007. attr = Attrs[property];
  83008. break;
  83009. }
  83010. } //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
  83011. if (isSfInAttrs) {
  83012. for (var i = 0, len = Gro.length; i < len; i++) {
  83013. if (attr.toString() === Gro[i].value.toString()) {
  83014. //feature.style = CommonUtil.copyAttributes(feature.style, this.defaultStyle);
  83015. var sty1 = Gro[i].style;
  83016. style = Util.copyAttributesWithClip(style, sty1);
  83017. }
  83018. }
  83019. }
  83020. }
  83021. if (feature.style && this.isAllowFeatureStyle === true) {
  83022. style = Util.copyAttributesWithClip(feature.style);
  83023. }
  83024. return style;
  83025. }
  83026. }, {
  83027. key: "canvasFunctionInternal_",
  83028. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  83029. // eslint-disable-line no-unused-vars
  83030. return GeoFeature.prototype.canvasFunctionInternal_.apply(this, arguments);
  83031. }
  83032. }]);
  83033. return Unique;
  83034. }(GeoFeature);
  83035. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/VectorTileStyles.js
  83036. function VectorTileStyles_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { VectorTileStyles_typeof = function _typeof(obj) { return typeof obj; }; } else { VectorTileStyles_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return VectorTileStyles_typeof(obj); }
  83037. function VectorTileStyles_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83038. function VectorTileStyles_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83039. function VectorTileStyles_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorTileStyles_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorTileStyles_defineProperties(Constructor, staticProps); return Constructor; }
  83040. function VectorTileStyles_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) VectorTileStyles_setPrototypeOf(subClass, superClass); }
  83041. function VectorTileStyles_setPrototypeOf(o, p) { VectorTileStyles_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorTileStyles_setPrototypeOf(o, p); }
  83042. function VectorTileStyles_createSuper(Derived) { var hasNativeReflectConstruct = VectorTileStyles_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = VectorTileStyles_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = VectorTileStyles_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return VectorTileStyles_possibleConstructorReturn(this, result); }; }
  83043. function VectorTileStyles_possibleConstructorReturn(self, call) { if (call && (VectorTileStyles_typeof(call) === "object" || typeof call === "function")) { return call; } return VectorTileStyles_assertThisInitialized(self); }
  83044. function VectorTileStyles_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83045. function VectorTileStyles_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  83046. function VectorTileStyles_getPrototypeOf(o) { VectorTileStyles_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorTileStyles_getPrototypeOf(o); }
  83047. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  83048. * This program are made available under the terms of the Apache License, Version 2.0
  83049. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83050. /**
  83051. * @class ol.supermap.VectorTileStyles
  83052. * @classdesc 矢量瓦片风格。
  83053. * @category Visualization VectorTile
  83054. * @param {Object} options - 交互时所需可选参数。
  83055. * @extends {ol/Observable}
  83056. */
  83057. var VectorTileStyles = /*#__PURE__*/function (_Observable) {
  83058. VectorTileStyles_inherits(VectorTileStyles, _Observable);
  83059. var _super = VectorTileStyles_createSuper(VectorTileStyles);
  83060. function VectorTileStyles(options) {
  83061. var _this;
  83062. VectorTileStyles_classCallCheck(this, VectorTileStyles);
  83063. _this = _super.call(this);
  83064. if (!options) {
  83065. return VectorTileStyles_possibleConstructorReturn(_this);
  83066. }
  83067. var donotNeedServerCartoCss = false;
  83068. if (options.donotNeedServerCartoCss !== undefined) {
  83069. donotNeedServerCartoCss = options.donotNeedServerCartoCss;
  83070. }
  83071. VectorTileStyles.setDonotNeedServerCartoCss(donotNeedServerCartoCss);
  83072. if (options.view) {
  83073. VectorTileStyles.setView(options.view);
  83074. }
  83075. if (options.url) {
  83076. VectorTileStyles.setUrl(options.url);
  83077. }
  83078. if (options.cartoCss) {
  83079. VectorTileStyles.setCartoCss(options.cartoCss);
  83080. }
  83081. var selectedPointStyle = getDefaultSelectedPointStyle();
  83082. if (options.selectedPointStyle) {
  83083. selectedPointStyle = options.selectedPointStyle;
  83084. }
  83085. VectorTileStyles.setSelectedPointStyle(selectedPointStyle);
  83086. var selectedLineStyle = getDefaultSelectedLineStyle();
  83087. if (options.selectedLineStyle) {
  83088. selectedLineStyle = options.selectedLineStyle;
  83089. }
  83090. VectorTileStyles.setSelectedLineStyle(selectedLineStyle);
  83091. var selectedRegionStyle = getDefaultSelectedRegionStyle();
  83092. if (options.selectedRegionStyle) {
  83093. selectedRegionStyle = options.selectedRegionStyle;
  83094. }
  83095. VectorTileStyles.setSelectedRegionStyle(selectedRegionStyle);
  83096. var selectedTextStyle = getDefaultSelectedTextStyle();
  83097. if (options.selectedTextStyle) {
  83098. selectedTextStyle = options.selectedTextStyle;
  83099. }
  83100. VectorTileStyles.setSelectedTextStyle(selectedTextStyle);
  83101. var layersXHR = new XMLHttpRequest();
  83102. layersXHR.onreadystatechange = function () {
  83103. if (layersXHR.readyState == 4) {
  83104. var result = JSON.parse(layersXHR.responseText);
  83105. var layersInfo = {};
  83106. for (var i = 0, len = result.length; i < len; i++) {
  83107. var layers = result[i].subLayers.layers;
  83108. for (var j = 0, len1 = layers.length; j < len1; j++) {
  83109. layers[j].layerIndex = len1 - j;
  83110. layersInfo[layers[j].name] = layers[j];
  83111. }
  83112. }
  83113. VectorTileStyles.setLayersInfo(layersInfo);
  83114. if (!VectorTileStyles.getDonotNeedServerCartoCss()) {
  83115. var vectorStylesXHR = new XMLHttpRequest();
  83116. vectorStylesXHR.open("GET", Util.urlPathAppend(VectorTileStyles.getUrl(), "tileFeature/vectorstyles.json"), false);
  83117. vectorStylesXHR.onreadystatechange = function () {
  83118. if (vectorStylesXHR.readyState == 4) {
  83119. var vectorStyles = new JSONFormat().read(vectorStylesXHR.responseText);
  83120. var cartoCss;
  83121. if (vectorStyles.style && vectorStyles.type === 'cartoCSS') {
  83122. cartoCss = vectorStyles.style;
  83123. cartoCss = cartoCss.replace(/[@]/gi, "___");
  83124. cartoCss = cartoCss.replace(/\\#/gi, "___"); //替换一些关键符号
  83125. for (var attr in layersInfo) {
  83126. var newAttr = attr.replace(/[@#\s]/gi, "___");
  83127. cartoCss = cartoCss.replace(attr.replace(/[#]/gi, "\\#"), newAttr);
  83128. }
  83129. cartoCss = cartoCss.replace(/[#]/gi, "\n#"); //将zoom转化为scale,以免引起混淆
  83130. cartoCss = cartoCss.replace(/\[zoom/gi, "[scale");
  83131. }
  83132. var cartoShadersArray = new CartoCSS(cartoCss).getShaders();
  83133. var cartoShaders = {};
  83134. cartoShadersArray.map(function (cartoShader) {
  83135. cartoShaders[cartoShader.elements[0].clean] = cartoShaders[cartoShader.elements[0].clean] || {};
  83136. cartoShaders[cartoShader.elements[0].clean][cartoShader.attachment] = cartoShaders[cartoShader.elements[0].clean][cartoShader.attachment] || [];
  83137. cartoShaders[cartoShader.elements[0].clean][cartoShader.attachment].push(cartoShader);
  83138. return cartoShader;
  83139. });
  83140. VectorTileStyles.setCartoShaders(cartoShaders);
  83141. }
  83142. };
  83143. vectorStylesXHR.send(null);
  83144. }
  83145. if (VectorTileStyles.getCartoCss()) {
  83146. var clientCartoShadersArray = new CartoCSS(VectorTileStyles.getCartoCss()).getShaders();
  83147. var clientCartoShaders = {};
  83148. clientCartoShadersArray.map(function (cartoShader) {
  83149. clientCartoShaders[cartoShader.elements[0].clean] = clientCartoShaders[cartoShader.elements[0].clean] || {};
  83150. clientCartoShaders[cartoShader.elements[0].clean][cartoShader.attachment] = clientCartoShaders[cartoShader.elements[0].clean][cartoShader.attachment] || [];
  83151. clientCartoShaders[cartoShader.elements[0].clean][cartoShader.attachment].push(cartoShader);
  83152. return cartoShader;
  83153. });
  83154. VectorTileStyles.setClientCartoShaders(clientCartoShaders);
  83155. }
  83156. }
  83157. };
  83158. layersXHR.open("GET", Util.urlPathAppend(VectorTileStyles.getUrl(), "layers.json"), false);
  83159. layersXHR.send(null);
  83160. _this.on('featureSelected', function (e) {
  83161. VectorTileStyles.setSelectedId(e.selectedId);
  83162. VectorTileStyles.setLayerName(e.layerName);
  83163. });
  83164. /**
  83165. * @function VectorTileStyles.prototype.getDefaultSelectedPointStyle
  83166. * @description 设置默认选择后的点样式。
  83167. */
  83168. function getDefaultSelectedPointStyle() {
  83169. return new (external_ol_style_Style_default())({
  83170. image: new (external_ol_style_Circle_default())({
  83171. radius: 5,
  83172. fill: new (external_ol_style_Fill_default())({
  83173. color: 'blue'
  83174. })
  83175. })
  83176. });
  83177. }
  83178. /**
  83179. * @function VectorTileStyles.prototype.getDefaultSelectedLineStyle
  83180. * @description 设置默认选择后的线样式。
  83181. */
  83182. function getDefaultSelectedLineStyle() {
  83183. return new (external_ol_style_Style_default())({
  83184. stroke: new (external_ol_style_Stroke_default())({
  83185. color: 'blue',
  83186. width: 3
  83187. })
  83188. });
  83189. }
  83190. /**
  83191. * @function VectorTileStyles.prototype.getDefaultSelectedRegionStyle
  83192. * @description 设置默认选择后的面样式。
  83193. */
  83194. function getDefaultSelectedRegionStyle() {
  83195. return new (external_ol_style_Style_default())({
  83196. fill: new (external_ol_style_Fill_default())({
  83197. color: [0, 0, 255, 0.5]
  83198. }),
  83199. stroke: new (external_ol_style_Stroke_default())({
  83200. color: 'blue',
  83201. width: 3
  83202. })
  83203. });
  83204. }
  83205. /**
  83206. * @function VectorTileStyles.prototype.getDefaultSelectedTextStyle
  83207. * @description 设置默认选择后的文本样式。
  83208. */
  83209. function getDefaultSelectedTextStyle() {
  83210. return new (external_ol_style_Style_default())({
  83211. text: new (external_ol_style_Text_default())({
  83212. font: '15px Microsoft YaHei',
  83213. fill: new (external_ol_style_Fill_default())({
  83214. color: 'blue'
  83215. }),
  83216. stroke: new (external_ol_style_Stroke_default())({
  83217. color: 'white',
  83218. width: 1
  83219. })
  83220. })
  83221. });
  83222. }
  83223. return _this;
  83224. }
  83225. /**
  83226. * @function ol.supermap.VectorTileStyles.setCartoShaders
  83227. * @description 设置 Carto 的阴影。
  83228. * @param {Array} cartoShaders - Carto 阴影。
  83229. */
  83230. VectorTileStyles_createClass(VectorTileStyles, [{
  83231. key: "getFeatureStyle",
  83232. /**
  83233. * @function ol.supermap.VectorTileStyles.prototype.getFeatureStyle
  83234. * @description 获取要素样式。
  83235. * @param {Object} feature - 要素。
  83236. */
  83237. value: function getFeatureStyle(feature) {
  83238. var selectedStyle;
  83239. var layerName = feature.getProperties().layerName || feature.getProperties().layer;
  83240. var id = feature.getProperties().id || parseInt(feature.getProperties().SmID);
  83241. if (feature.getProperties().type && feature.getProperties().type.toUpperCase() === 'TEXT') {
  83242. selectedStyle = VectorTileStyles.getSelectedStyle(feature.getProperties().type.toUpperCase());
  83243. if (feature.getProperties().texts) {
  83244. selectedStyle.getText().text_ = feature.getProperties().texts[0];
  83245. } else {
  83246. selectedStyle.getText().text_ = "";
  83247. }
  83248. } else {
  83249. selectedStyle = VectorTileStyles.getSelectedStyle(feature.getGeometry().getType().toUpperCase());
  83250. }
  83251. if (selectedStyle) {
  83252. var selectedLayerName = VectorTileStyles.getLayerName();
  83253. var selectedId = VectorTileStyles.getSelectedId();
  83254. if (selectedLayerName === layerName && id === selectedId) {
  83255. return selectedStyle;
  83256. }
  83257. }
  83258. return VectorTileStyles.getStyle(layerName, feature);
  83259. }
  83260. }], [{
  83261. key: "setCartoShaders",
  83262. value: function setCartoShaders(cartoShaders) {
  83263. this.cartoShaders = cartoShaders;
  83264. }
  83265. /**
  83266. * @function ol.supermap.VectorTileStyles.getCartoShaders
  83267. * @description 获取客户端 Carto 的阴影。
  83268. */
  83269. }, {
  83270. key: "getCartoShaders",
  83271. value: function getCartoShaders() {
  83272. return this.cartoShaders;
  83273. }
  83274. /**
  83275. * @function ol.supermap.VectorTileStyles.setClientCartoShaders
  83276. * @description 设置客户端 Carto 的阴影。
  83277. * @param {Array} clientCartoShaders - 客户端 Carto 阴影。
  83278. */
  83279. }, {
  83280. key: "setClientCartoShaders",
  83281. value: function setClientCartoShaders(clientCartoShaders) {
  83282. this.clientCartoShaders = clientCartoShaders;
  83283. }
  83284. /**
  83285. * @function ol.supermap.VectorTileStyles.getClientCartoShaders
  83286. * @description 获取客户端 Carto 的阴影。
  83287. */
  83288. }, {
  83289. key: "getClientCartoShaders",
  83290. value: function getClientCartoShaders() {
  83291. return this.clientCartoShaders;
  83292. }
  83293. /**
  83294. * @function VectorTileStyles.setCartoCss
  83295. * @description 设置 cartoCss 的样式。
  83296. * @param {Object} cartoCss - cartoCss 的样式。
  83297. */
  83298. }, {
  83299. key: "setCartoCss",
  83300. value: function setCartoCss(cartoCss) {
  83301. this.cartoCss = cartoCss;
  83302. }
  83303. /**
  83304. * @function ol.supermap.VectorTileStyles.getCartoCss
  83305. * @description 获取 cartoCss 的样式。
  83306. */
  83307. }, {
  83308. key: "getCartoCss",
  83309. value: function getCartoCss() {
  83310. return this.cartoCss;
  83311. }
  83312. /**
  83313. * @function ol.supermap.VectorTileStyles.setDonotNeedServerCartoCss
  83314. * @description 设置是否需要 CartoCss 服务。
  83315. * @param {Object} donotNeedServerCartoCss - 是否需要 CartoCss 服务。
  83316. */
  83317. }, {
  83318. key: "setDonotNeedServerCartoCss",
  83319. value: function setDonotNeedServerCartoCss(donotNeedServerCartoCss) {
  83320. this.donotNeedServerCartoCss = donotNeedServerCartoCss;
  83321. }
  83322. /**
  83323. * @function ol.supermap.VectorTileStyles.getDonotNeedServerCartoCss
  83324. * @description 获取是否需要 CartoCss 服务。
  83325. */
  83326. }, {
  83327. key: "getDonotNeedServerCartoCss",
  83328. value: function getDonotNeedServerCartoCss() {
  83329. return this.donotNeedServerCartoCss;
  83330. }
  83331. /**
  83332. * @function ol.supermap.VectorTileStyles.setLayersInfo
  83333. * @description 设置图层信息服务。
  83334. * @param {Object} layersInfo - 图层信息。
  83335. */
  83336. }, {
  83337. key: "setLayersInfo",
  83338. value: function setLayersInfo(layersInfo) {
  83339. this.layersInfo = layersInfo;
  83340. }
  83341. /**
  83342. * @function ol.supermap.VectorTileStyles.getLayersInfo
  83343. * @description 获取图层信息服务。
  83344. */
  83345. }, {
  83346. key: "getLayersInfo",
  83347. value: function getLayersInfo() {
  83348. return this.layersInfo;
  83349. }
  83350. /**
  83351. * @function ol.supermap.VectorTileStyles.setUrl
  83352. * @description 设置地址。
  83353. * @param {string} url - 地址。
  83354. */
  83355. }, {
  83356. key: "setUrl",
  83357. value: function setUrl(url) {
  83358. this.url = url;
  83359. }
  83360. /**
  83361. * @function ol.supermap.VectorTileStyles.getUrl
  83362. * @description 获取地址。
  83363. */
  83364. }, {
  83365. key: "getUrl",
  83366. value: function getUrl() {
  83367. return this.url;
  83368. }
  83369. /**
  83370. * @function ol.supermap.VectorTileStyles.setView
  83371. * @description 设置视图。
  83372. * @param {Object} view - 视图。
  83373. */
  83374. }, {
  83375. key: "setView",
  83376. value: function setView(view) {
  83377. this.view = view;
  83378. }
  83379. /**
  83380. * @function ol.supermap.VectorTileStyles.getView
  83381. * @description 获取视图。
  83382. */
  83383. }, {
  83384. key: "getView",
  83385. value: function getView() {
  83386. return this.view;
  83387. }
  83388. /**
  83389. * @function ol.supermap.VectorTileStyles.setSelectedId
  83390. * @description 设置选择序号。
  83391. * @param {number} selectedId - 选择序号。
  83392. */
  83393. }, {
  83394. key: "setSelectedId",
  83395. value: function setSelectedId(selectedId) {
  83396. this.selectedId = selectedId;
  83397. }
  83398. /**
  83399. * @function ol.supermap.VectorTileStyles.getSelectedId
  83400. * @description 获取选择序号。
  83401. */
  83402. }, {
  83403. key: "getSelectedId",
  83404. value: function getSelectedId() {
  83405. return this.selectedId;
  83406. }
  83407. /**
  83408. * @function ol.supermap.VectorTileStyles.setLayerName
  83409. * @description 设置图层名称。
  83410. * @param {string} layerName - 图层名称。
  83411. */
  83412. }, {
  83413. key: "setLayerName",
  83414. value: function setLayerName(layerName) {
  83415. this.layerName = layerName;
  83416. }
  83417. /**
  83418. * @function ol.supermap.VectorTileStyles.getLayerName
  83419. * @description 获取图层名称。
  83420. */
  83421. }, {
  83422. key: "getLayerName",
  83423. value: function getLayerName() {
  83424. return this.layerName;
  83425. }
  83426. /**
  83427. * @function ol.supermap.VectorTileStyles.setSelectedPointStyle
  83428. * @description 设置选择后点样式。
  83429. * @param {Object} selectedPointStyle - 选择后点样式。
  83430. */
  83431. }, {
  83432. key: "setSelectedPointStyle",
  83433. value: function setSelectedPointStyle(selectedPointStyle) {
  83434. this.selectedPointStyle = selectedPointStyle;
  83435. }
  83436. /**
  83437. * @function ol.supermap.VectorTileStyles.setSelectedLineStyle
  83438. * @description 设置选择后线样式。
  83439. * @param {Object} selectedLineStyle - 选择后线样式。
  83440. */
  83441. }, {
  83442. key: "setSelectedLineStyle",
  83443. value: function setSelectedLineStyle(selectedLineStyle) {
  83444. this.selectedLineStyle = selectedLineStyle;
  83445. }
  83446. /**
  83447. * @function ol.supermap.VectorTileStyles.setSelectedRegionStyle
  83448. * @description 设置选择后面样式。
  83449. * @param {Object} selectedRegionStyle - 选择后面样式。
  83450. */
  83451. }, {
  83452. key: "setSelectedRegionStyle",
  83453. value: function setSelectedRegionStyle(selectedRegionStyle) {
  83454. this.selectedRegionStyle = selectedRegionStyle;
  83455. }
  83456. /**
  83457. * @function ol.supermap.VectorTileStyles.setSelectedRegionStyle
  83458. * @description 设置选择后文本样式。
  83459. * @param {Object} selectedTextStyle - 选择后文本样式。
  83460. */
  83461. }, {
  83462. key: "setSelectedTextStyle",
  83463. value: function setSelectedTextStyle(selectedTextStyle) {
  83464. this.selectedTextStyle = selectedTextStyle;
  83465. }
  83466. /**
  83467. * @function ol.supermap.VectorTileStyles.getSelectedStyle
  83468. * @description 设置选择后的样式。
  83469. * @param {string} type - 选择后的样式。
  83470. */
  83471. }, {
  83472. key: "getSelectedStyle",
  83473. value: function getSelectedStyle(type) {
  83474. if (type === 'POINT' || type === 'MULTIPOINT') {
  83475. return this.selectedPointStyle;
  83476. }
  83477. if (type === 'LINESTRING' || type === 'MULTILINESTRING') {
  83478. return this.selectedLineStyle;
  83479. }
  83480. if (type === 'POLYGON' || type === 'MULTIPOLYGON') {
  83481. return this.selectedRegionStyle;
  83482. }
  83483. if (type === 'TEXT') {
  83484. return this.selectedTextStyle;
  83485. }
  83486. }
  83487. /**
  83488. * @function ol.supermap.VectorTileStyles.getLayerInfo
  83489. * @description 获取图层的信息。
  83490. * @param {string} layerName - 图层名。
  83491. */
  83492. }, {
  83493. key: "getLayerInfo",
  83494. value: function getLayerInfo(layerName) {
  83495. var layersInfo = VectorTileStyles.getLayersInfo();
  83496. if (layersInfo === undefined) {
  83497. return null;
  83498. }
  83499. var layerInfo = layersInfo[layerName];
  83500. if (!layerInfo) {
  83501. return null;
  83502. }
  83503. var layerInfo_simple = {
  83504. layerIndex: layerInfo.layerIndex,
  83505. ugcLayerType: layerInfo.ugcLayerType
  83506. };
  83507. switch (layerInfo.ugcLayerType) {
  83508. case "VECTOR":
  83509. layerInfo_simple.layerStyle = layerInfo.style ? layerInfo.style : null;
  83510. break;
  83511. case "THEME":
  83512. var theme = layerInfo.theme;
  83513. layerInfo_simple.layerStyle = theme ? theme.defaultStyle : null;
  83514. if (theme && theme.type === "LABEL") {
  83515. layerInfo_simple.type = theme.type;
  83516. layerInfo_simple.textField = theme.labelExpression;
  83517. }
  83518. break;
  83519. default:
  83520. //SVTile发布出来的地图没有ugcLayerType属性
  83521. if (layerInfo.style) {
  83522. layerInfo_simple.layerStyle = layerInfo.style;
  83523. }
  83524. break;
  83525. }
  83526. return layerInfo_simple;
  83527. }
  83528. /**
  83529. * @function ol.supermap.VectorTileStyles.getStyle
  83530. * @description 获取样式。
  83531. * @param {string} originalLayerName - 原始图层信息。
  83532. * @param {Object} feature - 要素对象。
  83533. */
  83534. }, {
  83535. key: "getStyle",
  83536. value: function getStyle(originalLayerName, feature) {
  83537. var url = VectorTileStyles.getUrl(),
  83538. view = VectorTileStyles.getView(),
  83539. zoom = view.getZoom(),
  83540. dpi = 96,
  83541. scale = core_Util_Util.resolutionToScale(view.getResolution(), dpi, REST_Unit.METER),
  83542. layerName = originalLayerName.replace(/(@)/gi, '___').replace(/(#)/gi, '___'); // feature对象样式的配置遵循以下优先级:
  83543. // 客户端CartoCSS > 服务器端CartoCSS > 服务器端layer样式 > 客户端默认样式。
  83544. if (VectorTileStyles.getCartoCss() && VectorTileStyles.getClientCartoShaders()[layerName]) {
  83545. return getStyleArray(VectorTileStyles.getClientCartoShaders()[layerName]);
  83546. }
  83547. var layerInfo = VectorTileStyles.getLayerInfo(originalLayerName);
  83548. if (!VectorTileStyles.getDonotNeedServerCartoCss() && VectorTileStyles.getCartoShaders()[layerName]) {
  83549. //如果是文本,这里特殊处理。
  83550. if (feature.getProperties().textStyle || feature.getProperties().TEXT_FEATURE_CONTENT || layerInfo.type == 'LABEL' && layerInfo.textField) {
  83551. var featureStyle = StyleUtils.getValidStyleFromLayerInfo(layerInfo, feature, url);
  83552. if (feature.getGeometry().getType().toUpperCase() === "POINT") {
  83553. featureStyle = mergeTextFeatureStyle(layerInfo, feature, url);
  83554. }
  83555. return featureStyle;
  83556. }
  83557. return getStyleArray(VectorTileStyles.getCartoShaders()[layerName]);
  83558. }
  83559. if (layerInfo) {
  83560. return StyleUtils.getValidStyleFromLayerInfo(layerInfo, feature, url);
  83561. }
  83562. function getStyleArray(shaderAttachment) {
  83563. var styleArray = [];
  83564. for (var j in shaderAttachment) {
  83565. shaderAttachment[j].map(function (shader) {
  83566. styleArray.push(StyleUtils.getStyleFromCarto(zoom, scale, shader, feature, true, url));
  83567. return shader;
  83568. });
  83569. }
  83570. return styleArray;
  83571. }
  83572. /**
  83573. * @function ol.supermap.VectorTileStyles.prototype.mergeTextFeatureStyle
  83574. * @description 合并文本要素样式。
  83575. * @param {string} layerInfo - 图层信息。
  83576. * @param {Object} feature - 获取的要素。
  83577. * @param {string} url - 地址。
  83578. */
  83579. function mergeTextFeatureStyle(layerInfo, feature, url) {
  83580. var textFeatureStyle = StyleUtils.getValidStyleFromLayerInfo(layerInfo, feature, url);
  83581. if (layerInfo.type == 'LABEL') {
  83582. feature.setProperties({
  83583. type: "TEXT"
  83584. });
  83585. var cartoTextStyles = getStyleArray(VectorTileStyles.getCartoShaders()[layerName]);
  83586. var textStyle = textFeatureStyle.getText();
  83587. for (var i = 0; i < cartoTextStyles.length; i++) {
  83588. if (!textStyle) {
  83589. textStyle = cartoTextStyles[i].getText();
  83590. } else {
  83591. textStyle.setText(cartoTextStyles[i].getText().getText());
  83592. }
  83593. }
  83594. textFeatureStyle.setText(textStyle);
  83595. return textFeatureStyle;
  83596. }
  83597. return textFeatureStyle;
  83598. }
  83599. }
  83600. }]);
  83601. return VectorTileStyles;
  83602. }((external_ol_Observable_default()));
  83603. ;// CONCATENATED MODULE: external "ol.source.VectorTile"
  83604. var external_ol_source_VectorTile_namespaceObject = ol.source.VectorTile;
  83605. var external_ol_source_VectorTile_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_VectorTile_namespaceObject);
  83606. ;// CONCATENATED MODULE: external "ol.format.MVT"
  83607. var external_ol_format_MVT_namespaceObject = ol.format.MVT;
  83608. var external_ol_format_MVT_default = /*#__PURE__*/__webpack_require__.n(external_ol_format_MVT_namespaceObject);
  83609. ;// CONCATENATED MODULE: external "ol.proj.Projection"
  83610. var external_ol_proj_Projection_namespaceObject = ol.proj.Projection;
  83611. var external_ol_proj_Projection_default = /*#__PURE__*/__webpack_require__.n(external_ol_proj_Projection_namespaceObject);
  83612. ;// CONCATENATED MODULE: ./src/openlayers/overlay/VectorTileSuperMapRest.js
  83613. function VectorTileSuperMapRest_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { VectorTileSuperMapRest_typeof = function _typeof(obj) { return typeof obj; }; } else { VectorTileSuperMapRest_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return VectorTileSuperMapRest_typeof(obj); }
  83614. function VectorTileSuperMapRest_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83615. function VectorTileSuperMapRest_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83616. function VectorTileSuperMapRest_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorTileSuperMapRest_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorTileSuperMapRest_defineProperties(Constructor, staticProps); return Constructor; }
  83617. function VectorTileSuperMapRest_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) VectorTileSuperMapRest_setPrototypeOf(subClass, superClass); }
  83618. function VectorTileSuperMapRest_setPrototypeOf(o, p) { VectorTileSuperMapRest_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorTileSuperMapRest_setPrototypeOf(o, p); }
  83619. function VectorTileSuperMapRest_createSuper(Derived) { var hasNativeReflectConstruct = VectorTileSuperMapRest_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = VectorTileSuperMapRest_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = VectorTileSuperMapRest_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return VectorTileSuperMapRest_possibleConstructorReturn(this, result); }; }
  83620. function VectorTileSuperMapRest_possibleConstructorReturn(self, call) { if (call && (VectorTileSuperMapRest_typeof(call) === "object" || typeof call === "function")) { return call; } return VectorTileSuperMapRest_assertThisInitialized(self); }
  83621. function VectorTileSuperMapRest_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83622. function VectorTileSuperMapRest_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  83623. function VectorTileSuperMapRest_getPrototypeOf(o) { VectorTileSuperMapRest_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorTileSuperMapRest_getPrototypeOf(o); }
  83624. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  83625. * This program are made available under the terms of the Apache License, Version 2.0
  83626. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83627. /**
  83628. * @class ol.source.VectorTileSuperMapRest
  83629. * @category Visualization VectorTile
  83630. * @classdesc 矢量瓦片图层源。
  83631. * @param {Object} options - 参数。
  83632. * @param {(string|undefined)} options.url - SuperMap iServer 地图服务地址。
  83633. * @param {(string|Object|undefined)} options.style - Mapbox Style JSON 对象或获取 Mapbox Style JSON 对象的 URL。当 `options.format` 为 `ol/format/MVT ` 且 `options.source` 不为空时有效,优先级高于 `options.url`。
  83634. * @param {(string|undefined)} options.source - Mapbox Style JSON 对象中的source名称。当 `options.style` 设置时有效。当不配置时,默认为 Mapbox Style JSON 的 `sources` 对象中的第一个。
  83635. * @param {(string|Object)} [options.attributions='Tile Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  83636. * @param {Object} [options.format] - 瓦片的要素格式化。
  83637. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  83638. * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
  83639. * @extends {ol/source/VectorTile}
  83640. */
  83641. var VectorTileSuperMapRest = /*#__PURE__*/function (_VectorTile) {
  83642. VectorTileSuperMapRest_inherits(VectorTileSuperMapRest, _VectorTile);
  83643. var _super = VectorTileSuperMapRest_createSuper(VectorTileSuperMapRest);
  83644. function VectorTileSuperMapRest(options) {
  83645. var _this;
  83646. VectorTileSuperMapRest_classCallCheck(this, VectorTileSuperMapRest);
  83647. if (options.url === undefined && options.style === undefined) {
  83648. console.error("one of 'options.style' or 'options.style' is required");
  83649. }
  83650. var zRegEx = /\{z\}/g;
  83651. var xRegEx = /\{x\}/g;
  83652. var yRegEx = /\{y\}/g;
  83653. var dashYRegEx = /\{-y\}/g;
  83654. options.attributions = options.attributions || "Tile Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>";
  83655. if (['4', '5'].indexOf(core_Util_Util.getOlVersion()) < 0) {
  83656. options.tileSize = options.format instanceof (external_ol_format_MVT_default()) && options.style ? 512 : 256;
  83657. }
  83658. _this = _super.call(this, {
  83659. attributions: options.attributions,
  83660. cacheSize: options.cacheSize,
  83661. format: options.format || new (external_ol_format_GeoJSON_default())(),
  83662. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  83663. overlaps: options.overlaps,
  83664. projection: options.projection,
  83665. state: options.format instanceof (external_ol_format_MVT_default()) && options.style && Object.prototype.toString.call(options.style) == '[object String]' ? 'loading' : options.state,
  83666. tileClass: options.tileClass,
  83667. tileGrid: options.tileGrid,
  83668. tilePixelRatio: options.tilePixelRatio,
  83669. tileUrlFunction: options.format instanceof (external_ol_format_MVT_default()) && options.style ? zxyTileUrlFunction : tileUrlFunction,
  83670. tileLoadFunction: options.format instanceof (external_ol_format_MVT_default()) ? mvtTileLoadFunction : tileLoadFunction,
  83671. wrapX: options.wrapX !== undefined ? options.wrapX : false,
  83672. tileSize: options.tileSize || null,
  83673. zDirection: ['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1 ? null : 0
  83674. });
  83675. var me = VectorTileSuperMapRest_assertThisInitialized(_this);
  83676. me.withCredentials = options.withCredentials;
  83677. me._tileType = options.tileType || 'ScaleXY';
  83678. _this.vectorTileStyles = new VectorTileStyles();
  83679. if (options.format instanceof (external_ol_format_MVT_default()) && options.style) {
  83680. if (Object.prototype.toString.call(options.style) == '[object String]') {
  83681. FetchRequest.get(options.style, null, {
  83682. withCredentials: options.withCredentials
  83683. }).then(function (response) {
  83684. return response.json();
  83685. }).then(function (mbStyle) {
  83686. _this._fillByStyleJSON(mbStyle, options.source);
  83687. _this.setState('ready');
  83688. });
  83689. } else {
  83690. _this._fillByStyleJSON(options.style, options.source);
  83691. }
  83692. } else {
  83693. _this._fillByRestMapOptions(options.url, options);
  83694. }
  83695. function tileUrlFunction(tileCoord, pixelRatio, projection) {
  83696. if (!me.tileGrid) {
  83697. me.tileGrid = me.getTileGridForProjection(projection);
  83698. }
  83699. var z = tileCoord[0];
  83700. var x = tileCoord[1];
  83701. var y = ['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1 ? -tileCoord[2] - 1 : tileCoord[2];
  83702. var tileSize = external_ol_size_namespaceObject.toSize(me.tileGrid.getTileSize(z, me.tmpSize));
  83703. var params = '';
  83704. if (me.tileType === 'ZXY') {
  83705. params = '&width=' + tileSize[0] + '&height=' + tileSize[1] + '&x=' + x + '&y=' + y + '&z=' + z;
  83706. } else if (me.tileType === 'ViewBounds') {
  83707. var tileExtent = me.tileGrid.getTileCoordExtent(tileCoord);
  83708. params = '&width=' + tileSize[0] + '&height=' + tileSize[1] + '&viewBounds=' + tileExtent[0] + ',' + tileExtent[1] + ',' + tileExtent[2] + ',' + tileExtent[3];
  83709. } else {
  83710. var origin = me.tileGrid.getOrigin(z);
  83711. var resolution = me.tileGrid.getResolution(z);
  83712. var dpi = 96;
  83713. var unit = projection.getUnits() || 'degrees';
  83714. if (unit === 'degrees') {
  83715. unit = REST_Unit.DEGREE;
  83716. }
  83717. if (unit === 'm') {
  83718. unit = REST_Unit.METER;
  83719. }
  83720. var scale = core_Util_Util.resolutionToScale(resolution, dpi, unit);
  83721. params = '&x=' + x + '&y=' + y + '&width=' + tileSize[0] + '&height=' + tileSize[1] + '&scale=' + scale + "&origin={'x':" + origin[0] + ",'y':" + origin[1] + '}';
  83722. }
  83723. return me._tileUrl + encodeURI(params);
  83724. }
  83725. function zxyTileUrlFunction(tileCoord) {
  83726. if (!tileCoord) {
  83727. return undefined;
  83728. } else {
  83729. return me._tileUrl.replace(zRegEx, tileCoord[0].toString()).replace(xRegEx, tileCoord[1].toString()).replace(yRegEx, function () {
  83730. var y = ['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1 ? -tileCoord[2] - 1 : tileCoord[2];
  83731. return y.toString();
  83732. }).replace(dashYRegEx, function () {
  83733. var z = tileCoord[0];
  83734. var range = me.tileGrid.getFullTileRange(z);
  83735. var y = range.getHeight() + tileCoord[2];
  83736. return y.toString();
  83737. });
  83738. }
  83739. }
  83740. /**
  83741. * @private
  83742. * @function ol.source.VectorTileSuperMapRest.prototype.tileLoadFunction
  83743. * @description 加载瓦片。
  83744. * @param {Object} tile -瓦片类。
  83745. * @param {string} tileUrl - 瓦片地址。
  83746. */
  83747. function tileLoadFunction(tile, tileUrl) {
  83748. var regWidth = new RegExp('(^|\\?|&)' + 'width' + '=([^&]*)(\\s|&|$)');
  83749. var regHeight = new RegExp('(^|\\?|&)' + 'height' + '=([^&]*)(\\s|&|$)');
  83750. var width = Number(tileUrl.match(regWidth)[2]);
  83751. var height = Number(tileUrl.match(regHeight)[2]);
  83752. tile.setLoader(function (extent, resolution, projection) {
  83753. FetchRequest.get(tileUrl).then(function (response) {
  83754. if (tile.getFormat() instanceof (external_ol_format_GeoJSON_default())) {
  83755. return response.json();
  83756. }
  83757. }).then(function (tileFeatureJson) {
  83758. var features = [];
  83759. if (tile.getFormat() instanceof (external_ol_format_GeoJSON_default())) {
  83760. tileFeatureJson.recordsets.map(function (recordset) {
  83761. recordset.features.map(function (feature) {
  83762. var points = [];
  83763. var startIndex = 0;
  83764. for (var i = 0; i < feature.geometry.parts.length; i++) {
  83765. var partPointsLength = feature.geometry.parts[i] * 2;
  83766. for (var j = 0, index = startIndex; j < partPointsLength; j += 2, index += 2) {
  83767. points.push(new Point(feature.geometry.points[index], feature.geometry.points[index + 1]));
  83768. }
  83769. startIndex += partPointsLength;
  83770. }
  83771. feature.geometry.points = points;
  83772. return feature;
  83773. });
  83774. return recordset;
  83775. });
  83776. tileFeatureJson.recordsets.map(function (recordset) {
  83777. recordset.features.map(function (feature) {
  83778. feature.layerName = recordset.layerName;
  83779. feature.type = feature.geometry.type;
  83780. features.push(feature);
  83781. return feature;
  83782. });
  83783. return recordset;
  83784. });
  83785. var dataProjection = new (external_ol_proj_Projection_default())({
  83786. extent: [0, 0, 256, 256],
  83787. code: 'TILE_PIXELS',
  83788. units: 'tile-pixels'
  83789. });
  83790. if (['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1) {
  83791. tile.setExtent([0, 0, width, height]);
  83792. tile.setProjection(dataProjection);
  83793. features = tile.getFormat().readFeatures(core_Util_Util.toGeoJSON(features));
  83794. } else {
  83795. features = tile.getFormat().readFeatures(core_Util_Util.toGeoJSON(features), {
  83796. extent: extent,
  83797. dataProjection: dataProjection,
  83798. featureProjection: projection
  83799. });
  83800. }
  83801. tile.setFeatures(features);
  83802. }
  83803. });
  83804. });
  83805. }
  83806. /**
  83807. * @private
  83808. * @function ol.source.VectorTileSuperMapRest.prototype.tileLoadFunction
  83809. * @description 加载瓦片。
  83810. * @param {Object} tile -瓦片类。
  83811. * @param {string} tileUrl - 瓦片地址。
  83812. */
  83813. function mvtTileLoadFunction(tile, tileUrl) {
  83814. var format = tile.getFormat();
  83815. var success = tile.onLoad.bind(tile);
  83816. var failure = tile.onError.bind(tile);
  83817. tile.setLoader(function (extent, resolution, projection) {
  83818. var xhr = new XMLHttpRequest();
  83819. xhr.open('GET', typeof tileUrl === 'function' ? tileUrl(extent, resolution, projection) : tileUrl, true);
  83820. if (format.getType() == 'arraybuffer') {
  83821. xhr.responseType = 'arraybuffer';
  83822. }
  83823. xhr.withCredentials = me.withCredentials;
  83824. xhr.onload = function () {
  83825. if (!xhr.status || xhr.status >= 200 && xhr.status < 300) {
  83826. var type = format.getType();
  83827. var source = void 0;
  83828. if (type === 'json' || type === 'text') {
  83829. source = xhr.responseText;
  83830. } else if (type === 'xml') {
  83831. source = xhr.responseXML;
  83832. if (!source) {
  83833. source = new DOMParser().parseFromString(xhr.responseText, 'application/xml');
  83834. }
  83835. } else if (type === 'arraybuffer') {
  83836. source = xhr.response;
  83837. }
  83838. if (source) {
  83839. if (['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1) {
  83840. success.call(this, format.readFeatures(source, {
  83841. featureProjection: projection
  83842. }), format.readProjection(source), format.getLastExtent());
  83843. } else {
  83844. success.call(this, format.readFeatures(source, {
  83845. extent: extent,
  83846. featureProjection: projection
  83847. }), format.readProjection(source));
  83848. }
  83849. } else {
  83850. failure.call(this);
  83851. }
  83852. } else {
  83853. failure.call(this);
  83854. }
  83855. }.bind(this);
  83856. xhr.onerror = function () {
  83857. failure.call(this);
  83858. }.bind(this);
  83859. xhr.send();
  83860. });
  83861. }
  83862. return _this;
  83863. }
  83864. VectorTileSuperMapRest_createClass(VectorTileSuperMapRest, [{
  83865. key: "_fillByStyleJSON",
  83866. value: function _fillByStyleJSON(style, source) {
  83867. if (!source) {
  83868. source = Object.keys(style.sources)[0];
  83869. }
  83870. if (style.sources && style.sources[source]) {
  83871. //ToDo 支持多个tiles地址
  83872. this._tileUrl = style.sources[source].tiles[0];
  83873. }
  83874. if (style.metadata && style.metadata.indexbounds) {
  83875. var indexbounds = style.metadata.indexbounds;
  83876. var max = Math.max(indexbounds[2] - indexbounds[0], indexbounds[3] - indexbounds[1]);
  83877. var defaultResolutions = [];
  83878. for (var index = 0; index < 30; index++) {
  83879. defaultResolutions.push(max / 512 / Math.pow(2, index));
  83880. }
  83881. this.tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  83882. extent: style.metadata.indexbounds,
  83883. resolutions: defaultResolutions,
  83884. tileSize: [512, 512]
  83885. });
  83886. }
  83887. }
  83888. }, {
  83889. key: "_fillByRestMapOptions",
  83890. value: function _fillByRestMapOptions(url, options) {
  83891. this._tileUrl = Util.urlPathAppend(options.url, 'tileFeature.json');
  83892. if (options.format instanceof (external_ol_format_MVT_default())) {
  83893. this._tileUrl = Util.urlPathAppend(options.url, 'tileFeature.mvt');
  83894. } //为url添加安全认证信息片段
  83895. options.serverType = options.serverType || ServerType.ISERVER;
  83896. this._tileUrl = appendCredential(this._tileUrl, options.serverType);
  83897. function appendCredential(url, serverType) {
  83898. var newUrl = url,
  83899. credential,
  83900. value;
  83901. switch (serverType) {
  83902. case ServerType.IPORTAL:
  83903. value = SecurityManager.getToken(url);
  83904. credential = value ? new Credential(value, 'token') : null;
  83905. if (!credential) {
  83906. value = SecurityManager.getKey(url);
  83907. credential = value ? new Credential(value, 'key') : null;
  83908. }
  83909. break;
  83910. case ServerType.ONLINE:
  83911. value = SecurityManager.getKey(url);
  83912. credential = value ? new Credential(value, 'key') : null;
  83913. break;
  83914. default:
  83915. //iserver or others
  83916. value = SecurityManager.getToken(url);
  83917. credential = value ? new Credential(value, 'token') : null;
  83918. break;
  83919. }
  83920. if (credential) {
  83921. newUrl = Util.urlAppend(newUrl, credential.getUrlParameters());
  83922. }
  83923. return newUrl;
  83924. }
  83925. var returnAttributes = true;
  83926. if (options.returnAttributes !== undefined) {
  83927. returnAttributes = options.returnAttributes;
  83928. }
  83929. var params = {};
  83930. params['returnAttributes'] = returnAttributes;
  83931. if (options._cache !== undefined) {
  83932. params['_cache'] = options._cache;
  83933. }
  83934. if (options.layersID !== undefined) {
  83935. params['layersID'] = options.layersID;
  83936. }
  83937. if (options.layerNames !== undefined) {
  83938. params['layerNames'] = options.layerNames;
  83939. }
  83940. if (options.expands !== undefined) {
  83941. params['expands'] = options.expands;
  83942. }
  83943. if (options.compressTolerance !== undefined) {
  83944. params['compressTolerance'] = options.compressTolerance;
  83945. }
  83946. if (options.coordinateType !== undefined) {
  83947. params['coordinateType'] = options.coordinateType;
  83948. }
  83949. if (options.returnCutEdges !== undefined) {
  83950. params['returnCutEdges'] = options.returnCutEdges;
  83951. }
  83952. this._tileUrl = Util.urlAppend(this._tileUrl, Util.getParameterString(params));
  83953. }
  83954. /**
  83955. * @function ol.source.VectorTileSuperMapRest.optionsFromMapJSON
  83956. * @param {string} url - 地址。
  83957. * @param {Object} mapJSONObj - 地图 JSON。
  83958. * @description 获取地图 JSON 信息。
  83959. */
  83960. }], [{
  83961. key: "optionsFromMapJSON",
  83962. value: function optionsFromMapJSON(url, mapJSONObj) {
  83963. var options = {};
  83964. options.url = url;
  83965. options.crossOrigin = 'anonymous';
  83966. var extent = [mapJSONObj.bounds.left, mapJSONObj.bounds.bottom, mapJSONObj.bounds.right, mapJSONObj.bounds.top];
  83967. var resolutions = getResolutions();
  83968. function getResolutions() {
  83969. var level = 17;
  83970. var dpi = 96;
  83971. var width = extent[2] - extent[0];
  83972. var height = extent[3] - extent[1];
  83973. var tileSize = width >= height ? width : height;
  83974. var maxReolution;
  83975. if (tileSize === width) {
  83976. maxReolution = tileSize / mapJSONObj.viewer.width;
  83977. } else {
  83978. maxReolution = tileSize / mapJSONObj.viewer.height;
  83979. }
  83980. var resolutions = [];
  83981. var unit = REST_Unit.METER;
  83982. if (mapJSONObj.coordUnit === REST_Unit.DEGREE) {
  83983. unit = REST_Unit.DEGREE;
  83984. }
  83985. if (mapJSONObj.visibleScales.length > 0) {
  83986. var scales = initScales(mapJSONObj);
  83987. for (var i = 0; i < scales.length; i++) {
  83988. resolutions.push(core_Util_Util.scaleToResolution(scales[i], dpi, unit));
  83989. }
  83990. } else {
  83991. for (var _i = 0; _i < level; _i++) {
  83992. resolutions.push(maxReolution / Math.pow(2, _i));
  83993. }
  83994. }
  83995. return resolutions;
  83996. }
  83997. function initScales(mapJSONObj) {
  83998. var scales = mapJSONObj.visibleScales;
  83999. if (!scales) {
  84000. return null;
  84001. }
  84002. var viewBounds = mapJSONObj.viewBounds,
  84003. coordUnit = mapJSONObj.coordUnit,
  84004. viewer = mapJSONObj.viewer,
  84005. scale = mapJSONObj.scale,
  84006. datumAxis = mapJSONObj.datumAxis; //将jsonObject转化为SuperMap.Bounds,用于计算dpi。
  84007. viewBounds = new Bounds(viewBounds.left, viewBounds.bottom, viewBounds.right, viewBounds.top);
  84008. viewer = new Size(viewer.rightBottom.x, viewer.rightBottom.y);
  84009. coordUnit = coordUnit.toLowerCase();
  84010. datumAxis = datumAxis || 6378137;
  84011. var units = coordUnit;
  84012. var dpi = Util.calculateDpi(viewBounds, viewer, scale, units, datumAxis);
  84013. var resolutions = _resolutionsFromScales(scales);
  84014. var len = resolutions.length;
  84015. scales = [len];
  84016. for (var i = 0; i < len; i++) {
  84017. scales[i] = Util.getScaleFromResolutionDpi(resolutions[i], dpi, units, datumAxis);
  84018. }
  84019. function _resolutionsFromScales(scales) {
  84020. if (scales === null) {
  84021. return;
  84022. }
  84023. var resolutions, len;
  84024. len = scales.length;
  84025. resolutions = [len];
  84026. for (var i = 0; i < len; i++) {
  84027. resolutions[i] = Util.getResolutionFromScaleDpi(scales[i], dpi, units, datumAxis);
  84028. }
  84029. return resolutions;
  84030. }
  84031. return scales;
  84032. }
  84033. options.tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  84034. extent: extent,
  84035. resolutions: resolutions
  84036. }); //options.projection = 'EPSG:' + mapJSONObj.prjCoordSys.epsgCode;
  84037. return options;
  84038. }
  84039. }]);
  84040. return VectorTileSuperMapRest;
  84041. }((external_ol_source_VectorTile_default()));
  84042. ;// CONCATENATED MODULE: ./src/openlayers/overlay/HeatMap.js
  84043. function HeatMap_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { HeatMap_typeof = function _typeof(obj) { return typeof obj; }; } else { HeatMap_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return HeatMap_typeof(obj); }
  84044. function HeatMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  84045. function HeatMap_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  84046. function HeatMap_createClass(Constructor, protoProps, staticProps) { if (protoProps) HeatMap_defineProperties(Constructor.prototype, protoProps); if (staticProps) HeatMap_defineProperties(Constructor, staticProps); return Constructor; }
  84047. function HeatMap_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) HeatMap_setPrototypeOf(subClass, superClass); }
  84048. function HeatMap_setPrototypeOf(o, p) { HeatMap_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HeatMap_setPrototypeOf(o, p); }
  84049. function HeatMap_createSuper(Derived) { var hasNativeReflectConstruct = HeatMap_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HeatMap_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HeatMap_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HeatMap_possibleConstructorReturn(this, result); }; }
  84050. function HeatMap_possibleConstructorReturn(self, call) { if (call && (HeatMap_typeof(call) === "object" || typeof call === "function")) { return call; } return HeatMap_assertThisInitialized(self); }
  84051. function HeatMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  84052. function HeatMap_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  84053. function HeatMap_getPrototypeOf(o) { HeatMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HeatMap_getPrototypeOf(o); }
  84054. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  84055. * This program are made available under the terms of the Apache License, Version 2.0
  84056. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84057. /**
  84058. * @class ol.source.HeatMap
  84059. * @classdesc 热力图层类。
  84060. * @category Visualization HeatMap
  84061. * @param {string} name - 图层名称s
  84062. * @param {Object} options - 构造参数。
  84063. * @param {ol/Map} options.map - openlayers 的 map 对象。
  84064. * @param {string} [options.id] - 专题图层 ID,默认使用 CommonUtil.createUniqueID("HeatMapSource_") 创建专题图层 ID。
  84065. * @param {string} [options.featureWeight] - 对应 feature 属性中的热点权重字段名称,权重值类型为 float。
  84066. * @param {number} [options.radius=50] - 热点渲染的最大半径(热点像素半径),单位为 px,当 useGeoUnit 参数 为 true 时,单位使用当前图层地理坐标单位。热点显示的时候以精确点为中心点开始往四周辐射衰减,其衰减半径和权重值成比列。
  84067. * @param {number} [options.opacity=1] - 图层透明度。
  84068. * @param {Array.<string>} [options.colors=['blue','cyan','lime','yellow','red']] - 颜色线性渐变数组,颜色值必须为 canvas 所支持的。
  84069. * @param {boolean} [options.useGeoUnit=false] - 使用地理单位,false 表示默认热点半径默认使用像素单位。当设置为 true 时,热点半径和图层地理坐标保持一致。
  84070. * @extends {ol/source/ImageCanvas}
  84071. */
  84072. var HeatMap = /*#__PURE__*/function (_ImageCanvasSource) {
  84073. HeatMap_inherits(HeatMap, _ImageCanvasSource);
  84074. var _super = HeatMap_createSuper(HeatMap);
  84075. function HeatMap(name, opt_options) {
  84076. var _this;
  84077. HeatMap_classCallCheck(this, HeatMap);
  84078. var options = opt_options ? opt_options : {};
  84079. _this = _super.call(this, {
  84080. attributions: options.attributions || "Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>",
  84081. canvasFunction: canvasFunctionInternal_,
  84082. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  84083. projection: options.projection,
  84084. ratio: options.ratio,
  84085. resolutions: options.resolutions,
  84086. state: options.state
  84087. });
  84088. function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  84089. // eslint-disable-line no-unused-vars
  84090. var mapWidth = size[0] * pixelRatio;
  84091. var mapHeight = size[1] * pixelRatio;
  84092. this.rootCanvas.width = this.maxWidth = mapWidth;
  84093. this.rootCanvas.height = this.maxHeight = mapHeight;
  84094. if (!this.features) {
  84095. return this.rootCanvas;
  84096. }
  84097. this.pixelRatio = pixelRatio; //记录偏移量
  84098. var width = this.map.getSize()[0] * pixelRatio;
  84099. var height = this.map.getSize()[1] * pixelRatio;
  84100. this.offset = [(mapWidth - width) / 2 / pixelRatio, (mapHeight - height) / 2 / pixelRatio];
  84101. this.updateHeatPoints(resolution);
  84102. return this.rootCanvas;
  84103. } //初始化成员变量
  84104. _this.canvasFunctionInternal_ = canvasFunctionInternal_;
  84105. _this.features = [];
  84106. _this.name = name;
  84107. if (!options.map) {
  84108. throw new Error('options.map is not found.');
  84109. }
  84110. _this.map = options.map; // this.TFEvents = options.TFEvents || [];
  84111. _this.id = options.id ? options.id : Util.createUniqueID("HeatMapSource_");
  84112. _this.opacity = options.opacity ? options.opacity : 1;
  84113. _this.colors = options.colors ? options.colors : ['blue', 'cyan', 'lime', 'yellow', 'red'];
  84114. _this.useGeoUnit = options.useGeoUnit ? options.useGeoUnit : false;
  84115. _this.radius = options.radius ? options.radius : 50;
  84116. _this.featureWeight = options.featureWeight ? options.featureWeight : null;
  84117. _this.maxWeight = null;
  84118. _this.minWeight = null;
  84119. _this.maxWidth = null;
  84120. _this.maxHeight = null; //创建热力图绘制面板
  84121. _this.rootCanvas = document.createElement("canvas");
  84122. var mapSize = _this.map.getSize();
  84123. _this.rootCanvas.width = _this.maxWidth = parseInt(mapSize[0]);
  84124. _this.rootCanvas.height = _this.maxHeight = parseInt(mapSize[1]);
  84125. Util.modifyDOMElement(_this.rootCanvas, null, null, null, null, null, null, _this.opacity);
  84126. _this.canvasContext = _this.rootCanvas.getContext('2d');
  84127. return _this;
  84128. }
  84129. /**
  84130. * @function ol.source.HeatMap.prototype.addFeatures
  84131. * @description 添加热点信息。
  84132. * @param {(GeoJSONObject|Array.<ol/Feature>)} features - 待添加的要素数组。
  84133. * @example
  84134. * var geojson = {
  84135. * "type": "FeatureCollection",
  84136. * "features": [
  84137. * {
  84138. * "type": "feature",
  84139. * "geometry": {
  84140. * "type": "Point", //只支持point类型
  84141. * "coordinates": [0, 0]
  84142. * },
  84143. * "properties": {
  84144. * "height": Math.random()*9,
  84145. * }
  84146. * }
  84147. * ]
  84148. * };
  84149. * var heatMapSource = new ol.source.HeatMap("heatMap",{"map": map});
  84150. * heatMapSource.addFeatures(geojson);
  84151. * map.addLayer(new ol.layer.Image({
  84152. * source: heatMapSource
  84153. * }));
  84154. */
  84155. HeatMap_createClass(HeatMap, [{
  84156. key: "addFeatures",
  84157. value: function addFeatures(features) {
  84158. this.features = this.toiClientFeature(features); //支持更新features,刷新底图
  84159. this.changed();
  84160. }
  84161. /**
  84162. * @function ol.source.HeatMap.prototype.setOpacity
  84163. * @description 设置图层的不透明度,取值 [0-1] 之间。
  84164. * @param {number} opacity - 不透明度。
  84165. */
  84166. }, {
  84167. key: "setOpacity",
  84168. value: function setOpacity(opacity) {
  84169. if (opacity !== this.opacity) {
  84170. this.opacity = opacity;
  84171. var element = this.rootCanvas;
  84172. Util.modifyDOMElement(element, null, null, null, null, null, null, opacity);
  84173. if (this.map !== null) {
  84174. // this.dispatchEvent({type: 'changelayer', value: {layer: this, property: "opacity"}});
  84175. this.changed();
  84176. }
  84177. }
  84178. }
  84179. /**
  84180. * @function ol.source.HeatMap.prototype.updateHeatPoints
  84181. * @description 刷新热点图显示。
  84182. * @param {ol.LngLatBounds} resolution - 当前显示范围。
  84183. * @private
  84184. */
  84185. }, {
  84186. key: "updateHeatPoints",
  84187. value: function updateHeatPoints(resolution) {
  84188. if (this.features && this.features.length > 0) {
  84189. this.convertFastToPixelPoints(resolution);
  84190. } else {
  84191. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxWidth);
  84192. }
  84193. }
  84194. /**
  84195. * @function ol.source.HeatMap.prototype.convertFastToPixelPoints
  84196. * @description 过滤位于当前显示范围内的热点,并转换其为当前分辨率下的像素坐标。
  84197. * @param {number} resolution - 当前分辨率。
  84198. * @private
  84199. */
  84200. }, {
  84201. key: "convertFastToPixelPoints",
  84202. value: function convertFastToPixelPoints(resolution) {
  84203. var data = [],
  84204. x,
  84205. y,
  84206. k,
  84207. maxTemp,
  84208. minTemp,
  84209. maxWeightTemp; //热点半径
  84210. this.useRadius = this.useGeoUnit ? parseInt(this.radius / resolution) : this.radius;
  84211. for (var i = 0; i < this.features.length; i++) {
  84212. var feature = this.features[i];
  84213. var point = feature.geometry; //过滤,只显示当前范围
  84214. // if (mapBounds.contains(point.x, point.y)) {
  84215. var pixelPoint = this.getLocalXY(new LonLat(point.x, point.y));
  84216. if (this.featureWeight) {
  84217. pixelPoint.weight = feature.attributes[this.featureWeight]; //point.value;
  84218. if (!this.maxWeight) {
  84219. //找出最大最小权重值
  84220. maxTemp = maxTemp ? maxTemp : pixelPoint.weight;
  84221. minTemp = minTemp ? minTemp : pixelPoint.weight;
  84222. maxTemp = Math.max(maxTemp, pixelPoint.weight);
  84223. minTemp = Math.min(minTemp, pixelPoint.weight);
  84224. }
  84225. } else {
  84226. pixelPoint.weight = 1;
  84227. }
  84228. x = Math.floor(pixelPoint[0]);
  84229. y = Math.floor(pixelPoint[1]);
  84230. k = pixelPoint.weight;
  84231. data.push([x, y, k]); // }
  84232. } //无最大权重设置
  84233. if (!this.maxWeight) {
  84234. if (maxTemp && minTemp) {
  84235. maxWeightTemp = (maxTemp + minTemp) / 2;
  84236. } else {
  84237. maxWeightTemp = 1;
  84238. }
  84239. this.draw(data, maxWeightTemp);
  84240. } else {
  84241. this.draw(data, this.maxWeight);
  84242. }
  84243. }
  84244. /**
  84245. * @function ol.source.HeatMap.prototype.draw
  84246. * @description 绘制热点图。
  84247. * @param {Array} data - convertToPixelPoints 方法计算出的点。
  84248. * @param {number} maxWeight -最大权重。
  84249. * @private
  84250. */
  84251. }, {
  84252. key: "draw",
  84253. value: function draw(data, maxWeight) {
  84254. if (this.maxHeight > 0 && this.maxWidth > 0) {
  84255. //清空
  84256. var ctx = this.canvasContext;
  84257. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxHeight);
  84258. this.drawCircle(this.useRadius);
  84259. this.createGradient();
  84260. for (var i = 0; i < data.length; i++) {
  84261. var p = data[i];
  84262. this.canvasContext.globalAlpha = Math.max(p[2] / maxWeight, 0.05);
  84263. this.canvasContext.drawImage(this.circle, p[0] - this.useRadius, p[1] - this.useRadius);
  84264. }
  84265. var colored = ctx.getImageData(0, 0, this.maxWidth, this.maxHeight);
  84266. this.colorize(colored.data, this.grad);
  84267. ctx.putImageData(colored, 0, 0);
  84268. } else {
  84269. return false;
  84270. }
  84271. }
  84272. /**
  84273. * @function ol.source.HeatMap.prototype.colorize
  84274. * @description 根据渐变色重置热点图 rgb 值。
  84275. * @param {Object} pixels - 像素 rgba 值。
  84276. * @param {Array} gradient - 渐变 canvas.getImageData.data。
  84277. * @private
  84278. */
  84279. }, {
  84280. key: "colorize",
  84281. value: function colorize(pixels, gradient) {
  84282. for (var i = 0, j; i < pixels.length; i += 4) {
  84283. j = pixels[i + 3] * 4;
  84284. if (j) {
  84285. pixels[i] = gradient[j];
  84286. pixels[i + 1] = gradient[j + 1];
  84287. pixels[i + 2] = gradient[j + 2];
  84288. }
  84289. }
  84290. }
  84291. /**
  84292. * @function ol.source.HeatMap.drawCircle
  84293. * @description 绘制热点半径圆。
  84294. * @param {number} r - 热点半径。
  84295. * @private
  84296. */
  84297. }, {
  84298. key: "drawCircle",
  84299. value: function drawCircle(r) {
  84300. var blur = r / 2;
  84301. var circle = this.circle = document.createElement('canvas'),
  84302. ctx = circle.getContext("2d");
  84303. circle.height = 2 * r;
  84304. circle.width = 2 * r;
  84305. ctx.shadowOffsetX = ctx.shadowOffsetY = 2 * r;
  84306. ctx.shadowBlur = blur;
  84307. ctx.shadowColor = "#000000";
  84308. ctx.beginPath();
  84309. ctx.arc(-r, -r, r / 2, 0, Math.PI * 2, true);
  84310. ctx.closePath();
  84311. ctx.fill();
  84312. }
  84313. /**
  84314. * @function ol.source.HeatMap.createGradient
  84315. * @description 根据 this.canvasColors 设置渐变并 getImageData。
  84316. * @private
  84317. */
  84318. }, {
  84319. key: "createGradient",
  84320. value: function createGradient() {
  84321. var colors = this.colors;
  84322. var canvas = document.createElement('canvas'),
  84323. ctx = canvas.getContext("2d"),
  84324. gradient = ctx.createLinearGradient(0, 0, 0, 256);
  84325. canvas.height = 256;
  84326. canvas.width = 1;
  84327. var index = 1;
  84328. for (var i = 0, len = colors.length; i < len; i++) {
  84329. gradient.addColorStop(index / len, colors[i]);
  84330. index++;
  84331. }
  84332. ctx.fillStyle = gradient;
  84333. ctx.fillRect(0, 0, 1, 256);
  84334. this.grad = ctx.getImageData(0, 0, 1, 256).data;
  84335. }
  84336. /**
  84337. * @function ol.source.HeatMap.prototype.getLocalXY
  84338. * @description 获取坐标系统。
  84339. * @param {Object} coordinate - 坐标位置。
  84340. */
  84341. }, {
  84342. key: "getLocalXY",
  84343. value: function getLocalXY(coordinate) {
  84344. var pixelP,
  84345. map = this.map;
  84346. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  84347. pixelP = map.getPixelFromCoordinate([coordinate.x, coordinate.y]);
  84348. }
  84349. if (coordinate instanceof LonLat) {
  84350. pixelP = map.getPixelFromCoordinate([coordinate.lon, coordinate.lat]);
  84351. }
  84352. var rotation = -map.getView().getRotation();
  84353. var center = map.getPixelFromCoordinate(map.getView().getCenter());
  84354. var rotatedP = pixelP;
  84355. if (this.pixelRatio) {
  84356. rotatedP = this.scale(pixelP, center, this.pixelRatio);
  84357. }
  84358. if (pixelP && center) {
  84359. rotatedP = this.rotate(rotatedP, rotation, center);
  84360. }
  84361. if (this.offset && rotatedP) {
  84362. return [rotatedP[0] + this.offset[0], rotatedP[1] + this.offset[1]];
  84363. }
  84364. return rotatedP;
  84365. }
  84366. /**
  84367. * @function ol.source.HeatMap.prototype.rotate
  84368. * @description 获取某像素坐标点 pixelP 绕中心 center 逆时针旋转 rotation 弧度后的像素点坐标。
  84369. * @param {number} pixelP - 像素坐标点位置。
  84370. * @param {number} rotation - 旋转角度。
  84371. * @param {number} center - 中心位置。
  84372. */
  84373. }, {
  84374. key: "rotate",
  84375. value: function rotate(pixelP, rotation, center) {
  84376. var x = Math.cos(rotation) * (pixelP[0] - center[0]) - Math.sin(rotation) * (pixelP[1] - center[1]) + center[0];
  84377. var y = Math.sin(rotation) * (pixelP[0] - center[0]) + Math.cos(rotation) * (pixelP[1] - center[1]) + center[1];
  84378. return [x, y];
  84379. }
  84380. /**
  84381. * @function ol.source.HeatMap.prototype.scale
  84382. * @description 获取某像素坐标点 pixelP 相对于中心 center 进行缩放 scaleRatio 倍后的像素点坐标。
  84383. * @param {Object} pixelP - 像素点。
  84384. * @param {Object} center - 中心点。
  84385. * @param {number} scaleRatio - 缩放倍数。
  84386. * @returns {Array.<number>} 返回数组形比例
  84387. */
  84388. }, {
  84389. key: "scale",
  84390. value: function scale(pixelP, center, scaleRatio) {
  84391. var x = (pixelP[0] - center[0]) * scaleRatio + center[0];
  84392. var y = (pixelP[1] - center[1]) * scaleRatio + center[1];
  84393. return [x, y];
  84394. }
  84395. /**
  84396. * @function ol.source.HeatMap.prototype.removeFeatures
  84397. * @description 移除指定的热点信息。
  84398. * @param {Array.<SuperMap.Feature.Vector>} features - 热点信息数组。
  84399. */
  84400. }, {
  84401. key: "removeFeatures",
  84402. value: function removeFeatures(features) {
  84403. if (!features || features.length === 0 || !this.features || this.features.length === 0) {
  84404. return;
  84405. }
  84406. if (features === this.features) {
  84407. return this.removeAllFeatures();
  84408. }
  84409. if (!Util.isArray(features)) {
  84410. features = [features];
  84411. }
  84412. var heatPoint,
  84413. index,
  84414. heatPointsFailedRemoved = [];
  84415. for (var i = 0, len = features.length; i < len; i++) {
  84416. heatPoint = features[i];
  84417. index = Util.indexOf(this.features, heatPoint); //找不到视为删除失败
  84418. if (index === -1) {
  84419. heatPointsFailedRemoved.push(heatPoint);
  84420. continue;
  84421. } //删除热点
  84422. this.features.splice(index, 1);
  84423. }
  84424. var succeed = heatPointsFailedRemoved.length == 0 ? true : false; //派发删除features成功的事件
  84425. this.dispatchEvent({
  84426. type: 'featuresremoved',
  84427. value: {
  84428. features: heatPointsFailedRemoved,
  84429. succeed: succeed
  84430. }
  84431. });
  84432. this.changed();
  84433. }
  84434. /**
  84435. * @function ol.source.HeatMapprototype.removeAllFeatures
  84436. * @description 移除全部的热点信息。
  84437. */
  84438. }, {
  84439. key: "removeAllFeatures",
  84440. value: function removeAllFeatures() {
  84441. this.features = [];
  84442. this.changed();
  84443. }
  84444. /**
  84445. * @function ol.source.HeatMap.prototype.toiClientFeature
  84446. * @description 转为 iClient 要素。
  84447. * @param {GeoJSONObject|Array.<ol/Feature>} features - 待添加的要素数组。
  84448. * @returns {SuperMap.Feature.Vector} 转换后的 iClient 要素
  84449. */
  84450. }, {
  84451. key: "toiClientFeature",
  84452. value: function toiClientFeature(features) {
  84453. if (!core_Util_Util.isArray(features)) {
  84454. features = [features];
  84455. }
  84456. var featuresTemp = [],
  84457. geometry,
  84458. attributes;
  84459. for (var i = 0, len = features.length; i < len; i++) {
  84460. if (features[i] instanceof (external_ol_Feature_default())) {
  84461. //热点图支支持传入点对象要素
  84462. if (features[i].getGeometry() instanceof (external_ol_geom_Point_default())) {
  84463. geometry = new Point(features[i].getGeometry().getCoordinates()[0], features[i].getGeometry().getCoordinates()[1]); //固定属性字段为 "Properties"
  84464. attributes = features[i].getProperties()["Properties"] ? features[i].getProperties()["Properties"] : {};
  84465. featuresTemp.push(new Vector(geometry, attributes));
  84466. }
  84467. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  84468. var format = new GeoJSON();
  84469. featuresTemp = featuresTemp.concat(format.read(features[i]));
  84470. } else if (features[i].geometry && features[i].geometry.parts) {
  84471. //iServer服务器返回数据格式
  84472. featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
  84473. } else {
  84474. throw new Error("Features[".concat(i, "]'s type does not match, please check."));
  84475. }
  84476. }
  84477. return featuresTemp;
  84478. }
  84479. }]);
  84480. return HeatMap;
  84481. }((external_ol_source_ImageCanvas_default()));
  84482. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/index.js
  84483. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  84484. * This program are made available under the terms of the Apache License, Version 2.0
  84485. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84486. ;// CONCATENATED MODULE: ./src/openlayers/overlay/mapv/index.js
  84487. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  84488. * This program are made available under the terms of the Apache License, Version 2.0
  84489. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84490. ;// CONCATENATED MODULE: ./src/openlayers/overlay/theme/index.js
  84491. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  84492. * This program are made available under the terms of the Apache License, Version 2.0
  84493. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84494. ;// CONCATENATED MODULE: external "ol.geom.LineString"
  84495. var external_ol_geom_LineString_namespaceObject = ol.geom.LineString;
  84496. var external_ol_geom_LineString_default = /*#__PURE__*/__webpack_require__.n(external_ol_geom_LineString_namespaceObject);
  84497. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/olExtends.js
  84498. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  84499. * This program are made available under the terms of the Apache License, Version 2.0
  84500. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84501. var olExtends = function olExtends(targetMap) {
  84502. //解决olms.js插件,在使用ol.js时沿线标注不显示的问题,因为ol.geom.LineString.getFlatMidpoint未非公开方法
  84503. if (!(external_ol_geom_LineString_default()).prototype.getFlatMidpoint) {
  84504. (external_ol_geom_LineString_default()).prototype.getFlatMidpoint = function () {
  84505. return this.getCoordinateAt(0.5);
  84506. };
  84507. }
  84508. if (core_Util_Util.getOlVersion() === '4' && window && window.ol && window.ol.geom.flat) {
  84509. // for ol4-debug
  84510. window.targetMapCache = targetMap;
  84511. var ol = window.ol; //解决 new ol.format.MVT({featureClass: ol.Feature})时,非3857显示异常的问题。ol即将发布的5.0版本已解决。
  84512. // eslint-disable-next-line no-unused-vars
  84513. ol.format.MVT.prototype.readProjection = function (source) {
  84514. return new ol.proj.Projection({
  84515. code: '',
  84516. units: ol.proj.Units.TILE_PIXELS
  84517. });
  84518. }; //解决 new ol.format.MVT({featureClass: ol.Feature})时,非3857显示异常的问题。ol即将发布的5.0版本已解决。
  84519. // eslint-disable-next-line no-unused-vars
  84520. ol.format.MVT.prototype.readProjection = function (source) {
  84521. return new ol.proj.Projection({
  84522. code: '',
  84523. units: ol.proj.Units.TILE_PIXELS
  84524. });
  84525. }; //解决面填充时不能整版填充的问题。ol即将发布的5.0版本已解决。
  84526. // eslint-disable-next-line no-unused-vars
  84527. ol.render.canvas.Replay.prototype.applyFill = function (state, geometry) {
  84528. var fillStyle = state.fillStyle;
  84529. var fillInstruction = [ol.render.canvas.Instruction.SET_FILL_STYLE, fillStyle];
  84530. if (typeof fillStyle !== 'string') {
  84531. var viewExtent = window.targetMapCache.getView().getProjection().getExtent();
  84532. fillInstruction.push([viewExtent[0], viewExtent[3]]);
  84533. }
  84534. this.instructions.push(fillInstruction);
  84535. }; //解决面填充时不能整版填充的问题。ol即将发布的5.0版本已解决。
  84536. // eslint-disable-next-line no-unused-vars
  84537. ol.render.canvas.Replay.prototype.applyFill = function (state, geometry) {
  84538. var fillStyle = state.fillStyle;
  84539. var fillInstruction = [ol.render.canvas.Instruction.SET_FILL_STYLE, fillStyle];
  84540. if (typeof fillStyle !== 'string') {
  84541. var viewExtent = window.targetMapCache.getView().getProjection().getExtent();
  84542. fillInstruction.push([viewExtent[0], viewExtent[3]]);
  84543. }
  84544. this.instructions.push(fillInstruction);
  84545. }; //解决在多面时,第一个面是逆时针时无法显示的问题。该问题由组件修复。
  84546. ol.format.MVT.prototype.createFeature_ = function (pbf, rawFeature, opt_options) {
  84547. var type = rawFeature.type;
  84548. if (type === 0) {
  84549. return null;
  84550. }
  84551. var feature;
  84552. var id = rawFeature.id;
  84553. var values = rawFeature.properties;
  84554. values[this.layerName_] = rawFeature.layer.name;
  84555. var flatCoordinates = [];
  84556. var ends = [];
  84557. ol.format.MVT.readRawGeometry_(pbf, rawFeature, flatCoordinates, ends);
  84558. var geometryType = ol.format.MVT.getGeometryType_(type, ends.length);
  84559. if (this.featureClass_ === ol.render.Feature) {
  84560. feature = new this.featureClass_(geometryType, flatCoordinates, ends, values, id);
  84561. } else {
  84562. var geom;
  84563. if (geometryType == ol.geom.GeometryType.POLYGON) {
  84564. var endss = [];
  84565. var offset = 0;
  84566. var prevEndIndex = 0;
  84567. for (var i = 0, ii = ends.length; i < ii; ++i) {
  84568. var end = ends[i];
  84569. if (!ol.geom.flat.orient.linearRingIsClockwise(flatCoordinates, offset, end, 2)) {
  84570. endss.push(ends.slice(prevEndIndex, i + 1));
  84571. prevEndIndex = i + 1;
  84572. }
  84573. offset = end;
  84574. }
  84575. if (endss.length > 1) {
  84576. ends = endss;
  84577. geom = new ol.geom.MultiPolygon(null);
  84578. } else {
  84579. geom = new ol.geom.Polygon(null);
  84580. }
  84581. } else {
  84582. geom = geometryType === ol.geom.GeometryType.POINT ? new ol.geom.Point(null) : geometryType === ol.geom.GeometryType.LINE_STRING ? new ol.geom.LineString(null) : geometryType === ol.geom.GeometryType.POLYGON ? new ol.geom.Polygon(null) : geometryType === ol.geom.GeometryType.MULTI_POINT ? new ol.geom.MultiPoint(null) : geometryType === ol.geom.GeometryType.MULTI_LINE_STRING ? new ol.geom.MultiLineString(null) : null;
  84583. }
  84584. if (geom) {
  84585. geom.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates, ends);
  84586. feature = new this.featureClass_();
  84587. if (this.geometryName_) {
  84588. feature.setGeometryName(this.geometryName_);
  84589. }
  84590. var geometry = ol.format.Feature.transformWithOptions(geom, false, this.adaptOptions(opt_options));
  84591. feature.setGeometry(geometry);
  84592. feature.setId(id);
  84593. feature.setProperties(values);
  84594. }
  84595. }
  84596. return feature;
  84597. }; //解决中文沿线表述显示不符合中文阅读习惯的问题
  84598. ol.geom.flat.textpath.lineString = function (flatCoordinates, offset, end, stride, text, measure, startM, maxAngle) {
  84599. var result = []; // Keep text upright
  84600. var anglereverse = Math.atan2(flatCoordinates[end - stride + 1] - flatCoordinates[offset + 1], flatCoordinates[end - stride] - flatCoordinates[offset]);
  84601. var reverse = anglereverse < -0.785 || anglereverse > 2.356; //0.785//2.356
  84602. var isRotateUp = anglereverse < -0.785 && anglereverse > -2.356 || anglereverse > 0.785 && anglereverse < 2.356;
  84603. var numChars = text.length;
  84604. var x1 = flatCoordinates[offset];
  84605. var y1 = flatCoordinates[offset + 1];
  84606. offset += stride;
  84607. var x2 = flatCoordinates[offset];
  84608. var y2 = flatCoordinates[offset + 1];
  84609. var segmentM = 0;
  84610. var segmentLength = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
  84611. while (offset < end - stride && segmentM + segmentLength < startM) {
  84612. x1 = x2;
  84613. y1 = y2;
  84614. offset += stride;
  84615. x2 = flatCoordinates[offset];
  84616. y2 = flatCoordinates[offset + 1];
  84617. segmentM += segmentLength;
  84618. segmentLength = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
  84619. }
  84620. var interpolate = (startM - segmentM) / segmentLength;
  84621. var x0 = ol.math.lerp(x1, x2, interpolate); //起始点
  84622. var y0 = ol.math.lerp(y1, y2, interpolate); //起始点
  84623. var chunk = '';
  84624. var chunkLength = 0;
  84625. var data, index, previousAngle, previousLang;
  84626. for (var i = 0; i < numChars; ++i) {
  84627. index = reverse ? numChars - i - 1 : i;
  84628. var _char = text.charAt(index);
  84629. var charcode = _char.charCodeAt(0);
  84630. var ischinese = charcode >= 19968 && charcode <= 40907;
  84631. chunk = reverse ? _char + chunk : chunk + _char;
  84632. var charLength = measure(chunk) - chunkLength;
  84633. chunkLength += charLength; //var charM = startM + charLength / 2;
  84634. while (offset < end - stride && Math.sqrt(Math.pow(x2 - x0, 2) + Math.pow(y2 - y0, 2)) < charLength / 2) {
  84635. x1 = x2;
  84636. y1 = y2;
  84637. offset += stride;
  84638. x2 = flatCoordinates[offset];
  84639. y2 = flatCoordinates[offset + 1];
  84640. }
  84641. var a = Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2);
  84642. var b = 2 * (x2 - x1) * (x1 - x0) + 2 * (y2 - y1) * (y1 - y0);
  84643. var c = Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2) - Math.pow(charLength / 2, 2);
  84644. var scale1 = (-b + Math.sqrt(b * b - 4 * a * c)) / (2 * a);
  84645. var scale2 = (-b - Math.sqrt(b * b - 4 * a * c)) / (2 * a);
  84646. interpolate = scale1 < 0 || scale1 > 1 ? scale2 : scale2 < 0 || scale2 > 1 ? scale1 : scale1 < scale2 ? scale2 : scale1;
  84647. var x = ol.math.lerp(x1, x2, interpolate);
  84648. var y = ol.math.lerp(y1, y2, interpolate);
  84649. while (offset < end - stride && Math.sqrt(Math.pow(x2 - x, 2) + Math.pow(y2 - y, 2)) < charLength / 2) {
  84650. x1 = x2;
  84651. y1 = y2;
  84652. offset += stride;
  84653. x2 = flatCoordinates[offset];
  84654. y2 = flatCoordinates[offset + 1];
  84655. }
  84656. a = Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2);
  84657. b = 2 * (x2 - x1) * (x1 - x) + 2 * (y2 - y1) * (y1 - y);
  84658. c = Math.pow(x1 - x, 2) + Math.pow(y1 - y, 2) - Math.pow(charLength / 2, 2);
  84659. scale1 = (-b + Math.sqrt(b * b - 4 * a * c)) / (2 * a);
  84660. scale2 = (-b - Math.sqrt(b * b - 4 * a * c)) / (2 * a);
  84661. interpolate = scale1 < 0 || scale1 > 1 ? scale2 : scale2 < 0 || scale2 > 1 ? scale1 : scale1 < scale2 ? scale2 : scale1;
  84662. var x3 = ol.math.lerp(x1, x2, interpolate);
  84663. var y3 = ol.math.lerp(y1, y2, interpolate);
  84664. var angle = Math.atan2(y3 - y0, x3 - x0);
  84665. if (reverse) {
  84666. angle += angle > 0 ? -Math.PI : Math.PI;
  84667. }
  84668. if (ischinese && isRotateUp) {
  84669. angle += angle > 0 ? -Math.PI / 2 : Math.PI / 2;
  84670. }
  84671. if (previousAngle !== undefined) {
  84672. var delta = angle - previousAngle;
  84673. delta += delta > Math.PI ? -2 * Math.PI : delta < -Math.PI ? 2 * Math.PI : 0;
  84674. if (ischinese === previousLang ? Math.abs(delta) > maxAngle : Math.abs(delta) > maxAngle + Math.PI / 2) {
  84675. return null;
  84676. }
  84677. }
  84678. if (previousAngle == angle && !isRotateUp) {
  84679. if (reverse) {
  84680. data[0] = x;
  84681. data[1] = y;
  84682. data[2] = charLength / 2;
  84683. }
  84684. data[4] = chunk;
  84685. } else {
  84686. chunk = _char;
  84687. chunkLength = charLength;
  84688. data = [x, y, charLength / 2, angle, chunk];
  84689. if (reverse) {
  84690. result.unshift(data);
  84691. } else {
  84692. result.push(data);
  84693. }
  84694. previousAngle = angle;
  84695. previousLang = ischinese;
  84696. }
  84697. x0 = x3;
  84698. y0 = y3;
  84699. startM += charLength;
  84700. }
  84701. return result;
  84702. }; //以下两个方法解决在大数据量图斑时,内存疯长的问题。该改法引发新问题:无法点选要素
  84703. ol.layer.VectorTile.prototype.setFastRender = function (fastRender) {
  84704. return this.fastRender = fastRender;
  84705. };
  84706. ol.renderer.canvas.VectorTileLayer.prototype.postCompose = function (context, frameState, layerState) {
  84707. var layer = this.getLayer();
  84708. var declutterReplays = layer.getDeclutter() ? {} : null;
  84709. var source =
  84710. /** @type {ol.source.VectorTile} */
  84711. layer.getSource();
  84712. var renderMode = layer.getRenderMode();
  84713. var replayTypes = ol.renderer.canvas.VectorTileLayer.VECTOR_REPLAYS[renderMode];
  84714. var pixelRatio = frameState.pixelRatio;
  84715. var rotation = frameState.viewState.rotation;
  84716. var size = frameState.size;
  84717. var offsetX, offsetY;
  84718. if (rotation) {
  84719. offsetX = Math.round(pixelRatio * size[0] / 2);
  84720. offsetY = Math.round(pixelRatio * size[1] / 2);
  84721. ol.render.canvas.rotateAtOffset(context, -rotation, offsetX, offsetY);
  84722. }
  84723. if (declutterReplays) {
  84724. this.declutterTree_.clear();
  84725. }
  84726. var tiles = this.renderedTiles;
  84727. var tileGrid = source.getTileGridForProjection(frameState.viewState.projection);
  84728. var clips = [];
  84729. var zs = [];
  84730. for (var i = tiles.length - 1; i >= 0; --i) {
  84731. var tile =
  84732. /** @type {ol.VectorImageTile} */
  84733. tiles[i];
  84734. if (tile.getState() == ol.TileState.ABORT) {
  84735. continue;
  84736. }
  84737. var tileCoord = tile.tileCoord;
  84738. var worldOffset = tileGrid.getTileCoordExtent(tileCoord)[0] - tileGrid.getTileCoordExtent(tile.wrappedTileCoord)[0];
  84739. var transform = undefined;
  84740. for (var t = 0, tt = tile.tileKeys.length; t < tt; ++t) {
  84741. var sourceTile = tile.getTile(tile.tileKeys[t]);
  84742. if (sourceTile.getState() == ol.TileState.ERROR) {
  84743. continue;
  84744. }
  84745. var replayGroup = sourceTile.getReplayGroup(layer, tileCoord.toString());
  84746. if (renderMode != ol.layer.VectorTileRenderType.VECTOR && (!replayGroup || !replayGroup.hasReplays(replayTypes))) {
  84747. if (layer.fastRender === true) {
  84748. sourceTile.replayGroups_ = {};
  84749. sourceTile.features_ = [];
  84750. }
  84751. continue;
  84752. }
  84753. if (!transform) {
  84754. transform = this.getTransform(frameState, worldOffset);
  84755. }
  84756. var currentZ = sourceTile.tileCoord[0];
  84757. var currentClip = replayGroup.getClipCoords(transform);
  84758. context.save();
  84759. context.globalAlpha = layerState.opacity; // Create a clip mask for regions in this low resolution tile that are
  84760. // already filled by a higher resolution tile
  84761. for (var j = 0, jj = clips.length; j < jj; ++j) {
  84762. var clip = clips[j];
  84763. if (currentZ < zs[j]) {
  84764. context.beginPath(); // counter-clockwise (outer ring) for current tile
  84765. context.moveTo(currentClip[0], currentClip[1]);
  84766. context.lineTo(currentClip[2], currentClip[3]);
  84767. context.lineTo(currentClip[4], currentClip[5]);
  84768. context.lineTo(currentClip[6], currentClip[7]); // clockwise (inner ring) for higher resolution tile
  84769. context.moveTo(clip[6], clip[7]);
  84770. context.lineTo(clip[4], clip[5]);
  84771. context.lineTo(clip[2], clip[3]);
  84772. context.lineTo(clip[0], clip[1]);
  84773. context.clip();
  84774. }
  84775. }
  84776. replayGroup.replay(context, transform, rotation, {}, replayTypes, declutterReplays);
  84777. context.restore();
  84778. clips.push(currentClip);
  84779. zs.push(currentZ);
  84780. }
  84781. }
  84782. if (declutterReplays) {
  84783. ol.render.canvas.ReplayGroup.replayDeclutter(declutterReplays, context, rotation);
  84784. }
  84785. if (rotation) {
  84786. ol.render.canvas.rotateAtOffset(context, rotation,
  84787. /** @type {number} */
  84788. offsetX,
  84789. /** @type {number} */
  84790. offsetY);
  84791. }
  84792. ol.renderer.canvas.TileLayer.prototype.postCompose.apply(this, arguments);
  84793. };
  84794. }
  84795. };
  84796. window.olExtends = olExtends;
  84797. // EXTERNAL MODULE: ./node_modules/lodash.remove/index.js
  84798. var lodash_remove = __webpack_require__(944);
  84799. var lodash_remove_default = /*#__PURE__*/__webpack_require__.n(lodash_remove);
  84800. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/MapboxStyles.js
  84801. function MapboxStyles_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MapboxStyles_typeof = function _typeof(obj) { return typeof obj; }; } else { MapboxStyles_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MapboxStyles_typeof(obj); }
  84802. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || MapboxStyles_unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  84803. 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."); }
  84804. function MapboxStyles_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return MapboxStyles_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 MapboxStyles_arrayLikeToArray(o, minLen); }
  84805. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
  84806. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return MapboxStyles_arrayLikeToArray(arr); }
  84807. function MapboxStyles_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; }
  84808. function MapboxStyles_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  84809. function MapboxStyles_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  84810. function MapboxStyles_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapboxStyles_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapboxStyles_defineProperties(Constructor, staticProps); return Constructor; }
  84811. function MapboxStyles_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) MapboxStyles_setPrototypeOf(subClass, superClass); }
  84812. function MapboxStyles_setPrototypeOf(o, p) { MapboxStyles_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapboxStyles_setPrototypeOf(o, p); }
  84813. function MapboxStyles_createSuper(Derived) { var hasNativeReflectConstruct = MapboxStyles_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MapboxStyles_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MapboxStyles_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MapboxStyles_possibleConstructorReturn(this, result); }; }
  84814. function MapboxStyles_possibleConstructorReturn(self, call) { if (call && (MapboxStyles_typeof(call) === "object" || typeof call === "function")) { return call; } return MapboxStyles_assertThisInitialized(self); }
  84815. function MapboxStyles_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  84816. function MapboxStyles_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  84817. function MapboxStyles_getPrototypeOf(o) { MapboxStyles_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapboxStyles_getPrototypeOf(o); }
  84818. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  84819. * This program are made available under the terms of the Apache License, Version 2.0
  84820. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84821. /**
  84822. * @class ol.supermap.MapboxStyles
  84823. * @classdesc Mapbox 矢量瓦片风格。
  84824. * <div style="padding: 20px;border: 1px solid #eee;border-left-width: 5px;border-radius: 3px;border-left-color: #ce4844;">
  84825. * <p style="color: #ce4844">Notice</p>
  84826. * <p style="font-size: 13px">该功能依赖 <a href='https://github.com/boundlessgeo/ol-mapbox-style'>ol-mapbox-style</a> 插件,请确认引入该插件。</p>
  84827. * `<script type="text/javascript" src="https://rawgit.com/boundlessgeo/ol-mapbox-style/v2.11.2-1/dist/olms.js"></script>`
  84828. * </div>
  84829. * @category Visualization VectorTile
  84830. * @param {Object} options - 初始化参数。
  84831. * @param {(string|undefined)} [options.url] - SuperMap iServer 地图服务地址,例如'http://localhost:8090/iserver/services/map-mvt-test/rest/maps/test',与options.style互斥,优先级低于options.style。
  84832. * @param {(Object|string|undefined)} [opStyleMaptions.style] - Mapbox Style JSON 对象或获取 Mapbox Style JSON 对象的 URL。与 options.url 互斥,优先级高于 options.url。
  84833. * @param {Array.<number>} [options.resolutions] - 地图分辨率数组,用于映射 zoom 值。通常情況与地图的 {@link ol/View} 的分辨率一致。</br>
  84834. * 默认值为:[78271.51696402048,39135.75848201024, 19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564, 1222.99245256282,611.49622628141,305.748113140705,152.8740565703525, 76.43702828517625,38.21851414258813,19.109257071294063,9.554628535647032, 4.777314267823516,2.388657133911758,1.194328566955879,0.5971642834779395, 0.29858214173896974,0.14929107086948487,0.07464553543474244]。
  84835. * @param {(string|Array.<string>|undefined)} [options.source] - Mapbox Style 'source'的 key 值或者 'layer' 的 ID 数组。
  84836. * 当配置 'source' 的 key 值时,source 为该值的 layer 会被加载;
  84837. * 当配置为 'layer' 的 ID 数组时,指定的 layer 会被加载,注意被指定的 layer 需要有相同的 source。
  84838. * 当不配置时,默认为 Mapbox Style JSON 的 `sources` 对象中的第一个。
  84839. * @param {ol/Map} [options.map] - Openlayers 地图对象,仅用于面填充样式,若没有面填充样式可不填。
  84840. * @param {ol/StyleFunction} [options.selectedStyle] -选中样式Function。
  84841. * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
  84842. * @example
  84843. * var mbStyle = new ol.supermap.MapboxStyles({
  84844. url: url,
  84845. source: 'California',
  84846. resolutions: [78271.51696402048,39135.75848201024, 19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564]
  84847. })
  84848. mbStyle.on('styleLoaded', function () {
  84849. var vectorLayer = new ol.layer.VectorTile({
  84850. //设置避让参数
  84851. declutter: true,
  84852. source: new ol.source.VectorTileSuperMapRest({
  84853. url: url,
  84854. format: new ol.format.MVT({
  84855. featureClass: ol.Feature
  84856. }),
  84857. tileType: 'ScaleXY'
  84858. }),
  84859. style: mbStyle.featureStyleFuntion
  84860. });
  84861. map.addLayer(vectorLayer);
  84862. })
  84863. */
  84864. var MapboxStyles = /*#__PURE__*/function (_Observable) {
  84865. MapboxStyles_inherits(MapboxStyles, _Observable);
  84866. var _super = MapboxStyles_createSuper(MapboxStyles);
  84867. function MapboxStyles(options) {
  84868. var _this;
  84869. MapboxStyles_classCallCheck(this, MapboxStyles);
  84870. _this = _super.call(this);
  84871. options = options || {};
  84872. _this.spriteRegEx = /^(.*)(\?.*)$/;
  84873. _this.defaultFont = ["DIN Offc Pro Medium", "Arial Unicode MS Regular"];
  84874. _this.map = options.map;
  84875. _this.source = options.source;
  84876. _this.styleTarget = options.style || Util.urlAppend(Util.urlPathAppend(options.url, 'tileFeature/vectorstyles'), 'type=MapBox_GL&styleonly=true');
  84877. _this.resolutions = options.resolutions;
  84878. _this.withCredentials = options.withCredentials;
  84879. _this.selectedObjects = [];
  84880. _this.selectedStyle = options.selectedStyle || function () {
  84881. return new (external_ol_style_Style_default())({
  84882. fill: new (external_ol_style_Fill_default())({
  84883. color: "rgba(255, 0, 0, 1)"
  84884. }),
  84885. stroke: new (external_ol_style_Stroke_default())({
  84886. color: "rgba(255, 0, 0, 1)",
  84887. width: 10
  84888. }),
  84889. text: new (external_ol_style_Text_default())({
  84890. font: 'normal 400 11.19px "Microsoft YaHei"',
  84891. placement: "point",
  84892. fill: new (external_ol_style_Fill_default())({
  84893. color: "blue"
  84894. })
  84895. }),
  84896. image: new (external_ol_style_Circle_default())({
  84897. radius: 5,
  84898. fill: new (external_ol_style_Fill_default())({
  84899. color: "blue"
  84900. })
  84901. })
  84902. });
  84903. };
  84904. _this.layersBySourceLayer = {};
  84905. olExtends(_this.map);
  84906. _this._loadStyle(_this.styleTarget);
  84907. return _this;
  84908. }
  84909. /**
  84910. * @function ol.supermap.MapboxStyles.prototype.getStyleFunction
  84911. * @description 获取 ol/StyleFunction。
  84912. * @returns {ol/StyleFunction} 返回 ol/StyleFunction
  84913. */
  84914. MapboxStyles_createClass(MapboxStyles, [{
  84915. key: "getStyleFunction",
  84916. value: function getStyleFunction() {
  84917. return this.featureStyleFuntion;
  84918. }
  84919. /**
  84920. * @function ol.supermap.MapboxStyles.prototype.getStylesBySourceLayer
  84921. * @description 根据图层名称获取样式。
  84922. * @param {string} sourceLayer - 数据图层名称。
  84923. */
  84924. }, {
  84925. key: "getStylesBySourceLayer",
  84926. value: function getStylesBySourceLayer(sourceLayer) {
  84927. if (this.layersBySourceLayer[sourceLayer]) {
  84928. return this.layersBySourceLayer[sourceLayer];
  84929. }
  84930. var layers = [];
  84931. for (var index = 0; index < this._mbStyle.layers.length; index++) {
  84932. var layer = this._mbStyle.layers[index];
  84933. if (layer["source-layer"] !== sourceLayer) {
  84934. continue;
  84935. }
  84936. layers.push(layer);
  84937. }
  84938. this.layersBySourceLayer[sourceLayer] = layers;
  84939. return layers;
  84940. }
  84941. /**
  84942. * @function ol.supermap.MapboxStyles.prototype.setSelectedId
  84943. * @description 设置选中要素,该要素将会用 `selectedStyle` 样式绘制。调用该方法后需要调用 `ol/layer/VectorTile` 的 `changed`,才能生效。
  84944. * @param {number} selectedId - 要素ID。
  84945. * @param {string} sourceLayer - 要素所在图层名称。
  84946. */
  84947. }, {
  84948. key: "setSelectedId",
  84949. value: function setSelectedId(selectedId, sourceLayer) {
  84950. this.selectedObjects = [];
  84951. this.selectedObjects.push({
  84952. id: selectedId,
  84953. sourceLayer: sourceLayer
  84954. });
  84955. }
  84956. /**
  84957. * @typedef {Object} ol.supermap.MapboxStyles.selectedObject
  84958. * @description 要选择的要素对象。
  84959. * @property {number} selectedId - 要素ID。
  84960. * @property {string} sourceLayer - 要素所在图层名称。
  84961. */
  84962. /**
  84963. * @function ol.supermap.MapboxStyles.prototype.setSelectedObjects
  84964. * @version 10.0.0
  84965. * @description 设置选中要素或要素数组,该要素将会用 `selectedStyle` 样式绘制。调用该方法后需要调用 `ol/layer/VectorTile` 的 `changed`,才能生效。
  84966. * @param {ol.supermap.MapboxStyles.selectedObject|Array.<ol.supermap.MapboxStyles.selectedObject>} addSelectedObjects - 选择的要素或要素数组。
  84967. */
  84968. }, {
  84969. key: "setSelectedObjects",
  84970. value: function setSelectedObjects(selectedObjects) {
  84971. if (!Array.isArray(selectedObjects)) {
  84972. selectedObjects = [selectedObjects];
  84973. }
  84974. this.selectedObjects = [];
  84975. this.selectedObjects = selectedObjects;
  84976. }
  84977. /**
  84978. * @function ol.supermap.MapboxStyles.prototype.addSelectedObjects
  84979. * @version 10.0.0
  84980. * @description 增加选中的要素或要素数组,该要素将会用 `selectedStyle` 样式绘制。调用该方法后需要调用 `ol/layer/VectorTile` 的 `changed`,才能生效。
  84981. * @param {ol.supermap.MapboxStyles.selectedObject|Array.<ol.supermap.MapboxStyles.selectedObject>} addSelectedObjects - 选择的要素或要素数组。
  84982. */
  84983. }, {
  84984. key: "addSelectedObjects",
  84985. value: function addSelectedObjects(selectedObjects) {
  84986. var _this$selectedObjects;
  84987. if (!Array.isArray(selectedObjects)) {
  84988. selectedObjects = [selectedObjects];
  84989. }
  84990. (_this$selectedObjects = this.selectedObjects).push.apply(_this$selectedObjects, _toConsumableArray(selectedObjects));
  84991. }
  84992. /**
  84993. * @function ol.supermap.MapboxStyles.prototype.clearSelectedObjects
  84994. * @version 10.0.0
  84995. * @description 清空选中状态。调用该方法后需要调用 `ol/layer/VectorTile` 的 `changed`,才能生效。
  84996. */
  84997. }, {
  84998. key: "removeSelectedObjects",
  84999. value: function removeSelectedObjects(selectedObjects) {
  85000. var _this2 = this;
  85001. if (!Array.isArray(selectedObjects)) {
  85002. selectedObjects = [selectedObjects];
  85003. }
  85004. selectedObjects.forEach(function (element) {
  85005. lodash_remove_default()(_this2.selectedObjects, function (obj) {
  85006. return element.id === obj.id && element.sourceLayer === obj.sourceLayer;
  85007. });
  85008. });
  85009. }
  85010. /**
  85011. * @function ol.supermap.MapboxStyles.prototype.clearSelectedObjects
  85012. * @version 10.0.0
  85013. * @description 清空选中状态。调用该方法后需要调用 `ol/layer/VectorTile` 的 `changed`,才能生效。
  85014. */
  85015. }, {
  85016. key: "clearSelectedObjects",
  85017. value: function clearSelectedObjects() {
  85018. this.selectedObjects = [];
  85019. }
  85020. /**
  85021. * @function ol.supermap.MapboxStyles.prototype.updateStyles
  85022. * @description 更新图层样式。
  85023. * @param {Object} layerStyles - 图层样式或图层样式数组。
  85024. */
  85025. }, {
  85026. key: "updateStyles",
  85027. value: function updateStyles(layerStyles) {
  85028. if (Object.prototype.toString.call(layerStyles) !== "[object Array]") {
  85029. layerStyles = [layerStyles];
  85030. }
  85031. var layerObj = {};
  85032. layerStyles.forEach(function (layerStyle) {
  85033. layerObj[layerStyle.id] = layerStyle;
  85034. });
  85035. var count = 0;
  85036. for (var key in this._mbStyle.layers) {
  85037. var oldLayerStyle = this._mbStyle.layers[key];
  85038. if (count >= layerStyles.length) {
  85039. break;
  85040. }
  85041. if (!layerObj[oldLayerStyle.id]) {
  85042. continue;
  85043. }
  85044. var newLayerStyle = JSON.parse(JSON.stringify(layerObj[oldLayerStyle.id]));
  85045. if (newLayerStyle.paint) {
  85046. newLayerStyle.paint = Object.assign({}, oldLayerStyle.paint, newLayerStyle.paint);
  85047. }
  85048. if (newLayerStyle.layout) {
  85049. newLayerStyle.layout = Object.assign({}, oldLayerStyle.layout, newLayerStyle.layout);
  85050. }
  85051. Object.assign(oldLayerStyle, newLayerStyle);
  85052. count++;
  85053. }
  85054. this._createStyleFunction();
  85055. }
  85056. /**
  85057. * @function ol.supermap.MapboxStyles.prototype.setStyle
  85058. * @version 9.1.1
  85059. * @description 设置 Mapbox style 对象。
  85060. * @param {Object} style - Mapbox style 对象。
  85061. */
  85062. }, {
  85063. key: "setStyle",
  85064. value: function setStyle(style) {
  85065. this.layersBySourceLayer = {};
  85066. this._loadStyle(style);
  85067. }
  85068. }, {
  85069. key: "_loadStyle",
  85070. value: function _loadStyle(style) {
  85071. var _this3 = this;
  85072. if (Object.prototype.toString.call(style) == "[object Object]") {
  85073. this._mbStyle = style;
  85074. this._resolve();
  85075. } else {
  85076. FetchRequest.get(style, null, {
  85077. withCredentials: this.withCredentials
  85078. }).then(function (response) {
  85079. return response.json();
  85080. }).then(function (mbStyle) {
  85081. _this3._mbStyle = mbStyle;
  85082. _this3._resolve();
  85083. });
  85084. }
  85085. }
  85086. }, {
  85087. key: "_resolve",
  85088. value: function _resolve() {
  85089. var _this4 = this;
  85090. if (!this.source) {
  85091. this.source = Object.keys(this._mbStyle.sources)[0];
  85092. }
  85093. if (this._mbStyle.sprite) {
  85094. var spriteScale = window.devicePixelRatio >= 1.5 ? 0.5 : 1;
  85095. var sizeFactor = spriteScale == 0.5 ? "@2x" : ""; //兼容一下iServer 等iServer修改
  85096. this._mbStyle.sprite = this._mbStyle.sprite.replace("@2x", "");
  85097. var spriteUrl = this._toSpriteUrl(this._mbStyle.sprite, this.path, sizeFactor + ".json");
  85098. FetchRequest.get(spriteUrl, null, {
  85099. withCredentials: this.withCredentials
  85100. }).then(function (response) {
  85101. return response.json();
  85102. }).then(function (spritesJson) {
  85103. _this4._spriteData = spritesJson;
  85104. _this4._spriteImageUrl = _this4._toSpriteUrl(_this4._mbStyle.sprite, _this4.path, sizeFactor + ".png");
  85105. _this4._spriteImage = null;
  85106. var img = new Image();
  85107. img.crossOrigin = _this4.withCredentials ? "use-credentials" : "anonymous";
  85108. img.onload = function () {
  85109. _this4._spriteImage = img;
  85110. _this4._initStyleFunction();
  85111. };
  85112. img.onerror = function () {
  85113. _this4._spriteImage = null;
  85114. _this4._initStyleFunction();
  85115. };
  85116. img.src = _this4._spriteImageUrl;
  85117. });
  85118. } else {
  85119. this._initStyleFunction();
  85120. }
  85121. }
  85122. }, {
  85123. key: "_initStyleFunction",
  85124. value: function _initStyleFunction() {
  85125. if (!this.resolutions && this._mbStyle.metadata && this._mbStyle.metadata.indexbounds) {
  85126. var indexbounds = this._mbStyle.metadata.indexbounds;
  85127. var max = Math.max(indexbounds[2] - indexbounds[0], indexbounds[3] - indexbounds[1]);
  85128. var defaultResolutions = [];
  85129. for (var index = 0; index < 30; index++) {
  85130. defaultResolutions.push(max / 512 / Math.pow(2, index));
  85131. }
  85132. this.resolutions = defaultResolutions;
  85133. }
  85134. this._createStyleFunction();
  85135. /**
  85136. * @event ol.supermap.MapboxStyles#styleloaded
  85137. * @description 样式加载成功后触发。
  85138. */
  85139. this.dispatchEvent("styleloaded");
  85140. }
  85141. }, {
  85142. key: "_createStyleFunction",
  85143. value: function _createStyleFunction() {
  85144. if (this.map) {
  85145. window.olms.applyBackground(this.map, this._mbStyle);
  85146. }
  85147. this.featureStyleFuntion = this._getStyleFunction();
  85148. }
  85149. }, {
  85150. key: "_getStyleFunction",
  85151. value: function _getStyleFunction() {
  85152. var _this5 = this;
  85153. this.fun = window.olms.stylefunction({
  85154. setStyle: function setStyle() {},
  85155. set: function set() {},
  85156. changed: function changed() {}
  85157. }, this._mbStyle, this.source, this.resolutions, this._spriteData, "", this._spriteImage);
  85158. return function (feature, resolution) {
  85159. var style = _this5.fun(feature, resolution);
  85160. if (_this5.selectedObjects.length > 0 && _this5.selectedObjects.find(function (element) {
  85161. return element.id === feature.getId() && element.sourceLayer === feature.get("layer");
  85162. })) {
  85163. var styleIndex = style && style[0] ? style[0].getZIndex() : 99999;
  85164. var selectStyles = _this5.selectedStyle(feature, resolution);
  85165. if (!Array.isArray(selectStyles)) {
  85166. selectStyles = [selectStyles];
  85167. }
  85168. for (var index = 0; index < selectStyles.length; index++) {
  85169. var selectStyle = selectStyles[index];
  85170. if (feature.getGeometry().getType() === "Point" && style[0].getText() && selectStyle.getText()) {
  85171. selectStyle.setFill(null);
  85172. selectStyle.setStroke(null);
  85173. selectStyle.setImage();
  85174. selectStyle.getText().setText(style[0].getText().getText());
  85175. }
  85176. selectStyle.setZIndex(styleIndex);
  85177. }
  85178. return selectStyles;
  85179. }
  85180. return style;
  85181. };
  85182. }
  85183. }, {
  85184. key: "_withPath",
  85185. value: function _withPath(url, path) {
  85186. if (path && url.indexOf("http") != 0) {
  85187. url = path + url;
  85188. }
  85189. return url;
  85190. }
  85191. }, {
  85192. key: "_toSpriteUrl",
  85193. value: function _toSpriteUrl(url, path, extension) {
  85194. url = this._withPath(url, path);
  85195. var parts = url.match(this.spriteRegEx);
  85196. return parts ? parts[1] + extension + (parts.length > 2 ? parts[2] : "") : url + extension;
  85197. }
  85198. }]);
  85199. return MapboxStyles;
  85200. }((external_ol_Observable_default()));
  85201. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/index.js
  85202. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  85203. * This program are made available under the terms of the Apache License, Version 2.0
  85204. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85205. ;// CONCATENATED MODULE: ./src/openlayers/overlay/index.js
  85206. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  85207. * This program are made available under the terms of the Apache License, Version 2.0
  85208. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85209. ;// CONCATENATED MODULE: ./src/openlayers/services/AddressMatchService.js
  85210. function services_AddressMatchService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_AddressMatchService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_AddressMatchService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_AddressMatchService_typeof(obj); }
  85211. function services_AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  85212. function services_AddressMatchService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  85213. function services_AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_AddressMatchService_defineProperties(Constructor, staticProps); return Constructor; }
  85214. function services_AddressMatchService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) services_AddressMatchService_setPrototypeOf(subClass, superClass); }
  85215. function services_AddressMatchService_setPrototypeOf(o, p) { services_AddressMatchService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_AddressMatchService_setPrototypeOf(o, p); }
  85216. function services_AddressMatchService_createSuper(Derived) { var hasNativeReflectConstruct = services_AddressMatchService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_AddressMatchService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_AddressMatchService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_AddressMatchService_possibleConstructorReturn(this, result); }; }
  85217. function services_AddressMatchService_possibleConstructorReturn(self, call) { if (call && (services_AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_AddressMatchService_assertThisInitialized(self); }
  85218. function services_AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  85219. function services_AddressMatchService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  85220. function services_AddressMatchService_getPrototypeOf(o) { services_AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_AddressMatchService_getPrototypeOf(o); }
  85221. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  85222. * This program are made available under the terms of the Apache License, Version 2.0
  85223. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85224. /**
  85225. * @class ol.supermap.AddressMatchService
  85226. * @category iServer AddressMatch
  85227. * @classdesc 地址匹配服务。
  85228. * @example
  85229. * new ol.supermap.AddressMatchService(url,options)
  85230. * .code(function(result){
  85231. * //doSomething
  85232. * })
  85233. * @param {string} url - 与客户端交互的服务地址。
  85234. * @param {Object} options - 参数。
  85235. * @param {string} [options.proxy] - 服务代理地址。
  85236. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  85237. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  85238. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  85239. * @param {Object} [options.headers] - 请求头。
  85240. * @extends {ol.supermap.ServiceBase}
  85241. */
  85242. var AddressMatchService = /*#__PURE__*/function (_ServiceBase) {
  85243. services_AddressMatchService_inherits(AddressMatchService, _ServiceBase);
  85244. var _super = services_AddressMatchService_createSuper(AddressMatchService);
  85245. function AddressMatchService(url, options) {
  85246. services_AddressMatchService_classCallCheck(this, AddressMatchService);
  85247. return _super.call(this, url, options);
  85248. }
  85249. /**
  85250. * @function ol.supermap.AddressMatchService.prototype.code
  85251. * @description 获取正向地址匹配结果。
  85252. * @param {SuperMap.GeoCodingParameter} params - 正向匹配参数。
  85253. * @param {RequestCallback} callback 请求结果的回调函数。
  85254. */
  85255. services_AddressMatchService_createClass(AddressMatchService, [{
  85256. key: "code",
  85257. value: function code(params, callback) {
  85258. var me = this;
  85259. var addressMatchService = new AddressMatchService_AddressMatchService(me.url, {
  85260. proxy: me.options.proxy,
  85261. withCredentials: me.options.withCredentials,
  85262. crossOrigin: me.options.crossOrigin,
  85263. headers: me.options.headers,
  85264. serverType: me.options.serverType,
  85265. eventListeners: {
  85266. scope: me,
  85267. processCompleted: callback,
  85268. processFailed: callback
  85269. }
  85270. });
  85271. addressMatchService.code(Util.urlPathAppend(me.url, 'geocoding'), params);
  85272. }
  85273. /**
  85274. * @function ol.supermap.AddressMatchService.prototype.decode
  85275. * @description 获取反向地址匹配结果。
  85276. * @param {SuperMap.GeoDecodingParameter} params - 反向匹配参数。
  85277. * @param {RequestCallback} callback 请求结果的回调函数。
  85278. */
  85279. }, {
  85280. key: "decode",
  85281. value: function decode(params, callback) {
  85282. var me = this;
  85283. var addressMatchService = new AddressMatchService_AddressMatchService(me.url, {
  85284. proxy: me.options.proxy,
  85285. withCredentials: me.options.withCredentials,
  85286. crossOrigin: me.options.crossOrigin,
  85287. headers: me.options.headers,
  85288. serverType: me.options.serverType,
  85289. eventListeners: {
  85290. scope: me,
  85291. processCompleted: callback,
  85292. processFailed: callback
  85293. }
  85294. });
  85295. addressMatchService.decode(Util.urlPathAppend(me.url, 'geodecoding'), params);
  85296. }
  85297. }]);
  85298. return AddressMatchService;
  85299. }(ServiceBase);
  85300. ;// CONCATENATED MODULE: ./src/openlayers/services/ChartService.js
  85301. function ChartService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ChartService_typeof = function _typeof(obj) { return typeof obj; }; } else { ChartService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ChartService_typeof(obj); }
  85302. function ChartService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  85303. 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); } }
  85304. function ChartService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartService_defineProperties(Constructor, staticProps); return Constructor; }
  85305. function ChartService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ChartService_setPrototypeOf(subClass, superClass); }
  85306. function ChartService_setPrototypeOf(o, p) { ChartService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartService_setPrototypeOf(o, p); }
  85307. function ChartService_createSuper(Derived) { var hasNativeReflectConstruct = ChartService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ChartService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ChartService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ChartService_possibleConstructorReturn(this, result); }; }
  85308. function ChartService_possibleConstructorReturn(self, call) { if (call && (ChartService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartService_assertThisInitialized(self); }
  85309. function ChartService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  85310. function ChartService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  85311. function ChartService_getPrototypeOf(o) { ChartService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartService_getPrototypeOf(o); }
  85312. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  85313. * This program are made available under the terms of the Apache License, Version 2.0
  85314. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85315. /**
  85316. * @class ol.supermap.ChartService
  85317. * @category iServer Map Chart
  85318. * @classdesc 海图服务。
  85319. * @extends {ol.supermap.ServiceBase}
  85320. * @example
  85321. * new ol.supermap.ChartService(url)
  85322. * .queryChart(param,function(result){
  85323. * //doSomething
  85324. * })
  85325. * @param {string} url - 与客户端交互的海图服务地址。
  85326. * @param {Object} options - 参数。
  85327. * @param {string} [options.proxy] - 服务代理地址。
  85328. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  85329. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  85330. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  85331. * @param {Object} [options.headers] - 请求头。
  85332. */
  85333. var ChartService = /*#__PURE__*/function (_ServiceBase) {
  85334. ChartService_inherits(ChartService, _ServiceBase);
  85335. var _super = ChartService_createSuper(ChartService);
  85336. function ChartService(url, options) {
  85337. ChartService_classCallCheck(this, ChartService);
  85338. return _super.call(this, url, options);
  85339. }
  85340. /**
  85341. * @function ol.supermap.ChartService.prototype.queryChart
  85342. * @description 查询海图服务。
  85343. * @param {SuperMap.ChartQueryParameters} params - 海图查询所需参数类。
  85344. * @param {RequestCallback} callback - 回调函数。
  85345. * @param {SuperMap.DataFormat} resultFormat - 返回的结果格式类型。
  85346. */
  85347. ChartService_createClass(ChartService, [{
  85348. key: "queryChart",
  85349. value: function queryChart(params, callback, resultFormat) {
  85350. var me = this,
  85351. param = me._processParams(params),
  85352. format = me._processFormat(resultFormat);
  85353. var chartQueryService = new ChartQueryService(me.url, {
  85354. proxy: me.options.proxy,
  85355. withCredentials: me.options.withCredentials,
  85356. crossOrigin: me.options.crossOrigin,
  85357. headers: me.options.headers,
  85358. serverType: me.options.serverType,
  85359. eventListeners: {
  85360. scope: me,
  85361. processCompleted: callback,
  85362. processFailed: callback
  85363. },
  85364. format: format
  85365. });
  85366. chartQueryService.processAsync(param);
  85367. }
  85368. /**
  85369. * @function ol.supermap.ChartService.prototype.getChartFeatureInfo
  85370. * @description 获取海图物标信息服务。
  85371. * @param {RequestCallback} callback 回调函数。
  85372. */
  85373. }, {
  85374. key: "getChartFeatureInfo",
  85375. value: function getChartFeatureInfo(callback) {
  85376. var me = this;
  85377. var url = Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
  85378. var chartFeatureInfoSpecsService = new ChartFeatureInfoSpecsService(url, {
  85379. proxy: me.options.proxy,
  85380. withCredentials: me.options.withCredentials,
  85381. crossOrigin: me.options.crossOrigin,
  85382. headers: me.options.headers,
  85383. serverType: me.options.serverType,
  85384. eventListeners: {
  85385. scope: me,
  85386. processCompleted: callback,
  85387. processFailed: callback
  85388. }
  85389. });
  85390. chartFeatureInfoSpecsService.processAsync();
  85391. }
  85392. }, {
  85393. key: "_processParams",
  85394. value: function _processParams(params) {
  85395. if (!params) {
  85396. return {};
  85397. }
  85398. params.returnContent = params.returnContent == null ? true : params.returnContent;
  85399. if (params.filter) {
  85400. params.chartQueryFilterParameters = core_Util_Util.isArray(params.filter) ? params.filter : [params.filter];
  85401. }
  85402. if (params.bounds) {
  85403. params.bounds = new Bounds(params.bounds[0], params.bounds[1], params.bounds[2], params.bounds[3]);
  85404. }
  85405. }
  85406. }, {
  85407. key: "_processFormat",
  85408. value: function _processFormat(resultFormat) {
  85409. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  85410. }
  85411. }]);
  85412. return ChartService;
  85413. }(ServiceBase);
  85414. ;// CONCATENATED MODULE: ./src/openlayers/services/FieldService.js
  85415. function FieldService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FieldService_typeof = function _typeof(obj) { return typeof obj; }; } else { FieldService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FieldService_typeof(obj); }
  85416. function FieldService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  85417. 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); } }
  85418. function FieldService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldService_defineProperties(Constructor, staticProps); return Constructor; }
  85419. function FieldService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) FieldService_setPrototypeOf(subClass, superClass); }
  85420. function FieldService_setPrototypeOf(o, p) { FieldService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldService_setPrototypeOf(o, p); }
  85421. function FieldService_createSuper(Derived) { var hasNativeReflectConstruct = FieldService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FieldService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FieldService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FieldService_possibleConstructorReturn(this, result); }; }
  85422. function FieldService_possibleConstructorReturn(self, call) { if (call && (FieldService_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldService_assertThisInitialized(self); }
  85423. function FieldService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  85424. function FieldService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  85425. function FieldService_getPrototypeOf(o) { FieldService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldService_getPrototypeOf(o); }
  85426. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  85427. * This program are made available under the terms of the Apache License, Version 2.0
  85428. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85429. /**
  85430. * @class ol.supermap.FieldService
  85431. * @category iServer Data Field
  85432. * @classdesc 字段服务类。
  85433. * @example
  85434. * new ol.supermap.FieldService(url).getFields(function(result){
  85435. * //doSomething
  85436. * });
  85437. * @param {string} url - 与客户端交互的服务地址。
  85438. * @param {Object} options - 参数。
  85439. * @param {string} [options.proxy] - 服务代理地址。
  85440. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  85441. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  85442. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  85443. * @param {Object} [options.headers] - 请求头。
  85444. * @extends {ol.supermap.ServiceBase}
  85445. */
  85446. var FieldService = /*#__PURE__*/function (_ServiceBase) {
  85447. FieldService_inherits(FieldService, _ServiceBase);
  85448. var _super = FieldService_createSuper(FieldService);
  85449. function FieldService(url, options) {
  85450. FieldService_classCallCheck(this, FieldService);
  85451. return _super.call(this, url, options);
  85452. }
  85453. /**
  85454. * @function ol.supermap.FieldService.prototype.getFields
  85455. * @description 字段查询服务。
  85456. * @param {SuperMap.FieldParameters} params - 字段信息查询参数类。
  85457. * @param {RequestCallback} callback - 回调函数。
  85458. */
  85459. FieldService_createClass(FieldService, [{
  85460. key: "getFields",
  85461. value: function getFields(params, callback) {
  85462. var me = this;
  85463. var getFieldsService = new GetFieldsService(me.url, {
  85464. proxy: me.options.proxy,
  85465. withCredentials: me.options.withCredentials,
  85466. crossOrigin: me.options.crossOrigin,
  85467. headers: me.options.headers,
  85468. serverType: me.options.serverType,
  85469. eventListeners: {
  85470. scope: me,
  85471. processCompleted: callback,
  85472. processFailed: callback
  85473. },
  85474. datasource: params.datasource,
  85475. dataset: params.dataset
  85476. });
  85477. getFieldsService.processAsync();
  85478. }
  85479. /**
  85480. * @function ol.supermap.FieldService.prototype.getFieldStatisticsInfo
  85481. * @description 字段统计服务。
  85482. * @param {SuperMap.FieldStatisticsParameters} params - 查询所需参数类。
  85483. * @param {RequestCallback} callback - 回调函数。
  85484. */
  85485. }, {
  85486. key: "getFieldStatisticsInfo",
  85487. value: function getFieldStatisticsInfo(params, callback) {
  85488. var me = this,
  85489. fieldName = params.fieldName,
  85490. modes = params.statisticMode;
  85491. if (modes && !core_Util_Util.isArray(modes)) {
  85492. modes = [modes];
  85493. }
  85494. me.currentStatisticResult = {
  85495. fieldName: fieldName
  85496. };
  85497. me._statisticsCallback = callback; //针对每种统计方式分别进行请求
  85498. modes.forEach(function (mode) {
  85499. me.currentStatisticResult[mode] = null;
  85500. me._fieldStatisticRequest(params.datasource, params.dataset, fieldName, mode);
  85501. });
  85502. }
  85503. }, {
  85504. key: "_fieldStatisticRequest",
  85505. value: function _fieldStatisticRequest(datasource, dataset, fieldName, statisticMode) {
  85506. var me = this;
  85507. var statisticService = new FieldStatisticService(me.url, {
  85508. eventListeners: {
  85509. scope: me,
  85510. processCompleted: me._processCompleted,
  85511. processFailed: me._statisticsCallback
  85512. },
  85513. crossOrigin: me.options.crossOrigin,
  85514. headers: me.options.headers,
  85515. datasource: datasource,
  85516. dataset: dataset,
  85517. field: fieldName,
  85518. statisticMode: statisticMode
  85519. });
  85520. statisticService.processAsync();
  85521. }
  85522. }, {
  85523. key: "_processCompleted",
  85524. value: function _processCompleted(fieldStatisticResult) {
  85525. var me = this;
  85526. var getAll = true,
  85527. result = fieldStatisticResult.result;
  85528. if (this.currentStatisticResult) {
  85529. if (null == me.currentStatisticResult[result.mode]) {
  85530. this.currentStatisticResult[result.mode] = result.result;
  85531. }
  85532. }
  85533. for (var mode in me.currentStatisticResult) {
  85534. if (null == me.currentStatisticResult[mode]) {
  85535. getAll = false;
  85536. break;
  85537. }
  85538. }
  85539. if (getAll) {
  85540. me._statisticsCallback({
  85541. result: me.currentStatisticResult
  85542. });
  85543. }
  85544. }
  85545. }]);
  85546. return FieldService;
  85547. }(ServiceBase);
  85548. ;// CONCATENATED MODULE: ./src/openlayers/services/GridCellInfosService.js
  85549. function GridCellInfosService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GridCellInfosService_typeof = function _typeof(obj) { return typeof obj; }; } else { GridCellInfosService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GridCellInfosService_typeof(obj); }
  85550. function GridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  85551. function GridCellInfosService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  85552. function GridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GridCellInfosService_defineProperties(Constructor, staticProps); return Constructor; }
  85553. function GridCellInfosService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) GridCellInfosService_setPrototypeOf(subClass, superClass); }
  85554. function GridCellInfosService_setPrototypeOf(o, p) { GridCellInfosService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GridCellInfosService_setPrototypeOf(o, p); }
  85555. function GridCellInfosService_createSuper(Derived) { var hasNativeReflectConstruct = GridCellInfosService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GridCellInfosService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GridCellInfosService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GridCellInfosService_possibleConstructorReturn(this, result); }; }
  85556. function GridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } return GridCellInfosService_assertThisInitialized(self); }
  85557. function GridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  85558. function GridCellInfosService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  85559. function GridCellInfosService_getPrototypeOf(o) { GridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GridCellInfosService_getPrototypeOf(o); }
  85560. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  85561. * This program are made available under the terms of the Apache License, Version 2.0
  85562. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85563. /**
  85564. /**
  85565. * @class ol.supermap.GridCellInfosService
  85566. * @category iServer Data Grid
  85567. * @classdesc 数据栅格查询服务。
  85568. * @extends {ol.supermap.ServiceBase}
  85569. * @example
  85570. * new ol.supermap.GridCellInfosService(url)
  85571. * .getGridCellInfos(param,function(result){
  85572. * //doSomething
  85573. * })
  85574. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  85575. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  85576. * @param {Object} options - 参数。
  85577. * @param {string} [options.proxy] - 服务代理地址。
  85578. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  85579. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  85580. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  85581. * @param {Object} [options.headers] - 请求头。
  85582. */
  85583. var GridCellInfosService = /*#__PURE__*/function (_ServiceBase) {
  85584. GridCellInfosService_inherits(GridCellInfosService, _ServiceBase);
  85585. var _super = GridCellInfosService_createSuper(GridCellInfosService);
  85586. function GridCellInfosService(url, options) {
  85587. GridCellInfosService_classCallCheck(this, GridCellInfosService);
  85588. return _super.call(this, url, options);
  85589. }
  85590. /**
  85591. * @function ol.supermap.GridCellInfosService.prototype.getGridCellInfos
  85592. * @param {SuperMap.GetGridCellInfosParameters} params - 查询所需参数类。
  85593. * @param {RequestCallback} callback - 回调函数。
  85594. */
  85595. GridCellInfosService_createClass(GridCellInfosService, [{
  85596. key: "getGridCellInfos",
  85597. value: function getGridCellInfos(params, callback) {
  85598. if (!params) {
  85599. return null;
  85600. }
  85601. var me = this;
  85602. var gridCellQueryService = new GetGridCellInfosService(me.url, {
  85603. proxy: me.options.proxy,
  85604. withCredentials: me.options.withCredentials,
  85605. crossOrigin: me.options.crossOrigin,
  85606. headers: me.options.headers,
  85607. serverType: me.options.serverType,
  85608. eventListeners: {
  85609. scope: me,
  85610. processCompleted: callback,
  85611. processFailed: callback
  85612. }
  85613. });
  85614. gridCellQueryService.processAsync(params);
  85615. }
  85616. }]);
  85617. return GridCellInfosService;
  85618. }(ServiceBase);
  85619. ;// CONCATENATED MODULE: ./src/openlayers/services/GeoprocessingService.js
  85620. function services_GeoprocessingService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_GeoprocessingService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_GeoprocessingService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_GeoprocessingService_typeof(obj); }
  85621. function services_GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  85622. function services_GeoprocessingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  85623. function services_GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_GeoprocessingService_defineProperties(Constructor, staticProps); return Constructor; }
  85624. function services_GeoprocessingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) services_GeoprocessingService_setPrototypeOf(subClass, superClass); }
  85625. function services_GeoprocessingService_setPrototypeOf(o, p) { services_GeoprocessingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_GeoprocessingService_setPrototypeOf(o, p); }
  85626. function services_GeoprocessingService_createSuper(Derived) { var hasNativeReflectConstruct = services_GeoprocessingService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_GeoprocessingService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_GeoprocessingService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_GeoprocessingService_possibleConstructorReturn(this, result); }; }
  85627. function services_GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (services_GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_GeoprocessingService_assertThisInitialized(self); }
  85628. function services_GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  85629. function services_GeoprocessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  85630. function services_GeoprocessingService_getPrototypeOf(o) { services_GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_GeoprocessingService_getPrototypeOf(o); }
  85631. /**
  85632. * @class ol.supermap.GeoprocessingService
  85633. * @classdesc 地理处理服务接口类。
  85634. * @version 10.1.0
  85635. * @category iServer GeoprocessingService
  85636. * @extends {ol.supermap.ServiceBase}
  85637. * @example
  85638. * //为了安全访问受保护的地理处理服务,必须通过传递iserver令牌(token),才能正确访问相关资源。
  85639. * SuperMap.SecurityManager.registerToken(serviceUrl, token);
  85640. * var geoprocessingService = new L.supermap.geoprocessingService("http://localhost:8090/iserver/services/geoprocessing/restjsr/gp/v2")
  85641. geoprocessingService.submitJob(identifier,params, environments, function(serverResult) {
  85642. console.log(serverResult.result);
  85643. var jobID = serverResult.result.jobID;
  85644. var options = {
  85645. interval: 5000,
  85646. statusCallback: function(state) {
  85647. console.log("Job Status: ", state);
  85648. }
  85649. };
  85650. geoprocessingService.waitForJobCompletion(jobID, identifier, options, function(serverResult) {
  85651. console.log(serverResult);
  85652. })
  85653. })
  85654. * @param {string} url - 服务地址。
  85655. * @param {Object} options - 参数。
  85656. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online。
  85657. */
  85658. var GeoprocessingService = /*#__PURE__*/function (_ServiceBase) {
  85659. services_GeoprocessingService_inherits(GeoprocessingService, _ServiceBase);
  85660. var _super = services_GeoprocessingService_createSuper(GeoprocessingService);
  85661. function GeoprocessingService(url, options) {
  85662. var _this;
  85663. services_GeoprocessingService_classCallCheck(this, GeoprocessingService);
  85664. _this = _super.call(this, url, options);
  85665. _this.headers = true;
  85666. _this.crossOrigin = true;
  85667. _this.withCredentials = true;
  85668. _this.proxy = true;
  85669. return _this;
  85670. }
  85671. /**
  85672. * @function ol.supermap.GeoprocessingService.prototype.getTools
  85673. * @description 获取地理处理工具列表。
  85674. * @param {RequestCallback} callback 请求结果的回调函数。
  85675. */
  85676. services_GeoprocessingService_createClass(GeoprocessingService, [{
  85677. key: "getTools",
  85678. value: function getTools(callback) {
  85679. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  85680. proxy: this.options.proxy,
  85681. withCredentials: this.options.withCredentials,
  85682. crossOrigin: this.options.crossOrigin,
  85683. headers: this.options.headers,
  85684. serverType: this.options.serverType,
  85685. eventListeners: {
  85686. scope: this,
  85687. processCompleted: callback,
  85688. processFailed: callback
  85689. }
  85690. });
  85691. geoprocessingJobsService.getTools();
  85692. }
  85693. /**
  85694. * @function ol.supermap.GeoprocessingService.prototype.getTool
  85695. * @description 获取地理处理工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  85696. * @param {string} identifier - 地理处理工具ID。
  85697. * @param {RequestCallback} callback 请求结果的回调函数。
  85698. */
  85699. }, {
  85700. key: "getTool",
  85701. value: function getTool(identifier, callback) {
  85702. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  85703. proxy: this.options.proxy,
  85704. withCredentials: this.options.withCredentials,
  85705. crossOrigin: this.options.crossOrigin,
  85706. headers: this.options.headers,
  85707. serverType: this.options.serverType,
  85708. eventListeners: {
  85709. scope: this,
  85710. processCompleted: callback,
  85711. processFailed: callback
  85712. }
  85713. });
  85714. geoprocessingJobsService.getTool(identifier);
  85715. }
  85716. /**
  85717. * @function ol.supermap.GeoprocessingService.prototype.execute
  85718. * @description 同步执行地理处理工具。
  85719. * @param {string} identifier - 地理处理工具ID。
  85720. * @param {Object} parameter - 地理处理工具的输入参数。
  85721. * @param {Object} environment - 地理处理工具的环境参数。
  85722. * @param {RequestCallback} callback 回调函数。
  85723. */
  85724. }, {
  85725. key: "execute",
  85726. value: function execute(identifier, parameter, environment, callback) {
  85727. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  85728. proxy: this.options.proxy,
  85729. withCredentials: this.options.withCredentials,
  85730. crossOrigin: this.options.crossOrigin,
  85731. headers: this.options.headers,
  85732. serverType: this.options.serverType,
  85733. eventListeners: {
  85734. scope: this,
  85735. processCompleted: callback,
  85736. processFailed: callback
  85737. }
  85738. });
  85739. geoprocessingJobsService.execute(identifier, parameter, environment);
  85740. }
  85741. /**
  85742. * @function ol.supermap.GeoprocessingService.prototype.submitJob
  85743. * @description 异步执行地理处理工具。
  85744. * @param {string} identifier - 地理处理工具ID。
  85745. * @param {Object} parameter - 地理处理工具的输入参数。
  85746. * @param {Object} environment - 地理处理工具的环境参数。
  85747. * @param {RequestCallback} callback 回调函数。
  85748. */
  85749. }, {
  85750. key: "submitJob",
  85751. value: function submitJob(identifier, parameter, environment, callback) {
  85752. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  85753. proxy: this.options.proxy,
  85754. withCredentials: this.options.withCredentials,
  85755. crossOrigin: this.options.crossOrigin,
  85756. headers: this.options.headers,
  85757. serverType: this.options.serverType,
  85758. eventListeners: {
  85759. scope: this,
  85760. processCompleted: callback,
  85761. processFailed: callback
  85762. }
  85763. });
  85764. geoprocessingJobsService.submitJob(identifier, parameter, environment);
  85765. }
  85766. /**
  85767. * @function ol.supermap.GeoprocessingService.prototype.waitForJobCompletion
  85768. * @description 获取地理处理异步执行状态信息。
  85769. * @param {string} jobId - 地理处理任务ID。
  85770. * @param {string} identifier - 地理处理工具ID。
  85771. * @param {Object} options - 状态信息参数。
  85772. * @param {number} options.interval - 定时器时间间隔。
  85773. * @param {Callback} options.statusCallback - 任务状态的回调函数。
  85774. * @param {RequestCallback} callback 回调函数。
  85775. */
  85776. }, {
  85777. key: "waitForJobCompletion",
  85778. value: function waitForJobCompletion(jobId, identifier, options, callback) {
  85779. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  85780. proxy: this.options.proxy,
  85781. withCredentials: this.options.withCredentials,
  85782. crossOrigin: this.options.crossOrigin,
  85783. headers: this.options.headers,
  85784. serverType: this.options.serverType,
  85785. eventListeners: {
  85786. scope: this,
  85787. processCompleted: callback,
  85788. processFailed: callback
  85789. }
  85790. });
  85791. geoprocessingJobsService.waitForJobCompletion(jobId, identifier, options);
  85792. }
  85793. /**
  85794. * @function ol.supermap.GeoprocessingService.prototype.getJobInfo
  85795. * @description 获取地理处理任务的执行信息。
  85796. * @param {string} identifier - 地理处理工具ID。
  85797. * @param {string} jobId - 地理处理任务ID。
  85798. * @param {RequestCallback} callback 回调函数。
  85799. */
  85800. }, {
  85801. key: "getJobInfo",
  85802. value: function getJobInfo(identifier, jobId, callback) {
  85803. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  85804. proxy: this.options.proxy,
  85805. withCredentials: this.options.withCredentials,
  85806. crossOrigin: this.options.crossOrigin,
  85807. headers: this.options.headers,
  85808. serverType: this.options.serverType,
  85809. eventListeners: {
  85810. scope: this,
  85811. processCompleted: callback,
  85812. processFailed: callback
  85813. }
  85814. });
  85815. geoprocessingJobsService.getJobInfo(identifier, jobId);
  85816. }
  85817. /**
  85818. * @function ol.supermap.GeoprocessingService.prototype.cancelJob
  85819. * @description 取消地理处理任务的异步执行。
  85820. * @param {string} identifier - 地理处理工具ID。
  85821. * @param {string} jobId - 地理处理任务ID。
  85822. * @param {RequestCallback} callback 回调函数。
  85823. */
  85824. }, {
  85825. key: "cancelJob",
  85826. value: function cancelJob(identifier, jobId, callback) {
  85827. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  85828. proxy: this.options.proxy,
  85829. withCredentials: this.options.withCredentials,
  85830. crossOrigin: this.options.crossOrigin,
  85831. headers: this.options.headers,
  85832. serverType: this.options.serverType,
  85833. eventListeners: {
  85834. scope: this,
  85835. processCompleted: callback,
  85836. processFailed: callback
  85837. }
  85838. });
  85839. geoprocessingJobsService.cancelJob(identifier, jobId);
  85840. }
  85841. /**
  85842. * @function ol.supermap.GeoprocessingService.prototype.getJobs
  85843. * @description 获取地理处理服务任务列表。
  85844. * @param {string} identifier - 地理处理工具ID。(可选,传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  85845. * @param {RequestCallback} callback 回调函数。
  85846. */
  85847. }, {
  85848. key: "getJobs",
  85849. value: function getJobs(identifier, callback) {
  85850. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  85851. proxy: this.options.proxy,
  85852. withCredentials: this.options.withCredentials,
  85853. crossOrigin: this.options.crossOrigin,
  85854. headers: this.options.headers,
  85855. serverType: this.options.serverType,
  85856. eventListeners: {
  85857. scope: this,
  85858. processCompleted: callback,
  85859. processFailed: callback
  85860. }
  85861. });
  85862. geoprocessingJobsService.getJobs(identifier);
  85863. }
  85864. /**
  85865. * @function ol.supermap.GeoprocessingService.prototype.getResults
  85866. * @description 地理处理工具异步执行的结果,支持结果过滤。
  85867. * @param {string} identifier - 地理处理工具ID。
  85868. * @param {string} jobId - 地理处理任务ID。
  85869. * @param {string} filter - 输出异步结果的id。(可选,传入filter参数时对该地理处理工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  85870. * @param {RequestCallback} callback 请求结果的回调函数。
  85871. */
  85872. }, {
  85873. key: "getResults",
  85874. value: function getResults(identifier, jobId, filter, callback) {
  85875. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  85876. proxy: this.options.proxy,
  85877. withCredentials: this.options.withCredentials,
  85878. crossOrigin: this.options.crossOrigin,
  85879. headers: this.options.headers,
  85880. serverType: this.options.serverType,
  85881. eventListeners: {
  85882. scope: this,
  85883. processCompleted: callback,
  85884. processFailed: callback
  85885. }
  85886. });
  85887. geoprocessingJobsService.getResults(identifier, jobId, filter);
  85888. }
  85889. }]);
  85890. return GeoprocessingService;
  85891. }(ServiceBase);
  85892. ;// CONCATENATED MODULE: ./src/openlayers/services/LayerInfoService.js
  85893. function LayerInfoService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LayerInfoService_typeof = function _typeof(obj) { return typeof obj; }; } else { LayerInfoService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LayerInfoService_typeof(obj); }
  85894. function LayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  85895. 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); } }
  85896. function LayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  85897. function LayerInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) LayerInfoService_setPrototypeOf(subClass, superClass); }
  85898. function LayerInfoService_setPrototypeOf(o, p) { LayerInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LayerInfoService_setPrototypeOf(o, p); }
  85899. function LayerInfoService_createSuper(Derived) { var hasNativeReflectConstruct = LayerInfoService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LayerInfoService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LayerInfoService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LayerInfoService_possibleConstructorReturn(this, result); }; }
  85900. function LayerInfoService_possibleConstructorReturn(self, call) { if (call && (LayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return LayerInfoService_assertThisInitialized(self); }
  85901. function LayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  85902. function LayerInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  85903. function LayerInfoService_getPrototypeOf(o) { LayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LayerInfoService_getPrototypeOf(o); }
  85904. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  85905. * This program are made available under the terms of the Apache License, Version 2.0
  85906. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85907. /**
  85908. * @class ol.supermap.LayerInfoService
  85909. * @category iServer Map Layer
  85910. * @classdesc 图层信息服务类。
  85911. * @extends {ol.supermap.ServiceBase}
  85912. * @example
  85913. * new ol.supermap.LayerInfoService(url).getLayersInfo(function(result){
  85914. * //doSomething
  85915. * })
  85916. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  85917. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  85918. * @param {Object} options - 参数。
  85919. * @param {string} [options.proxy] - 服务代理地址。
  85920. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  85921. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  85922. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  85923. * @param {Object} [options.headers] - 请求头。
  85924. */
  85925. var LayerInfoService = /*#__PURE__*/function (_ServiceBase) {
  85926. LayerInfoService_inherits(LayerInfoService, _ServiceBase);
  85927. var _super = LayerInfoService_createSuper(LayerInfoService);
  85928. function LayerInfoService(url, options) {
  85929. LayerInfoService_classCallCheck(this, LayerInfoService);
  85930. return _super.call(this, url, options);
  85931. }
  85932. /**
  85933. * @function ol.supermap.LayerInfoService.prototype.getLayersInfo
  85934. * @description 获取图层信息服务。
  85935. * @param {RequestCallback} callback - 回调函数。
  85936. */
  85937. LayerInfoService_createClass(LayerInfoService, [{
  85938. key: "getLayersInfo",
  85939. value: function getLayersInfo(callback) {
  85940. var me = this;
  85941. var getLayersInfoService = new GetLayersInfoService(me.url, {
  85942. proxy: me.options.proxy,
  85943. withCredentials: me.options.withCredentials,
  85944. crossOrigin: me.options.crossOrigin,
  85945. headers: me.options.headers,
  85946. serverType: me.options.serverType,
  85947. eventListeners: {
  85948. processCompleted: callback,
  85949. processFailed: callback
  85950. }
  85951. });
  85952. getLayersInfoService.processAsync();
  85953. }
  85954. /**
  85955. * @function ol.supermap.LayerInfoService.prototype.setLayerInfo
  85956. * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
  85957. * @param {SuperMap.SetLayerInfoParameters} params - 设置图层信息参数类。
  85958. * @param {RequestCallback} callback - 回调函数。
  85959. */
  85960. }, {
  85961. key: "setLayerInfo",
  85962. value: function setLayerInfo(params, callback) {
  85963. if (!params) {
  85964. return;
  85965. }
  85966. var me = this,
  85967. resourceID = params.resourceID,
  85968. tempLayerName = params.tempLayerName,
  85969. layerInfoParams = params.layerInfo;
  85970. if (!resourceID || !tempLayerName) {
  85971. return;
  85972. }
  85973. var url = Util.urlPathAppend(me.url, "tempLayersSet/" + resourceID + "/" + tempLayerName);
  85974. var setLayerInfoService = new SetLayerInfoService(url, {
  85975. proxy: me.options.proxy,
  85976. withCredentials: me.options.withCredentials,
  85977. crossOrigin: me.options.crossOrigin,
  85978. headers: me.options.headers,
  85979. serverType: me.options.serverType,
  85980. eventListeners: {
  85981. processCompleted: callback,
  85982. processFailed: callback
  85983. }
  85984. });
  85985. setLayerInfoService.processAsync(layerInfoParams);
  85986. }
  85987. /**
  85988. * @function ol.supermap.LayerInfoService.prototype.setLayersInfo
  85989. * @description 设置图层信息服务。可以实现创建新的临时图层和对现有临时图层的修改。
  85990. * @param {SuperMap.SetLayersInfoParameters} params - 设置图层信息参数类,包括临时图层。
  85991. * @param {RequestCallback} callback - 回调函数。
  85992. */
  85993. }, {
  85994. key: "setLayersInfo",
  85995. value: function setLayersInfo(params, callback) {
  85996. if (!params) {
  85997. return;
  85998. }
  85999. var me = this,
  86000. resourceID = params.resourceID,
  86001. isTempLayers = params.isTempLayers ? params.isTempLayers : false,
  86002. layersInfo = params.layersInfo;
  86003. if (isTempLayers && !resourceID || !layersInfo) {
  86004. return;
  86005. }
  86006. var setLayersInfoService = new SetLayersInfoService(me.url, {
  86007. proxy: me.options.proxy,
  86008. withCredentials: me.options.withCredentials,
  86009. crossOrigin: me.options.crossOrigin,
  86010. headers: me.options.headers,
  86011. serverType: me.options.serverType,
  86012. eventListeners: {
  86013. processCompleted: callback,
  86014. processFailed: callback
  86015. },
  86016. resourceID: resourceID,
  86017. isTempLayers: isTempLayers
  86018. });
  86019. setLayersInfoService.processAsync(layersInfo);
  86020. }
  86021. /**
  86022. * @function ol.supermap.LayerInfoService.prototype.setLayerStatus
  86023. * @description 子图层显示控制服务。负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  86024. * @param {SuperMap.SetLayerStatusParameters} params - 子图层显示控制参数类。
  86025. * @param {RequestCallback} callback - 回调函数。
  86026. */
  86027. }, {
  86028. key: "setLayerStatus",
  86029. value: function setLayerStatus(params, callback) {
  86030. if (!params) {
  86031. return;
  86032. }
  86033. var me = this;
  86034. var setLayerStatusService = new SetLayerStatusService(me.url, {
  86035. proxy: me.options.proxy,
  86036. withCredentials: me.options.withCredentials,
  86037. crossOrigin: me.options.crossOrigin,
  86038. headers: me.options.headers,
  86039. serverType: me.options.serverType,
  86040. eventListeners: {
  86041. processCompleted: callback,
  86042. processFailed: callback
  86043. }
  86044. });
  86045. setLayerStatusService.processAsync(params);
  86046. }
  86047. }]);
  86048. return LayerInfoService;
  86049. }(ServiceBase);
  86050. ;// CONCATENATED MODULE: ./src/openlayers/services/MeasureService.js
  86051. function services_MeasureService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_MeasureService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_MeasureService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_MeasureService_typeof(obj); }
  86052. function services_MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  86053. function services_MeasureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  86054. function services_MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_MeasureService_defineProperties(Constructor, staticProps); return Constructor; }
  86055. function services_MeasureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) services_MeasureService_setPrototypeOf(subClass, superClass); }
  86056. function services_MeasureService_setPrototypeOf(o, p) { services_MeasureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_MeasureService_setPrototypeOf(o, p); }
  86057. function services_MeasureService_createSuper(Derived) { var hasNativeReflectConstruct = services_MeasureService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_MeasureService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_MeasureService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_MeasureService_possibleConstructorReturn(this, result); }; }
  86058. function services_MeasureService_possibleConstructorReturn(self, call) { if (call && (services_MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_MeasureService_assertThisInitialized(self); }
  86059. function services_MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  86060. function services_MeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  86061. function services_MeasureService_getPrototypeOf(o) { services_MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_MeasureService_getPrototypeOf(o); }
  86062. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  86063. * This program are made available under the terms of the Apache License, Version 2.0
  86064. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86065. /**
  86066. * @class ol.supermap.MeasureService
  86067. * @category iServer Map Measure
  86068. * @classdesc 测量服务。
  86069. * @extends ol.supermap.ServiceBase
  86070. * @param {string} url - 服务访问的地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  86071. * @param {Object} options - 交互服务时所需可选参数。
  86072. * @param {string} [options.proxy] - 服务代理地址。
  86073. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  86074. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  86075. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  86076. * @param {Object} [options.headers] - 请求头。
  86077. */
  86078. var MeasureService = /*#__PURE__*/function (_ServiceBase) {
  86079. services_MeasureService_inherits(MeasureService, _ServiceBase);
  86080. var _super = services_MeasureService_createSuper(MeasureService);
  86081. function MeasureService(url, options) {
  86082. services_MeasureService_classCallCheck(this, MeasureService);
  86083. return _super.call(this, url, options);
  86084. }
  86085. /**
  86086. * @function ol.supermap.MeasureService.prototype.measureDistance
  86087. * @description 测距。
  86088. * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
  86089. * @param {RequestCallback} callback - 回调函数。
  86090. */
  86091. services_MeasureService_createClass(MeasureService, [{
  86092. key: "measureDistance",
  86093. value: function measureDistance(params, callback) {
  86094. this.measure(params, 'DISTANCE', callback);
  86095. }
  86096. /**
  86097. * @function ol.supermap.MeasureService.prototype.measureArea
  86098. * @description 测面积。
  86099. * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
  86100. * @param {RequestCallback} callback - 回调函数。
  86101. */
  86102. }, {
  86103. key: "measureArea",
  86104. value: function measureArea(params, callback) {
  86105. this.measure(params, 'AREA', callback);
  86106. }
  86107. /**
  86108. * @function ol.supermap.MeasureService.prototype.measure
  86109. * @description 测量。
  86110. * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
  86111. * @param {string} type - 类型。
  86112. * @param {RequestCallback} callback - 回调函数。
  86113. * @returns {ol.supermap.MeasureService} 测量服务。
  86114. */
  86115. }, {
  86116. key: "measure",
  86117. value: function measure(params, type, callback) {
  86118. var me = this;
  86119. var measureService = new MeasureService_MeasureService(me.url, {
  86120. proxy: me.options.proxy,
  86121. withCredentials: me.options.withCredentials,
  86122. crossOrigin: me.options.crossOrigin,
  86123. headers: me.options.headers,
  86124. serverType: me.options.serverType,
  86125. measureMode: type,
  86126. eventListeners: {
  86127. scope: me,
  86128. processCompleted: callback,
  86129. processFailed: callback
  86130. }
  86131. });
  86132. measureService.processAsync(me._processParam(params));
  86133. }
  86134. }, {
  86135. key: "_processParam",
  86136. value: function _processParam(params) {
  86137. if (params && params.geometry) {
  86138. params.geometry = core_Util_Util.toSuperMapGeometry(JSON.parse(new (external_ol_format_GeoJSON_default())().writeGeometry(params.geometry)));
  86139. }
  86140. return params;
  86141. }
  86142. }]);
  86143. return MeasureService;
  86144. }(ServiceBase);
  86145. ;// CONCATENATED MODULE: ./src/openlayers/services/NetworkAnalyst3DService.js
  86146. function NetworkAnalyst3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { NetworkAnalyst3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { NetworkAnalyst3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return NetworkAnalyst3DService_typeof(obj); }
  86147. function NetworkAnalyst3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  86148. 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); } }
  86149. function NetworkAnalyst3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalyst3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalyst3DService_defineProperties(Constructor, staticProps); return Constructor; }
  86150. function NetworkAnalyst3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) NetworkAnalyst3DService_setPrototypeOf(subClass, superClass); }
  86151. function NetworkAnalyst3DService_setPrototypeOf(o, p) { NetworkAnalyst3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalyst3DService_setPrototypeOf(o, p); }
  86152. function NetworkAnalyst3DService_createSuper(Derived) { var hasNativeReflectConstruct = NetworkAnalyst3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NetworkAnalyst3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NetworkAnalyst3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NetworkAnalyst3DService_possibleConstructorReturn(this, result); }; }
  86153. function NetworkAnalyst3DService_possibleConstructorReturn(self, call) { if (call && (NetworkAnalyst3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return NetworkAnalyst3DService_assertThisInitialized(self); }
  86154. function NetworkAnalyst3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  86155. function NetworkAnalyst3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  86156. function NetworkAnalyst3DService_getPrototypeOf(o) { NetworkAnalyst3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalyst3DService_getPrototypeOf(o); }
  86157. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  86158. * This program are made available under the terms of the Apache License, Version 2.0
  86159. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86160. /**
  86161. * @class ol.supermap.NetworkAnalyst3DService
  86162. * @category iServer FacilityAnalyst3D
  86163. * @classdesc 3D 网络分析服务类。
  86164. * @extends {ol.supermap.ServiceBase}
  86165. * @example
  86166. * new ol.supermap.NetworkAnalyst3DService(url)
  86167. * .sinksFacilityAnalyst(params,function(result){
  86168. * //doSomething
  86169. * })
  86170. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL 应为:
  86171. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  86172. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  86173. * @param {Object} options - 参数。
  86174. * @param {string} [options.proxy] - 服务代理地址。
  86175. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  86176. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  86177. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  86178. * @param {Object} [options.headers] - 请求头。
  86179. */
  86180. var NetworkAnalyst3DService = /*#__PURE__*/function (_ServiceBase) {
  86181. NetworkAnalyst3DService_inherits(NetworkAnalyst3DService, _ServiceBase);
  86182. var _super = NetworkAnalyst3DService_createSuper(NetworkAnalyst3DService);
  86183. function NetworkAnalyst3DService(url, options) {
  86184. NetworkAnalyst3DService_classCallCheck(this, NetworkAnalyst3DService);
  86185. return _super.call(this, url, options);
  86186. }
  86187. /**
  86188. * @function ol.supermap.NetworkAnalyst3DService.prototype.sinksFacilityAnalyst
  86189. * @description 汇查找服务
  86190. * @param {SuperMap.FacilityAnalystSinks3DParameters} params- 最近设施分析参数类(汇查找资源)。
  86191. * @param {RequestCallback} callback - 回调函数。
  86192. * @returns {ol.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  86193. */
  86194. NetworkAnalyst3DService_createClass(NetworkAnalyst3DService, [{
  86195. key: "sinksFacilityAnalyst",
  86196. value: function sinksFacilityAnalyst(params, callback) {
  86197. var me = this;
  86198. var facilityAnalystSinks3DService = new FacilityAnalystSinks3DService(me.url, {
  86199. proxy: me.options.proxy,
  86200. withCredentials: me.options.withCredentials,
  86201. crossOrigin: me.options.crossOrigin,
  86202. headers: me.options.headers,
  86203. serverType: me.options.serverType,
  86204. eventListeners: {
  86205. scope: me,
  86206. processCompleted: callback,
  86207. processFailed: callback
  86208. }
  86209. });
  86210. facilityAnalystSinks3DService.processAsync(params);
  86211. }
  86212. /**
  86213. * @function ol.supermap.NetworkAnalyst3DService.prototype.sourcesFacilityAnalyst
  86214. * @description 源查找服务。
  86215. * @param {SuperMap.FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找服务)。
  86216. * @param {RequestCallback} callback - 回调函数。
  86217. * @returns {ol.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  86218. */
  86219. }, {
  86220. key: "sourcesFacilityAnalyst",
  86221. value: function sourcesFacilityAnalyst(params, callback) {
  86222. var me = this;
  86223. var facilityAnalystSources3DService = new FacilityAnalystSources3DService(me.url, {
  86224. proxy: me.options.proxy,
  86225. withCredentials: me.options.withCredentials,
  86226. crossOrigin: me.options.crossOrigin,
  86227. headers: me.options.headers,
  86228. serverType: me.options.serverType,
  86229. eventListeners: {
  86230. scope: me,
  86231. processCompleted: callback,
  86232. processFailed: callback
  86233. }
  86234. });
  86235. facilityAnalystSources3DService.processAsync(params);
  86236. }
  86237. /**
  86238. * @function ol.supermap.NetworkAnalyst3DService.prototype.traceUpFacilityAnalyst
  86239. * @description 上游追踪资源服务。
  86240. * @param {SuperMap.FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
  86241. * @param {RequestCallback} callback - 回调函数。
  86242. * @returns {ol.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  86243. */
  86244. }, {
  86245. key: "traceUpFacilityAnalyst",
  86246. value: function traceUpFacilityAnalyst(params, callback) {
  86247. var me = this;
  86248. var facilityAnalystTraceup3DService = new FacilityAnalystTraceup3DService(me.url, {
  86249. proxy: me.options.proxy,
  86250. withCredentials: me.options.withCredentials,
  86251. crossOrigin: me.options.crossOrigin,
  86252. headers: me.options.headers,
  86253. serverType: me.options.serverType,
  86254. eventListeners: {
  86255. scope: me,
  86256. processCompleted: callback,
  86257. processFailed: callback
  86258. }
  86259. });
  86260. facilityAnalystTraceup3DService.processAsync(params);
  86261. }
  86262. /**
  86263. * @function ol.supermap.NetworkAnalyst3DService.prototype.traceDownFacilityAnalyst
  86264. * @description 下游追踪资源服务。
  86265. * @param {SuperMap.FacilityAnalystTracedown3DParameters} params - 下游追踪资源服务参数类。
  86266. * @param {RequestCallback} callback - 回调函数。
  86267. * @returns {ol.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  86268. */
  86269. }, {
  86270. key: "traceDownFacilityAnalyst",
  86271. value: function traceDownFacilityAnalyst(params, callback) {
  86272. var me = this;
  86273. var facilityAnalystTracedown3DService = new FacilityAnalystTracedown3DService(me.url, {
  86274. proxy: me.options.proxy,
  86275. withCredentials: me.options.withCredentials,
  86276. crossOrigin: me.options.crossOrigin,
  86277. headers: me.options.headers,
  86278. serverType: me.options.serverType,
  86279. eventListeners: {
  86280. scope: me,
  86281. processCompleted: callback,
  86282. processFailed: callback
  86283. }
  86284. });
  86285. facilityAnalystTracedown3DService.processAsync(params);
  86286. }
  86287. /**
  86288. * @function ol.supermap.NetworkAnalyst3DService.prototype.upstreamFacilityAnalyst
  86289. * @description 上游关键设施查找服务。
  86290. * @param {SuperMap.FacilityAnalystUpstream3DParameters} params - 上游关键设施查找服务参数类。
  86291. * @param {RequestCallback} callback - 回调函数。
  86292. * @returns {ol.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  86293. */
  86294. }, {
  86295. key: "upstreamFacilityAnalyst",
  86296. value: function upstreamFacilityAnalyst(params, callback) {
  86297. var me = this;
  86298. var facilityAnalystUpstream3DService = new FacilityAnalystUpstream3DService(me.url, {
  86299. proxy: me.options.proxy,
  86300. withCredentials: me.options.withCredentials,
  86301. crossOrigin: me.options.crossOrigin,
  86302. headers: me.options.headers,
  86303. serverType: me.options.serverType,
  86304. eventListeners: {
  86305. scope: me,
  86306. processCompleted: callback,
  86307. processFailed: callback
  86308. }
  86309. });
  86310. facilityAnalystUpstream3DService.processAsync(params);
  86311. }
  86312. }]);
  86313. return NetworkAnalyst3DService;
  86314. }(ServiceBase);
  86315. ;// CONCATENATED MODULE: ./src/openlayers/services/NetworkAnalystService.js
  86316. function NetworkAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { NetworkAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { NetworkAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return NetworkAnalystService_typeof(obj); }
  86317. function NetworkAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  86318. 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); } }
  86319. function NetworkAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  86320. function NetworkAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) NetworkAnalystService_setPrototypeOf(subClass, superClass); }
  86321. function NetworkAnalystService_setPrototypeOf(o, p) { NetworkAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystService_setPrototypeOf(o, p); }
  86322. function NetworkAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = NetworkAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NetworkAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NetworkAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NetworkAnalystService_possibleConstructorReturn(this, result); }; }
  86323. function NetworkAnalystService_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return NetworkAnalystService_assertThisInitialized(self); }
  86324. function NetworkAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  86325. function NetworkAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  86326. function NetworkAnalystService_getPrototypeOf(o) { NetworkAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystService_getPrototypeOf(o); }
  86327. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  86328. * This program are made available under the terms of the Apache License, Version 2.0
  86329. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86330. /**
  86331. * @class ol.supermap.NetworkAnalystService
  86332. * @category iServer NetworkAnalyst
  86333. * @classdesc 网络分析服务类。
  86334. * @extends {ol.supermap.ServiceBase}
  86335. * @example
  86336. * new ol.supermap.NetworkAnalystService(url)
  86337. * .findPath(params,function(result){
  86338. * //doSomething
  86339. * })
  86340. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL 应为:
  86341. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};<br>
  86342. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  86343. * @param {Object} options - 参数。
  86344. * @param {string} [options.proxy] - 服务代理地址。
  86345. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  86346. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  86347. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  86348. * @param {Object} [options.headers] - 请求头。
  86349. */
  86350. var NetworkAnalystService = /*#__PURE__*/function (_ServiceBase) {
  86351. NetworkAnalystService_inherits(NetworkAnalystService, _ServiceBase);
  86352. var _super = NetworkAnalystService_createSuper(NetworkAnalystService);
  86353. function NetworkAnalystService(url, options) {
  86354. NetworkAnalystService_classCallCheck(this, NetworkAnalystService);
  86355. return _super.call(this, url, options);
  86356. }
  86357. /**
  86358. * @function ol.supermap.NetworkAnalystService.prototype.burstPipelineAnalyst
  86359. * @description 爆管分析服务:即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组,普通结点 ID 数组及其上下游弧段 ID 数组。
  86360. * @param {SuperMap.BurstPipelineAnalystParameters} params - 爆管分析服务参数类。
  86361. * @param {RequestCallback} callback 回调函数。
  86362. */
  86363. NetworkAnalystService_createClass(NetworkAnalystService, [{
  86364. key: "burstPipelineAnalyst",
  86365. value: function burstPipelineAnalyst(params, callback) {
  86366. var me = this;
  86367. var burstPipelineAnalystService = new BurstPipelineAnalystService(me.url, {
  86368. proxy: me.options.proxy,
  86369. withCredentials: me.options.withCredentials,
  86370. crossOrigin: me.options.crossOrigin,
  86371. headers: me.options.headers,
  86372. serverType: me.options.serverType,
  86373. eventListeners: {
  86374. scope: me,
  86375. processCompleted: callback,
  86376. processFailed: callback
  86377. }
  86378. });
  86379. burstPipelineAnalystService.processAsync(me._processParams(params));
  86380. }
  86381. /**
  86382. * @function ol.supermap.NetworkAnalystService.prototype.computeWeightMatrix
  86383. * @description 耗费矩阵分析服务:根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  86384. * @param {SuperMap.ComputeWeightMatrixParameters} params - 耗费矩阵分析服务参数类。
  86385. * @param {RequestCallback} callback - 回调函数。
  86386. */
  86387. }, {
  86388. key: "computeWeightMatrix",
  86389. value: function computeWeightMatrix(params, callback) {
  86390. var me = this;
  86391. var computeWeightMatrixService = new ComputeWeightMatrixService(me.url, {
  86392. proxy: me.options.proxy,
  86393. withCredentials: me.options.withCredentials,
  86394. crossOrigin: me.options.crossOrigin,
  86395. headers: me.options.headers,
  86396. serverType: me.options.serverType,
  86397. eventListeners: {
  86398. scope: me,
  86399. processCompleted: callback,
  86400. processFailed: callback
  86401. }
  86402. });
  86403. computeWeightMatrixService.processAsync(me._processParams(params));
  86404. }
  86405. /**
  86406. * @function ol.supermap.NetworkAnalystService.prototype.findClosestFacilities
  86407. * @description 最近设施分析服务:指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  86408. * @param {SuperMap.FindClosestFacilitiesParameters} params - 最近设施分析服务参数类。
  86409. * @param {RequestCallback} callback - 回调函数。
  86410. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86411. */
  86412. }, {
  86413. key: "findClosestFacilities",
  86414. value: function findClosestFacilities(params, callback, resultFormat) {
  86415. var me = this;
  86416. var findClosestFacilitiesService = new FindClosestFacilitiesService(me.url, {
  86417. proxy: me.options.proxy,
  86418. withCredentials: me.options.withCredentials,
  86419. crossOrigin: me.options.crossOrigin,
  86420. headers: me.options.headers,
  86421. serverType: me.options.serverType,
  86422. eventListeners: {
  86423. scope: me,
  86424. processCompleted: callback,
  86425. processFailed: callback
  86426. },
  86427. format: me._processFormat(resultFormat)
  86428. });
  86429. findClosestFacilitiesService.processAsync(me._processParams(params));
  86430. }
  86431. /**
  86432. * @function ol.supermap.NetworkAnalystService.prototype.streamFacilityAnalyst
  86433. * @description 上游/下游 关键设施查找资源服务:查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  86434. * @param {SuperMap.FacilityAnalystStreamParameters} params - 上游/下游 关键设施查找资源服务参数类。
  86435. * @param {RequestCallback} callback - 回调函数。
  86436. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86437. */
  86438. }, {
  86439. key: "streamFacilityAnalyst",
  86440. value: function streamFacilityAnalyst(params, callback, resultFormat) {
  86441. var me = this;
  86442. var facilityAnalystStreamService = new FacilityAnalystStreamService(me.url, {
  86443. proxy: me.options.proxy,
  86444. withCredentials: me.options.withCredentials,
  86445. crossOrigin: me.options.crossOrigin,
  86446. headers: me.options.headers,
  86447. serverType: me.options.serverType,
  86448. eventListeners: {
  86449. scope: me,
  86450. processCompleted: callback,
  86451. processFailed: callback
  86452. },
  86453. format: me._processFormat(resultFormat)
  86454. });
  86455. facilityAnalystStreamService.processAsync(me._processParams(params));
  86456. }
  86457. /**
  86458. * @function ol.supermap.NetworkAnalystService.prototype.findLocation
  86459. * @description 选址分区分析服务:确定一个或多个待建设施的最佳或最优位置。
  86460. * @param {SuperMap.FindLocationParameters} params - 选址分区分析服务参数类。
  86461. * @param {RequestCallback} callback - 回调函数。
  86462. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86463. */
  86464. }, {
  86465. key: "findLocation",
  86466. value: function findLocation(params, callback, resultFormat) {
  86467. var me = this;
  86468. var findLocationService = new FindLocationService(me.url, {
  86469. proxy: me.options.proxy,
  86470. withCredentials: me.options.withCredentials,
  86471. crossOrigin: me.options.crossOrigin,
  86472. headers: me.options.headers,
  86473. serverType: me.options.serverType,
  86474. eventListeners: {
  86475. scope: me,
  86476. processCompleted: callback,
  86477. processFailed: callback
  86478. },
  86479. format: me._processFormat(resultFormat)
  86480. });
  86481. findLocationService.processAsync(me._processParams(params));
  86482. }
  86483. /**
  86484. * @function ol.supermap.NetworkAnalystService.prototype.findPath
  86485. * @description 最佳路径分析服务:在网络数据集中指定一些节点,按照节点的选择顺序,顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  86486. * @param {SuperMap.FindPathParameters} params - 最佳路径分析服务参数类。
  86487. * @param {RequestCallback} callback - 回调函数。
  86488. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86489. */
  86490. }, {
  86491. key: "findPath",
  86492. value: function findPath(params, callback, resultFormat) {
  86493. var me = this;
  86494. var findPathService = new FindPathService(me.url, {
  86495. proxy: me.options.proxy,
  86496. withCredentials: me.options.withCredentials,
  86497. crossOrigin: me.options.crossOrigin,
  86498. headers: me.options.headers,
  86499. serverType: me.options.serverType,
  86500. eventListeners: {
  86501. scope: me,
  86502. processCompleted: callback,
  86503. processFailed: callback
  86504. },
  86505. format: me._processFormat(resultFormat)
  86506. });
  86507. findPathService.processAsync(me._processParams(params));
  86508. }
  86509. /**
  86510. * @function ol.supermap.NetworkAnalystService.prototype.findTSPPaths
  86511. * @description 旅行商分析服务:路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  86512. * @param {SuperMap.SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
  86513. * @param {RequestCallback} callback - 回调函数。
  86514. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86515. */
  86516. }, {
  86517. key: "findTSPPaths",
  86518. value: function findTSPPaths(params, callback, resultFormat) {
  86519. var me = this;
  86520. var findTSPPathsService = new FindTSPPathsService(me.url, {
  86521. proxy: me.options.proxy,
  86522. withCredentials: me.options.withCredentials,
  86523. crossOrigin: me.options.crossOrigin,
  86524. headers: me.options.headers,
  86525. serverType: me.options.serverType,
  86526. eventListeners: {
  86527. scope: me,
  86528. processCompleted: callback,
  86529. processFailed: callback
  86530. },
  86531. format: me._processFormat(resultFormat)
  86532. });
  86533. findTSPPathsService.processAsync(me._processParams(params));
  86534. }
  86535. /**
  86536. * @function ol.supermap.NetworkAnalystService.prototype.findMTSPPaths
  86537. * @description 多旅行商分析服务:也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。查找经济有效的配送路径,并给出相应的行走路线。
  86538. * @param {SuperMap.FindMTSPPathsParameters} params - 多旅行商分析服务参数类。
  86539. * @param {RequestCallback} callback - 回调函数。
  86540. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86541. */
  86542. }, {
  86543. key: "findMTSPPaths",
  86544. value: function findMTSPPaths(params, callback, resultFormat) {
  86545. var me = this;
  86546. var findMTSPPathsService = new FindMTSPPathsService(me.url, {
  86547. proxy: me.options.proxy,
  86548. withCredentials: me.options.withCredentials,
  86549. crossOrigin: me.options.crossOrigin,
  86550. headers: me.options.headers,
  86551. serverType: me.options.serverType,
  86552. eventListeners: {
  86553. scope: me,
  86554. processCompleted: callback,
  86555. processFailed: callback
  86556. },
  86557. format: me._processFormat(resultFormat)
  86558. });
  86559. findMTSPPathsService.processAsync(me._processParams(params));
  86560. }
  86561. /**
  86562. * @function ol.supermap.NetworkAnalystService.prototype.findServiceAreas
  86563. * @description 服务区分析服务:以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  86564. * @param {SuperMap.FindServiceAreasParameters} params - 服务区分析服务参数类。
  86565. * @param {RequestCallback} callback - 回调函数。
  86566. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86567. */
  86568. }, {
  86569. key: "findServiceAreas",
  86570. value: function findServiceAreas(params, callback, resultFormat) {
  86571. var me = this;
  86572. var findServiceAreasService = new FindServiceAreasService(me.url, {
  86573. proxy: me.options.proxy,
  86574. withCredentials: me.options.withCredentials,
  86575. crossOrigin: me.options.crossOrigin,
  86576. headers: me.options.headers,
  86577. serverType: me.options.serverType,
  86578. eventListeners: {
  86579. scope: me,
  86580. processCompleted: callback,
  86581. processFailed: callback
  86582. },
  86583. format: me._processFormat(resultFormat)
  86584. });
  86585. findServiceAreasService.processAsync(me._processParams(params));
  86586. }
  86587. /**
  86588. * @function ol.supermap.NetworkAnalystService.prototype.updateEdgeWeight
  86589. * @description 更新边的耗费权重服务。
  86590. * @param {SuperMap.UpdateEdgeWeightParameters} params - 更新边的耗费权重服务参数类。
  86591. * @param {RequestCallback} callback 回调函数。
  86592. */
  86593. }, {
  86594. key: "updateEdgeWeight",
  86595. value: function updateEdgeWeight(params, callback) {
  86596. var me = this;
  86597. var updateEdgeWeightService = new UpdateEdgeWeightService(me.url, {
  86598. proxy: me.options.proxy,
  86599. withCredentials: me.options.withCredentials,
  86600. crossOrigin: me.options.crossOrigin,
  86601. headers: me.options.headers,
  86602. serverType: me.options.serverType,
  86603. eventListeners: {
  86604. scope: me,
  86605. processCompleted: callback,
  86606. processFailed: callback
  86607. }
  86608. });
  86609. updateEdgeWeightService.processAsync(params);
  86610. }
  86611. /**
  86612. * @function ol.supermap.NetworkAnalystService.prototype.updateTurnNodeWeight
  86613. * @description 转向耗费权重更新服务。
  86614. * @param {SuperMap.UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类。
  86615. * @param {RequestCallback} callback - 回调函数。
  86616. */
  86617. }, {
  86618. key: "updateTurnNodeWeight",
  86619. value: function updateTurnNodeWeight(params, callback) {
  86620. var me = this;
  86621. var updateTurnNodeWeightService = new UpdateTurnNodeWeightService(me.url, {
  86622. proxy: me.options.proxy,
  86623. withCredentials: me.options.withCredentials,
  86624. crossOrigin: me.options.crossOrigin,
  86625. headers: me.options.headers,
  86626. serverType: me.options.serverType,
  86627. eventListeners: {
  86628. scope: me,
  86629. processCompleted: callback,
  86630. processFailed: callback
  86631. }
  86632. });
  86633. updateTurnNodeWeightService.processAsync(params);
  86634. }
  86635. }, {
  86636. key: "_processParams",
  86637. value: function _processParams(params) {
  86638. if (!params) {
  86639. return {};
  86640. }
  86641. if (params.centers && core_Util_Util.isArray(params.centers)) {
  86642. params.centers.map(function (point, key) {
  86643. params.centers[key] = point instanceof (external_ol_geom_Point_default()) ? {
  86644. x: point.getCoordinates()[0],
  86645. y: point.getCoordinates()[1]
  86646. } : point;
  86647. return params.centers[key];
  86648. });
  86649. }
  86650. if (params.nodes && core_Util_Util.isArray(params.nodes)) {
  86651. params.nodes.map(function (point, key) {
  86652. params.nodes[key] = point instanceof (external_ol_geom_Point_default()) ? {
  86653. x: point.getCoordinates()[0],
  86654. y: point.getCoordinates()[1]
  86655. } : point;
  86656. return params.nodes[key];
  86657. });
  86658. }
  86659. if (params.event && params.event instanceof (external_ol_geom_Point_default())) {
  86660. params.event = {
  86661. x: params.event.getCoordinates()[0],
  86662. y: params.event.getCoordinates()[1]
  86663. };
  86664. }
  86665. if (params.facilities && core_Util_Util.isArray(params.facilities)) {
  86666. params.facilities.map(function (point, key) {
  86667. params.facilities[key] = point instanceof (external_ol_geom_Point_default()) ? {
  86668. x: point.getCoordinates()[0],
  86669. y: point.getCoordinates()[1]
  86670. } : point;
  86671. return params.facilities[key];
  86672. });
  86673. }
  86674. if (params.parameter && params.parameter.barrierPoints) {
  86675. var barrierPoints = params.parameter.barrierPoints;
  86676. if (core_Util_Util.isArray(barrierPoints)) {
  86677. barrierPoints.map(function (point, key) {
  86678. params.parameter.barrierPoints[key] = point instanceof (external_ol_geom_Point_default()) ? {
  86679. x: point.getCoordinates()[0],
  86680. y: point.getCoordinates()[1]
  86681. } : point;
  86682. return params.parameter.barrierPoints[key];
  86683. });
  86684. } else {
  86685. params.parameter.barrierPoints = [barrierPoints instanceof (external_ol_geom_Point_default()) ? {
  86686. x: barrierPoints.getCoordinates()[0],
  86687. y: barrierPoints.getCoordinates()[1]
  86688. } : barrierPoints];
  86689. }
  86690. }
  86691. return params;
  86692. }
  86693. }, {
  86694. key: "_processFormat",
  86695. value: function _processFormat(resultFormat) {
  86696. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  86697. }
  86698. }]);
  86699. return NetworkAnalystService;
  86700. }(ServiceBase);
  86701. ;// CONCATENATED MODULE: ./src/openlayers/services/ProcessingService.js
  86702. function ProcessingService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ProcessingService_typeof = function _typeof(obj) { return typeof obj; }; } else { ProcessingService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ProcessingService_typeof(obj); }
  86703. function ProcessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  86704. 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); } }
  86705. function ProcessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingService_defineProperties(Constructor, staticProps); return Constructor; }
  86706. function ProcessingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ProcessingService_setPrototypeOf(subClass, superClass); }
  86707. function ProcessingService_setPrototypeOf(o, p) { ProcessingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingService_setPrototypeOf(o, p); }
  86708. function ProcessingService_createSuper(Derived) { var hasNativeReflectConstruct = ProcessingService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ProcessingService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ProcessingService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ProcessingService_possibleConstructorReturn(this, result); }; }
  86709. function ProcessingService_possibleConstructorReturn(self, call) { if (call && (ProcessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return ProcessingService_assertThisInitialized(self); }
  86710. function ProcessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  86711. function ProcessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  86712. function ProcessingService_getPrototypeOf(o) { ProcessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingService_getPrototypeOf(o); }
  86713. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  86714. * This program are made available under the terms of the Apache License, Version 2.0
  86715. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86716. /**
  86717. * @class ol.supermap.ProcessingService
  86718. * @category iServer ProcessingService
  86719. * @classdesc 分布式分析相关服务类。
  86720. * @extends {ol.supermap.ServiceBase}
  86721. * @example
  86722. * new ol.supermap.ProcessingService(url,options)
  86723. * .getKernelDensityJobs(function(result){
  86724. * //doSomething
  86725. * })
  86726. * @param {string} url - 分布式分析服务地址。
  86727. * @param {Object} options - 参数。
  86728. * @param {string} [options.proxy] - 服务代理地址。
  86729. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  86730. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  86731. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  86732. * @param {Object} [options.headers] - 请求头。
  86733. */
  86734. var ProcessingService = /*#__PURE__*/function (_ServiceBase) {
  86735. ProcessingService_inherits(ProcessingService, _ServiceBase);
  86736. var _super = ProcessingService_createSuper(ProcessingService);
  86737. function ProcessingService(url, options) {
  86738. var _this;
  86739. ProcessingService_classCallCheck(this, ProcessingService);
  86740. _this = _super.call(this, url, options);
  86741. _this.kernelDensityJobs = {};
  86742. _this.summaryMeshJobs = {};
  86743. _this.queryJobs = {};
  86744. _this.summaryRegionJobs = {};
  86745. _this.vectorClipJobs = {};
  86746. _this.overlayGeoJobs = {};
  86747. _this.buffersJobs = {};
  86748. _this.topologyValidatorJobs = {};
  86749. _this.summaryAttributesJobs = {};
  86750. return _this;
  86751. }
  86752. /**
  86753. * @function ol.supermap.ProcessingService.prototype.getKernelDensityJobs
  86754. * @description 获取密度分析的列表。
  86755. * @param {RequestCallback} callback - 请求结果的回调函数。
  86756. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86757. */
  86758. ProcessingService_createClass(ProcessingService, [{
  86759. key: "getKernelDensityJobs",
  86760. value: function getKernelDensityJobs(callback, resultFormat) {
  86761. var me = this,
  86762. format = me._processFormat(resultFormat);
  86763. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  86764. proxy: me.options.proxy,
  86765. withCredentials: me.options.withCredentials,
  86766. crossOrigin: me.options.crossOrigin,
  86767. headers: me.options.headers,
  86768. serverType: me.options.serverType,
  86769. eventListeners: {
  86770. scope: me,
  86771. processCompleted: callback,
  86772. processFailed: callback
  86773. },
  86774. format: format
  86775. });
  86776. kernelDensityJobsService.getKernelDensityJobs();
  86777. }
  86778. /**
  86779. * @function ol.supermap.ProcessingService.prototype.getKernelDensityJob
  86780. * @description 获取某一个密度分析。
  86781. * @param {string} id - 空间分析的 ID。
  86782. * @param {RequestCallback} callback - 请求结果的回调函数。
  86783. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86784. */
  86785. }, {
  86786. key: "getKernelDensityJob",
  86787. value: function getKernelDensityJob(id, callback, resultFormat) {
  86788. var me = this,
  86789. format = me._processFormat(resultFormat);
  86790. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  86791. proxy: me.options.proxy,
  86792. withCredentials: me.options.withCredentials,
  86793. crossOrigin: me.options.crossOrigin,
  86794. headers: me.options.headers,
  86795. serverType: me.options.serverType,
  86796. eventListeners: {
  86797. scope: me,
  86798. processCompleted: callback,
  86799. processFailed: callback
  86800. },
  86801. format: format
  86802. });
  86803. kernelDensityJobsService.getKernelDensityJob(id);
  86804. }
  86805. /**
  86806. * @function ol.supermap.ProcessingService.prototype.addKernelDensityJob
  86807. * @description 新建一个密度分析。
  86808. * @param {SuperMap.KernelDensityJobParameter} params - 创建一个空间分析的请求参数。
  86809. * @param {RequestCallback} callback - 请求结果的回调函数。
  86810. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  86811. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86812. */
  86813. }, {
  86814. key: "addKernelDensityJob",
  86815. value: function addKernelDensityJob(params, callback, seconds, resultFormat) {
  86816. var me = this,
  86817. param = me._processParams(params),
  86818. format = me._processFormat(resultFormat);
  86819. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  86820. proxy: me.proxy,
  86821. crossOrigin: me.options.crossOrigin,
  86822. headers: me.options.headers,
  86823. eventListeners: {
  86824. scope: me,
  86825. processCompleted: callback,
  86826. processFailed: callback,
  86827. processRunning: function processRunning(job) {
  86828. me.kernelDensityJobs[job.id] = job.state;
  86829. }
  86830. },
  86831. format: format
  86832. });
  86833. kernelDensityJobsService.addKernelDensityJob(param, seconds);
  86834. }
  86835. /**
  86836. * @function ol.supermap.ProcessingService.prototype.getKernelDensityJobState
  86837. * @description 获取密度分析的状态。
  86838. * @param {string} id - 密度分析的 ID。
  86839. * @returns {Object} 密度分析的状态
  86840. */
  86841. }, {
  86842. key: "getKernelDensityJobState",
  86843. value: function getKernelDensityJobState(id) {
  86844. return this.kernelDensityJobs[id];
  86845. }
  86846. /**
  86847. * @function ol.supermap.ProcessingService.prototype.getSummaryMeshJobs
  86848. * @description 获取点聚合分析的列表。
  86849. * @param {RequestCallback} callback - 请求结果的回调函数。
  86850. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86851. */
  86852. }, {
  86853. key: "getSummaryMeshJobs",
  86854. value: function getSummaryMeshJobs(callback, resultFormat) {
  86855. var me = this,
  86856. format = me._processFormat(resultFormat);
  86857. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  86858. proxy: me.options.proxy,
  86859. withCredentials: me.options.withCredentials,
  86860. crossOrigin: me.options.crossOrigin,
  86861. headers: me.options.headers,
  86862. serverType: me.options.serverType,
  86863. eventListeners: {
  86864. scope: me,
  86865. processCompleted: callback,
  86866. processFailed: callback
  86867. },
  86868. format: format
  86869. });
  86870. summaryMeshJobsService.getSummaryMeshJobs();
  86871. }
  86872. /**
  86873. * @function ol.supermap.ProcessingService.prototype.getSummaryMeshJob
  86874. * @description 获取某一个点聚合分析。
  86875. * @param {string} id - 空间分析的 ID。
  86876. * @param {RequestCallback} callback - 请求结果的回调函数。
  86877. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86878. */
  86879. }, {
  86880. key: "getSummaryMeshJob",
  86881. value: function getSummaryMeshJob(id, callback, resultFormat) {
  86882. var me = this,
  86883. format = me._processFormat(resultFormat);
  86884. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  86885. proxy: me.options.proxy,
  86886. crossOrigin: me.options.crossOrigin,
  86887. headers: me.options.headers,
  86888. withCredentials: me.options.withCredentials,
  86889. serverType: me.options.serverType,
  86890. eventListeners: {
  86891. scope: me,
  86892. processCompleted: callback,
  86893. processFailed: callback
  86894. },
  86895. format: format
  86896. });
  86897. summaryMeshJobsService.getSummaryMeshJob(id);
  86898. }
  86899. /**
  86900. * @function ol.supermap.ProcessingService.prototype.addSummaryMeshJob
  86901. * @description 新建一个点聚合分析。
  86902. * @param {SuperMap.SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  86903. * @param {RequestCallback} callback - 请求结果的回调函数。
  86904. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  86905. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86906. */
  86907. }, {
  86908. key: "addSummaryMeshJob",
  86909. value: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
  86910. var me = this,
  86911. param = me._processParams(params),
  86912. format = me._processFormat(resultFormat);
  86913. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  86914. proxy: me.proxy,
  86915. crossOrigin: me.options.crossOrigin,
  86916. headers: me.options.headers,
  86917. eventListeners: {
  86918. scope: me,
  86919. processCompleted: callback,
  86920. processFailed: callback,
  86921. processRunning: function processRunning(job) {
  86922. me.summaryMeshJobs[job.id] = job.state;
  86923. }
  86924. },
  86925. format: format
  86926. });
  86927. summaryMeshJobsService.addSummaryMeshJob(param, seconds);
  86928. }
  86929. /**
  86930. * @function ol.supermap.ProcessingService.prototype.getSummaryMeshJobState
  86931. * @description 获取点聚合分析的状态。
  86932. * @param {string} id - 点聚合分析的 ID。
  86933. * @returns {Object} 点聚合分析的状态
  86934. */
  86935. }, {
  86936. key: "getSummaryMeshJobState",
  86937. value: function getSummaryMeshJobState(id) {
  86938. return this.summaryMeshJobs[id];
  86939. }
  86940. /**
  86941. * @function ol.supermap.ProcessingService.prototype.getQueryJobs
  86942. * @description 获取单对象查询分析的列表。
  86943. * @param {RequestCallback} callback - 请求结果的回调函数。
  86944. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86945. */
  86946. }, {
  86947. key: "getQueryJobs",
  86948. value: function getQueryJobs(callback, resultFormat) {
  86949. var me = this,
  86950. format = me._processFormat(resultFormat);
  86951. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  86952. proxy: me.options.proxy,
  86953. withCredentials: me.options.withCredentials,
  86954. crossOrigin: me.options.crossOrigin,
  86955. headers: me.options.headers,
  86956. serverType: me.options.serverType,
  86957. eventListeners: {
  86958. scope: me,
  86959. processCompleted: callback,
  86960. processFailed: callback
  86961. },
  86962. format: format
  86963. });
  86964. singleObjectQueryJobsService.getQueryJobs();
  86965. }
  86966. /**
  86967. * @function ol.supermap.ProcessingService.prototype.getQueryJob
  86968. * @description 获取某一个单对象查询分析。
  86969. * @param {string} id - 空间分析的 ID。
  86970. * @param {RequestCallback} callback - 请求结果的回调函数。
  86971. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  86972. */
  86973. }, {
  86974. key: "getQueryJob",
  86975. value: function getQueryJob(id, callback, resultFormat) {
  86976. var me = this,
  86977. format = me._processFormat(resultFormat);
  86978. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  86979. proxy: me.options.proxy,
  86980. withCredentials: me.options.withCredentials,
  86981. crossOrigin: me.options.crossOrigin,
  86982. headers: me.options.headers,
  86983. serverType: me.options.serverType,
  86984. eventListeners: {
  86985. scope: me,
  86986. processCompleted: callback,
  86987. processFailed: callback
  86988. },
  86989. format: format
  86990. });
  86991. singleObjectQueryJobsService.getQueryJob(id);
  86992. }
  86993. /**
  86994. * @function ol.supermap.ProcessingService.prototype.addQueryJob
  86995. * @description 新建一个单对象查询分析。
  86996. * @param {SuperMap.SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
  86997. * @param {RequestCallback} callback - 请求结果的回调函数。
  86998. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  86999. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87000. */
  87001. }, {
  87002. key: "addQueryJob",
  87003. value: function addQueryJob(params, callback, seconds, resultFormat) {
  87004. var me = this,
  87005. param = me._processParams(params),
  87006. format = me._processFormat(resultFormat);
  87007. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  87008. proxy: me.proxy,
  87009. crossOrigin: me.options.crossOrigin,
  87010. headers: me.options.headers,
  87011. eventListeners: {
  87012. scope: me,
  87013. processCompleted: callback,
  87014. processFailed: callback,
  87015. processRunning: function processRunning(job) {
  87016. me.queryJobs[job.id] = job.state;
  87017. }
  87018. },
  87019. format: format
  87020. });
  87021. singleObjectQueryJobsService.addQueryJob(param, seconds);
  87022. }
  87023. /**
  87024. * @function ol.supermap.ProcessingService.prototype.getQueryJobState
  87025. * @description 获取单对象查询分析的状态。
  87026. * @param {string} id - 单对象查询分析的 ID。
  87027. * @returns {Object} 单对象查询分析的状态
  87028. */
  87029. }, {
  87030. key: "getQueryJobState",
  87031. value: function getQueryJobState(id) {
  87032. return this.queryJobs[id];
  87033. }
  87034. /**
  87035. * @function ol.supermap.ProcessingService.prototype.getSummaryRegionJobs
  87036. * @description 获取区域汇总分析的列表。
  87037. * @param {RequestCallback} callback - 请求结果的回调函数。
  87038. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87039. */
  87040. }, {
  87041. key: "getSummaryRegionJobs",
  87042. value: function getSummaryRegionJobs(callback, resultFormat) {
  87043. var me = this,
  87044. format = me._processFormat(resultFormat);
  87045. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  87046. proxy: me.options.proxy,
  87047. withCredentials: me.options.withCredentials,
  87048. crossOrigin: me.options.crossOrigin,
  87049. headers: me.options.headers,
  87050. serverType: me.options.serverType,
  87051. eventListeners: {
  87052. scope: me,
  87053. processCompleted: callback,
  87054. processFailed: callback
  87055. },
  87056. format: format
  87057. });
  87058. summaryRegionJobsService.getSummaryRegionJobs();
  87059. }
  87060. /**
  87061. * @function ol.supermap.ProcessingService.prototype.getSummaryRegionJob
  87062. * @description 获取某一个区域汇总分析。
  87063. * @param {string} id - 区域汇总分析的 ID。
  87064. * @param {RequestCallback} callback - 请求结果的回调函数。
  87065. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87066. */
  87067. }, {
  87068. key: "getSummaryRegionJob",
  87069. value: function getSummaryRegionJob(id, callback, resultFormat) {
  87070. var me = this,
  87071. format = me._processFormat(resultFormat);
  87072. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  87073. proxy: me.options.proxy,
  87074. withCredentials: me.options.withCredentials,
  87075. crossOrigin: me.options.crossOrigin,
  87076. headers: me.options.headers,
  87077. serverType: me.options.serverType,
  87078. eventListeners: {
  87079. scope: me,
  87080. processCompleted: callback,
  87081. processFailed: callback
  87082. },
  87083. format: format
  87084. });
  87085. summaryRegionJobsService.getSummaryRegionJob(id);
  87086. }
  87087. /**
  87088. * @function ol.supermap.ProcessingService.prototype.addSummaryRegionJob
  87089. * @description 新建一个区域汇总分析。
  87090. * @param {SuperMap.SummaryRegionJobParameter} params - 区域汇总分析参数类。
  87091. * @param {RequestCallback} callback - 请求结果的回调函数。
  87092. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  87093. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87094. */
  87095. }, {
  87096. key: "addSummaryRegionJob",
  87097. value: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
  87098. var me = this,
  87099. param = me._processParams(params),
  87100. format = me._processFormat(resultFormat);
  87101. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  87102. proxy: me.proxy,
  87103. crossOrigin: me.options.crossOrigin,
  87104. headers: me.options.headers,
  87105. eventListeners: {
  87106. scope: me,
  87107. processCompleted: callback,
  87108. processFailed: callback,
  87109. processRunning: function processRunning(job) {
  87110. me.summaryRegionJobs[job.id] = job.state;
  87111. }
  87112. },
  87113. format: format
  87114. });
  87115. summaryRegionJobsService.addSummaryRegionJob(param, seconds);
  87116. }
  87117. /**
  87118. * @function ol.supermap.ProcessingService.prototype.getSummaryRegionJobState
  87119. * @description 获取区域汇总分析的状态。
  87120. * @param {string} id - 生成区域汇总分析的 ID。
  87121. * @returns {Object} 区域汇总分析的状态。
  87122. */
  87123. }, {
  87124. key: "getSummaryRegionJobState",
  87125. value: function getSummaryRegionJobState(id) {
  87126. return this.summaryRegionJobs[id];
  87127. }
  87128. /**
  87129. * @function ol.supermap.ProcessingService.prototype.getVectorClipJobs
  87130. * @description 获取矢量裁剪分析的列表。
  87131. * @param {RequestCallback} callback 请求结果的回调函数。
  87132. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87133. */
  87134. }, {
  87135. key: "getVectorClipJobs",
  87136. value: function getVectorClipJobs(callback, resultFormat) {
  87137. var me = this,
  87138. format = me._processFormat(resultFormat);
  87139. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  87140. proxy: me.options.proxy,
  87141. withCredentials: me.options.withCredentials,
  87142. crossOrigin: me.options.crossOrigin,
  87143. headers: me.options.headers,
  87144. serverType: me.options.serverType,
  87145. eventListeners: {
  87146. scope: me,
  87147. processCompleted: callback,
  87148. processFailed: callback
  87149. },
  87150. format: format
  87151. });
  87152. vectorClipJobsService.getVectorClipJobs();
  87153. }
  87154. /**
  87155. * @function ol.supermap.ProcessingService.prototype.getVectorClipJob
  87156. * @description 获取某一个矢量裁剪分析。
  87157. * @param {string} id - 空间分析的 ID。
  87158. * @param {RequestCallback} callback 请求结果的回调函数。
  87159. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87160. */
  87161. }, {
  87162. key: "getVectorClipJob",
  87163. value: function getVectorClipJob(id, callback, resultFormat) {
  87164. var me = this,
  87165. format = me._processFormat(resultFormat);
  87166. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  87167. proxy: me.options.proxy,
  87168. withCredentials: me.options.withCredentials,
  87169. crossOrigin: me.options.crossOrigin,
  87170. headers: me.options.headers,
  87171. serverType: me.options.serverType,
  87172. eventListeners: {
  87173. scope: me,
  87174. processCompleted: callback,
  87175. processFailed: callback
  87176. },
  87177. format: format
  87178. });
  87179. vectorClipJobsService.getVectorClipJob(id);
  87180. }
  87181. /**
  87182. * @function ol.supermap.ProcessingService.prototype.addVectorClipJob
  87183. * @description 新建一个矢量裁剪分析。
  87184. * @param {SuperMap.VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  87185. * @param {RequestCallback} callback 请求结果的回调函数。
  87186. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  87187. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87188. */
  87189. }, {
  87190. key: "addVectorClipJob",
  87191. value: function addVectorClipJob(params, callback, seconds, resultFormat) {
  87192. var me = this,
  87193. param = me._processParams(params),
  87194. format = me._processFormat(resultFormat);
  87195. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  87196. proxy: me.options.proxy,
  87197. withCredentials: me.options.withCredentials,
  87198. crossOrigin: me.options.crossOrigin,
  87199. headers: me.options.headers,
  87200. serverType: me.options.serverType,
  87201. eventListeners: {
  87202. scope: me,
  87203. processCompleted: callback,
  87204. processFailed: callback,
  87205. processRunning: function processRunning(job) {
  87206. me.vectorClipJobs[job.id] = job.state;
  87207. }
  87208. },
  87209. format: format
  87210. });
  87211. vectorClipJobsService.addVectorClipJob(param, seconds);
  87212. }
  87213. /**
  87214. * @function ol.supermap.ProcessingService.prototype.getVectorClipJobState
  87215. * @description 获取矢量裁剪分析的状态。
  87216. * @param {number} id - 矢量裁剪分析的 ID。
  87217. * @returns {Object} 矢量裁剪分析的状态
  87218. */
  87219. }, {
  87220. key: "getVectorClipJobState",
  87221. value: function getVectorClipJobState(id) {
  87222. return this.vectorClipJobs[id];
  87223. }
  87224. /**
  87225. * @function ol.supermap.processingService.prototype.getOverlayGeoJobs
  87226. * @description 获取叠加分析的列表。
  87227. * @param {RequestCallback} callback 请求结果的回调函数。
  87228. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87229. */
  87230. }, {
  87231. key: "getOverlayGeoJobs",
  87232. value: function getOverlayGeoJobs(callback, resultFormat) {
  87233. var me = this,
  87234. format = me._processFormat(resultFormat);
  87235. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  87236. proxy: me.options.proxy,
  87237. withCredentials: me.options.withCredentials,
  87238. crossOrigin: me.options.crossOrigin,
  87239. headers: me.options.headers,
  87240. serverType: me.options.serverType,
  87241. eventListeners: {
  87242. scope: me,
  87243. processCompleted: callback,
  87244. processFailed: callback
  87245. },
  87246. format: format
  87247. });
  87248. overlayGeoJobsService.getOverlayGeoJobs();
  87249. }
  87250. /**
  87251. * @function ol.supermap.processingService.prototype.getOverlayGeoJob
  87252. * @description 获取某一个叠加分析。
  87253. * @param {string} id - 空间分析的 ID。
  87254. * @param {RequestCallback} callback 请求结果的回调函数。
  87255. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87256. */
  87257. }, {
  87258. key: "getOverlayGeoJob",
  87259. value: function getOverlayGeoJob(id, callback, resultFormat) {
  87260. var me = this,
  87261. format = me._processFormat(resultFormat);
  87262. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  87263. proxy: me.options.proxy,
  87264. withCredentials: me.options.withCredentials,
  87265. crossOrigin: me.options.crossOrigin,
  87266. headers: me.options.headers,
  87267. serverType: me.options.serverType,
  87268. eventListeners: {
  87269. scope: me,
  87270. processCompleted: callback,
  87271. processFailed: callback
  87272. },
  87273. format: format
  87274. });
  87275. overlayGeoJobsService.getOverlayGeoJob(id);
  87276. }
  87277. /**
  87278. * @function ol.supermap.processingService.prototype.addOverlayGeoJob
  87279. * @description 新建一个叠加分析。
  87280. * @param {SuperMap.OverlayGeoJobParameter} params - 创建一个空间分析的请求参数。
  87281. * @param {RequestCallback} callback 请求结果的回调函数。
  87282. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  87283. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87284. */
  87285. }, {
  87286. key: "addOverlayGeoJob",
  87287. value: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
  87288. var me = this,
  87289. param = me._processParams(params),
  87290. format = me._processFormat(resultFormat);
  87291. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  87292. proxy: me.options.proxy,
  87293. withCredentials: me.options.withCredentials,
  87294. serverType: me.options.serverType,
  87295. crossOrigin: me.options.crossOrigin,
  87296. headers: me.options.headers,
  87297. eventListeners: {
  87298. scope: me,
  87299. processCompleted: callback,
  87300. processFailed: callback,
  87301. processRunning: function processRunning(job) {
  87302. me.overlayGeoJobs[job.id] = job.state;
  87303. }
  87304. },
  87305. format: format
  87306. });
  87307. overlayGeoJobsService.addOverlayGeoJob(param, seconds);
  87308. }
  87309. /**
  87310. * @function ol.supermap.processingService.prototype.getoverlayGeoJobState
  87311. * @description 获取叠加分析的状态。
  87312. * @param {string} id - 叠加分析的 ID。
  87313. * @returns {Object} 叠加分析的状态
  87314. */
  87315. }, {
  87316. key: "getoverlayGeoJobState",
  87317. value: function getoverlayGeoJobState(id) {
  87318. return this.overlayGeoJobs[id];
  87319. }
  87320. /**
  87321. * @function ol.supermap.processingService.prototype.getBuffersJobs
  87322. * @description 获取缓冲区分析的列表。
  87323. * @param {RequestCallback} callback 请求结果的回调函数。
  87324. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87325. */
  87326. }, {
  87327. key: "getBuffersJobs",
  87328. value: function getBuffersJobs(callback, resultFormat) {
  87329. var me = this,
  87330. format = me._processFormat(resultFormat);
  87331. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  87332. proxy: me.options.proxy,
  87333. withCredentials: me.options.withCredentials,
  87334. crossOrigin: me.options.crossOrigin,
  87335. headers: me.options.headers,
  87336. serverType: me.options.serverType,
  87337. eventListeners: {
  87338. scope: me,
  87339. processCompleted: callback,
  87340. processFailed: callback
  87341. },
  87342. format: format
  87343. });
  87344. buffersAnalystJobsService.getBuffersJobs();
  87345. }
  87346. /**
  87347. * @function ol.supermap.processingService.prototype.getBuffersJob
  87348. * @description 获取某一个缓冲区分析。
  87349. * @param {string} id - 空间分析的 ID。
  87350. * @param {RequestCallback} callback 请求结果的回调函数。
  87351. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87352. */
  87353. }, {
  87354. key: "getBuffersJob",
  87355. value: function getBuffersJob(id, callback, resultFormat) {
  87356. var me = this,
  87357. format = me._processFormat(resultFormat);
  87358. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  87359. proxy: me.options.proxy,
  87360. withCredentials: me.options.withCredentials,
  87361. crossOrigin: me.options.crossOrigin,
  87362. headers: me.options.headers,
  87363. serverType: me.options.serverType,
  87364. eventListeners: {
  87365. scope: me,
  87366. processCompleted: callback,
  87367. processFailed: callback
  87368. },
  87369. format: format
  87370. });
  87371. buffersAnalystJobsService.getBuffersJob(id);
  87372. }
  87373. /**
  87374. * @function ol.supermap.processingService.prototype.addBuffersJob
  87375. * @description 新建一个缓冲区分析。
  87376. * @param {SuperMap.BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  87377. * @param {RequestCallback} callback 请求结果的回调函数。
  87378. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  87379. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87380. */
  87381. }, {
  87382. key: "addBuffersJob",
  87383. value: function addBuffersJob(params, callback, seconds, resultFormat) {
  87384. var me = this,
  87385. param = me._processParams(params),
  87386. format = me._processFormat(resultFormat);
  87387. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  87388. proxy: me.options.proxy,
  87389. withCredentials: me.options.withCredentials,
  87390. crossOrigin: me.options.crossOrigin,
  87391. headers: me.options.headers,
  87392. serverType: me.options.serverType,
  87393. eventListeners: {
  87394. scope: me,
  87395. processCompleted: callback,
  87396. processFailed: callback,
  87397. processRunning: function processRunning(job) {
  87398. me.buffersJobs[job.id] = job.state;
  87399. }
  87400. },
  87401. format: format
  87402. });
  87403. buffersAnalystJobsService.addBuffersJob(param, seconds);
  87404. }
  87405. /**
  87406. * @function ol.supermap.processingService.prototype.getBuffersJobState
  87407. * @description 获取缓冲区分析的状态。
  87408. * @param {string} id - 缓冲区分析的 ID。
  87409. * @returns {Object} 缓冲区分析的状态。
  87410. */
  87411. }, {
  87412. key: "getBuffersJobState",
  87413. value: function getBuffersJobState(id) {
  87414. return this.buffersJobs[id];
  87415. }
  87416. /**
  87417. * @function ol.supermap.processingService.prototype.getTopologyValidatorJobs
  87418. * @description 获取拓扑检查分析的列表。
  87419. * @param {RequestCallback} callback 请求结果的回调函数。
  87420. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87421. */
  87422. }, {
  87423. key: "getTopologyValidatorJobs",
  87424. value: function getTopologyValidatorJobs(callback, resultFormat) {
  87425. var me = this,
  87426. format = me._processFormat(resultFormat);
  87427. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  87428. proxy: me.options.proxy,
  87429. withCredentials: me.options.withCredentials,
  87430. crossOrigin: me.options.crossOrigin,
  87431. headers: me.options.headers,
  87432. serverType: me.options.serverType,
  87433. eventListeners: {
  87434. scope: me,
  87435. processCompleted: callback,
  87436. processFailed: callback
  87437. },
  87438. format: format
  87439. });
  87440. topologyValidatorJobsService.getTopologyValidatorJobs();
  87441. }
  87442. /**
  87443. * @function ol.supermap.processingService.prototype.getTopologyValidatorJob
  87444. * @description 获取某一个拓扑检查分析。
  87445. * @param {string} id - 空间分析的 ID。
  87446. * @param {RequestCallback} callback - 请求结果的回调函数。
  87447. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87448. */
  87449. }, {
  87450. key: "getTopologyValidatorJob",
  87451. value: function getTopologyValidatorJob(id, callback, resultFormat) {
  87452. var me = this,
  87453. format = me._processFormat(resultFormat);
  87454. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  87455. proxy: me.options.proxy,
  87456. withCredentials: me.options.withCredentials,
  87457. crossOrigin: me.options.crossOrigin,
  87458. headers: me.options.headers,
  87459. serverType: me.options.serverType,
  87460. eventListeners: {
  87461. scope: me,
  87462. processCompleted: callback,
  87463. processFailed: callback
  87464. },
  87465. format: format
  87466. });
  87467. topologyValidatorJobsService.getTopologyValidatorJob(id);
  87468. }
  87469. /**
  87470. * @function ol.supermap.processingService.prototype.addTopologyValidatorJob
  87471. * @description 新建一个拓扑检查分析。
  87472. * @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
  87473. * @param {RequestCallback} callback - 请求结果的回调函数。
  87474. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  87475. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87476. */
  87477. }, {
  87478. key: "addTopologyValidatorJob",
  87479. value: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  87480. var me = this,
  87481. param = me._processParams(params),
  87482. format = me._processFormat(resultFormat);
  87483. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  87484. proxy: me.options.proxy,
  87485. withCredentials: me.options.withCredentials,
  87486. crossOrigin: me.options.crossOrigin,
  87487. headers: me.options.headers,
  87488. serverType: me.options.serverType,
  87489. eventListeners: {
  87490. scope: me,
  87491. processCompleted: callback,
  87492. processFailed: callback,
  87493. processRunning: function processRunning(job) {
  87494. me.topologyValidatorJobs[job.id] = job.state;
  87495. }
  87496. },
  87497. format: format
  87498. });
  87499. topologyValidatorJobsService.addTopologyValidatorJob(param, seconds);
  87500. }
  87501. /**
  87502. * @function ol.supermap.processingService.prototype.getTopologyValidatorJobState
  87503. * @description 获取拓扑检查分析的状态。
  87504. * @param {string} id - 拓扑检查分析的 ID。
  87505. * @returns {Object} 拓扑检查分析的状态
  87506. */
  87507. }, {
  87508. key: "getTopologyValidatorJobState",
  87509. value: function getTopologyValidatorJobState(id) {
  87510. return this.topologyValidatorJobs[id];
  87511. }
  87512. /**
  87513. * @function ol.supermap.processingService.prototype.getSummaryAttributesJobs
  87514. * @description 获取拓扑检查属性汇总分析的列表。
  87515. * @param {RequestCallback} callback - 请求结果的回调函数。
  87516. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87517. */
  87518. }, {
  87519. key: "getSummaryAttributesJobs",
  87520. value: function getSummaryAttributesJobs(callback, resultFormat) {
  87521. var me = this,
  87522. format = me._processFormat(resultFormat);
  87523. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  87524. proxy: me.options.proxy,
  87525. withCredentials: me.options.withCredentials,
  87526. crossOrigin: me.options.crossOrigin,
  87527. headers: me.options.headers,
  87528. serverType: me.options.serverType,
  87529. eventListeners: {
  87530. scope: me,
  87531. processCompleted: callback,
  87532. processFailed: callback
  87533. },
  87534. format: format
  87535. });
  87536. summaryAttributesJobsService.getSummaryAttributesJobs();
  87537. }
  87538. /**
  87539. * @function ol.supermap.processingService.prototype.getSummaryAttributesJob
  87540. * @description 获取某一个属性汇总分析。
  87541. * @param {string} id - 空间分析的 ID。
  87542. * @param {RequestCallback} callback - 请求结果的回调函数。
  87543. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87544. */
  87545. }, {
  87546. key: "getSummaryAttributesJob",
  87547. value: function getSummaryAttributesJob(id, callback, resultFormat) {
  87548. var me = this,
  87549. format = me._processFormat(resultFormat);
  87550. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  87551. proxy: me.options.proxy,
  87552. withCredentials: me.options.withCredentials,
  87553. crossOrigin: me.options.crossOrigin,
  87554. headers: me.options.headers,
  87555. serverType: me.options.serverType,
  87556. eventListeners: {
  87557. scope: me,
  87558. processCompleted: callback,
  87559. processFailed: callback
  87560. },
  87561. format: format
  87562. });
  87563. summaryAttributesJobsService.getSummaryAttributesJob(id);
  87564. }
  87565. /**
  87566. * @function ol.supermap.processingService.prototype.addSummaryAttributesJob
  87567. * @description 新建一个属性汇总分析。
  87568. * @param {SuperMap.SummaryAttributesJobsParameter} params - 创建一个空间分析的请求参数。
  87569. * @param {RequestCallback} callback - 请求结果的回调函数。
  87570. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  87571. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87572. */
  87573. }, {
  87574. key: "addSummaryAttributesJob",
  87575. value: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  87576. var me = this,
  87577. param = me._processParams(params),
  87578. format = me._processFormat(resultFormat);
  87579. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  87580. proxy: me.options.proxy,
  87581. withCredentials: me.options.withCredentials,
  87582. crossOrigin: me.options.crossOrigin,
  87583. headers: me.options.headers,
  87584. serverType: me.options.serverType,
  87585. eventListeners: {
  87586. scope: me,
  87587. processCompleted: callback,
  87588. processFailed: callback,
  87589. processRunning: function processRunning(job) {
  87590. me.summaryAttributesJobs[job.id] = job.state;
  87591. }
  87592. },
  87593. format: format
  87594. });
  87595. summaryAttributesJobsService.addSummaryAttributesJob(param, seconds);
  87596. }
  87597. /**
  87598. * @function ol.supermap.processingService.prototype.getSummaryAttributesJobState
  87599. * @description 获取属性汇总分析的状态。
  87600. * @param {string} id - 属性汇总分析的 ID。
  87601. * @returns {Object} 属性汇总分析的状态。
  87602. */
  87603. }, {
  87604. key: "getSummaryAttributesJobState",
  87605. value: function getSummaryAttributesJobState(id) {
  87606. return this.summaryAttributesJobs[id];
  87607. }
  87608. }, {
  87609. key: "_processFormat",
  87610. value: function _processFormat(resultFormat) {
  87611. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  87612. }
  87613. }, {
  87614. key: "_processParams",
  87615. value: function _processParams(params) {
  87616. if (!params) {
  87617. return {};
  87618. }
  87619. if (params.bounds) {
  87620. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  87621. }
  87622. if (params.query) {
  87623. params.query = core_Util_Util.toSuperMapBounds(params.query);
  87624. }
  87625. if (params.geometryQuery) {
  87626. params.geometryQuery = core_Util_Util.toProcessingParam(params.geometryQuery);
  87627. }
  87628. if (params.geometryClip) {
  87629. params.geometryClip = core_Util_Util.toProcessingParam(params.geometryClip);
  87630. }
  87631. return params;
  87632. }
  87633. }]);
  87634. return ProcessingService;
  87635. }(ServiceBase);
  87636. ;// CONCATENATED MODULE: ./src/openlayers/services/SpatialAnalystService.js
  87637. function SpatialAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SpatialAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { SpatialAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SpatialAnalystService_typeof(obj); }
  87638. function SpatialAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  87639. 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); } }
  87640. function SpatialAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  87641. function SpatialAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SpatialAnalystService_setPrototypeOf(subClass, superClass); }
  87642. function SpatialAnalystService_setPrototypeOf(o, p) { SpatialAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystService_setPrototypeOf(o, p); }
  87643. function SpatialAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = SpatialAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SpatialAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SpatialAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SpatialAnalystService_possibleConstructorReturn(this, result); }; }
  87644. function SpatialAnalystService_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return SpatialAnalystService_assertThisInitialized(self); }
  87645. function SpatialAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  87646. function SpatialAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  87647. function SpatialAnalystService_getPrototypeOf(o) { SpatialAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystService_getPrototypeOf(o); }
  87648. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  87649. * This program are made available under the terms of the Apache License, Version 2.0
  87650. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87651. /**
  87652. * @class ol.supermap.SpatialAnalystService
  87653. * @extends {ol.supermap.ServiceBase}
  87654. * @category iServer SpatialAnalyst
  87655. * @classdesc 空间分析服务类。提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。
  87656. * @example
  87657. * new ol.supermap.SpatialAnalystService(url)
  87658. * .bufferAnalysis(params,function(result){
  87659. * //doSomething
  87660. * })
  87661. * @param {string} url - 服务的访问地址。
  87662. * @param {Object} options - 参数。
  87663. * @param {string} [options.proxy] - 服务代理地址。
  87664. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  87665. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  87666. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  87667. * @param {Object} [options.headers] - 请求头。
  87668. */
  87669. var SpatialAnalystService = /*#__PURE__*/function (_ServiceBase) {
  87670. SpatialAnalystService_inherits(SpatialAnalystService, _ServiceBase);
  87671. var _super = SpatialAnalystService_createSuper(SpatialAnalystService);
  87672. function SpatialAnalystService(url, options) {
  87673. SpatialAnalystService_classCallCheck(this, SpatialAnalystService);
  87674. return _super.call(this, url, options);
  87675. }
  87676. /**
  87677. * @function ol.supermap.SpatialAnalystService.prototype.getAreaSolarRadiationResult
  87678. * @description 地区太阳辐射。
  87679. * @param {SuperMap.AreaSolarRadiationParameters} params - 查询相关参数类。
  87680. * @param {RequestCallback} callback 回调函数。
  87681. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87682. */
  87683. SpatialAnalystService_createClass(SpatialAnalystService, [{
  87684. key: "getAreaSolarRadiationResult",
  87685. value: function getAreaSolarRadiationResult(params, callback, resultFormat) {
  87686. var me = this;
  87687. var areaSolarRadiationService = new AreaSolarRadiationService(me.url, {
  87688. proxy: me.options.proxy,
  87689. withCredentials: me.options.withCredentials,
  87690. crossOrigin: me.options.crossOrigin,
  87691. headers: me.options.headers,
  87692. serverType: me.options.serverType,
  87693. eventListeners: {
  87694. scope: me,
  87695. processCompleted: callback,
  87696. processFailed: callback
  87697. },
  87698. format: me._processFormat(resultFormat)
  87699. });
  87700. areaSolarRadiationService.processAsync(params);
  87701. }
  87702. /**
  87703. * @function ol.supermap.SpatialAnalystService.prototype.bufferAnalysis
  87704. * @description 缓冲区分析。
  87705. * @param {SuperMap.DatasetBufferAnalystParameters} params - 查询相关参数类。
  87706. * @param {RequestCallback} callback 回调函数。
  87707. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87708. */
  87709. }, {
  87710. key: "bufferAnalysis",
  87711. value: function bufferAnalysis(params, callback, resultFormat) {
  87712. var me = this;
  87713. var bufferAnalystService = new BufferAnalystService(me.url, {
  87714. proxy: me.options.proxy,
  87715. withCredentials: me.options.withCredentials,
  87716. crossOrigin: me.options.crossOrigin,
  87717. headers: me.options.headers,
  87718. serverType: me.options.serverType,
  87719. eventListeners: {
  87720. scope: me,
  87721. processCompleted: callback,
  87722. processFailed: callback
  87723. },
  87724. format: me._processFormat(resultFormat)
  87725. });
  87726. bufferAnalystService.processAsync(me._processParams(params));
  87727. }
  87728. /**
  87729. * @function ol.supermap.SpatialAnalystService.prototype.densityAnalysis
  87730. * @description 点密度分析。
  87731. * @param {SuperMap.DensityKernelAnalystParameters} params - 查询相关参数类。
  87732. * @param {RequestCallback} callback 回调函数。
  87733. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87734. */
  87735. }, {
  87736. key: "densityAnalysis",
  87737. value: function densityAnalysis(params, callback, resultFormat) {
  87738. var me = this;
  87739. var densityAnalystService = new DensityAnalystService(me.url, {
  87740. proxy: me.options.proxy,
  87741. withCredentials: me.options.withCredentials,
  87742. crossOrigin: me.options.crossOrigin,
  87743. headers: me.options.headers,
  87744. serverType: me.options.serverType,
  87745. eventListeners: {
  87746. scope: me,
  87747. processCompleted: callback,
  87748. processFailed: callback
  87749. },
  87750. format: me._processFormat(resultFormat)
  87751. });
  87752. densityAnalystService.processAsync(me._processParams(params));
  87753. }
  87754. /**
  87755. * @function ol.supermap.SpatialAnalystService.prototype.generateSpatialData
  87756. * @description 动态分段分析。
  87757. * @param {SuperMap.GenerateSpatialDataParameters} params - 查询相关参数类。
  87758. * @param {RequestCallback} callback 回调函数。
  87759. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87760. */
  87761. }, {
  87762. key: "generateSpatialData",
  87763. value: function generateSpatialData(params, callback, resultFormat) {
  87764. var me = this;
  87765. var generateSpatialDataService = new GenerateSpatialDataService(me.url, {
  87766. proxy: me.options.proxy,
  87767. withCredentials: me.options.withCredentials,
  87768. crossOrigin: me.options.crossOrigin,
  87769. headers: me.options.headers,
  87770. serverType: me.options.serverType,
  87771. eventListeners: {
  87772. scope: me,
  87773. processCompleted: callback,
  87774. processFailed: callback
  87775. },
  87776. format: me._processFormat(resultFormat)
  87777. });
  87778. generateSpatialDataService.processAsync(params);
  87779. }
  87780. /**
  87781. * @function ol.supermap.SpatialAnalystService.prototype.geoRelationAnalysis
  87782. * @description 空间关系分析。
  87783. * @param {SuperMap.GeoRelationAnalystParameters} params - 查询相关参数类。
  87784. * @param {RequestCallback} callback 回调函数。
  87785. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87786. */
  87787. }, {
  87788. key: "geoRelationAnalysis",
  87789. value: function geoRelationAnalysis(params, callback, resultFormat) {
  87790. var me = this;
  87791. var geoRelationAnalystService = new GeoRelationAnalystService(me.url, {
  87792. proxy: me.options.proxy,
  87793. withCredentials: me.options.withCredentials,
  87794. crossOrigin: me.options.crossOrigin,
  87795. headers: me.options.headers,
  87796. serverType: me.options.serverType,
  87797. eventListeners: {
  87798. scope: me,
  87799. processCompleted: callback,
  87800. processFailed: callback
  87801. },
  87802. format: me._processFormat(resultFormat)
  87803. });
  87804. geoRelationAnalystService.processAsync(params);
  87805. }
  87806. /**
  87807. * @function ol.supermap.SpatialAnalystService.prototype.interpolationAnalysis
  87808. * @description 插值分析。
  87809. * @param {SuperMap.InterpolationRBFAnalystParameters} params - 查询相关参数类。
  87810. * @param {RequestCallback} callback 回调函数。
  87811. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87812. */
  87813. }, {
  87814. key: "interpolationAnalysis",
  87815. value: function interpolationAnalysis(params, callback, resultFormat) {
  87816. var me = this;
  87817. var interpolationAnalystService = new InterpolationAnalystService(me.url, {
  87818. proxy: me.options.proxy,
  87819. withCredentials: me.options.withCredentials,
  87820. crossOrigin: me.options.crossOrigin,
  87821. headers: me.options.headers,
  87822. serverType: me.options.serverType,
  87823. eventListeners: {
  87824. scope: me,
  87825. processCompleted: callback,
  87826. processFailed: callback
  87827. },
  87828. format: me._processFormat(resultFormat)
  87829. });
  87830. interpolationAnalystService.processAsync(me._processParams(params));
  87831. }
  87832. /**
  87833. * @function ol.supermap.SpatialAnalystService.prototype.mathExpressionAnalysis
  87834. * @description 栅格代数运算。
  87835. * @param {SuperMap.MathExpressionAnalysisParameters} params - 查询相关参数类。
  87836. * @param {RequestCallback} callback 回调函数。
  87837. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87838. */
  87839. }, {
  87840. key: "mathExpressionAnalysis",
  87841. value: function mathExpressionAnalysis(params, callback, resultFormat) {
  87842. var me = this;
  87843. var mathExpressionAnalysisService = new MathExpressionAnalysisService(me.url, {
  87844. proxy: me.options.proxy,
  87845. withCredentials: me.options.withCredentials,
  87846. crossOrigin: me.options.crossOrigin,
  87847. headers: me.options.headers,
  87848. serverType: me.options.serverType,
  87849. eventListeners: {
  87850. scope: me,
  87851. processCompleted: callback,
  87852. processFailed: callback
  87853. },
  87854. format: me._processFormat(resultFormat)
  87855. });
  87856. mathExpressionAnalysisService.processAsync(me._processParams(params));
  87857. }
  87858. /**
  87859. * @function ol.supermap.SpatialAnalystService.prototype.overlayAnalysis
  87860. * @description 叠加分析。
  87861. * @param {SuperMap.DatasetOverlayAnalystParameters|SuperMap.GeometryOverlayAnalystParameters} params - 叠加分析参数类,支持批量几何要素叠加分析。
  87862. * @param {RequestCallback} callback 回调函数。
  87863. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87864. */
  87865. }, {
  87866. key: "overlayAnalysis",
  87867. value: function overlayAnalysis(params, callback, resultFormat) {
  87868. var me = this;
  87869. var overlayAnalystService = new OverlayAnalystService(me.url, {
  87870. proxy: me.options.proxy,
  87871. withCredentials: me.options.withCredentials,
  87872. crossOrigin: me.options.crossOrigin,
  87873. headers: me.options.headers,
  87874. serverType: me.options.serverType,
  87875. eventListeners: {
  87876. scope: me,
  87877. processCompleted: callback,
  87878. processFailed: callback
  87879. },
  87880. format: me._processFormat(resultFormat)
  87881. });
  87882. overlayAnalystService.processAsync(me._processParams(params));
  87883. }
  87884. /**
  87885. * @function ol.supermap.SpatialAnalystService.prototype.routeCalculateMeasure
  87886. * @description 路由测量计算。
  87887. * @param {SuperMap.RouteCalculateMeasureParameters} params - 查询相关参数类。
  87888. * @param {RequestCallback} callback 回调函数。
  87889. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87890. */
  87891. }, {
  87892. key: "routeCalculateMeasure",
  87893. value: function routeCalculateMeasure(params, callback, resultFormat) {
  87894. var me = this;
  87895. var routeCalculateMeasureService = new RouteCalculateMeasureService(me.url, {
  87896. proxy: me.options.proxy,
  87897. withCredentials: me.options.withCredentials,
  87898. crossOrigin: me.options.crossOrigin,
  87899. headers: me.options.headers,
  87900. serverType: me.options.serverType,
  87901. eventListeners: {
  87902. scope: me,
  87903. processCompleted: callback,
  87904. processFailed: callback
  87905. },
  87906. format: me._processFormat(resultFormat)
  87907. });
  87908. routeCalculateMeasureService.processAsync(me._processParams(params));
  87909. }
  87910. /**
  87911. * @function ol.supermap.SpatialAnalystService.prototype.routeLocate
  87912. * @description 路由定位。
  87913. * @param {SuperMap.RouteLocatorParameters} params - 查询相关参数类。
  87914. * @param {RequestCallback} callback 回调函数。
  87915. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87916. */
  87917. }, {
  87918. key: "routeLocate",
  87919. value: function routeLocate(params, callback, resultFormat) {
  87920. var me = this;
  87921. var routeLocatorService = new RouteLocatorService(me.url, {
  87922. proxy: me.options.proxy,
  87923. withCredentials: me.options.withCredentials,
  87924. crossOrigin: me.options.crossOrigin,
  87925. headers: me.options.headers,
  87926. serverType: me.options.serverType,
  87927. eventListeners: {
  87928. scope: me,
  87929. processCompleted: callback,
  87930. processFailed: callback
  87931. },
  87932. format: me._processFormat(resultFormat)
  87933. });
  87934. routeLocatorService.processAsync(me._processParams(params));
  87935. }
  87936. /**
  87937. * @function ol.supermap.SpatialAnalystService.prototype.surfaceAnalysis
  87938. * @description 表面分析。
  87939. * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析参数类。
  87940. * @param {RequestCallback} callback 回调函数。
  87941. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87942. */
  87943. }, {
  87944. key: "surfaceAnalysis",
  87945. value: function surfaceAnalysis(params, callback, resultFormat) {
  87946. var me = this;
  87947. var surfaceAnalystService = new SurfaceAnalystService(me.url, {
  87948. proxy: me.options.proxy,
  87949. withCredentials: me.options.withCredentials,
  87950. crossOrigin: me.options.crossOrigin,
  87951. headers: me.options.headers,
  87952. serverType: me.options.serverType,
  87953. eventListeners: {
  87954. scope: me,
  87955. processCompleted: callback,
  87956. processFailed: callback
  87957. },
  87958. format: me._processFormat(resultFormat)
  87959. });
  87960. surfaceAnalystService.processAsync(me._processParams(params));
  87961. }
  87962. /**
  87963. * @function ol.supermap.SpatialAnalystService.prototype.terrainCurvatureCalculate
  87964. * @description 地形曲率计算。
  87965. * @param {SuperMap.TerrainCurvatureCalculationParameters} params - 地形曲率计算相关参数。
  87966. * @param {RequestCallback} callback 回调函数。
  87967. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87968. */
  87969. }, {
  87970. key: "terrainCurvatureCalculate",
  87971. value: function terrainCurvatureCalculate(params, callback, resultFormat) {
  87972. var me = this;
  87973. var terrainCurvatureCalculationService = new TerrainCurvatureCalculationService(me.url, {
  87974. proxy: me.options.proxy,
  87975. withCredentials: me.options.withCredentials,
  87976. crossOrigin: me.options.crossOrigin,
  87977. headers: me.options.headers,
  87978. serverType: me.options.serverType,
  87979. eventListeners: {
  87980. scope: me,
  87981. processCompleted: callback,
  87982. processFailed: callback
  87983. },
  87984. format: me._processFormat(resultFormat)
  87985. });
  87986. terrainCurvatureCalculationService.processAsync(params);
  87987. }
  87988. /**
  87989. * @function ol.supermap.SpatialAnalystService.prototype.thiessenAnalysis
  87990. * @description 泰森多边形分析。
  87991. * @param {SuperMap.DatasetThiessenAnalystParameters} params - 查询相关参数类。
  87992. * @param {RequestCallback} callback 回调函数。
  87993. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  87994. */
  87995. }, {
  87996. key: "thiessenAnalysis",
  87997. value: function thiessenAnalysis(params, callback, resultFormat) {
  87998. var me = this;
  87999. var thiessenAnalystService = new ThiessenAnalystService(me.url, {
  88000. proxy: me.options.proxy,
  88001. withCredentials: me.options.withCredentials,
  88002. crossOrigin: me.options.crossOrigin,
  88003. headers: me.options.headers,
  88004. serverType: me.options.serverType,
  88005. eventListeners: {
  88006. scope: me,
  88007. processCompleted: callback,
  88008. processFailed: callback
  88009. },
  88010. format: me._processFormat(resultFormat)
  88011. });
  88012. thiessenAnalystService.processAsync(me._processParams(params));
  88013. }
  88014. /**
  88015. * @function ol.supermap.SpatialAnalystService.prototype.geometrybatchAnalysis
  88016. * @description 批量空间分析。
  88017. * @param {Array} params - 批量分析参数对象数组。
  88018. * @param {Array.<Object>} params.analystName - 空间分析方法的名称。包括:</br>
  88019. * "buffer","overlay","interpolationDensity","interpolationidw","interpolationRBF","interpolationKriging","isoregion","isoline"。
  88020. * @param {Object} params.param - 空间分析类型对应的请求参数,包括:</br>
  88021. * {SuperMap.GeometryBufferAnalystParameters} 缓冲区分析参数类。</br>
  88022. * {SuperMap.GeometryOverlayAnalystParameters} 叠加分析参数类。</br>
  88023. * {SuperMap.InterpolationAnalystParameters} 插值分析参数类。</br>
  88024. * {SuperMap.SurfaceAnalystParameters} 表面分析参数类。</br>
  88025. * @param {RequestCallback} callback - 回调函数。
  88026. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  88027. */
  88028. }, {
  88029. key: "geometrybatchAnalysis",
  88030. value: function geometrybatchAnalysis(params, callback, resultFormat) {
  88031. var me = this;
  88032. var geometryBatchAnalystService = new GeometryBatchAnalystService(me.url, {
  88033. serverType: me.options.serverType,
  88034. eventListeners: {
  88035. scope: me,
  88036. processCompleted: callback,
  88037. processFailed: callback
  88038. },
  88039. format: me._processFormat(resultFormat)
  88040. }); //处理批量分析中各个分类类型的参数:
  88041. var analystParameters = [];
  88042. for (var i = 0; i < params.length; i++) {
  88043. var tempParameter = params[i];
  88044. analystParameters.push({
  88045. analystName: tempParameter.analystName,
  88046. param: me._processParams(tempParameter.param)
  88047. });
  88048. }
  88049. geometryBatchAnalystService.processAsync(analystParameters);
  88050. }
  88051. }, {
  88052. key: "_processParams",
  88053. value: function _processParams(params) {
  88054. if (!params) {
  88055. return {};
  88056. }
  88057. if (params.bounds) {
  88058. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  88059. }
  88060. if (params.inputPoints) {
  88061. for (var i = 0; i < params.inputPoints.length; i++) {
  88062. var inputPoint = params.inputPoints[i];
  88063. if (core_Util_Util.isArray(inputPoint)) {
  88064. params.inputPoints[i] = {
  88065. x: inputPoint[0],
  88066. y: inputPoint[1],
  88067. tag: inputPoint[2]
  88068. };
  88069. } else {
  88070. params.inputPoints[i] = {
  88071. x: inputPoint.getCoordinates()[0],
  88072. y: inputPoint.getCoordinates()[1],
  88073. tag: inputPoint.tag
  88074. };
  88075. }
  88076. }
  88077. }
  88078. if (params.points) {
  88079. for (var _i = 0; _i < params.points.length; _i++) {
  88080. var point = params.points[_i];
  88081. if (core_Util_Util.isArray(point)) {
  88082. point.setCoordinates(point);
  88083. }
  88084. params.points[_i] = new Point(point.getCoordinates()[0], point.getCoordinates()[1]);
  88085. }
  88086. }
  88087. if (params.point) {
  88088. var _point = params.point;
  88089. if (core_Util_Util.isArray(_point)) {
  88090. _point.setCoordinates(_point);
  88091. }
  88092. params.point = new Point(_point.getCoordinates()[0], _point.getCoordinates()[1]);
  88093. }
  88094. if (params.extractRegion) {
  88095. params.extractRegion = this.convertGeometry(params.extractRegion);
  88096. }
  88097. if (params.extractParameter && params.extractParameter.clipRegion) {
  88098. params.extractParameter.clipRegion = this.convertGeometry(params.extractParameter.clipRegion);
  88099. }
  88100. if (params.clipParam && params.clipParam.clipRegion) {
  88101. params.clipParam.clipRegion = this.convertGeometry(params.clipParam.clipRegion);
  88102. } //支持格式:Vector Layers; GeoJson
  88103. if (params.sourceGeometry) {
  88104. var SRID = null;
  88105. if (params.sourceGeometrySRID) {
  88106. SRID = params.sourceGeometrySRID;
  88107. }
  88108. params.sourceGeometry = this.convertGeometry(params.sourceGeometry);
  88109. if (SRID) {
  88110. params.sourceGeometry.SRID = SRID;
  88111. }
  88112. delete params.sourceGeometry.sourceGeometrySRID;
  88113. }
  88114. if (params.operateGeometry) {
  88115. params.operateGeometry = this.convertGeometry(params.operateGeometry);
  88116. } //支持传入多个几何要素进行叠加分析:
  88117. if (params.sourceGeometries) {
  88118. var sourceGeometries = [];
  88119. for (var k = 0; k < params.sourceGeometries.length; k++) {
  88120. sourceGeometries.push(this.convertGeometry(params.sourceGeometries[k]));
  88121. }
  88122. params.sourceGeometries = sourceGeometries;
  88123. } //支持传入多个几何要素进行叠加分析:
  88124. if (params.operateGeometries) {
  88125. var operateGeometries = [];
  88126. for (var j = 0; j < params.operateGeometries.length; j++) {
  88127. operateGeometries.push(this.convertGeometry(params.operateGeometries[j]));
  88128. }
  88129. params.operateGeometries = operateGeometries;
  88130. }
  88131. if (params.sourceRoute) {
  88132. if (params.sourceRoute instanceof (external_ol_geom_LineString_default()) && params.sourceRoute.getCoordinates()) {
  88133. var target = {};
  88134. target.type = "LINEM";
  88135. target.parts = [params.sourceRoute.getCoordinates()[0].length];
  88136. target.points = [];
  88137. for (var _i2 = 0; _i2 < params.sourceRoute.getCoordinates()[0].length; _i2++) {
  88138. var _point2 = params.sourceRoute.getCoordinates()[0][_i2];
  88139. target.points = target.points.concat({
  88140. x: _point2[0],
  88141. y: _point2[1],
  88142. measure: _point2[2]
  88143. });
  88144. }
  88145. params.sourceRoute = target;
  88146. }
  88147. }
  88148. var me = this;
  88149. if (params.operateRegions && core_Util_Util.isArray(params.operateRegions)) {
  88150. params.operateRegions.map(function (geometry, key) {
  88151. params.operateRegions[key] = me.convertGeometry(geometry);
  88152. return params.operateRegions[key];
  88153. });
  88154. }
  88155. if (params.sourceRoute && params.sourceRoute.components && core_Util_Util.isArray(params.sourceRoute.components)) {
  88156. params.sourceRoute.components.map(function (geometry, key) {
  88157. params.sourceRoute.components[key] = me.convertGeometry(geometry);
  88158. return params.sourceRoute.components[key];
  88159. });
  88160. }
  88161. return params;
  88162. }
  88163. }, {
  88164. key: "_processFormat",
  88165. value: function _processFormat(resultFormat) {
  88166. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  88167. }
  88168. /**
  88169. * @private
  88170. * @function ol.supermap.SpatialAnalystService.prototype.convertGeometry
  88171. * @description 转换几何对象。
  88172. * @param {Object} ol3Geometry - 待转换的几何对象。
  88173. */
  88174. }, {
  88175. key: "convertGeometry",
  88176. value: function convertGeometry(ol3Geometry) {
  88177. //判断是否传入的是geojson 并作相应处理
  88178. if (["FeatureCollection", "Feature", "Geometry"].indexOf(ol3Geometry.type) != -1) {
  88179. return core_Util_Util.toSuperMapGeometry(ol3Geometry);
  88180. }
  88181. return core_Util_Util.toSuperMapGeometry(JSON.parse(new (external_ol_format_GeoJSON_default())().writeGeometry(ol3Geometry)));
  88182. }
  88183. }]);
  88184. return SpatialAnalystService;
  88185. }(ServiceBase);
  88186. ;// CONCATENATED MODULE: ./src/openlayers/services/ThemeService.js
  88187. function services_ThemeService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_ThemeService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_ThemeService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_ThemeService_typeof(obj); }
  88188. function services_ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88189. function services_ThemeService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  88190. function services_ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ThemeService_defineProperties(Constructor, staticProps); return Constructor; }
  88191. function services_ThemeService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) services_ThemeService_setPrototypeOf(subClass, superClass); }
  88192. function services_ThemeService_setPrototypeOf(o, p) { services_ThemeService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_ThemeService_setPrototypeOf(o, p); }
  88193. function services_ThemeService_createSuper(Derived) { var hasNativeReflectConstruct = services_ThemeService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_ThemeService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_ThemeService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_ThemeService_possibleConstructorReturn(this, result); }; }
  88194. function services_ThemeService_possibleConstructorReturn(self, call) { if (call && (services_ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_ThemeService_assertThisInitialized(self); }
  88195. function services_ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  88196. function services_ThemeService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  88197. function services_ThemeService_getPrototypeOf(o) { services_ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_ThemeService_getPrototypeOf(o); }
  88198. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  88199. * This program are made available under the terms of the Apache License, Version 2.0
  88200. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88201. /**
  88202. * @class ol.supermap.ThemeService
  88203. * @category iServer Map Theme
  88204. * @classdesc 专题图服务类。
  88205. * @extends {ol.supermap.ServiceBase}
  88206. * @example
  88207. * new ol.supermap.ThemeService(url,{
  88208. * projection:projection
  88209. * }).getThemeInfo(params,function(result){
  88210. * //doSomething
  88211. * });
  88212. * @param {string} url - 服务的访问地址。
  88213. * @param {Object} options - 参数。
  88214. * @param {string} [options.proxy] - 服务代理地址。
  88215. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  88216. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  88217. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  88218. * @param {Object} [options.headers] - 请求头。
  88219. */
  88220. var ThemeService = /*#__PURE__*/function (_ServiceBase) {
  88221. services_ThemeService_inherits(ThemeService, _ServiceBase);
  88222. var _super = services_ThemeService_createSuper(ThemeService);
  88223. function ThemeService(url, options) {
  88224. services_ThemeService_classCallCheck(this, ThemeService);
  88225. return _super.call(this, url, options);
  88226. }
  88227. /**
  88228. * @function ol.supermap.ThemeService.prototype.getThemeInfo
  88229. * @description 获取专题图信息。
  88230. * @param {SuperMap.ThemeParameters} params - 专题图参数类。
  88231. * @param {RequestCallback} callback 回调函数。
  88232. */
  88233. services_ThemeService_createClass(ThemeService, [{
  88234. key: "getThemeInfo",
  88235. value: function getThemeInfo(params, callback) {
  88236. var me = this;
  88237. var themeService = new ThemeService_ThemeService(me.url, {
  88238. proxy: me.options.proxy,
  88239. withCredentials: me.options.withCredentials,
  88240. crossOrigin: me.options.crossOrigin,
  88241. headers: me.options.headers,
  88242. serverType: me.options.serverType,
  88243. eventListeners: {
  88244. scope: me,
  88245. processCompleted: callback,
  88246. processFailed: callback
  88247. }
  88248. });
  88249. themeService.processAsync(params);
  88250. }
  88251. }]);
  88252. return ThemeService;
  88253. }(ServiceBase);
  88254. ;// CONCATENATED MODULE: ./src/openlayers/services/TrafficTransferAnalystService.js
  88255. function TrafficTransferAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TrafficTransferAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { TrafficTransferAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TrafficTransferAnalystService_typeof(obj); }
  88256. function TrafficTransferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88257. 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); } }
  88258. function TrafficTransferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TrafficTransferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TrafficTransferAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  88259. function TrafficTransferAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) TrafficTransferAnalystService_setPrototypeOf(subClass, superClass); }
  88260. function TrafficTransferAnalystService_setPrototypeOf(o, p) { TrafficTransferAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TrafficTransferAnalystService_setPrototypeOf(o, p); }
  88261. function TrafficTransferAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = TrafficTransferAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TrafficTransferAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TrafficTransferAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TrafficTransferAnalystService_possibleConstructorReturn(this, result); }; }
  88262. function TrafficTransferAnalystService_possibleConstructorReturn(self, call) { if (call && (TrafficTransferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return TrafficTransferAnalystService_assertThisInitialized(self); }
  88263. function TrafficTransferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  88264. function TrafficTransferAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  88265. function TrafficTransferAnalystService_getPrototypeOf(o) { TrafficTransferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TrafficTransferAnalystService_getPrototypeOf(o); }
  88266. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  88267. * This program are made available under the terms of the Apache License, Version 2.0
  88268. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88269. /**
  88270. * @class ol.supermap.TrafficTransferAnalystService
  88271. * @extends {ol.supermap.ServiceBase}
  88272. * @category iServer TrafficTransferAnalyst
  88273. * @classdesc 交通换乘分析服务类。
  88274. * @example
  88275. * new ol.supermap.TrafficTransferAnalystService(url)
  88276. * .queryStop(params,function(result){
  88277. * //doSomething
  88278. * })
  88279. * @param {string} url - 服务地址。
  88280. * @param {Object} options - 参数。
  88281. * @param {string} [options.proxy] - 服务代理地址。
  88282. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  88283. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  88284. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  88285. * @param {Object} [options.headers] - 请求头。
  88286. */
  88287. var TrafficTransferAnalystService = /*#__PURE__*/function (_ServiceBase) {
  88288. TrafficTransferAnalystService_inherits(TrafficTransferAnalystService, _ServiceBase);
  88289. var _super = TrafficTransferAnalystService_createSuper(TrafficTransferAnalystService);
  88290. function TrafficTransferAnalystService(url, options) {
  88291. TrafficTransferAnalystService_classCallCheck(this, TrafficTransferAnalystService);
  88292. return _super.call(this, url, options);
  88293. }
  88294. /**
  88295. * @function ol.supermap.TrafficTransferAnalystService.prototype.queryStop
  88296. * @description 站点查询服务。
  88297. * @param {SuperMap.StopQueryParameters} params - 查询相关参数类。
  88298. * @param {RequestCallback} callback - 回调函数。
  88299. */
  88300. TrafficTransferAnalystService_createClass(TrafficTransferAnalystService, [{
  88301. key: "queryStop",
  88302. value: function queryStop(params, callback) {
  88303. var me = this;
  88304. var stopQueryService = new StopQueryService(me.url, {
  88305. proxy: me.options.proxy,
  88306. withCredentials: me.options.withCredentials,
  88307. crossOrigin: me.options.crossOrigin,
  88308. headers: me.options.headers,
  88309. serverType: me.options.serverType,
  88310. eventListeners: {
  88311. scope: me,
  88312. processCompleted: callback,
  88313. processFailed: callback
  88314. }
  88315. });
  88316. stopQueryService.processAsync(params);
  88317. }
  88318. /**
  88319. * @function ol.supermap.TrafficTransferAnalystService.prototype.analysisTransferPath
  88320. * @description 交通换乘线路查询服务。
  88321. * @param {SuperMap.TransferPathParameters} params - 查询相关参数类。
  88322. * @param {RequestCallback} callback - 回调函数。
  88323. */
  88324. }, {
  88325. key: "analysisTransferPath",
  88326. value: function analysisTransferPath(params, callback) {
  88327. var me = this;
  88328. var transferPathService = new TransferPathService(me.url, {
  88329. proxy: me.options.proxy,
  88330. withCredentials: me.options.withCredentials,
  88331. crossOrigin: me.options.crossOrigin,
  88332. headers: me.options.headers,
  88333. serverType: me.options.serverType,
  88334. eventListeners: {
  88335. scope: me,
  88336. processCompleted: callback,
  88337. processFailed: callback
  88338. }
  88339. });
  88340. transferPathService.processAsync(me._processParams(params));
  88341. }
  88342. /**
  88343. * @function ol.supermap.TrafficTransferAnalystService.prototype.analysisTransferSolution
  88344. * @description 交通换乘方案查询服务。
  88345. * @param {SuperMap.TransferSolutionParameters} params - 查询相关参数类。
  88346. * @param {RequestCallback} callback - 回调函数。
  88347. */
  88348. }, {
  88349. key: "analysisTransferSolution",
  88350. value: function analysisTransferSolution(params, callback) {
  88351. var me = this;
  88352. var transferSolutionService = new TransferSolutionService(me.url, {
  88353. proxy: me.options.proxy,
  88354. withCredentials: me.options.withCredentials,
  88355. crossOrigin: me.options.crossOrigin,
  88356. headers: me.options.headers,
  88357. serverType: me.options.serverType,
  88358. eventListeners: {
  88359. scope: me,
  88360. processCompleted: callback,
  88361. processFailed: callback
  88362. }
  88363. });
  88364. transferSolutionService.processAsync(me._processParams(params));
  88365. }
  88366. }, {
  88367. key: "_processParams",
  88368. value: function _processParams(params) {
  88369. if (!params) {
  88370. return {};
  88371. }
  88372. if (params.transferLines && !core_Util_Util.isArray(params.transferLines)) {
  88373. params.transferLines = [params.transferLines];
  88374. }
  88375. if (params.points && core_Util_Util.isArray(params.points)) {
  88376. params.points.map(function (point, key) {
  88377. params.points[key] = point instanceof (external_ol_geom_Point_default()) ? {
  88378. x: point.getCoordinates()[0],
  88379. y: point.getCoordinates()[1]
  88380. } : point;
  88381. return params.points[key];
  88382. });
  88383. }
  88384. return params;
  88385. }
  88386. }]);
  88387. return TrafficTransferAnalystService;
  88388. }(ServiceBase);
  88389. ;// CONCATENATED MODULE: ./src/openlayers/services/WebPrintingJobService.js
  88390. function WebPrintingJobService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { WebPrintingJobService_typeof = function _typeof(obj) { return typeof obj; }; } else { WebPrintingJobService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return WebPrintingJobService_typeof(obj); }
  88391. function WebPrintingJobService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88392. function WebPrintingJobService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  88393. function WebPrintingJobService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobService_defineProperties(Constructor, staticProps); return Constructor; }
  88394. function WebPrintingJobService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) WebPrintingJobService_setPrototypeOf(subClass, superClass); }
  88395. function WebPrintingJobService_setPrototypeOf(o, p) { WebPrintingJobService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingJobService_setPrototypeOf(o, p); }
  88396. function WebPrintingJobService_createSuper(Derived) { var hasNativeReflectConstruct = WebPrintingJobService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WebPrintingJobService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WebPrintingJobService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WebPrintingJobService_possibleConstructorReturn(this, result); }; }
  88397. function WebPrintingJobService_possibleConstructorReturn(self, call) { if (call && (WebPrintingJobService_typeof(call) === "object" || typeof call === "function")) { return call; } return WebPrintingJobService_assertThisInitialized(self); }
  88398. function WebPrintingJobService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  88399. function WebPrintingJobService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  88400. function WebPrintingJobService_getPrototypeOf(o) { WebPrintingJobService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingJobService_getPrototypeOf(o); }
  88401. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  88402. * This program are made available under the terms of the Apache License, Version 2.0
  88403. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88404. /**
  88405. * @class ol.supermap.WebPrintingJobService
  88406. * @category iServer WebPrintingJob
  88407. * @version 10.1.0
  88408. * @classdesc Web 打印服务类。
  88409. * 提供:创建 Web 打印任务,获取 Web 打印任务内容,获取 Web 打印输出文档流,获取 Web 打印服务的布局模板信息。
  88410. * @extends {ol.supermap.ServiceBase}
  88411. * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  88412. * @param {Object} options - 服务交互时所需的可选参数。
  88413. * @param {string} [options.proxy] - 服务代理地址。
  88414. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  88415. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  88416. * @param {Object} [options.headers] - 请求头。
  88417. * @example
  88418. * new ol.supermap.WebPrintingJobService(url)
  88419. * .createWebPrintingJob(param,function(result){
  88420. * //doSomething
  88421. * })
  88422. */
  88423. var WebPrintingJobService = /*#__PURE__*/function (_ServiceBase) {
  88424. WebPrintingJobService_inherits(WebPrintingJobService, _ServiceBase);
  88425. var _super = WebPrintingJobService_createSuper(WebPrintingJobService);
  88426. function WebPrintingJobService(url, options) {
  88427. WebPrintingJobService_classCallCheck(this, WebPrintingJobService);
  88428. return _super.call(this, url, options);
  88429. }
  88430. /**
  88431. * @function ol.supermap.WebPrintingJobService.prototype.createWebPrintingJob
  88432. * @description 创建 Web 打印任务。
  88433. * @param {SuperMap.WebPrintingJobParameters} params - 打印的相关参数类。
  88434. * @param {RequestCallback} callback - 回调函数。
  88435. */
  88436. WebPrintingJobService_createClass(WebPrintingJobService, [{
  88437. key: "createWebPrintingJob",
  88438. value: function createWebPrintingJob(params, callback) {
  88439. if (!params) {
  88440. return;
  88441. }
  88442. var me = this;
  88443. var webPrintingService = new WebPrintingService(me.url, {
  88444. proxy: me.options.proxy,
  88445. withCredentials: me.options.withCredentials,
  88446. crossOrigin: me.options.crossOrigin,
  88447. headers: me.options.headers,
  88448. serverType: me.options.serverType,
  88449. eventListeners: {
  88450. scope: me,
  88451. processCompleted: callback,
  88452. processFailed: callback
  88453. }
  88454. });
  88455. webPrintingService.createWebPrintingJob(me._processParams(params));
  88456. }
  88457. /**
  88458. * @function ol.supermap.WebPrintingJobService.prototype.getPrintingJob
  88459. * @description 获取 Web 打印输出文档任务。
  88460. * @param {String} jobId - Web 打印输入文档任务 Id。
  88461. * @param {RequestCallback} callback - 回调函数。
  88462. */
  88463. }, {
  88464. key: "getPrintingJob",
  88465. value: function getPrintingJob(jobId, callback) {
  88466. var me = this;
  88467. var webPrintingService = new WebPrintingService(me.url, {
  88468. proxy: me.options.proxy,
  88469. withCredentials: me.options.withCredentials,
  88470. crossOrigin: me.options.crossOrigin,
  88471. headers: me.options.headers,
  88472. serverType: me.options.serverType,
  88473. eventListeners: {
  88474. scope: me,
  88475. processCompleted: callback,
  88476. processFailed: callback
  88477. }
  88478. });
  88479. webPrintingService.getPrintingJob(jobId);
  88480. }
  88481. /**
  88482. * @function ol.supermap.WebPrintingJobService.prototype.getPrintingJobResult
  88483. * @description 获取 Web 打印任务的输出文档。
  88484. * @param {String} jobId - Web 打印输入文档任务 Id。
  88485. * @param {RequestCallback} callback - 回调函数。
  88486. */
  88487. }, {
  88488. key: "getPrintingJobResult",
  88489. value: function getPrintingJobResult(jobId, callback) {
  88490. var me = this;
  88491. var webPrintingService = new WebPrintingService(me.url, {
  88492. proxy: me.options.proxy,
  88493. withCredentials: me.options.withCredentials,
  88494. crossOrigin: me.options.crossOrigin,
  88495. headers: me.options.headers,
  88496. serverType: me.options.serverType,
  88497. eventListeners: {
  88498. scope: me,
  88499. processCompleted: callback,
  88500. processFailed: callback
  88501. }
  88502. });
  88503. webPrintingService.getPrintingJobResult(jobId);
  88504. }
  88505. /**
  88506. * @function ol.supermap.WebPrintingJobService.prototype.getLayoutTemplates
  88507. * @description 查询 Web 打印服务所有可用的模板信息。
  88508. * @param {RequestCallback} callback - 回调函数。
  88509. */
  88510. }, {
  88511. key: "getLayoutTemplates",
  88512. value: function getLayoutTemplates(callback) {
  88513. var me = this;
  88514. var webPrintingService = new WebPrintingService(me.url, {
  88515. proxy: me.options.proxy,
  88516. withCredentials: me.options.withCredentials,
  88517. crossOrigin: me.options.crossOrigin,
  88518. headers: me.options.headers,
  88519. serverType: me.options.serverType,
  88520. eventListeners: {
  88521. scope: me,
  88522. processCompleted: callback,
  88523. processFailed: callback
  88524. }
  88525. });
  88526. webPrintingService.getLayoutTemplates();
  88527. }
  88528. }, {
  88529. key: "_processParams",
  88530. value: function _processParams(params) {
  88531. if (params.layoutOptions && params.layoutOptions.littleMapOptions) {
  88532. params.layoutOptions.littleMapOptions.center = this._toPointObject(params.layoutOptions.littleMapOptions.center);
  88533. }
  88534. if (params.exportOptions) {
  88535. params.exportOptions.center = this._toPointObject(params.exportOptions.center);
  88536. }
  88537. return params;
  88538. }
  88539. }, {
  88540. key: "_toPointObject",
  88541. value: function _toPointObject(point) {
  88542. if (core_Util_Util.isArray(point)) {
  88543. return {
  88544. x: point[0],
  88545. y: point[1]
  88546. };
  88547. } else if (point instanceof SuperMap.Geometry.Point || point instanceof (external_ol_geom_Point_default())) {
  88548. return {
  88549. x: point.x,
  88550. y: point.y
  88551. };
  88552. }
  88553. return point;
  88554. }
  88555. }]);
  88556. return WebPrintingJobService;
  88557. }(ServiceBase);
  88558. ;// CONCATENATED MODULE: ./src/openlayers/services/index.js
  88559. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  88560. * This program are made available under the terms of the Apache License, Version 2.0
  88561. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88562. ;// CONCATENATED MODULE: ./src/openlayers/mapping/webmap/config/ProvinceCenter.json
  88563. var ProvinceCenter_namespaceObject = JSON.parse("[{\"name\":\"黑龙江省\",\"coord\":[127.64559817675396,48.48668098449708]},{\"name\":\"内蒙古自治区\",\"coord\":[118.34519572208615,45.370218276977525]},{\"name\":\"新疆维吾尔自治区\",\"coord\":[87.13479065593184,41.75497055053711]},{\"name\":\"吉林省\",\"coord\":[126.12985278813787,43.57983207702637]},{\"name\":\"辽宁省\",\"coord\":[124.02494773936439,41.105743408203125]},{\"name\":\"甘肃省\",\"coord\":[102.87785725633012,37.69582366943361]},{\"name\":\"河北省\",\"coord\":[115.66327227481898,39.33383178710938]},{\"name\":\"北京市\",\"coord\":[116.62199343603638,40.25053787231445]},{\"name\":\"山西省\",\"coord\":[112.45180235808988,37.666561126708984]},{\"name\":\"天津市\",\"coord\":[117.35711842642581,39.406789779663086]},{\"name\":\"陕西省\",\"coord\":[109.56294003056632,35.64754199981689]},{\"name\":\"宁夏回族自治区\",\"coord\":[105.96110877640074,37.3081169128418]},{\"name\":\"青海省\",\"coord\":[96.07301048277901,35.44417190551758]},{\"name\":\"山东省\",\"coord\":[118.03833752951093,36.29800605773925]},{\"name\":\"西藏自治区\",\"coord\":[87.47361520439412,31.6703872680664]},{\"name\":\"河南省\",\"coord\":[113.07832397097275,33.87751102447509]},{\"name\":\"江苏省\",\"coord\":[119.93926538201052,32.945452690124505]},{\"name\":\"安徽省\",\"coord\":[117.15146765881019,32.024482727050774]},{\"name\":\"四川省\",\"coord\":[102.28998890142759,30.182161331176758]},{\"name\":\"湖北省\",\"coord\":[112.87798261431585,31.157071113586426]},{\"name\":\"重庆市\",\"coord\":[107.870126637831,30.188085556030266]},{\"name\":\"上海市\",\"coord\":[121.42561166015514,31.276043891906745]},{\"name\":\"浙江省\",\"coord\":[119.75337092707514,29.175934791564945]},{\"name\":\"湖南省\",\"coord\":[111.52770282777405,27.38110256195069]},{\"name\":\"江西省\",\"coord\":[115.51091280655628,27.283511161804206]},{\"name\":\"云南省\",\"coord\":[101.27053825991308,25.19783210754396]},{\"name\":\"贵州省\",\"coord\":[106.49672346773299,26.92267990112305]},{\"name\":\"福建省\",\"coord\":[117.9976766946587,25.939599990844727]},{\"name\":\"广西壮族自治区\",\"coord\":[108.98706831086302,23.891559600830078]},{\"name\":\"台湾省\",\"coord\":[120.82468432537434,23.602651596069336]},{\"name\":\"香港特别行政区\",\"coord\":[114.21036850371561,22.374858856201172]},{\"name\":\"海南省\",\"coord\":[109.62792940960824,19.163116455078125]},{\"name\":\"广东省\",\"coord\":[113.32127888266032,22.873867034912106]},{\"name\":\"澳门特别行政区\",\"coord\":[113.56819996291901,22.160347992976]}]");
  88564. ;// CONCATENATED MODULE: ./src/openlayers/mapping/webmap/config/MunicipalCenter.json
  88565. var MunicipalCenter_namespaceObject = JSON.parse("[{\"name\":\"克拉玛依市\",\"coord\":[85.01486759299489,45.406422237230046]},{\"name\":\"昌吉回族自治州\",\"coord\":[88.7154624754753,44.26991024636568]},{\"name\":\"石河子市\",\"coord\":[86.0208600035924,44.239045558096805]},{\"name\":\"霍林郭勒市\",\"coord\":[114.73479243733115,44.16058374713977]},{\"name\":\"本溪市\",\"coord\":[124.64357865201586,41.177197783134275]},{\"name\":\"嘉峪关市\",\"coord\":[98.16891560537093,39.76279786284264]},{\"name\":\"莱芜市\",\"coord\":[117.65723565456207,36.27916499211527]},{\"name\":\"神农架林区\",\"coord\":[110.48296222218153,31.581260143666697]},{\"name\":\"天门市\",\"coord\":[113.00615321481195,30.64105781887143]},{\"name\":\"鄂州市\",\"coord\":[114.94764081970385,30.325634953844585]},{\"name\":\"潜江市\",\"coord\":[112.70703817700621,30.349210666019893]},{\"name\":\"仙桃市\",\"coord\":[113.34688900729822,30.315951161935402]},{\"name\":\"萍乡市\",\"coord\":[113.88072263074415,27.47193090553213]},{\"name\":\"台湾省\",\"coord\":[120.14338943402045,23.596002465926095]},{\"name\":\"东莞市\",\"coord\":[113.89443658529342,22.897826158636448]},{\"name\":\"中山市\",\"coord\":[113.37118387764659,22.501478858616522]},{\"name\":\"珠海市\",\"coord\":[113.21799258934986,22.23782602992192]},{\"name\":\"北海市\",\"coord\":[109.18248083043899,21.695773689750148]},{\"name\":\"香港\",\"coord\":[114.20689279508653,22.36016760139811]},{\"name\":\"舟山市\",\"coord\":[122.22514712841459,30.338633120695956]},{\"name\":\"克孜勒苏柯尔克孜\",\"coord\":[74.62910472637343,39.59886016069875]},{\"name\":\"喀什地区\",\"coord\":[77.19899922143753,37.85462871211595]},{\"name\":\"阿克苏地区\",\"coord\":[81.43930290016381,41.067304799230456]},{\"name\":\"和田地区\",\"coord\":[80.69780509160952,36.95287032287055]},{\"name\":\"阿里地区\",\"coord\":[82.536487505389,32.69566569631762]},{\"name\":\"日喀则地区\",\"coord\":[86.5996831353606,29.54861754814263]},{\"name\":\"那曲地区\",\"coord\":[88.32523292667608,33.20600450932715]},{\"name\":\"玉树藏族自治州\",\"coord\":[95.2107128446203,33.90320387919257]},{\"name\":\"迪庆藏族自治州\",\"coord\":[99.42465312188943,28.052797714348895]},{\"name\":\"怒江傈傈族自治州\",\"coord\":[98.85737910439825,26.98345757528851]},{\"name\":\"大理白族自治州\",\"coord\":[99.93934374816013,25.684737357453045]},{\"name\":\"德宏傣族景颇族自\",\"coord\":[98.13830877778075,24.593421919561205]},{\"name\":\"保山市\",\"coord\":[99.19031013453166,24.979380341662]},{\"name\":\"临沧市\",\"coord\":[99.62483778975081,24.058807858948214]},{\"name\":\"普洱市\",\"coord\":[100.94440267992684,23.44121660743221]},{\"name\":\"西双版纳傣族自治\",\"coord\":[100.86105801845994,21.882475641324206]},{\"name\":\"拉萨市\",\"coord\":[91.3684790613129,30.14176592960237]},{\"name\":\"山南地区\",\"coord\":[92.11665242621062,28.33000201578789]},{\"name\":\"林芝地区\",\"coord\":[94.9307847458166,29.125110156601963]},{\"name\":\"昌都地区\",\"coord\":[97.33912235873476,30.48520825551814]},{\"name\":\"丽江市\",\"coord\":[100.65713436205135,26.96190318191959]},{\"name\":\"攀枝花市\",\"coord\":[101.73355913301131,26.714486678752795]},{\"name\":\"凉山彝族自治州\",\"coord\":[102.08678551422615,27.683020519860396]},{\"name\":\"楚雄彝族自治州\",\"coord\":[101.68264761198458,25.369603845264024]},{\"name\":\"红河哈尼族彝族自\",\"coord\":[102.95101719613119,23.624860095239875]},{\"name\":\"文山壮族苗族自治\",\"coord\":[104.8708359910614,23.579587266862504]},{\"name\":\"百色市\",\"coord\":[106.69546907589859,23.98220841166522]},{\"name\":\"崇左市\",\"coord\":[107.3277087317123,22.49769755349952]},{\"name\":\"防城港市\",\"coord\":[107.88939931155171,21.94550204069006]},{\"name\":\"南宁市\",\"coord\":[108.67078983716917,23.12207641861882]},{\"name\":\"钦州市\",\"coord\":[108.8532307305186,22.157690108421384]},{\"name\":\"玉林市\",\"coord\":[110.26918466489103,22.391823643610415]},{\"name\":\"湛江市\",\"coord\":[109.93033457863683,21.086751055633457]},{\"name\":\"茂名市\",\"coord\":[110.80336192333934,22.069184739040775]},{\"name\":\"阳江市\",\"coord\":[111.70471342186183,22.108751366417575]},{\"name\":\"江门市\",\"coord\":[112.53715618649149,22.297368082806777]},{\"name\":\"广州市\",\"coord\":[113.4949302208309,23.28359314707863]},{\"name\":\"清远市\",\"coord\":[113.10957368131268,24.334444053233856]},{\"name\":\"肇庆市\",\"coord\":[112.11117530204233,23.60241158796112]},{\"name\":\"梧州市\",\"coord\":[111.01709510772797,23.518132876753846]},{\"name\":\"贺州市\",\"coord\":[111.50423061842756,24.4095096817199]},{\"name\":\"桂林市\",\"coord\":[110.44046163393094,25.353966673735407]},{\"name\":\"柳州市\",\"coord\":[109.34854449214147,24.972408051485047]},{\"name\":\"河池市\",\"coord\":[107.81191841865586,24.649291651298164]},{\"name\":\"黔东南苗族侗族自\",\"coord\":[108.39952601614591,26.429286420465576]},{\"name\":\"贵阳市\",\"coord\":[106.59784062851153,26.797907456479816]},{\"name\":\"安顺市\",\"coord\":[105.76161265300635,25.988644902171018]},{\"name\":\"黔西南布依族苗族\",\"coord\":[105.5954078788574,25.404850939549405]},{\"name\":\"曲靖市\",\"coord\":[103.9164335632742,25.697243690315265]},{\"name\":\"六盘水市\",\"coord\":[104.77723228072432,26.15402255629164]},{\"name\":\"毕节地区\",\"coord\":[105.03867422931839,27.077913968069666]},{\"name\":\"昭通市\",\"coord\":[104.29730513046874,27.62418247971078]},{\"name\":\"宜宾市\",\"coord\":[104.76748901448207,28.553501804266475]},{\"name\":\"乐山市\",\"coord\":[103.56027669102787,29.160754519210577]},{\"name\":\"自贡市\",\"coord\":[104.63272827056402,29.273152614922402]},{\"name\":\"内江市\",\"coord\":[104.82644562304716,29.61272653799929]},{\"name\":\"遵义市\",\"coord\":[106.82413636302059,28.191847588570702]},{\"name\":\"达州市\",\"coord\":[107.59704170009518,31.32138258839703]},{\"name\":\"遂宁市\",\"coord\":[105.48979445433736,30.677687821242678]},{\"name\":\"广安市\",\"coord\":[106.56708164098042,30.43500706741521]},{\"name\":\"泸州市\",\"coord\":[105.42591761727707,28.50277238478137]},{\"name\":\"资阳市\",\"coord\":[104.97995126874034,30.154251886139654]},{\"name\":\"雅安市\",\"coord\":[102.69931299964517,29.892630706195035]},{\"name\":\"眉山市\",\"coord\":[104.07052881858888,29.894202166560405]},{\"name\":\"甘孜藏族自治州\",\"coord\":[100.50721042614238,30.975216556269658]},{\"name\":\"果洛藏族自治州\",\"coord\":[99.30775565051923,34.03539865224808]},{\"name\":\"海南藏族自治州\",\"coord\":[100.39969108016373,35.90048272566899]},{\"name\":\"黄南藏族自治州\",\"coord\":[101.5360706381689,35.10286360841902]},{\"name\":\"赣南藏族自治州\",\"coord\":[102.97083885806067,34.326752803339026]},{\"name\":\"陇南市\",\"coord\":[105.24780098912132,33.57031117443431]},{\"name\":\"天水市\",\"coord\":[105.53503634660417,34.62320421368087]},{\"name\":\"定西市\",\"coord\":[104.58787768541339,35.08900966621695]},{\"name\":\"临夏回族自治州\",\"coord\":[103.2612870434902,35.591577124455235]},{\"name\":\"西宁市\",\"coord\":[101.57680657999033,36.84800271717157]},{\"name\":\"海东地区\",\"coord\":[102.30909850729282,36.287400615025646]},{\"name\":\"海北藏族自治州\",\"coord\":[100.27122484450717,37.892557516083826]},{\"name\":\"金昌市\",\"coord\":[102.02244049169511,38.497330414886164]},{\"name\":\"酒泉市\",\"coord\":[95.94486678270127,40.56891536586272]},{\"name\":\"海西蒙古族藏族自\",\"coord\":[94.67143298050689,36.022725148503724]},{\"name\":\"巴音郭楞蒙古自治\",\"coord\":[88.18116214759745,39.556478810319916]},{\"name\":\"哈密地区\",\"coord\":[93.84302392518026,42.95015211178875]},{\"name\":\"叶鲁番地区\",\"coord\":[89.82035217277885,42.399368632283505]},{\"name\":\"乌鲁木齐市\",\"coord\":[88.00048109561487,43.549986370786]},{\"name\":\"阿勒泰地区\",\"coord\":[88.11213933257655,47.05593413019629]},{\"name\":\"博尔塔拉蒙古自治\",\"coord\":[82.26402238163408,44.671135542630864]},{\"name\":\"伊犁哈萨克自治州\",\"coord\":[82.80778717477179,43.53783381365267]},{\"name\":\"阿拉善盟\",\"coord\":[103.29923966842289,40.10955801781495]},{\"name\":\"武威市\",\"coord\":[102.73362058791429,37.94211141321436]},{\"name\":\"兰州市\",\"coord\":[103.73793563506032,36.27379827886003]},{\"name\":\"中卫市\",\"coord\":[105.6943786030716,37.20654236148948]},{\"name\":\"银川市\",\"coord\":[106.20022174140034,38.52103167597483]},{\"name\":\"石嘴山市\",\"coord\":[106.41544011793628,38.84054137571417]},{\"name\":\"乌海市\",\"coord\":[106.8984175998405,39.54616572239788]},{\"name\":\"鄂尔多斯市\",\"coord\":[108.43285571424619,39.24036799350715]},{\"name\":\"巴彦淖尔市\",\"coord\":[107.45840392808307,41.30159860424196]},{\"name\":\"包头市\",\"coord\":[110.46472193224272,41.48017783644221]},{\"name\":\"呼和浩特市\",\"coord\":[111.48365173603975,40.498363056149884]},{\"name\":\"乌兰察布市\",\"coord\":[112.61568977597707,41.75789561273154]},{\"name\":\"大同市\",\"coord\":[113.7107192749083,39.898956799744184]},{\"name\":\"朔州市\",\"coord\":[112.65428748167508,39.681772914701924]},{\"name\":\"忻州市\",\"coord\":[112.36127575589583,38.88990233614568]},{\"name\":\"榆林市\",\"coord\":[109.68473112169593,38.19921027134876]},{\"name\":\"延安市\",\"coord\":[109.52425222161318,36.406522726136814]},{\"name\":\"庆阳市\",\"coord\":[107.73052193155061,36.183821532624464]},{\"name\":\"固原市\",\"coord\":[106.20191575442442,36.11634909496382]},{\"name\":\"白银市\",\"coord\":[104.68634478137065,36.51582865625868]},{\"name\":\"宝鸡市\",\"coord\":[107.33534779230747,34.3387216485855]},{\"name\":\"汉中市\",\"coord\":[107.03534754266246,33.00142998064871]},{\"name\":\"广元市\",\"coord\":[105.92928137563939,32.21872447205537]},{\"name\":\"巴中市\",\"coord\":[107.03422410306194,31.99874720836291]},{\"name\":\"南充市\",\"coord\":[106.32964805032347,31.156657700184095]},{\"name\":\"绵阳市\",\"coord\":[104.58949560201106,31.88628780630976]},{\"name\":\"德阳市\",\"coord\":[104.41542984932845,31.110558133718676]},{\"name\":\"成都市\",\"coord\":[103.8852290010473,30.777258040348634]},{\"name\":\"阿坝藏族羌族自治\",\"coord\":[102.26209319552814,32.45725845387284]},{\"name\":\"安康市\",\"coord\":[109.14236501848015,32.77467694678074]},{\"name\":\"十堰市\",\"coord\":[110.39934083416314,32.376209039347906]},{\"name\":\"襄阳市\",\"coord\":[111.97539147094662,31.93399822417465]},{\"name\":\"宜昌市\",\"coord\":[111.22204852395754,30.772457669035354]},{\"name\":\"恩施市\",\"coord\":[109.42158366502872,30.260366574390105]},{\"name\":\"张家界市\",\"coord\":[110.59760006538717,29.330107409240718]},{\"name\":\"吉首市\",\"coord\":[109.72176899848378,28.681903937242495]},{\"name\":\"铜仁地区\",\"coord\":[108.54247523485463,28.11736237519646]},{\"name\":\"重庆市\",\"coord\":[107.86007108564992,30.186253395053196]},{\"name\":\"怀化市\",\"coord\":[109.94325166787243,27.43919084801186]},{\"name\":\"益阳市\",\"coord\":[112.43060358108062,28.75127294553697]},{\"name\":\"娄底市\",\"coord\":[111.41891416951897,27.696312460064604]},{\"name\":\"常德市\",\"coord\":[111.72571610131646,29.27189463838195]},{\"name\":\"荆州市\",\"coord\":[112.65896596965268,30.05161542755362]},{\"name\":\"荆门市\",\"coord\":[112.6586855902184,31.01267124474617]},{\"name\":\"岳阳市\",\"coord\":[113.2595036144316,29.106247116930163]},{\"name\":\"长沙市\",\"coord\":[113.15415586456598,28.222934680488425]},{\"name\":\"湘潭市\",\"coord\":[112.51092596317824,27.69881544105668]},{\"name\":\"株州市\",\"coord\":[113.49665538546823,27.03993794610501]},{\"name\":\"衡阳市\",\"coord\":[112.48849636578527,26.783613569970782]},{\"name\":\"邵阳市\",\"coord\":[110.6723832117475,26.81652287086792]},{\"name\":\"永州市\",\"coord\":[111.8565364154186,25.768488267811968]},{\"name\":\"韶关市\",\"coord\":[113.53420325850979,24.69848878771937]},{\"name\":\"惠州市\",\"coord\":[114.32029589634925,23.25504544231892]},{\"name\":\"佛山市\",\"coord\":[112.95925897403649,23.10116677189257]},{\"name\":\"云浮市\",\"coord\":[111.78042514904234,22.840400494105687]},{\"name\":\"深圳市\",\"coord\":[114.13138648919008,22.649563063468342]},{\"name\":\"汕尾市\",\"coord\":[115.57412892884373,23.06989642104901]},{\"name\":\"河源市\",\"coord\":[114.89746229844398,23.97971937124767]},{\"name\":\"揭阳市\",\"coord\":[116.04290004239446,23.304802704715357]},{\"name\":\"汕头市\",\"coord\":[116.7008461897183,23.35898625947344]},{\"name\":\"潮州市\",\"coord\":[116.75405548481658,23.854381508863064]},{\"name\":\"梅州市\",\"coord\":[116.13719397345734,24.15633544812716]},{\"name\":\"漳州市\",\"coord\":[117.38279760543345,24.41111215459575]},{\"name\":\"厦门市\",\"coord\":[118.04275971554665,24.675908246507944]},{\"name\":\"龙岩市\",\"coord\":[116.69341144552507,25.20284542644492]},{\"name\":\"泉州市\",\"coord\":[118.12035864630246,25.22984144365049]},{\"name\":\"莆田市\",\"coord\":[118.82439690138142,25.439653480972687]},{\"name\":\"福州市\",\"coord\":[119.1608285845262,25.99117532466728]},{\"name\":\"三明市\",\"coord\":[117.51188176216434,26.318292906961602]},{\"name\":\"南平市\",\"coord\":[118.16153136678187,27.306303151805437]},{\"name\":\"抚州市\",\"coord\":[116.3455359885574,27.487043655935366]},{\"name\":\"鹰潭市\",\"coord\":[117.01082360702333,28.241253742969946]},{\"name\":\"吉安市\",\"coord\":[114.91377151807418,26.957486660664525]},{\"name\":\"赣州市\",\"coord\":[115.046455717572,25.81565075681663]},{\"name\":\"郴州市\",\"coord\":[113.1544526703492,25.871927095452524]},{\"name\":\"新余市\",\"coord\":[114.94161795877827,27.79044654578371]},{\"name\":\"宜春市\",\"coord\":[115.04574494880995,28.306428044943356]},{\"name\":\"南昌市\",\"coord\":[115.9963824234495,28.664803351584705]},{\"name\":\"九江市\",\"coord\":[115.53225905704193,29.362905920276297]},{\"name\":\"上饶市\",\"coord\":[117.8595355766598,28.765755150094634]},{\"name\":\"景德镇市\",\"coord\":[117.25387030721845,29.33426823662448]},{\"name\":\"黄山市\",\"coord\":[117.85476357809696,29.969632034273722]},{\"name\":\"池州市\",\"coord\":[117.34517113140791,30.208089337922335]},{\"name\":\"铜陵市\",\"coord\":[117.93160431300694,30.926442655001676]},{\"name\":\"安庆市\",\"coord\":[116.54307680610799,30.524265461641296]},{\"name\":\"黄石市\",\"coord\":[115.02354597728443,29.924060229331015]},{\"name\":\"咸宁市\",\"coord\":[114.26967602231792,29.652174021136048]},{\"name\":\"黄冈市\",\"coord\":[115.2859016705373,30.65856897065683]},{\"name\":\"武汉市\",\"coord\":[114.34552076948799,30.68836237966767]},{\"name\":\"随州市\",\"coord\":[113.3850627838818,31.87891659924412]},{\"name\":\"信阳市\",\"coord\":[114.81374730587638,32.0309685135914]},{\"name\":\"驻马店市\",\"coord\":[114.07756451509235,32.896720987266114]},{\"name\":\"商洛市\",\"coord\":[109.82044421310393,33.77403373563189]},{\"name\":\"西安市\",\"coord\":[109.11839808451401,34.225257215515896]},{\"name\":\"渭南市\",\"coord\":[109.75732444226935,35.025913644359306]},{\"name\":\"铜川市\",\"coord\":[108.98695328111377,35.19235092947735]},{\"name\":\"咸阳市\",\"coord\":[108.36398776446165,34.84311348287181]},{\"name\":\"三门峡市\",\"coord\":[110.80049688104964,34.31818709571671]},{\"name\":\"运城市\",\"coord\":[111.1736679525165,35.19010372283576]},{\"name\":\"洛阳市\",\"coord\":[111.87577573098216,34.33379926109848]},{\"name\":\"平顶山市\",\"coord\":[112.80931281928427,33.759895800153096]},{\"name\":\"漯河市\",\"coord\":[113.83505724178012,33.70034266174508]},{\"name\":\"许昌市\",\"coord\":[113.78762484088509,34.051835688452435]},{\"name\":\"郑州市\",\"coord\":[113.49619951867594,34.61181797865449]},{\"name\":\"焦作市\",\"coord\":[113.13404280173008,35.134167097471625]},{\"name\":\"晋城市\",\"coord\":[112.7495732073233,35.63186423091449]},{\"name\":\"长治市\",\"coord\":[112.85900842873183,36.45872910742828]},{\"name\":\"临汾市\",\"coord\":[111.49379787924448,36.22810800777857]},{\"name\":\"太原市\",\"coord\":[112.15628804033796,37.91704444063036]},{\"name\":\"吕梁市\",\"coord\":[111.31901105774872,37.712740463356496]},{\"name\":\"晋中市\",\"coord\":[113.08199599739676,37.36532613794343]},{\"name\":\"邯郸市\",\"coord\":[114.41824047234618,36.530119932543315]},{\"name\":\"安阳市\",\"coord\":[113.88883283163116,35.7797611183252]},{\"name\":\"鹤壁市\",\"coord\":[114.3654094911545,35.75770487428472]},{\"name\":\"新乡市\",\"coord\":[113.9184107718167,35.348471214026716]},{\"name\":\"开封市\",\"coord\":[114.52801677500626,34.61371216679872]},{\"name\":\"周口市\",\"coord\":[114.88509782391864,33.69999759722657]},{\"name\":\"阜阳市\",\"coord\":[115.44595951398213,32.98060371610532]},{\"name\":\"淮南市\",\"coord\":[116.68941991880993,32.79972275772595]},{\"name\":\"蚌埠市\",\"coord\":[117.38594715783302,33.106729536033896]},{\"name\":\"淮北市\",\"coord\":[116.69651711889378,33.69527529383458]},{\"name\":\"宿州市\",\"coord\":[117.30175405886838,33.943330421260015]},{\"name\":\"亳州市\",\"coord\":[116.12410804185097,33.46769392946132]},{\"name\":\"商丘市\",\"coord\":[115.59575176872548,34.28339840831147]},{\"name\":\"菏泽市\",\"coord\":[115.53631974831816,35.197319393220624]},{\"name\":\"濮阳市\",\"coord\":[115.3070485514902,35.775883510964334]},{\"name\":\"聊城市\",\"coord\":[115.8870069012884,36.40529594548765]},{\"name\":\"邢台市\",\"coord\":[114.74259008644859,37.251396750084155]},{\"name\":\"石家庄市\",\"coord\":[114.56923838363613,38.13141710980106]},{\"name\":\"阳泉市\",\"coord\":[113.39216149668508,38.09075470547468]},{\"name\":\"保定市\",\"coord\":[115.261524468934,39.09118520781398]},{\"name\":\"衡水市\",\"coord\":[115.8182936677897,37.715661598187154]},{\"name\":\"德州市\",\"coord\":[116.4582273790399,37.19372347888644]},{\"name\":\"沧州市\",\"coord\":[116.76192710911863,38.20240042039232]},{\"name\":\"廊坊市\",\"coord\":[116.50410772133856,39.27896741763884]},{\"name\":\"天津市\",\"coord\":[117.31988934444873,39.37154482470619]},{\"name\":\"北京市\",\"coord\":[116.59734730757869,40.237112944270976]},{\"name\":\"张家口市\",\"coord\":[115.1823606483226,40.83732566607167]},{\"name\":\"唐山市\",\"coord\":[117.8693184261954,39.71862889477249]},{\"name\":\"秦皇岛市\",\"coord\":[119.30467355367742,39.990574652162564]},{\"name\":\"承德市\",\"coord\":[117.16275671911026,41.36623845548547]},{\"name\":\"葫芦岛市\",\"coord\":[119.9342336210531,40.5628822626519]},{\"name\":\"朝阳市\",\"coord\":[120.11853493535794,41.471852354885755]},{\"name\":\"赤峰市\",\"coord\":[118.50943546234379,43.25452976059767]},{\"name\":\"锦州市\",\"coord\":[121.5167549323861,41.45933087433065]},{\"name\":\"营口市\",\"coord\":[122.58571915054674,40.42093503997384]},{\"name\":\"丹东市\",\"coord\":[124.33549382902183,40.46369290272115]},{\"name\":\"辽阳市\",\"coord\":[123.34064798039414,41.152331397771356]},{\"name\":\"盘锦市\",\"coord\":[122.06718005354679,41.05573599862555]},{\"name\":\"阜新市\",\"coord\":[121.93889757908204,42.27641773244204]},{\"name\":\"鞍山市\",\"coord\":[122.78904432242356,40.77781183142038]},{\"name\":\"沈阳市\",\"coord\":[122.99508899709724,42.1162195010079]},{\"name\":\"铁岭市\",\"coord\":[124.23100515588399,42.72666083611828]},{\"name\":\"扶顺市\",\"coord\":[124.46027188217573,41.82955407638859]},{\"name\":\"通辽市\",\"coord\":[122.0729370657937,43.90889130864869]},{\"name\":\"兴安盟\",\"coord\":[120.79456431092532,45.92003249442161]},{\"name\":\"白城市\",\"coord\":[123.10619907715235,45.25475749267784]},{\"name\":\"齐齐哈尔市\",\"coord\":[124.5462214659102,47.55395009317394]},{\"name\":\"大兴安岭地区\",\"coord\":[124.50992855161529,52.18438447846694]},{\"name\":\"黑河市\",\"coord\":[127.14721400335922,49.25080134026901]},{\"name\":\"大庆市\",\"coord\":[124.40329830095243,46.401048760966745]},{\"name\":\"绥化市\",\"coord\":[126.5214484055605,46.76992452194825]},{\"name\":\"松原市\",\"coord\":[124.21244334807682,44.75779381338502]},{\"name\":\"四平市\",\"coord\":[124.27839350328821,43.52139065090318]},{\"name\":\"通化市\",\"coord\":[125.67392830706305,41.91771808663852]},{\"name\":\"辽源市\",\"coord\":[125.33529527643432,42.758340204944986]},{\"name\":\"吉林市\",\"coord\":[126.83350281902375,43.60730120049175]},{\"name\":\"长春市\",\"coord\":[125.53597875970374,44.24624314701737]},{\"name\":\"白山市\",\"coord\":[127.16780160322108,42.093893880305075]},{\"name\":\"哈尔滨市\",\"coord\":[127.39125008786029,45.36200668820575]},{\"name\":\"鹤岗市\",\"coord\":[130.4703811258197,47.66520688940109]},{\"name\":\"伊春市\",\"coord\":[128.91240831703635,47.93833794565277]},{\"name\":\"七台河市\",\"coord\":[131.2677920224311,45.945099776108584]},{\"name\":\"鸡西市\",\"coord\":[132.38059153660274,45.722934218318535]},{\"name\":\"双鸭山市\",\"coord\":[132.3184817002743,46.65813679030265]},{\"name\":\"佳木斯市\",\"coord\":[132.26174446608726,47.17569713691394]},{\"name\":\"呼伦贝尔市\",\"coord\":[122.3210739998419,50.18176996070858]},{\"name\":\"孝感市\",\"coord\":[113.83749892135485,31.11757234692128]},{\"name\":\"贵港市\",\"coord\":[110.07354588052804,23.380735604767374]},{\"name\":\"黔南布依族苗族自\",\"coord\":[107.30931767543106,26.2976919432269]},{\"name\":\"宁德市\",\"coord\":[119.52482556634342,27.013151692716413]},{\"name\":\"温州市\",\"coord\":[120.30037042732202,27.8699145504001]},{\"name\":\"台州市\",\"coord\":[120.88886782713843,28.670799172772313]},{\"name\":\"丽水市\",\"coord\":[119.56796851966463,28.170268394477755]},{\"name\":\"衢州市\",\"coord\":[118.79479802644406,28.865874397158763]},{\"name\":\"金华市\",\"coord\":[119.99381920686633,29.093455548185744]},{\"name\":\"绍兴市\",\"coord\":[120.46546691682343,29.69382513836818]},{\"name\":\"宁波市\",\"coord\":[121.42142987830871,29.70001162878972]},{\"name\":\"杭州市\",\"coord\":[119.4405685790891,29.87218307296989]},{\"name\":\"宣城市\",\"coord\":[118.68748382914703,30.628143499626418]},{\"name\":\"湖州市\",\"coord\":[119.98261306633574,30.7945175862809]},{\"name\":\"嘉兴市\",\"coord\":[120.83889215988998,30.67538495499343]},{\"name\":\"上海市\",\"coord\":[121.37534147322967,31.25628247908459]},{\"name\":\"苏州市\",\"coord\":[120.6906182622391,31.381280695137775]},{\"name\":\"无锡市\",\"coord\":[120.32182300914366,31.54113306724517]},{\"name\":\"常州市\",\"coord\":[119.61953292830165,31.611878565375576]},{\"name\":\"南京市\",\"coord\":[118.71890548838064,31.910863187910323]},{\"name\":\"镇江市\",\"coord\":[119.42349332902813,31.97942313430778]},{\"name\":\"合肥市\",\"coord\":[117.30651975617157,31.79407863049138]},{\"name\":\"六安市\",\"coord\":[116.24668220575353,31.820846193819513]},{\"name\":\"滁州市\",\"coord\":[117.88422385307969,32.51792621904418]},{\"name\":\"泰州市\",\"coord\":[120.03124303305091,32.56503102346783]},{\"name\":\"南通市\",\"coord\":[120.85599446760912,32.18496706099728]},{\"name\":\"盐城市\",\"coord\":[120.01812490612667,33.54219948734023]},{\"name\":\"淮安市\",\"coord\":[119.0749424205415,33.39203631772854]},{\"name\":\"宿迁市\",\"coord\":[118.45404943216346,33.666258719120265]},{\"name\":\"徐州市\",\"coord\":[117.77482249295966,34.30847766157078]},{\"name\":\"济宁市\",\"coord\":[116.74147276546373,35.27488504351119]},{\"name\":\"枣庄市\",\"coord\":[117.43359942491492,34.884162021736]},{\"name\":\"连云港市\",\"coord\":[119.01553213785074,34.54316517587849]},{\"name\":\"临沂市\",\"coord\":[118.31478835349617,35.28173079028279]},{\"name\":\"日照市\",\"coord\":[119.14265350444272,35.54479073199592]},{\"name\":\"青岛市\",\"coord\":[120.27779044405756,36.3464117375903]},{\"name\":\"威海市\",\"coord\":[122.12963327195605,37.13879077904251]},{\"name\":\"烟台市\",\"coord\":[120.7689567423966,37.19772002195597]},{\"name\":\"潍坊市\",\"coord\":[119.02178548592039,36.49292234053931]},{\"name\":\"淄博市\",\"coord\":[117.92936024367185,36.60871347163638]},{\"name\":\"泰安市\",\"coord\":[116.93810893944303,36.0423330118612]},{\"name\":\"济南市\",\"coord\":[117.34560282551296,36.769574973846304]},{\"name\":\"东营市\",\"coord\":[118.4915054457184,37.52194690335787]},{\"name\":\"滨州市\",\"coord\":[117.67610299757533,37.4439597758601]},{\"name\":\"昆明市\",\"coord\":[102.93100245594789,25.481300763922075]},{\"name\":\"玉溪市\",\"coord\":[102.23080854291823,24.156168324611663]},{\"name\":\"塔城地区\",\"coord\":[83.60908162840168,45.3721852373893]},{\"name\":\"张掖市\",\"coord\":[100.47710030600572,38.704239320458385]},{\"name\":\"南阳市\",\"coord\":[112.1400670951149,33.03033276715801]},{\"name\":\"扬州市\",\"coord\":[119.48949608990988,32.80956776339646]},{\"name\":\"延边朝鲜族自治州\",\"coord\":[129.3577692895626,43.24968794080283]},{\"name\":\"牡丹江市\",\"coord\":[129.87240796405672,44.7073040108322]},{\"name\":\"澳门\",\"coord\":[113.56289691515346,22.14602596262204]},{\"name\":\"吴忠市\",\"coord\":[106.76894508116403,37.72566765880316]},{\"name\":\"来宾市\",\"coord\":[109.25592217010114,23.86346274681084]},{\"name\":\"平凉市\",\"coord\":[107.0708132782897,35.30329631658711]},{\"name\":\"马鞍山市\",\"coord\":[118.27245878467022,31.657727937739004]},{\"name\":\"芜湖市\",\"coord\":[118.32992684415504,31.081688223101658]},{\"name\":\"澄迈县\",\"coord\":[110.04198076060266,19.694955078668105]},{\"name\":\"保亭黎族苗族自治\",\"coord\":[109.6055304964257,18.6101488675304]},{\"name\":\"乐东黎族自治县\",\"coord\":[109.04051999525574,18.643137437909203]},{\"name\":\"儋州市\",\"coord\":[109.3431358337404,19.550974957403195]},{\"name\":\"定安县\",\"coord\":[110.38744429685676,19.47557074114284]},{\"name\":\"屯昌县\",\"coord\":[110.00574767630334,19.367175093044388]},{\"name\":\"白沙黎族自治县\",\"coord\":[109.36860737761768,19.214416393082217]},{\"name\":\"琼中黎族苗族自治\",\"coord\":[109.86691465937548,19.073671135862682]},{\"name\":\"东方市\",\"coord\":[108.86903802405428,19.017352815445214]},{\"name\":\"昌江黎族自治县\",\"coord\":[108.9686431884767,19.182594167127824]},{\"name\":\"海口市\",\"coord\":[110.420654296875,19.806565564640795]},{\"name\":\"济源市\",\"coord\":[112.38051465474433,35.07958362422394]},{\"name\":\"五指山市\",\"coord\":[109.53595187364496,18.832908264613966]},{\"name\":\"大连市\",\"coord\":[121.96662235866603,39.444150542439914]},{\"name\":\"文昌市三沙市\",\"coord\":[110.81828537536748,19.756501444162936]},{\"name\":\"三亚市\",\"coord\":[109.38424600793707,18.39186315877128]},{\"name\":\"万宁市\",\"coord\":[110.28485046979574,18.860240588635115]},{\"name\":\"陵水黎族自治县\",\"coord\":[109.95577603229562,18.594712684620465]},{\"name\":\"临高县\",\"coord\":[109.71915395436967,19.79420403032508]},{\"name\":\"琼海市\",\"coord\":[110.41650700703043,19.22315873149372]}]");
  88566. ;// CONCATENATED MODULE: ./src/openlayers/mapping/webmap/config/SampleDataInfo.json
  88567. var SampleDataInfo_namespaceObject = JSON.parse("[{\"id\":\"SalesJan2009\",\"fileName\":\"SalesJan2009\",\"xField\":\"Longitude\",\"yField\":\"Latitude\",\"type\":\"POINT\"},{\"id\":\"Sacramentorealestatetransactions\",\"fileName\":\"Ealestate transactions\",\"xField\":\"longitude\",\"yField\":\"latitude\",\"type\":\"POINT\"},{\"id\":\"BeijingResidentialDistrict\",\"fileName\":\"北京市住宅小区\",\"xField\":\"SmX\",\"yField\":\"SmY\",\"type\":\"POINT\"},{\"id\":\"GlobalRecordOfOver7Earthquakes\",\"fileName\":\"全球历史7级以上地震记录\",\"xField\":\"经度\",\"yField\":\"纬度\",\"type\":\"POINT\"},{\"id\":\"ChinaRecordOfOver6Earthquakes\",\"fileName\":\"中国历史6级以上地震记录\",\"xField\":\"经度\",\"yField\":\"纬度\",\"type\":\"POINT\"},{\"id\":\"ChinaMeteorologicalObservationStation\",\"fileName\":\"中国气象观测站\",\"xField\":\"经度\",\"yField\":\"纬度\",\"type\":\"POINT\"},{\"id\":\"BeijingSubwayLine\",\"fileName\":\"北京市地铁交通线路\",\"type\":\"LINE\"},{\"id\":\"ChinaEarthquakeIntensityZone\",\"fileName\":\"中国地震烈度区划面\",\"type\":\"POLYGON\"}]");
  88568. ;// CONCATENATED MODULE: external "ol.View"
  88569. var external_ol_View_namespaceObject = ol.View;
  88570. var external_ol_View_default = /*#__PURE__*/__webpack_require__.n(external_ol_View_namespaceObject);
  88571. ;// CONCATENATED MODULE: external "ol.proj.proj4"
  88572. var external_ol_proj_proj4_namespaceObject = ol.proj.proj4;
  88573. ;// CONCATENATED MODULE: external "ol.proj.Units"
  88574. var external_ol_proj_Units_namespaceObject = ol.proj.Units;
  88575. var external_ol_proj_Units_default = /*#__PURE__*/__webpack_require__.n(external_ol_proj_Units_namespaceObject);
  88576. ;// CONCATENATED MODULE: external "ol.layer"
  88577. var external_ol_layer_namespaceObject = ol.layer;
  88578. ;// CONCATENATED MODULE: external "ol.format.WMTSCapabilities"
  88579. var external_ol_format_WMTSCapabilities_namespaceObject = ol.format.WMTSCapabilities;
  88580. var external_ol_format_WMTSCapabilities_default = /*#__PURE__*/__webpack_require__.n(external_ol_format_WMTSCapabilities_namespaceObject);
  88581. ;// CONCATENATED MODULE: external "ol.geom"
  88582. var external_ol_geom_namespaceObject = ol.geom;
  88583. ;// CONCATENATED MODULE: external "ol.source"
  88584. var external_ol_source_namespaceObject = ol.source;
  88585. ;// CONCATENATED MODULE: external "ol.render.Feature"
  88586. var external_ol_render_Feature_namespaceObject = ol.render.Feature;
  88587. var external_ol_render_Feature_default = /*#__PURE__*/__webpack_require__.n(external_ol_render_Feature_namespaceObject);
  88588. ;// CONCATENATED MODULE: external "ol.Collection"
  88589. var external_ol_Collection_namespaceObject = ol.Collection;
  88590. var external_ol_Collection_default = /*#__PURE__*/__webpack_require__.n(external_ol_Collection_namespaceObject);
  88591. ;// CONCATENATED MODULE: ./src/openlayers/mapping/WebMap.js
  88592. function WebMap_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { WebMap_typeof = function _typeof(obj) { return typeof obj; }; } else { WebMap_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return WebMap_typeof(obj); }
  88593. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || WebMap_unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  88594. 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."); }
  88595. function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; }
  88596. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  88597. function WebMap_toConsumableArray(arr) { return WebMap_arrayWithoutHoles(arr) || WebMap_iterableToArray(arr) || WebMap_unsupportedIterableToArray(arr) || WebMap_nonIterableSpread(); }
  88598. function WebMap_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."); }
  88599. function WebMap_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return WebMap_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 WebMap_arrayLikeToArray(o, minLen); }
  88600. function WebMap_iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
  88601. function WebMap_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return WebMap_arrayLikeToArray(arr); }
  88602. function WebMap_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; }
  88603. 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); } }
  88604. 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); }); }; }
  88605. function WebMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88606. function WebMap_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  88607. function WebMap_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebMap_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebMap_defineProperties(Constructor, staticProps); return Constructor; }
  88608. function WebMap_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) WebMap_setPrototypeOf(subClass, superClass); }
  88609. function WebMap_setPrototypeOf(o, p) { WebMap_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebMap_setPrototypeOf(o, p); }
  88610. function WebMap_createSuper(Derived) { var hasNativeReflectConstruct = WebMap_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WebMap_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WebMap_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WebMap_possibleConstructorReturn(this, result); }; }
  88611. function WebMap_possibleConstructorReturn(self, call) { if (call && (WebMap_typeof(call) === "object" || typeof call === "function")) { return call; } return WebMap_assertThisInitialized(self); }
  88612. function WebMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  88613. function WebMap_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  88614. function WebMap_getPrototypeOf(o) { WebMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebMap_getPrototypeOf(o); }
  88615. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  88616. * This program are made available under the terms of the Apache License, Version 2.0
  88617. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88618. // eslint-disable-line import/extensions
  88619. // eslint-disable-line import/extensions
  88620. // eslint-disable-line import/extensions
  88621. window.proj4 = lib;
  88622. window.Proj4js = lib; //数据转换工具
  88623. var transformTools = new (external_ol_format_GeoJSON_default())(); // 迁徙图最大支持要素数量
  88624. var MAX_MIGRATION_ANIMATION_COUNT = 1000; //不同坐标系单位。计算公式中的值
  88625. var metersPerUnit = {
  88626. DEGREES: 2 * Math.PI * 6370997 / 360,
  88627. DEGREE: 2 * Math.PI * 6370997 / 360,
  88628. FEET: 0.3048,
  88629. METERS: 1,
  88630. METER: 1,
  88631. M: 1,
  88632. USFEET: 1200 / 3937
  88633. };
  88634. var dpiConfig = {
  88635. "default": 96,
  88636. // 常用dpi
  88637. iServerWMTS: 90.7142857142857 // iserver使用的wmts图层dpi
  88638. };
  88639. /**
  88640. * @class ol.supermap.WebMap
  88641. * @category iPortal/Online
  88642. * @classdesc 对接 iPortal/Online 地图类
  88643. * @param {Object} options - 参数
  88644. * @param {string} [options.target='map'] - 地图容器id
  88645. * @param {Object | string} [options.webMap] - webMap对象,或者是获取webMap的url地址。存在webMap,优先使用webMap, id的选项则会被忽略
  88646. * @param {number} [options.id] - 地图的id
  88647. * @param {string} [options.server="https://www.supermapol.com"] - 地图的地址,如果使用传入id,server则会和id拼接成webMap请求地址
  88648. * @param {function} [options.successCallback] - 成功加载地图后调用的函数
  88649. * @param {function} [options.errorCallback] - 加载地图失败调用的函数
  88650. * @param {string} [options.credentialKey] - 凭证密钥。例如为"key"、"token",或者用户自定义的密钥。用户申请了密钥,此参数必填
  88651. * @param {string} [options.credentialValue] - 凭证密钥对应的值,credentialKey和credentialValue必须一起使用
  88652. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
  88653. * @param {boolean} [options.excludePortalProxyUrl] - server传递过来的url是否带有代理
  88654. * @param {Object} [options.serviceProxy] - iportal内置代理信息, 仅矢量瓦片图层上图才会使用
  88655. * @param {string} [options.tiandituKey] - 天地图的key
  88656. * @param {string} [options.proxy] - 代理地址,当域名不一致,请求会加上代理。避免跨域
  88657. * @param {string} [options.tileFormat] - 地图瓦片出图格式,png/webp
  88658. * @param {function} [options.mapSetting.mapClickCallback] - 地图被点击的回调函数
  88659. * @param {function} [options.mapSetting.overlays] - 地图的overlayer
  88660. * @param {function} [options.mapSetting.controls] - 地图的控件
  88661. * @param {function} [options.mapSetting.interactions] - 地图控制的参数
  88662. * @extends {ol/Observable}
  88663. */
  88664. var WebMap = /*#__PURE__*/function (_Observable) {
  88665. WebMap_inherits(WebMap, _Observable);
  88666. var _super = WebMap_createSuper(WebMap);
  88667. function WebMap(id, options) {
  88668. var _this2;
  88669. WebMap_classCallCheck(this, WebMap);
  88670. _this2 = _super.call(this);
  88671. if (core_Util_Util.isObject(id)) {
  88672. options = id;
  88673. _this2.mapId = options.id;
  88674. } else {
  88675. _this2.mapId = id;
  88676. }
  88677. options = options || {};
  88678. _this2.server = options.server;
  88679. _this2.successCallback = options.successCallback;
  88680. _this2.errorCallback = options.errorCallback;
  88681. _this2.credentialKey = options.credentialKey;
  88682. _this2.credentialValue = options.credentialValue;
  88683. _this2.withCredentials = options.withCredentials || false;
  88684. _this2.target = options.target || "map";
  88685. _this2.excludePortalProxyUrl = options.excludePortalProxyUrl || false;
  88686. _this2.serviceProxy = options.serviceProxy || null;
  88687. _this2.tiandituKey = options.tiandituKey;
  88688. _this2.proxy = options.proxy; //计数叠加图层,处理过的数量(成功和失败都会计数)
  88689. _this2.layerAdded = 0;
  88690. _this2.layers = [];
  88691. _this2.events = new Events(WebMap_assertThisInitialized(_this2), null, ["updateDataflowFeature"], true);
  88692. _this2.webMap = options.webMap;
  88693. _this2.tileFormat = options.tileFormat && options.tileFormat.toLowerCase();
  88694. _this2.createMap(options.mapSetting);
  88695. if (_this2.webMap) {
  88696. // webmap有可能是url地址,有可能是webmap对象
  88697. core_Util_Util.isString(_this2.webMap) ? _this2.createWebmap(_this2.webMap) : _this2.getMapInfoSuccess(options.webMap);
  88698. } else {
  88699. if (!_this2.server) {
  88700. _this2.server = 'https://www.supermapol.com';
  88701. }
  88702. _this2.createWebmap();
  88703. }
  88704. return _this2;
  88705. }
  88706. /**
  88707. * @private
  88708. * @function ol.supermap.WebMap.prototype._removeBaseLayer
  88709. * @description 移除底图
  88710. */
  88711. WebMap_createClass(WebMap, [{
  88712. key: "_removeBaseLayer",
  88713. value: function _removeBaseLayer() {
  88714. var map = this.map;
  88715. var _this$baseLayer = this.baseLayer,
  88716. layer = _this$baseLayer.layer,
  88717. labelLayer = _this$baseLayer.labelLayer; // 移除天地图标签图层
  88718. labelLayer && map.removeLayer(labelLayer); // 移除图层
  88719. layer && map.removeLayer(layer);
  88720. this.baseLayer = null;
  88721. }
  88722. /**
  88723. * @private
  88724. * @function ol.supermap.WebMap.prototype._removeLayers
  88725. * @description 移除叠加图层
  88726. */
  88727. }, {
  88728. key: "_removeLayers",
  88729. value: function _removeLayers() {
  88730. var map = this.map;
  88731. this.layers.forEach(function (_ref) {
  88732. var layerType = _ref.layerType,
  88733. layer = _ref.layer,
  88734. labelLayer = _ref.labelLayer,
  88735. pathLayer = _ref.pathLayer,
  88736. dataflowService = _ref.dataflowService;
  88737. if (!layer) {
  88738. return;
  88739. }
  88740. if (layerType === 'MIGRATION') {
  88741. layer.remove();
  88742. return;
  88743. }
  88744. if (layerType === 'DATAFLOW_POINT_TRACK' || layerType === 'DATAFLOW_HEAT') {
  88745. // 移除轨迹图层
  88746. pathLayer && map.removeLayer(pathLayer); // 取消订阅
  88747. dataflowService && dataflowService.unSubscribe();
  88748. } // 移除标签图层
  88749. labelLayer && map.removeLayer(labelLayer); // 移除图层
  88750. map.removeLayer(layer);
  88751. });
  88752. this.layers = [];
  88753. }
  88754. /**
  88755. * @private
  88756. * @function ol.supermap.WebMap.prototype.clear
  88757. * @description 清空地图
  88758. */
  88759. }, {
  88760. key: "_clear",
  88761. value: function _clear() {
  88762. // 比例尺
  88763. this.scales = []; // 分辨率
  88764. this.resolutionArray = []; // 比例尺-分辨率 {scale: resolution}
  88765. this.resolutions = {}; // 计数叠加图层,处理过的数量(成功和失败都会计数)
  88766. this.layerAdded = 0;
  88767. this._removeBaseLayer();
  88768. this._removeLayers();
  88769. }
  88770. /**
  88771. * @function ol.supermap.WebMap.prototype.refresh
  88772. * @version 10.1.0
  88773. * @description 重新渲染地图
  88774. */
  88775. }, {
  88776. key: "refresh",
  88777. value: function refresh() {
  88778. this._clear();
  88779. this.createWebmap();
  88780. }
  88781. /**
  88782. * @private
  88783. * @function ol.supermap.WebMap.prototype.createMap
  88784. * @description 创建地图对象以及注册地图事件
  88785. * @param {object} mapSetting - 关于地图的设置以及需要注册的事件
  88786. */
  88787. }, {
  88788. key: "createMap",
  88789. value: function createMap(mapSetting) {
  88790. var overlays, controls, interactions;
  88791. if (mapSetting) {
  88792. interactions = mapSetting.interactions;
  88793. overlays = mapSetting.overlays;
  88794. controls = mapSetting.controls;
  88795. }
  88796. this.map = new (external_ol_Map_default())({
  88797. interactions: interactions,
  88798. overlays: overlays,
  88799. controls: controls,
  88800. target: this.target
  88801. });
  88802. mapSetting && this.registerMapEvent({
  88803. mapClickCallback: mapSetting.mapClickCallback
  88804. });
  88805. }
  88806. /**
  88807. * @private
  88808. * @function ol.supermap.WebMap.prototype.registerMapEvent
  88809. * @description 注册地图事件
  88810. * @param {object} mapSetting - 关于地图的设置以及需要注册的事件
  88811. */
  88812. }, {
  88813. key: "registerMapEvent",
  88814. value: function registerMapEvent(mapSetting) {
  88815. var map = this.map;
  88816. map.on("click", function (evt) {
  88817. mapSetting.mapClickCallback && mapSetting.mapClickCallback(evt);
  88818. });
  88819. }
  88820. /**
  88821. * @private
  88822. * @function ol.supermap.WebMap.prototype.createWebmap
  88823. * @description 创建webmap
  88824. * @param {string} webMapUrl - 请求webMap的地址
  88825. */
  88826. }, {
  88827. key: "createWebmap",
  88828. value: function createWebmap(webMapUrl) {
  88829. var mapUrl;
  88830. if (webMapUrl) {
  88831. mapUrl = webMapUrl;
  88832. } else {
  88833. var urlArr = this.server.split('');
  88834. if (urlArr[urlArr.length - 1] !== '/') {
  88835. this.server += '/';
  88836. }
  88837. mapUrl = this.server + 'web/maps/' + this.mapId + '/map';
  88838. var filter = 'getUrlResource.json?url=';
  88839. if (this.excludePortalProxyUrl && this.server.indexOf(filter) > -1) {
  88840. //大屏需求,或者有加上代理的
  88841. var urlArray = this.server.split(filter);
  88842. if (urlArray.length > 1) {
  88843. mapUrl = urlArray[0] + filter + this.server + 'web/maps/' + this.mapId + '/map.json';
  88844. }
  88845. }
  88846. }
  88847. this.getMapInfo(mapUrl);
  88848. }
  88849. /**
  88850. * @private
  88851. * @function ol.supermap.WebMap.prototype.getMapInfo
  88852. * @description 获取地图的json信息
  88853. * @param {string} url - 请求地图的url
  88854. */
  88855. }, {
  88856. key: "getMapInfo",
  88857. value: function getMapInfo(url) {
  88858. var that = this,
  88859. mapUrl = url;
  88860. if (url.indexOf('.json') === -1) {
  88861. //传递过来的url,没有包括.json,在这里加上。
  88862. mapUrl = "".concat(url, ".json");
  88863. }
  88864. FetchRequest.get(that.getRequestUrl(mapUrl), null, {
  88865. withCredentials: this.withCredentials
  88866. }).then(function (response) {
  88867. return response.json();
  88868. }).then(function (mapInfo) {
  88869. that.getMapInfoSuccess(mapInfo);
  88870. })["catch"](function (error) {
  88871. that.errorCallback && that.errorCallback(error, 'getMapFaild', that.map);
  88872. });
  88873. }
  88874. /**
  88875. * @private
  88876. * @function ol.supermap.WebMap.prototype.getMapInfoSuccess
  88877. * @description 获取地图的json信息
  88878. * @param {Object} mapInfo - webMap对象
  88879. */
  88880. }, {
  88881. key: "getMapInfoSuccess",
  88882. value: function () {
  88883. var _getMapInfoSuccess = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(mapInfo) {
  88884. var that, handleResult;
  88885. return regenerator_default().wrap(function _callee$(_context) {
  88886. while (1) {
  88887. switch (_context.prev = _context.next) {
  88888. case 0:
  88889. that = this;
  88890. if (!(mapInfo.succeed === false)) {
  88891. _context.next = 4;
  88892. break;
  88893. }
  88894. that.errorCallback && that.errorCallback(mapInfo.error, 'getMapFaild', that.map);
  88895. return _context.abrupt("return");
  88896. case 4:
  88897. _context.next = 6;
  88898. return that.handleCRS(mapInfo.projection, mapInfo.baseLayer.url);
  88899. case 6:
  88900. handleResult = _context.sent;
  88901. //存储地图的名称以及描述等信息,返回给用户
  88902. that.mapParams = {
  88903. title: mapInfo.title,
  88904. description: mapInfo.description
  88905. };
  88906. if (!(handleResult.action === "BrowseMap")) {
  88907. _context.next = 12;
  88908. break;
  88909. }
  88910. that.createSpecLayer(mapInfo);
  88911. _context.next = 29;
  88912. break;
  88913. case 12:
  88914. if (!(handleResult.action === "OpenMap")) {
  88915. _context.next = 27;
  88916. break;
  88917. }
  88918. that.baseProjection = handleResult.newCrs || mapInfo.projection;
  88919. that.webMapVersion = mapInfo.version;
  88920. that.baseLayer = mapInfo.baseLayer; // that.mapParams = {
  88921. // title: mapInfo.title,
  88922. // description: mapInfo.description
  88923. // }; //存储地图的名称以及描述等信息,返回给用户
  88924. that.isHaveGraticule = mapInfo.grid && mapInfo.grid.graticule;
  88925. if (!(mapInfo.baseLayer && mapInfo.baseLayer.layerType === 'MAPBOXSTYLE')) {
  88926. _context.next = 21;
  88927. break;
  88928. }
  88929. // 添加矢量瓦片服务作为底图
  88930. that.addMVTMapLayer(mapInfo, mapInfo.baseLayer, 0).then(function () {
  88931. that.createView(mapInfo);
  88932. if (!mapInfo.layers || mapInfo.layers.length === 0) {
  88933. that.sendMapToUser(0);
  88934. } else {
  88935. that.addLayers(mapInfo);
  88936. }
  88937. that.addGraticule(mapInfo);
  88938. });
  88939. _context.next = 25;
  88940. break;
  88941. case 21:
  88942. _context.next = 23;
  88943. return that.addBaseMap(mapInfo);
  88944. case 23:
  88945. if (!mapInfo.layers || mapInfo.layers.length === 0) {
  88946. that.sendMapToUser(0);
  88947. } else {
  88948. that.addLayers(mapInfo);
  88949. }
  88950. that.addGraticule(mapInfo);
  88951. case 25:
  88952. _context.next = 29;
  88953. break;
  88954. case 27:
  88955. // 不支持的坐标系
  88956. that.errorCallback && that.errorCallback({
  88957. type: "Not support CS",
  88958. errorMsg: "Not support CS: ".concat(mapInfo.projection)
  88959. }, 'getMapFaild', that.map);
  88960. return _context.abrupt("return");
  88961. case 29:
  88962. case "end":
  88963. return _context.stop();
  88964. }
  88965. }
  88966. }, _callee, this);
  88967. }));
  88968. function getMapInfoSuccess(_x) {
  88969. return _getMapInfoSuccess.apply(this, arguments);
  88970. }
  88971. return getMapInfoSuccess;
  88972. }()
  88973. /**
  88974. * 处理坐标系(底图)
  88975. * @private
  88976. * @param {string} crs 必传参数,值是webmap2中定义的坐标系,可能是 1、EGSG:xxx 2、WKT string
  88977. * @param {string} baseLayerUrl 可选参数,地图的服务地址;用于EPSG:-1 的时候,用于请求iServer提供的wkt
  88978. * @return {Object}
  88979. */
  88980. }, {
  88981. key: "handleCRS",
  88982. value: function () {
  88983. var _handleCRS = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee3(crs, baseLayerUrl) {
  88984. var that, handleResult, newCrs, action;
  88985. return regenerator_default().wrap(function _callee3$(_context3) {
  88986. while (1) {
  88987. switch (_context3.prev = _context3.next) {
  88988. case 0:
  88989. that = this, handleResult = {};
  88990. newCrs = crs, action = "OpenMap";
  88991. if (!(crs === "EPSG:-1")) {
  88992. _context3.next = 7;
  88993. break;
  88994. }
  88995. _context3.next = 5;
  88996. return FetchRequest.get(that.getRequestUrl("".concat(baseLayerUrl, "/prjCoordSys.wkt")), null, {
  88997. withCredentials: that.withCredentials,
  88998. withoutFormatSuffix: true
  88999. }).then(function (response) {
  89000. return response.text();
  89001. }).then( /*#__PURE__*/function () {
  89002. var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2(result) {
  89003. return regenerator_default().wrap(function _callee2$(_context2) {
  89004. while (1) {
  89005. switch (_context2.prev = _context2.next) {
  89006. case 0:
  89007. if (!(result.indexOf("<!doctype html>") === -1)) {
  89008. _context2.next = 5;
  89009. break;
  89010. }
  89011. that.addProjctionFromWKT(result, "EPSG:-1");
  89012. handleResult = {
  89013. action: action,
  89014. newCrs: newCrs
  89015. };
  89016. _context2.next = 6;
  89017. break;
  89018. case 5:
  89019. throw 'ERROR';
  89020. case 6:
  89021. case "end":
  89022. return _context2.stop();
  89023. }
  89024. }
  89025. }, _callee2);
  89026. }));
  89027. return function (_x4) {
  89028. return _ref2.apply(this, arguments);
  89029. };
  89030. }())["catch"](function () {
  89031. action = "BrowseMap";
  89032. handleResult = {
  89033. action: action,
  89034. newCrs: newCrs
  89035. };
  89036. });
  89037. case 5:
  89038. _context3.next = 9;
  89039. break;
  89040. case 7:
  89041. if (crs.indexOf("EPSG") === 0 && crs.split(":")[1] <= 0) {
  89042. // 自定义坐标系 rest map EPSG:-1(自定义坐标系) 支持编辑
  89043. // 未知坐标系情况特殊处理,只支持预览 1、rest map EPSG:-1000(没定义坐标系) 2、wms/wmts EPSG:0 (自定义坐标系)
  89044. action = "BrowseMap";
  89045. } else if (crs === 'EPSG:910111' || crs === 'EPSG:910112') {
  89046. // 早期数据存在的自定义坐标系 "EPSG:910111": "GCJ02MERCATOR", "EPSG:910112": "BDMERCATOR"
  89047. newCrs = "EPSG:3857";
  89048. } else if (crs === 'EPSG:910101' || crs === 'EPSG:910102') {
  89049. // 早期数据存在的自定义坐标系 "EPSG:910101": "GCJ02", "EPSG:910102": "BD",
  89050. newCrs = "EPSG:4326";
  89051. } else if (crs.indexOf("EPSG") !== 0) {
  89052. // wkt
  89053. that.addProjctionFromWKT(newCrs);
  89054. newCrs = that.getEpsgInfoFromWKT(crs);
  89055. }
  89056. handleResult = {
  89057. action: action,
  89058. newCrs: newCrs
  89059. };
  89060. case 9:
  89061. return _context3.abrupt("return", handleResult);
  89062. case 10:
  89063. case "end":
  89064. return _context3.stop();
  89065. }
  89066. }
  89067. }, _callee3, this);
  89068. }));
  89069. function handleCRS(_x2, _x3) {
  89070. return _handleCRS.apply(this, arguments);
  89071. }
  89072. return handleCRS;
  89073. }()
  89074. /**
  89075. * @private
  89076. * @function ol.supermap.WebMap.prototype.getScales
  89077. * @description 根据级别获取每个级别对应的分辨率
  89078. * @param {Object} baseLayerInfo - 底图的图层信息
  89079. */
  89080. }, {
  89081. key: "getScales",
  89082. value: function getScales(baseLayerInfo) {
  89083. var _this3 = this;
  89084. var scales = [],
  89085. resolutions = {},
  89086. res,
  89087. scale,
  89088. resolutionArray = [],
  89089. coordUnit = baseLayerInfo.coordUnit || external_ol_proj_namespaceObject.get(baseLayerInfo.projection).getUnits();
  89090. if (!coordUnit) {
  89091. coordUnit = this.baseProjection === "EPSG:3857" ? "m" : "degree";
  89092. }
  89093. if (baseLayerInfo.visibleScales && baseLayerInfo.visibleScales.length > 0) {
  89094. //底部设置过固定比例尺,则使用设置的
  89095. baseLayerInfo.visibleScales.forEach(function (scale) {
  89096. var value = 1 / scale;
  89097. res = _this3.getResFromScale(value, coordUnit);
  89098. scale = "1:".concat(value.toLocaleString()); //多此一举转换,因为toLocalString会自动保留小数点后三位,and当第二位小数是0就会保存小数点后两位。所有为了统一。
  89099. resolutions[_this3.formatScale(scale)] = res;
  89100. resolutionArray.push(res);
  89101. scales.push(scale);
  89102. }, this);
  89103. } else if (baseLayerInfo.layerType === 'WMTS') {
  89104. baseLayerInfo.scales.forEach(function (scale) {
  89105. res = _this3.getResFromScale(scale, coordUnit, 90.7);
  89106. scale = "1:".concat(scale.toLocaleString()); //多此一举转换,因为toLocalString会自动保留小数点后三位,and当第二位小数是0就会保存小数点后两位。所有为了统一。
  89107. resolutions[_this3.formatScale(scale)] = res;
  89108. resolutionArray.push(res);
  89109. scales.push(scale);
  89110. }, this);
  89111. } else {
  89112. var _baseLayerInfo$minZoo = baseLayerInfo.minZoom,
  89113. minZoom = _baseLayerInfo$minZoo === void 0 ? 0 : _baseLayerInfo$minZoo,
  89114. _baseLayerInfo$maxZoo = baseLayerInfo.maxZoom,
  89115. maxZoom = _baseLayerInfo$maxZoo === void 0 ? 22 : _baseLayerInfo$maxZoo,
  89116. view = this.map.getView();
  89117. for (var i = minZoom; i <= maxZoom; i++) {
  89118. res = view.getResolutionForZoom(i);
  89119. scale = this.getScaleFromRes(res, coordUnit);
  89120. if (scales.indexOf(scale) === -1) {
  89121. //不添加重复的比例尺
  89122. scales.push(scale);
  89123. var attr = scale.replace(/,/g, "");
  89124. resolutions[attr] = res;
  89125. resolutionArray.push(res);
  89126. }
  89127. }
  89128. }
  89129. this.scales = scales;
  89130. this.resolutions = resolutions;
  89131. this.resolutionArray = resolutionArray;
  89132. }
  89133. /**
  89134. * @private
  89135. * @function ol.supermap.WebMap.prototype.getResFromScale
  89136. * @description 将比例尺转换为分辨率
  89137. * @param {Number} scale - 比例尺
  89138. * @param {String} coordUnit - 比例尺单位
  89139. * @param {Number} dpi
  89140. */
  89141. }, {
  89142. key: "getResFromScale",
  89143. value: function getResFromScale(scale) {
  89144. var coordUnit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "DEGREE";
  89145. var dpi = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 96;
  89146. var mpu = metersPerUnit[coordUnit.toUpperCase()];
  89147. return scale * .0254 / dpi / mpu;
  89148. }
  89149. /**
  89150. * @private
  89151. * @function ol.supermap.WebMap.prototype.getScaleFromRes
  89152. * @description 将分辨率转换为比例尺
  89153. * @param {Number} resolution - 分辨率
  89154. * @param {String} coordUnit - 比例尺单位
  89155. * @param {Number} dpi
  89156. */
  89157. }, {
  89158. key: "getScaleFromRes",
  89159. value: function getScaleFromRes(resolution) {
  89160. var coordUnit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "DEGREE";
  89161. var dpi = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 96;
  89162. var scale,
  89163. mpu = metersPerUnit[coordUnit.toUpperCase()];
  89164. scale = resolution * dpi * mpu / .0254;
  89165. return '1:' + scale.toLocaleString();
  89166. }
  89167. /**
  89168. * @private
  89169. * @function ol.supermap.WebMap.prototype.formatScale
  89170. * @description 将有千位符的数字转为普通数字。例如:1,234 => 1234
  89171. * @param {number} scale - 比例尺分母
  89172. */
  89173. }, {
  89174. key: "formatScale",
  89175. value: function formatScale(scale) {
  89176. return scale.replace(/,/g, "");
  89177. }
  89178. /**
  89179. * @private
  89180. * @function ol.supermap.WebMap.prototype.createSpecLayer
  89181. * @description 创建坐标系为0和-1000的图层
  89182. * @param {object} mapInfo - 地图信息
  89183. */
  89184. }, {
  89185. key: "createSpecLayer",
  89186. value: function createSpecLayer(mapInfo) {
  89187. var me = this,
  89188. baseLayerInfo = mapInfo.baseLayer,
  89189. url = baseLayerInfo.url,
  89190. baseLayerType = baseLayerInfo.layerType;
  89191. var extent = [mapInfo.extent.leftBottom.x, mapInfo.extent.leftBottom.y, mapInfo.extent.rightTop.x, mapInfo.extent.rightTop.y];
  89192. var proj = new external_ol_proj_namespaceObject.Projection({
  89193. extent: extent,
  89194. units: 'm',
  89195. code: 'EPSG:0'
  89196. });
  89197. external_ol_proj_namespaceObject.addProjection(proj);
  89198. var options = {
  89199. center: mapInfo.center,
  89200. level: 0
  89201. }; //添加view
  89202. me.baseProjection = proj;
  89203. var viewOptions = {
  89204. center: options.center ? [options.center.x, options.center.y] : [0, 0],
  89205. zoom: 0,
  89206. projection: proj
  89207. };
  89208. if (['4', '5'].indexOf(core_Util_Util.getOlVersion()) < 0) {
  89209. // 兼容 ol 4,5,6
  89210. viewOptions.multiWorld = true;
  89211. }
  89212. var view = new (external_ol_View_default())(viewOptions);
  89213. me.map.setView(view);
  89214. if (me.mapParams) {
  89215. me.mapParams.extent = extent;
  89216. me.mapParams.projection = mapInfo.projection;
  89217. }
  89218. if (url && url.indexOf("?token=") > -1) {
  89219. //兼容iserver地址有token的情况
  89220. me.credentialKey = 'token';
  89221. me.credentialValue = mapInfo.baseLayer.credential = url.split("?token=")[1];
  89222. url = url.split("?token=")[0];
  89223. }
  89224. var source;
  89225. if (baseLayerType === "TILE") {
  89226. FetchRequest.get(me.getRequestUrl("".concat(url, ".json")), null, {
  89227. withCredentials: this.withCredentials
  89228. }).then(function (response) {
  89229. return response.json();
  89230. }).then(function (result) {
  89231. baseLayerInfo.originResult = result;
  89232. var serverType = "IPORTAL",
  89233. credential = baseLayerInfo.credential,
  89234. keyfix = 'Token',
  89235. keyParams = baseLayerInfo.url;
  89236. if (baseLayerInfo.url.indexOf("www.supermapol.com") > -1 || baseLayerInfo.url.indexOf("itest.supermapol.com") > -1) {
  89237. keyfix = 'Key';
  89238. keyParams = [keyParams];
  89239. serverType = "ONLINE";
  89240. }
  89241. if (credential) {
  89242. SecurityManager["register".concat(keyfix)](keyParams, credential);
  89243. }
  89244. var options = {
  89245. serverType: serverType,
  89246. url: url,
  89247. tileGrid: TileSuperMapRest.optionsFromMapJSON(url, result).tileGrid
  89248. };
  89249. if (url && !me.isSameDomain(url)) {
  89250. options.tileProxy = me.server + 'apps/viewer/getUrlResource.png?url=';
  89251. }
  89252. source = new TileSuperMapRest(options);
  89253. me.addSpecToMap(source);
  89254. })["catch"](function (error) {
  89255. me.errorCallback && me.errorCallback(error, 'getMapFaild', me.map);
  89256. });
  89257. } else if (baseLayerType === "WMS") {
  89258. source = me.createWMSSource(baseLayerInfo);
  89259. me.addSpecToMap(source);
  89260. } else if (baseLayerType === "WMTS") {
  89261. FetchRequest.get(me.getRequestUrl(url, true), null, {
  89262. withCredentials: this.withCredentials
  89263. }).then(function (response) {
  89264. return response.text();
  89265. }).then(function (capabilitiesText) {
  89266. baseLayerInfo.extent = [mapInfo.extent.leftBottom.x, mapInfo.extent.leftBottom.y, mapInfo.extent.rightTop.x, mapInfo.extent.rightTop.y];
  89267. baseLayerInfo.scales = me.getWMTSScales(baseLayerInfo.tileMatrixSet, capabilitiesText);
  89268. baseLayerInfo.dpi = dpiConfig.iServerWMTS;
  89269. source = me.createWMTSSource(baseLayerInfo);
  89270. me.addSpecToMap(source);
  89271. })["catch"](function (error) {
  89272. me.errorCallback && me.errorCallback(error, 'getMapFaild', me.map);
  89273. });
  89274. } else {
  89275. me.errorCallback && me.errorCallback({
  89276. type: "Not support CS",
  89277. errorMsg: "Not support CS: ".concat(baseLayerType)
  89278. }, 'getMapFaild', me.map);
  89279. }
  89280. view && view.fit(extent);
  89281. }
  89282. /**
  89283. * @private
  89284. * @function ol.supermap.WebMap.prototype.addSpecToMap
  89285. * @description 将坐标系为0和-1000的图层添加到地图上
  89286. * @param {object} mapInfo - 地图信息
  89287. */
  89288. }, {
  89289. key: "addSpecToMap",
  89290. value: function addSpecToMap(source) {
  89291. var layer = new external_ol_layer_namespaceObject.Tile({
  89292. source: source,
  89293. zIndex: 0
  89294. });
  89295. this.map.addLayer(layer);
  89296. this.sendMapToUser(0);
  89297. }
  89298. /**
  89299. * @private
  89300. * @function ol.supermap.WebMap.prototype.getWMTSScales
  89301. * @description 获取wmts的比例尺
  89302. * @param {object} identifier - 图层存储的标识信息
  89303. * @param {object} capabilitiesText - wmts信息
  89304. */
  89305. }, {
  89306. key: "getWMTSScales",
  89307. value: function getWMTSScales(identifier, capabilitiesText) {
  89308. var format = new (external_ol_format_WMTSCapabilities_default())();
  89309. var capabilities = format.read(capabilitiesText);
  89310. var content = capabilities.Contents,
  89311. tileMatrixSet = content.TileMatrixSet;
  89312. var scales = [];
  89313. for (var i = 0; i < tileMatrixSet.length; i++) {
  89314. if (tileMatrixSet[i].Identifier === identifier) {
  89315. for (var h = 0; h < tileMatrixSet[i].TileMatrix.length; h++) {
  89316. scales.push(tileMatrixSet[i].TileMatrix[h].ScaleDenominator);
  89317. }
  89318. break;
  89319. }
  89320. }
  89321. return scales;
  89322. }
  89323. /**
  89324. * @private
  89325. * @function ol.supermap.WebMap.prototype.addBaseMap
  89326. * @description 添加底图
  89327. * @param {string} mapInfo - 请求地图的url
  89328. */
  89329. }, {
  89330. key: "addBaseMap",
  89331. value: function () {
  89332. var _addBaseMap = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee4(mapInfo) {
  89333. var baseLayer, layerType, layer, labelLayer;
  89334. return regenerator_default().wrap(function _callee4$(_context4) {
  89335. while (1) {
  89336. switch (_context4.prev = _context4.next) {
  89337. case 0:
  89338. baseLayer = mapInfo.baseLayer, layerType = baseLayer.layerType; //底图,使用默认的配置,不用存储的
  89339. if (!(layerType !== 'TILE' && layerType !== 'WMS' && layerType !== 'WMTS')) {
  89340. _context4.next = 5;
  89341. break;
  89342. }
  89343. this.getInternetMapInfo(baseLayer);
  89344. _context4.next = 13;
  89345. break;
  89346. case 5:
  89347. if (!(layerType === 'WMTS')) {
  89348. _context4.next = 10;
  89349. break;
  89350. }
  89351. _context4.next = 8;
  89352. return this.getWmtsInfo(baseLayer);
  89353. case 8:
  89354. _context4.next = 13;
  89355. break;
  89356. case 10:
  89357. if (!(layerType === 'TILE')) {
  89358. _context4.next = 13;
  89359. break;
  89360. }
  89361. _context4.next = 13;
  89362. return this.getTileInfo(baseLayer);
  89363. case 13:
  89364. baseLayer.projection = mapInfo.projection;
  89365. if (!baseLayer.extent) {
  89366. baseLayer.extent = [mapInfo.extent.leftBottom.x, mapInfo.extent.leftBottom.y, mapInfo.extent.rightTop.x, mapInfo.extent.rightTop.y];
  89367. }
  89368. this.createView(mapInfo);
  89369. layer = this.createBaseLayer(baseLayer, 0, null, null, true); //底图增加图层类型,DV分享需要用它来识别版权信息
  89370. layer.setProperties({
  89371. layerType: layerType
  89372. });
  89373. this.map.addLayer(layer);
  89374. if (this.mapParams) {
  89375. this.mapParams.extent = baseLayer.extent;
  89376. this.mapParams.projection = mapInfo.projection;
  89377. }
  89378. if (baseLayer.labelLayerVisible) {
  89379. //存在天地图路网
  89380. labelLayer = new external_ol_layer_namespaceObject.Tile({
  89381. source: this.createTiandituSource(baseLayer.layerType, mapInfo.projection, true),
  89382. zIndex: baseLayer.zIndex || 1,
  89383. visible: baseLayer.visible
  89384. });
  89385. this.map.addLayer(labelLayer); // 挂载带baseLayer上,便于删除
  89386. baseLayer.labelLayer = labelLayer;
  89387. }
  89388. case 21:
  89389. case "end":
  89390. return _context4.stop();
  89391. }
  89392. }
  89393. }, _callee4, this);
  89394. }));
  89395. function addBaseMap(_x5) {
  89396. return _addBaseMap.apply(this, arguments);
  89397. }
  89398. return addBaseMap;
  89399. }()
  89400. /**
  89401. * @private
  89402. * @function ol.supermap.WebMap.prototype.addMVTMapLayer
  89403. * @description 添加地图服务mapboxstyle图层
  89404. * @param {object} mapInfo - 地图信息
  89405. * @param {object} layerInfo - mapboxstyle图层信息
  89406. */
  89407. }, {
  89408. key: "addMVTMapLayer",
  89409. value: function addMVTMapLayer(mapInfo, layerInfo, zIndex) {
  89410. var _this4 = this;
  89411. layerInfo.zIndex = zIndex; // 获取地图详细信息
  89412. return this.getMapboxStyleLayerInfo(mapInfo, layerInfo).then(function (msLayerInfo) {
  89413. // 创建图层
  89414. return _this4.createMVTLayer(msLayerInfo).then(function (layer) {
  89415. var layerID = core_Util_Util.newGuid(8);
  89416. if (layerInfo.name) {
  89417. layer.setProperties({
  89418. name: layerInfo.name,
  89419. layerID: layerID,
  89420. layerType: 'VECTOR_TILE'
  89421. });
  89422. }
  89423. layerInfo.visibleScale && _this4.setVisibleScales(layer, layerInfo.visibleScale); //否则没有ID,对不上号
  89424. layerInfo.layer = layer;
  89425. layerInfo.layerID = layerID;
  89426. _this4.map.addLayer(layer);
  89427. });
  89428. });
  89429. }
  89430. /**
  89431. * @private
  89432. * @function ol.supermap.WebMap.prototype.createView
  89433. * @description 创建地图视图
  89434. * @param {object} options - 关于地图的信息
  89435. */
  89436. }, {
  89437. key: "createView",
  89438. value: function createView(options) {
  89439. var oldcenter = options.center,
  89440. zoom = options.level !== undefined ? options.level : 1,
  89441. maxZoom = options.maxZoom || 22,
  89442. extent,
  89443. projection = this.baseProjection;
  89444. var center = [];
  89445. for (var key in oldcenter) {
  89446. center.push(oldcenter[key]);
  89447. }
  89448. if (center.length === 0) {
  89449. //兼容wms
  89450. center = [0, 0];
  89451. } //与DV一致用底图的默认范围,不用存储的范围。否则会导致地图拖不动
  89452. this.baseLayerExtent = extent = options.baseLayer && options.baseLayer.extent;
  89453. if (this.mapParams) {
  89454. this.mapParams.extent = extent;
  89455. this.mapParams.projection = projection;
  89456. } //当前中心点不在extent内,就用extent的中心点 todo
  89457. !(0,external_ol_extent_namespaceObject.containsCoordinate)(extent, center) && (center = (0,external_ol_extent_namespaceObject.getCenter)(extent)); // 计算当前最大分辨率
  89458. var baseLayer = options.baseLayer;
  89459. var maxResolution;
  89460. if (baseLayer.visibleScales && baseLayer.visibleScales.length > 0 || baseLayer.scales && baseLayer.scales.length > 0) {
  89461. //底图有固定比例尺,就直接获取。不用view计算
  89462. this.getScales(baseLayer);
  89463. } else if (options.baseLayer && extent && extent.length === 4) {
  89464. var width = extent[2] - extent[0];
  89465. var height = extent[3] - extent[1];
  89466. var maxResolution1 = width / 512;
  89467. var maxResolution2 = height / 512;
  89468. maxResolution = Math.max(maxResolution1, maxResolution2);
  89469. } // if(options.baseLayer.visibleScales && options.baseLayer.visibleScales.length > 0){
  89470. // maxZoom = options.baseLayer.visibleScales.length;
  89471. // }
  89472. var viewOptions = {};
  89473. if (baseLayer.scales && baseLayer.scales.length > 0 && baseLayer.layerType === "WMTS" || this.resolutionArray && this.resolutionArray.length > 0) {
  89474. viewOptions = {
  89475. zoom: zoom,
  89476. center: center,
  89477. projection: projection,
  89478. resolutions: this.resolutionArray,
  89479. maxZoom: maxZoom
  89480. };
  89481. } else if (baseLayer.layerType === "WMTS") {
  89482. viewOptions = {
  89483. zoom: zoom,
  89484. center: center,
  89485. projection: projection,
  89486. maxZoom: maxZoom
  89487. };
  89488. this.getScales(baseLayer);
  89489. } else {
  89490. viewOptions = {
  89491. zoom: zoom,
  89492. center: center,
  89493. projection: projection,
  89494. maxResolution: maxResolution,
  89495. maxZoom: maxZoom
  89496. };
  89497. this.getScales(baseLayer);
  89498. }
  89499. if (['4', '5'].indexOf(core_Util_Util.getOlVersion()) < 0) {
  89500. // 兼容 ol 4,5,6
  89501. viewOptions.multiWorld = true;
  89502. viewOptions.showFullExtent = true;
  89503. viewOptions.enableRotation = false;
  89504. viewOptions.constrainResolution = true; //设置此参数,是因为需要显示整数级别。为了可视比例尺中包含当前比例尺
  89505. }
  89506. this.map.setView(new (external_ol_View_default())(viewOptions));
  89507. if (options.visibleExtent) {
  89508. var view = this.map.getView();
  89509. var resolution = view.getResolutionForExtent(options.visibleExtent, this.map.getSize());
  89510. view.setResolution(resolution);
  89511. view.setCenter((0,external_ol_extent_namespaceObject.getCenter)(options.visibleExtent));
  89512. }
  89513. }
  89514. /**
  89515. * @private
  89516. * @function ol.supermap.WebMap.prototype.createBaseLayer
  89517. * @description 创建矢量图层,包括底图及其叠加的矢量图层
  89518. * @param {object} layerInfo - 关于地图的信息
  89519. * @param {number} index - 当前图层在地图中的index
  89520. * @param {boolean} isCallBack - 是否调用回调函数
  89521. * @param {scope} {object} this对象
  89522. */
  89523. }, {
  89524. key: "createBaseLayer",
  89525. value: function createBaseLayer(layerInfo, index, isCallBack, scope, isBaseLayer) {
  89526. var source,
  89527. that = this;
  89528. if (scope) {
  89529. // 解决异步回调
  89530. that = scope;
  89531. }
  89532. var layerType = layerInfo.layerType; //底图和rest地图兼容
  89533. if (layerType.indexOf('TIANDITU_VEC') > -1 || layerType.indexOf('TIANDITU_IMG') > -1 || layerType.indexOf('TIANDITU_TER') > -1) {
  89534. layerType = layerType.substr(0, 12);
  89535. }
  89536. switch (layerType) {
  89537. case "TIANDITU_VEC":
  89538. case "TIANDITU_IMG":
  89539. case "TIANDITU_TER":
  89540. source = this.createTiandituSource(layerType, layerInfo.projection);
  89541. break;
  89542. case "BAIDU":
  89543. source = this.createBaiduSource();
  89544. break;
  89545. case 'BING':
  89546. source = this.createBingSource(layerInfo, layerInfo.projection);
  89547. break;
  89548. case "WMS":
  89549. source = this.createWMSSource(layerInfo);
  89550. break;
  89551. case "WMTS":
  89552. source = that.createWMTSSource(layerInfo);
  89553. break;
  89554. case 'TILE':
  89555. case 'SUPERMAP_REST':
  89556. source = that.createDynamicTiledSource(layerInfo, isBaseLayer);
  89557. break;
  89558. case 'CLOUD':
  89559. case 'CLOUD_BLACK':
  89560. case 'OSM':
  89561. case 'JAPAN_ORT':
  89562. case 'JAPAN_RELIEF':
  89563. case 'JAPAN_PALE':
  89564. case 'JAPAN_STD':
  89565. case 'GOOGLE_CN':
  89566. case 'GOOGLE':
  89567. source = this.createXYZSource(layerInfo);
  89568. break;
  89569. default:
  89570. break;
  89571. }
  89572. var layer = new external_ol_layer_namespaceObject.Tile({
  89573. source: source,
  89574. zIndex: layerInfo.zIndex || 1,
  89575. visible: layerInfo.visible
  89576. });
  89577. var layerID = core_Util_Util.newGuid(8);
  89578. if (layerInfo.name) {
  89579. layer.setProperties({
  89580. name: layerInfo.name,
  89581. layerID: layerID
  89582. });
  89583. }
  89584. if (layerInfo.visible === undefined || layerInfo.visible === null) {
  89585. layerInfo.visible = true;
  89586. }
  89587. layer.setVisible(layerInfo.visible);
  89588. layerInfo.opacity && layer.setOpacity(layerInfo.opacity); //layerInfo没有存储index属性
  89589. index && layer.setZIndex(index); //否则没有ID,对不上号
  89590. layerInfo.layer = layer;
  89591. layerInfo.layerID = layerID;
  89592. var visibleScale = layerInfo.visibleScale,
  89593. autoUpdateTime = layerInfo.autoUpdateTime,
  89594. minResolution,
  89595. maxResolution;
  89596. if (visibleScale) {
  89597. maxResolution = this.resolutions[visibleScale.minScale];
  89598. minResolution = this.resolutions[visibleScale.maxScale]; //比例尺和分别率是反比的关系
  89599. maxResolution > 1 ? layer.setMaxResolution(Math.ceil(maxResolution)) : layer.setMaxResolution(maxResolution * 1.1);
  89600. layer.setMinResolution(minResolution);
  89601. }
  89602. if (autoUpdateTime && !layerInfo.autoUpdateInterval) {
  89603. //自动更新
  89604. layerInfo.autoUpdateInterval = setInterval(function () {
  89605. that.updateTileToMap(layerInfo, index);
  89606. }, autoUpdateTime);
  89607. }
  89608. if (isCallBack) {
  89609. layer.setZIndex(0); // wmts
  89610. that.map.addLayer(layer);
  89611. }
  89612. return layer;
  89613. }
  89614. /**
  89615. * @private
  89616. * @function ol.supermap.WebMap.prototype.updateTileToMap
  89617. * @description 获取底图对应的图层信息,不是用请求回来的底图信息
  89618. * @param {object} layerInfo - 图层信息
  89619. * @param {number} layerIndex - 图层index
  89620. */
  89621. }, {
  89622. key: "updateTileToMap",
  89623. value: function updateTileToMap(layerInfo, layerIndex) {
  89624. this.map.removeLayer(layerInfo.layer);
  89625. this.map.addLayer(this.createBaseLayer(layerInfo, layerIndex));
  89626. }
  89627. /**
  89628. * @private
  89629. * @function ol.supermap.WebMap.prototype.getInternetMapInfo
  89630. * @description 获取底图对应的图层信息,不是用请求回来的底图信息
  89631. * @param {object} baseLayerInfo - 底图信息
  89632. * @returns {Object} 底图的具体信息
  89633. */
  89634. }, {
  89635. key: "getInternetMapInfo",
  89636. value: function getInternetMapInfo(baseLayerInfo) {
  89637. var baiduBounds = [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892];
  89638. var bounds_4326 = [-180, -90, 180, 90];
  89639. var osmBounds = [-20037508.34, -20037508.34, 20037508.34, 20037508.34];
  89640. var japanReliefBounds = [12555667.53929, 1281852.98656, 17525908.86651, 7484870.70596];
  89641. var japanOrtBounds = [-19741117.14519, -10003921.36848, 19981677.71404, 19660983.56089];
  89642. baseLayerInfo.units = "m";
  89643. switch (baseLayerInfo.layerType) {
  89644. case 'BAIDU':
  89645. baseLayerInfo.iServerUrl = 'https://map.baidu.com/';
  89646. baseLayerInfo.epsgCode = 'EPSG:3857';
  89647. baseLayerInfo.minZoom = 1;
  89648. baseLayerInfo.maxZoom = 19;
  89649. baseLayerInfo.level = 1;
  89650. baseLayerInfo.extent = baiduBounds; // thumbnail: this.getImagePath('bmap.png') 暂时不用到缩略图
  89651. break;
  89652. case 'CLOUD':
  89653. baseLayerInfo.url = 'http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}';
  89654. baseLayerInfo.epsgCode = 'EPSG:3857';
  89655. baseLayerInfo.minZoom = 1;
  89656. baseLayerInfo.maxZoom = 18;
  89657. baseLayerInfo.level = 1;
  89658. baseLayerInfo.extent = baiduBounds;
  89659. break;
  89660. case 'CLOUD_BLACK':
  89661. baseLayerInfo.url = 'http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}';
  89662. baseLayerInfo.epsgCode = 'EPSG:3857';
  89663. baseLayerInfo.minZoom = 1;
  89664. baseLayerInfo.maxZoom = 18;
  89665. baseLayerInfo.level = 1;
  89666. baseLayerInfo.extent = baiduBounds;
  89667. break;
  89668. case 'tencent':
  89669. baseLayerInfo.epsgCode = 'EPSG:3857';
  89670. baseLayerInfo.minZoom = 1;
  89671. baseLayerInfo.maxZoom = 18;
  89672. baseLayerInfo.level = 1;
  89673. baseLayerInfo.extent = baiduBounds;
  89674. break;
  89675. case 'TIANDITU_VEC_3857':
  89676. case 'TIANDITU_IMG_3857':
  89677. case 'TIANDITU_TER_3857':
  89678. baseLayerInfo.iserverUrl = 'https://map.tianditu.gov.cn/';
  89679. baseLayerInfo.epsgCode = 'EPSG:3857';
  89680. baseLayerInfo.minZoom = 0;
  89681. baseLayerInfo.maxZoom = 19;
  89682. baseLayerInfo.level = 1;
  89683. baseLayerInfo.extent = baiduBounds;
  89684. if (baseLayerInfo.layerType === "TIANDITU_TER_3857") {
  89685. baseLayerInfo.maxZoom = 14;
  89686. }
  89687. break;
  89688. case 'TIANDITU_VEC_4326':
  89689. case 'TIANDITU_IMG_4326':
  89690. case 'TIANDITU_TER_4326':
  89691. baseLayerInfo.iserverUrl = 'https://map.tianditu.gov.cn/';
  89692. baseLayerInfo.epsgCode = 'EPSG:4326';
  89693. baseLayerInfo.minZoom = 0;
  89694. baseLayerInfo.maxZoom = 19;
  89695. baseLayerInfo.level = 1;
  89696. baseLayerInfo.extent = bounds_4326;
  89697. if (baseLayerInfo.layerType === "TIANDITU_TER_4326") {
  89698. baseLayerInfo.maxZoom = 14;
  89699. }
  89700. break;
  89701. case 'OSM':
  89702. baseLayerInfo.url = 'http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
  89703. baseLayerInfo.epsgCode = 'EPSG:3857';
  89704. baseLayerInfo.minZoom = 1;
  89705. baseLayerInfo.maxZoom = 19;
  89706. baseLayerInfo.level = 1;
  89707. baseLayerInfo.extent = osmBounds;
  89708. baseLayerInfo.iserverUrl = 'https://www.openstreetmap.org';
  89709. break;
  89710. case 'GOOGLE':
  89711. baseLayerInfo.url = 'https://www.google.cn/maps/vt/pb=!1m4!1m3!1i{z}!2i{x}!3i{y}!2m3!1e0!2sm!3i380072576!3m8!2szh-CN!3scn!5e1105!12m4!1e68!2m2!1sset!2sRoadmap!4e0!5m1!1e0';
  89712. baseLayerInfo.epsgCode = 'EPSG:3857';
  89713. baseLayerInfo.minZoom = 1;
  89714. baseLayerInfo.maxZoom = 22;
  89715. baseLayerInfo.level = 1;
  89716. baseLayerInfo.extent = osmBounds;
  89717. baseLayerInfo.iserverUrl = 'https://www.google.cn/maps';
  89718. break;
  89719. case 'JAPAN_STD':
  89720. baseLayerInfo.url = 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png';
  89721. baseLayerInfo.epsgCode = 'EPSG:3857';
  89722. baseLayerInfo.minZoom = 1;
  89723. baseLayerInfo.maxZoom = 19;
  89724. baseLayerInfo.level = 0;
  89725. baseLayerInfo.extent = osmBounds;
  89726. break;
  89727. case 'JAPAN_PALE':
  89728. baseLayerInfo.url = 'https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png';
  89729. baseLayerInfo.epsgCode = 'EPSG:3857';
  89730. baseLayerInfo.minZoom = 2;
  89731. baseLayerInfo.maxZoom = 19;
  89732. baseLayerInfo.level = 2;
  89733. baseLayerInfo.extent = osmBounds;
  89734. break;
  89735. case 'JAPAN_RELIEF':
  89736. baseLayerInfo.url = 'https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png';
  89737. baseLayerInfo.epsgCode = 'EPSG:3857';
  89738. baseLayerInfo.minZoom = 5;
  89739. baseLayerInfo.maxZoom = 14;
  89740. baseLayerInfo.level = 5;
  89741. baseLayerInfo.extent = japanReliefBounds;
  89742. break;
  89743. case 'JAPAN_ORT':
  89744. baseLayerInfo.url = 'https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg';
  89745. baseLayerInfo.epsgCode = 'EPSG:3857';
  89746. baseLayerInfo.minZoom = 2;
  89747. baseLayerInfo.maxZoom = 12;
  89748. baseLayerInfo.level = 2;
  89749. baseLayerInfo.extent = japanOrtBounds;
  89750. break;
  89751. }
  89752. }
  89753. /**
  89754. * @private
  89755. * @function ol.supermap.WebMap.prototype.createDynamicTiledSource
  89756. * @description 获取supermap iServer类型的地图的source。
  89757. * @param {object} layerInfo
  89758. * @param {boolean} isBaseLayer 是否是底图
  89759. */
  89760. }, {
  89761. key: "createDynamicTiledSource",
  89762. value: function createDynamicTiledSource(layerInfo, isBaseLayer) {
  89763. var serverType = "IPORTAL",
  89764. credential = layerInfo.credential ? layerInfo.credential.token : undefined,
  89765. keyfix = 'Token',
  89766. keyParams = layerInfo.url;
  89767. if (layerInfo.url.indexOf("www.supermapol.com") > -1 || layerInfo.url.indexOf("itest.supermapol.com") > -1) {
  89768. keyfix = 'Key';
  89769. keyParams = [keyParams];
  89770. serverType = "ONLINE";
  89771. }
  89772. if (credential) {
  89773. SecurityManager["register".concat(keyfix)](keyParams, credential);
  89774. } // extent: isBaseLayer ? layerInfo.extent : ol.proj.transformExtent(layerInfo.extent, layerInfo.projection, this.baseProjection),
  89775. var options = {
  89776. transparent: true,
  89777. url: layerInfo.url,
  89778. wrapX: false,
  89779. serverType: serverType,
  89780. // crossOrigin: 'anonymous', //在IE11.0.9600版本,会影响通过注册服务打开的iserver地图,不出图。因为没有携带cookie会报跨域问题
  89781. // extent: this.baseLayerExtent,
  89782. // prjCoordSys: {epsgCode: isBaseLayer ? layerInfo.projection.split(':')[1] : this.baseProjection.split(':')[1]},
  89783. format: layerInfo.format
  89784. };
  89785. if (!isBaseLayer && this.baseProjection !== "EPSG:-1") {
  89786. options.prjCoordSys = {
  89787. epsgCode: this.baseProjection.split(':')[1]
  89788. };
  89789. }
  89790. if (layerInfo.visibleScales && layerInfo.visibleScales.length > 0) {
  89791. var visibleResolutions = [];
  89792. for (var i in layerInfo.visibleScales) {
  89793. var resolution = core_Util_Util.scaleToResolution(layerInfo.visibleScales[i], dpiConfig["default"], layerInfo.coordUnit);
  89794. visibleResolutions.push(resolution);
  89795. }
  89796. layerInfo.visibleResolutions = visibleResolutions;
  89797. var tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  89798. extent: layerInfo.extent,
  89799. resolutions: visibleResolutions
  89800. });
  89801. options.tileGrid = tileGrid;
  89802. } else {
  89803. options.extent = this.baseLayerExtent; //bug:ISVJ-2412,不添加下列代码出不了图。参照iserver ol3出图方式
  89804. var _tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  89805. extent: layerInfo.extent,
  89806. resolutions: this.getResolutionsFromBounds(layerInfo.extent)
  89807. });
  89808. options.tileGrid = _tileGrid;
  89809. } //主机名相同时不添加代理,iportal geturlResource不支持webp代理
  89810. if (layerInfo.url && !this.isSameDomain(layerInfo.url) && layerInfo.format !== 'webp') {
  89811. options.tileProxy = this.server + 'apps/viewer/getUrlResource.png?url=';
  89812. }
  89813. var source = new TileSuperMapRest(options);
  89814. SecurityManager["register".concat(keyfix)](layerInfo.url);
  89815. return source;
  89816. }
  89817. /**
  89818. * @private
  89819. * @function ol.supermap.WebMap.prototype.getResolutionsFromBounds
  89820. * @description 获取比例尺数组
  89821. * @param bounds {Array} 范围数组
  89822. * @returns {styleResolutions} 比例尺数组
  89823. */
  89824. }, {
  89825. key: "getResolutionsFromBounds",
  89826. value: function getResolutionsFromBounds(bounds) {
  89827. var styleResolutions = [];
  89828. var temp = Math.abs(bounds[0] - bounds[2]) / 512;
  89829. for (var i = 0; i < 22; i++) {
  89830. if (i === 0) {
  89831. styleResolutions[i] = temp;
  89832. continue;
  89833. }
  89834. temp = temp / 2;
  89835. styleResolutions[i] = temp;
  89836. }
  89837. return styleResolutions;
  89838. }
  89839. /**
  89840. * @private
  89841. * @function ol.supermap.WebMap.prototype.createTiandituSource
  89842. * @description 创建天地图的source。
  89843. * @param layerType 图层类型
  89844. * @param projection 地理坐标系
  89845. * @param isLabel 是否有路网图层
  89846. * @returns {ol.source.Tianditu} 天地图的source
  89847. */
  89848. }, {
  89849. key: "createTiandituSource",
  89850. value: function createTiandituSource(layerType, projection, isLabel) {
  89851. var options = {
  89852. layerType: layerType.split('_')[1].toLowerCase(),
  89853. isLabel: isLabel || false,
  89854. projection: projection,
  89855. url: "https://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?tk=".concat(this.tiandituKey)
  89856. };
  89857. return new Tianditu(options);
  89858. }
  89859. /**
  89860. * @private
  89861. * @function ol.supermap.WebMap.prototype.createBaiduSource
  89862. * @description 创建百度地图的source。
  89863. * @returns {ol.source.BaiduMap} baidu地图的source
  89864. */
  89865. }, {
  89866. key: "createBaiduSource",
  89867. value: function createBaiduSource() {
  89868. return new BaiduMap();
  89869. }
  89870. /**
  89871. * @private
  89872. * @function ol.supermap.WebMap.prototype.createBingSource
  89873. * @description 创建bing地图的source。
  89874. * @returns {ol/source/XYZ} bing地图的source
  89875. */
  89876. }, {
  89877. key: "createBingSource",
  89878. value: function createBingSource(layerInfo, projection) {
  89879. var url = 'https://dynamic.t0.tiles.ditu.live.com/comp/ch/{quadKey}?it=G,TW,L,LA&mkt=zh-cn&og=109&cstl=w4c&ur=CN&n=z';
  89880. return new external_ol_source_namespaceObject.XYZ({
  89881. wrapX: false,
  89882. projection: projection,
  89883. crossOrigin: 'anonymous',
  89884. tileUrlFunction: function tileUrlFunction(coordinates) {
  89885. var _ref3 = WebMap_toConsumableArray(coordinates),
  89886. z = _ref3[0],
  89887. x = _ref3[1],
  89888. y = _ref3[2];
  89889. y = y > 0 ? y - 1 : -y - 1;
  89890. var index = '';
  89891. for (var i = z; i > 0; i--) {
  89892. var b = 0;
  89893. var mask = 1 << i - 1;
  89894. if ((x & mask) !== 0) {
  89895. b++;
  89896. }
  89897. if ((y & mask) !== 0) {
  89898. b += 2;
  89899. }
  89900. index += b.toString();
  89901. }
  89902. return url.replace('{quadKey}', index);
  89903. }
  89904. });
  89905. }
  89906. /**
  89907. * @private
  89908. * @function ol.supermap.WebMap.prototype.createXYZSource
  89909. * @description 创建图层的XYZsource。
  89910. * @param {Object} layerInfo - 图层信息
  89911. * @returns {ol/source/XYZ} xyz的source
  89912. */
  89913. }, {
  89914. key: "createXYZSource",
  89915. value: function createXYZSource(layerInfo) {
  89916. return new external_ol_source_namespaceObject.XYZ({
  89917. url: layerInfo.url,
  89918. wrapX: false,
  89919. crossOrigin: 'anonymous'
  89920. });
  89921. }
  89922. /**
  89923. * @private
  89924. * @function ol.supermap.WebMap.prototype.createWMSSource
  89925. * @description 创建wms地图source。
  89926. * @param {Object} layerInfo - 图层信息。
  89927. * @returns {ol/source/TileWMS} wms的source
  89928. */
  89929. }, {
  89930. key: "createWMSSource",
  89931. value: function createWMSSource(layerInfo) {
  89932. var that = this;
  89933. return new external_ol_source_namespaceObject.TileWMS({
  89934. url: layerInfo.url,
  89935. wrapX: false,
  89936. params: {
  89937. LAYERS: layerInfo.layers ? layerInfo.layers[0] : "0",
  89938. FORMAT: 'image/png'
  89939. },
  89940. projection: layerInfo.projection || that.baseProjection,
  89941. tileLoadFunction: function tileLoadFunction(imageTile, src) {
  89942. imageTile.getImage().src = src;
  89943. }
  89944. });
  89945. }
  89946. /**
  89947. * @private
  89948. * @function ol.supermap.WebMap.prototype.getTileLayerExtent
  89949. * @description 获取(Supermap RestMap)的图层参数。
  89950. * @param {Object} layerInfo - 图层信息。
  89951. * @param {function} callback - 获得tile图层参数执行的回调函数
  89952. * @param {function} failedCallback - 失败回调函数
  89953. */
  89954. }, {
  89955. key: "getTileLayerExtent",
  89956. value: function () {
  89957. var _getTileLayerExtent = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee5(layerInfo, callback, failedCallback) {
  89958. var that, dynamicLayerInfo, originLayerInfo;
  89959. return regenerator_default().wrap(function _callee5$(_context5) {
  89960. while (1) {
  89961. switch (_context5.prev = _context5.next) {
  89962. case 0:
  89963. that = this; // 默认使用动态投影方式请求数据
  89964. _context5.next = 3;
  89965. return that.getTileLayerExtentInfo(layerInfo);
  89966. case 3:
  89967. dynamicLayerInfo = _context5.sent;
  89968. if (!(dynamicLayerInfo.succeed === false)) {
  89969. _context5.next = 15;
  89970. break;
  89971. }
  89972. if (!(dynamicLayerInfo.error.code === 400)) {
  89973. _context5.next = 12;
  89974. break;
  89975. }
  89976. _context5.next = 8;
  89977. return that.getTileLayerExtentInfo(layerInfo, false);
  89978. case 8:
  89979. originLayerInfo = _context5.sent;
  89980. if (originLayerInfo.succeed === false) {
  89981. failedCallback();
  89982. } else {
  89983. Object.assign(layerInfo, originLayerInfo);
  89984. callback(layerInfo);
  89985. }
  89986. _context5.next = 13;
  89987. break;
  89988. case 12:
  89989. failedCallback();
  89990. case 13:
  89991. _context5.next = 17;
  89992. break;
  89993. case 15:
  89994. Object.assign(layerInfo, dynamicLayerInfo);
  89995. callback(layerInfo);
  89996. case 17:
  89997. case "end":
  89998. return _context5.stop();
  89999. }
  90000. }
  90001. }, _callee5, this);
  90002. }));
  90003. function getTileLayerExtent(_x6, _x7, _x8) {
  90004. return _getTileLayerExtent.apply(this, arguments);
  90005. }
  90006. return getTileLayerExtent;
  90007. }()
  90008. /**
  90009. * @private
  90010. * @function ol.supermap.WebMap.prototype.getTileLayerExtentInfo
  90011. * @description 获取rest map的图层参数。
  90012. * @param {Object} layerInfo - 图层信息。
  90013. * @param {Boolean} isDynamic - 是否请求动态投影信息
  90014. */
  90015. }, {
  90016. key: "getTileLayerExtentInfo",
  90017. value: function getTileLayerExtentInfo(layerInfo) {
  90018. var isDynamic = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  90019. var that = this,
  90020. token,
  90021. url = layerInfo.url.trim(),
  90022. credential = layerInfo.credential,
  90023. options = {
  90024. withCredentials: this.withCredentials,
  90025. withoutFormatSuffix: true
  90026. };
  90027. if (isDynamic) {
  90028. var projection = {
  90029. epsgCode: that.baseProjection.split(":")[1]
  90030. };
  90031. if (that.baseProjection !== "EPSG:-1") {
  90032. // bug IE11 不会自动编码
  90033. url += '.json?prjCoordSys=' + encodeURI(JSON.stringify(projection));
  90034. }
  90035. }
  90036. if (credential) {
  90037. url = "".concat(url, "&token=").concat(encodeURI(credential.token));
  90038. token = credential.token;
  90039. }
  90040. return FetchRequest.get(that.getRequestUrl("".concat(url, ".json")), null, options).then(function (response) {
  90041. return response.json();
  90042. }).then( /*#__PURE__*/function () {
  90043. var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee6(result) {
  90044. var format, isSupportWebp;
  90045. return regenerator_default().wrap(function _callee6$(_context6) {
  90046. while (1) {
  90047. switch (_context6.prev = _context6.next) {
  90048. case 0:
  90049. if (!(result.succeed === false)) {
  90050. _context6.next = 2;
  90051. break;
  90052. }
  90053. return _context6.abrupt("return", result);
  90054. case 2:
  90055. format = 'png';
  90056. if (!(that.tileFormat === 'webp')) {
  90057. _context6.next = 8;
  90058. break;
  90059. }
  90060. _context6.next = 6;
  90061. return that.isSupportWebp(layerInfo.url, token);
  90062. case 6:
  90063. isSupportWebp = _context6.sent;
  90064. format = isSupportWebp ? 'webp' : 'png';
  90065. case 8:
  90066. return _context6.abrupt("return", {
  90067. units: result.coordUnit && result.coordUnit.toLowerCase(),
  90068. coordUnit: result.coordUnit,
  90069. visibleScales: result.visibleScales,
  90070. extent: [result.bounds.left, result.bounds.bottom, result.bounds.right, result.bounds.top],
  90071. projection: "EPSG:".concat(result.prjCoordSys.epsgCode),
  90072. format: format
  90073. });
  90074. case 9:
  90075. case "end":
  90076. return _context6.stop();
  90077. }
  90078. }
  90079. }, _callee6);
  90080. }));
  90081. return function (_x9) {
  90082. return _ref4.apply(this, arguments);
  90083. };
  90084. }())["catch"](function (error) {
  90085. return {
  90086. succeed: false,
  90087. error: error
  90088. };
  90089. });
  90090. }
  90091. /**
  90092. * @private
  90093. * @function ol.supermap.WebMap.prototype.getTileInfo
  90094. * @description 获取rest map的图层参数。
  90095. * @param {Object} layerInfo - 图层信息。
  90096. * @param {function} callback - 获得wmts图层参数执行的回调函数
  90097. */
  90098. }, {
  90099. key: "getTileInfo",
  90100. value: function getTileInfo(layerInfo, callback, mapInfo) {
  90101. var that = this;
  90102. var options = {
  90103. withCredentials: this.withCredentials,
  90104. withoutFormatSuffix: true
  90105. };
  90106. if (layerInfo.url.indexOf("?token=") > -1) {
  90107. that.credentialKey = 'token';
  90108. that.credentialValue = layerInfo.credential = layerInfo.url.split("?token=")[1];
  90109. layerInfo.url = layerInfo.url.split("?token=")[0];
  90110. }
  90111. return FetchRequest.get(that.getRequestUrl("".concat(layerInfo.url, ".json")), null, options).then(function (response) {
  90112. return response.json();
  90113. }).then( /*#__PURE__*/function () {
  90114. var _ref5 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee7(result) {
  90115. var token, isSupprtWebp;
  90116. return regenerator_default().wrap(function _callee7$(_context7) {
  90117. while (1) {
  90118. switch (_context7.prev = _context7.next) {
  90119. case 0:
  90120. if (!(result && result.code && result.code !== 200)) {
  90121. _context7.next = 2;
  90122. break;
  90123. }
  90124. throw result;
  90125. case 2:
  90126. if (result.visibleScales) {
  90127. layerInfo.visibleScales = result.visibleScales;
  90128. layerInfo.coordUnit = result.coordUnit;
  90129. }
  90130. layerInfo.maxZoom = result.maxZoom;
  90131. layerInfo.maxZoom = result.minZoom;
  90132. token = layerInfo.credential ? layerInfo.credential.token : undefined;
  90133. layerInfo.format = 'png'; // china_dark为默认底图,还是用png出图
  90134. if (!(that.tileFormat === 'webp' && layerInfo.url !== 'https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark')) {
  90135. _context7.next = 12;
  90136. break;
  90137. }
  90138. _context7.next = 10;
  90139. return that.isSupportWebp(layerInfo.url, token);
  90140. case 10:
  90141. isSupprtWebp = _context7.sent;
  90142. layerInfo.format = isSupprtWebp ? 'webp' : 'png';
  90143. case 12:
  90144. // 请求结果完成 继续添加图层
  90145. if (mapInfo) {
  90146. //todo 这个貌似没有用到,下次优化
  90147. callback && callback(mapInfo, null, true, that);
  90148. } else {
  90149. callback && callback(layerInfo);
  90150. }
  90151. case 13:
  90152. case "end":
  90153. return _context7.stop();
  90154. }
  90155. }
  90156. }, _callee7);
  90157. }));
  90158. return function (_x10) {
  90159. return _ref5.apply(this, arguments);
  90160. };
  90161. }())["catch"](function (error) {
  90162. that.errorCallback && that.errorCallback(error, 'getTileInfo', that.map);
  90163. });
  90164. }
  90165. /**
  90166. * @private
  90167. * @function ol.supermap.WebMap.prototype.getWMTSUrl
  90168. * @description 获取wmts请求文档的url
  90169. * @param {string} url - 图层信息。
  90170. * @param {boolean} isKvp - 是否为kvp模式
  90171. */
  90172. }, {
  90173. key: "getWMTSUrl",
  90174. value: function getWMTSUrl(url, isKvp) {
  90175. var splitStr = '?';
  90176. if (url.indexOf('?') > -1) {
  90177. splitStr = '&';
  90178. }
  90179. if (isKvp) {
  90180. url += splitStr + 'SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities';
  90181. } else {
  90182. url += splitStr + '/1.0.0/WMTSCapabilities.xml';
  90183. }
  90184. return this.getRequestUrl(url, true);
  90185. }
  90186. /**
  90187. * @private
  90188. * @function ol.supermap.WebMap.prototype.getWmtsInfo
  90189. * @description 获取wmts的图层参数。
  90190. * @param {Object} layerInfo - 图层信息。
  90191. * @param {function} callback - 获得wmts图层参数执行的回调函数
  90192. */
  90193. }, {
  90194. key: "getWmtsInfo",
  90195. value: function getWmtsInfo(layerInfo, callback) {
  90196. var that = this;
  90197. var options = {
  90198. withCredentials: that.withCredentials,
  90199. withoutFormatSuffix: true
  90200. };
  90201. var isKvp = !layerInfo.requestEncoding || layerInfo.requestEncoding === 'KVP';
  90202. return FetchRequest.get(that.getWMTSUrl(layerInfo.url, isKvp), null, options).then(function (response) {
  90203. return response.text();
  90204. }).then(function (capabilitiesText) {
  90205. var format = new (external_ol_format_WMTSCapabilities_default())();
  90206. var capabilities = format.read(capabilitiesText);
  90207. if (that.isValidResponse(capabilities)) {
  90208. var content = capabilities.Contents,
  90209. tileMatrixSet = content.TileMatrixSet,
  90210. layers = content.Layer,
  90211. layer,
  90212. idx,
  90213. layerFormat,
  90214. style = 'default';
  90215. for (var n = 0; n < layers.length; n++) {
  90216. if (layers[n].Identifier === layerInfo.layer) {
  90217. idx = n;
  90218. layer = layers[idx];
  90219. layerFormat = layer.Format[0];
  90220. var layerBounds = layer.WGS84BoundingBox; // tileMatrixSetLink = layer.TileMatrixSetLink;
  90221. break;
  90222. }
  90223. }
  90224. layer && layer.Style && layer.Style.forEach(function (value) {
  90225. if (value.isDefault) {
  90226. style = value.Identifier;
  90227. }
  90228. });
  90229. var scales = [],
  90230. matrixIds = [];
  90231. for (var i = 0; i < tileMatrixSet.length; i++) {
  90232. if (tileMatrixSet[i].Identifier === layerInfo.tileMatrixSet) {
  90233. var wmtsLayerEpsg = "EPSG:".concat(tileMatrixSet[i].SupportedCRS.split('::')[1]);
  90234. for (var h = 0; h < tileMatrixSet[i].TileMatrix.length; h++) {
  90235. scales.push(tileMatrixSet[i].TileMatrix[h].ScaleDenominator);
  90236. matrixIds.push(tileMatrixSet[i].TileMatrix[h].Identifier);
  90237. } //bug wmts出图需要加上origin,否则会出现出图不正确的情况。偏移或者瓦片出不了
  90238. var origin = tileMatrixSet[i].TileMatrix[0].TopLeftCorner;
  90239. layerInfo.origin = ["EPSG:4326", "EPSG:4490"].indexOf(wmtsLayerEpsg) > -1 ? [origin[1], origin[0]] : origin;
  90240. break;
  90241. }
  90242. }
  90243. var name = layerInfo.name,
  90244. extent;
  90245. if (layerBounds) {
  90246. extent = external_ol_proj_namespaceObject.transformExtent(layerBounds, 'EPSG:4326', that.baseProjection);
  90247. } else {
  90248. extent = external_ol_proj_namespaceObject.get(that.baseProjection).getExtent();
  90249. }
  90250. layerInfo.tileUrl = that.getTileUrl(capabilities.OperationsMetadata.GetTile.DCP.HTTP.Get, layer, layerFormat, isKvp); //将需要的参数补上
  90251. layerInfo.extent = extent;
  90252. layerInfo.name = name;
  90253. layerInfo.orginEpsgCode = layerInfo.projection;
  90254. layerInfo.overLayer = true;
  90255. layerInfo.scales = scales;
  90256. layerInfo.style = style;
  90257. layerInfo.title = name;
  90258. layerInfo.unit = "m";
  90259. layerInfo.layerFormat = layerFormat;
  90260. layerInfo.matrixIds = matrixIds;
  90261. callback && callback(layerInfo);
  90262. }
  90263. })["catch"](function (error) {
  90264. that.errorCallback && that.errorCallback(error, 'getWmtsFaild', that.map);
  90265. });
  90266. }
  90267. /**
  90268. * @private
  90269. * @function ol.supermap.WebMap.prototype.getTileUrl
  90270. * @description 获取wmts的图层参数。
  90271. * @param {array} getTileArray - 图层信息。
  90272. * @param {string} layer - 选择的图层
  90273. * @param {string} format - 选择的出图方式
  90274. * @param {boolean} isKvp - 是否是kvp方式
  90275. */
  90276. }, {
  90277. key: "getTileUrl",
  90278. value: function getTileUrl(getTileArray, layer, format, isKvp) {
  90279. var url;
  90280. if (isKvp) {
  90281. getTileArray.forEach(function (data) {
  90282. if (data.Constraint[0].AllowedValues.Value[0].toUpperCase() === 'KVP') {
  90283. url = data.href;
  90284. }
  90285. });
  90286. } else {
  90287. var reuslt = layer.ResourceURL.filter(function (resource) {
  90288. return resource.format === format;
  90289. });
  90290. url = reuslt[0].template;
  90291. }
  90292. return url;
  90293. }
  90294. /**
  90295. * @private
  90296. * @function ol.supermap.WebMap.prototype.createWMTSSource
  90297. * @description 获取WMTS类型图层的source。
  90298. * @param {Object} layerInfo - 图层信息。
  90299. * @returns {ol/source/WMTS} wmts的souce
  90300. */
  90301. }, {
  90302. key: "createWMTSSource",
  90303. value: function createWMTSSource(layerInfo) {
  90304. var extent = layerInfo.extent || external_ol_proj_namespaceObject.get(layerInfo.projection).getExtent(); // 单位通过坐标系获取 (PS: 以前代码非4326 都默认是米)
  90305. var unit = external_ol_proj_namespaceObject.get(this.baseProjection).getUnits();
  90306. return new external_ol_source_namespaceObject.WMTS({
  90307. url: layerInfo.tileUrl || layerInfo.url,
  90308. layer: layerInfo.layer,
  90309. format: layerInfo.layerFormat,
  90310. style: layerInfo.style,
  90311. matrixSet: layerInfo.tileMatrixSet,
  90312. requestEncoding: layerInfo.requestEncoding || 'KVP',
  90313. tileGrid: this.getWMTSTileGrid(extent, layerInfo.scales, unit, layerInfo.dpi, layerInfo.origin, layerInfo.matrixIds),
  90314. tileLoadFunction: function tileLoadFunction(imageTile, src) {
  90315. imageTile.getImage().src = src;
  90316. }
  90317. });
  90318. }
  90319. /**
  90320. * @private
  90321. * @function ol.supermap.WebMap.prototype.getWMTSTileGrid
  90322. * @description 获取wmts的瓦片。
  90323. * @param {Object} extent - 图层范围。
  90324. * @param {number} scales - 图层比例尺
  90325. * @param {string} unit - 单位
  90326. * @param {number} dpi - dpi
  90327. * @param {Array} origin 瓦片的原点
  90328. * @returns {ol/tilegrid/WMTS} wmts的瓦片
  90329. */
  90330. }, {
  90331. key: "getWMTSTileGrid",
  90332. value: function getWMTSTileGrid(extent, scales, unit, dpi, origin, matrixIds) {
  90333. var resolutionsInfo = this.getReslutionsFromScales(scales, dpi || dpiConfig.iServerWMTS, unit);
  90334. return new (external_ol_tilegrid_WMTS_default())({
  90335. origin: origin,
  90336. extent: extent,
  90337. resolutions: resolutionsInfo.res,
  90338. matrixIds: matrixIds || resolutionsInfo.matrixIds
  90339. });
  90340. }
  90341. /**
  90342. * @private
  90343. * @function ol.supermap.WebMap.prototype.getReslutionsFromScales
  90344. * @description 根据比例尺(比例尺分母)、地图单位、dpi、获取一个分辨率数组
  90345. * @param {array} scales - 比例尺(比例尺分母)
  90346. * @param {number} dpi - 地图dpi
  90347. * @param {string} unit - 单位
  90348. * @param {number} datumAxis
  90349. * @returns {{res: Array, matrixIds: Array}}
  90350. */
  90351. }, {
  90352. key: "getReslutionsFromScales",
  90353. value: function getReslutionsFromScales(scales, dpi, unit, datumAxis) {
  90354. unit = unit && unit.toLowerCase() || 'degrees';
  90355. dpi = dpi || dpiConfig.iServerWMTS;
  90356. datumAxis = datumAxis || 6378137;
  90357. var res = [],
  90358. matrixIds = []; //给个默认的
  90359. if (core_Util_Util.isArray(scales)) {
  90360. scales && scales.forEach(function (scale, idx) {
  90361. if (scale > 1.0) {
  90362. matrixIds.push(idx);
  90363. res.push(this.getResolutionFromScale(scale, dpi, unit, datumAxis));
  90364. }
  90365. }, this);
  90366. } else {
  90367. var tileMatrixSet = scales['TileMatrix'];
  90368. tileMatrixSet && tileMatrixSet.forEach(function (tileMatrix) {
  90369. matrixIds.push(tileMatrix['Identifier']);
  90370. res.push(this.getResolutionFromScale(tileMatrix['ScaleDenominator'], dpi, unit, datumAxis));
  90371. }, this);
  90372. }
  90373. return {
  90374. res: res,
  90375. matrixIds: matrixIds
  90376. };
  90377. }
  90378. /**
  90379. * @private
  90380. * @function ol.supermap.WebMap.prototype.getResolutionFromScale
  90381. * @description 获取一个WMTS source需要的tileGrid
  90382. * @param {number} scale - 比例尺(比例尺分母)
  90383. * @param {number} dpi - 地图dpi
  90384. * @param {string} unit - 单位
  90385. * @param {number} datumAxis
  90386. * @returns {{res: Array, matrixIds: Array}}
  90387. */
  90388. }, {
  90389. key: "getResolutionFromScale",
  90390. value: function getResolutionFromScale(scale) {
  90391. var dpi = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : dpiConfig["default"];
  90392. var unit = arguments.length > 2 ? arguments[2] : undefined;
  90393. var datumAxis = arguments.length > 3 ? arguments[3] : undefined;
  90394. //radio = 10000;
  90395. var res;
  90396. scale = +scale;
  90397. scale = scale > 1.0 ? 1.0 / scale : scale;
  90398. if (unit === 'degrees' || unit === 'dd' || unit === 'degree') {
  90399. res = 0.0254 * 10000 / dpi / scale / (Math.PI * 2 * datumAxis / 360) / 10000;
  90400. } else {
  90401. res = 0.0254 * 10000 / dpi / scale / 10000;
  90402. }
  90403. return res;
  90404. }
  90405. /**
  90406. * @private
  90407. * @function ol.supermap.WebMap.prototype.isValidResponse
  90408. * @description 返回信息是否符合对应类型的标准
  90409. * @param {object} response - 返回的信息
  90410. * @returns {boolean}
  90411. */
  90412. }, {
  90413. key: "isValidResponse",
  90414. value: function isValidResponse(response) {
  90415. var responseEnum = ['Contents', 'OperationsMetadata'],
  90416. valid = true;
  90417. for (var i = 0; i < responseEnum.length; i++) {
  90418. if (!response[responseEnum[i]] || response.error) {
  90419. valid = false;
  90420. break;
  90421. }
  90422. }
  90423. return valid;
  90424. }
  90425. /**
  90426. * @private
  90427. * @function ol.supermap.WebMap.prototype.addLayers
  90428. * @description 添加叠加图层
  90429. * @param {object} mapInfo - 地图信息
  90430. */
  90431. }, {
  90432. key: "addLayers",
  90433. value: function addLayers(mapInfo) {
  90434. var layers = mapInfo.layers,
  90435. that = this;
  90436. var features = [],
  90437. len = layers.length;
  90438. if (len > 0) {
  90439. //存储地图上所有的图层对象
  90440. this.layers = layers;
  90441. layers.forEach(function (layer, index) {
  90442. //加上底图的index
  90443. var layerIndex = index + 1,
  90444. dataSource = layer.dataSource,
  90445. isSampleData = dataSource && dataSource.type === "SAMPLE_DATA" && !!dataSource.name; //SAMPLE_DATA是本地示例数据
  90446. if (layer.layerType === "MAPBOXSTYLE") {
  90447. that.addMVTMapLayer(mapInfo, layer, layerIndex).then(function () {
  90448. that.layerAdded++;
  90449. that.sendMapToUser(len);
  90450. });
  90451. } else if (dataSource && dataSource.serverId || layer.layerType === "MARKER" || layer.layerType === 'HOSTED_TILE' || isSampleData) {
  90452. //数据存储到iportal上了
  90453. var _dataSource = layer.dataSource,
  90454. serverId = _dataSource ? _dataSource.serverId : layer.serverId;
  90455. if (!serverId && !isSampleData) {
  90456. that.addLayer(layer, null, layerIndex);
  90457. that.layerAdded++;
  90458. that.sendMapToUser(len);
  90459. return;
  90460. }
  90461. if (layer.layerType === "MARKER" || _dataSource && (!_dataSource.accessType || _dataSource.accessType === 'DIRECT') || isSampleData) {
  90462. //原来二进制文件
  90463. var url = isSampleData ? "".concat(that.server, "apps/dataviz/libs/sample-datas/").concat(_dataSource.name, ".json") : "".concat(that.server, "web/datas/").concat(serverId, "/content.json?pageSize=9999999&currentPage=1");
  90464. url = that.getRequestUrl(url);
  90465. FetchRequest.get(url, null, {
  90466. withCredentials: this.withCredentials
  90467. }).then(function (response) {
  90468. return response.json();
  90469. }).then( /*#__PURE__*/function () {
  90470. var _ref6 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee8(data) {
  90471. var _layer$dataSource$adm, divisionType, divisionField, geojson, content;
  90472. return regenerator_default().wrap(function _callee8$(_context8) {
  90473. while (1) {
  90474. switch (_context8.prev = _context8.next) {
  90475. case 0:
  90476. if (!(data.succeed === false)) {
  90477. _context8.next = 5;
  90478. break;
  90479. }
  90480. //请求失败
  90481. that.layerAdded++;
  90482. that.sendMapToUser(len);
  90483. that.errorCallback && that.errorCallback(data.error, 'getLayerFaild', that.map);
  90484. return _context8.abrupt("return");
  90485. case 5:
  90486. if (!(data && data.type)) {
  90487. _context8.next = 28;
  90488. break;
  90489. }
  90490. if (!(data.type === "JSON" || data.type === "GEOJSON")) {
  90491. _context8.next = 11;
  90492. break;
  90493. }
  90494. data.content = data.content.type ? data.content : JSON.parse(data.content);
  90495. features = that.geojsonToFeature(data.content, layer);
  90496. _context8.next = 25;
  90497. break;
  90498. case 11:
  90499. if (!(data.type === 'EXCEL' || data.type === 'CSV')) {
  90500. _context8.next = 24;
  90501. break;
  90502. }
  90503. if (!(layer.dataSource && layer.dataSource.administrativeInfo)) {
  90504. _context8.next = 19;
  90505. break;
  90506. }
  90507. //行政规划信息
  90508. data.content.rows.unshift(data.content.colTitles);
  90509. _layer$dataSource$adm = layer.dataSource.administrativeInfo, divisionType = _layer$dataSource$adm.divisionType, divisionField = _layer$dataSource$adm.divisionField;
  90510. geojson = that.excelData2FeatureByDivision(data.content, divisionType, divisionField);
  90511. features = that._parseGeoJsonData2Feature({
  90512. allDatas: {
  90513. features: geojson.features
  90514. },
  90515. fileCode: layer.projection
  90516. });
  90517. _context8.next = 22;
  90518. break;
  90519. case 19:
  90520. _context8.next = 21;
  90521. return that.excelData2Feature(data.content, layer);
  90522. case 21:
  90523. features = _context8.sent;
  90524. case 22:
  90525. _context8.next = 25;
  90526. break;
  90527. case 24:
  90528. if (data.type === 'SHP') {
  90529. content = JSON.parse(data.content);
  90530. data.content = content.layers[0];
  90531. features = that.geojsonToFeature(data.content, layer);
  90532. }
  90533. case 25:
  90534. that.addLayer(layer, features, layerIndex);
  90535. that.layerAdded++;
  90536. that.sendMapToUser(len);
  90537. case 28:
  90538. case "end":
  90539. return _context8.stop();
  90540. }
  90541. }
  90542. }, _callee8);
  90543. }));
  90544. return function (_x11) {
  90545. return _ref6.apply(this, arguments);
  90546. };
  90547. }())["catch"](function (error) {
  90548. that.layerAdded++;
  90549. that.sendMapToUser(len);
  90550. that.errorCallback && that.errorCallback(error, 'getLayerFaild', that.map);
  90551. });
  90552. } else {
  90553. //关系型文件
  90554. var isMapService = layer.layerType === 'HOSTED_TILE',
  90555. _serverId = _dataSource ? _dataSource.serverId : layer.serverId;
  90556. that.checkUploadToRelationship(_serverId).then(function (result) {
  90557. if (result && result.length > 0) {
  90558. var datasetName = result[0].name,
  90559. featureType = result[0].type.toUpperCase();
  90560. that.getDataService(_serverId, datasetName).then(function (data) {
  90561. var dataItemServices = data.dataItemServices;
  90562. if (dataItemServices.length === 0) {
  90563. that.layerAdded++;
  90564. that.sendMapToUser(len);
  90565. that.errorCallback && that.errorCallback(null, 'getLayerFaild', that.map);
  90566. return;
  90567. }
  90568. if (isMapService) {
  90569. //需要判断是使用tile还是mvt服务
  90570. var dataService = that.getService(dataItemServices, 'RESTDATA');
  90571. that.isMvt(dataService.address, datasetName).then(function (info) {
  90572. that.getServiceInfoFromLayer(layerIndex, len, layer, dataItemServices, datasetName, featureType, info);
  90573. })["catch"](function () {
  90574. //判断失败就走之前逻辑,>数据量用tile
  90575. that.getServiceInfoFromLayer(layerIndex, len, layer, dataItemServices, datasetName, featureType);
  90576. });
  90577. } else {
  90578. that.getServiceInfoFromLayer(layerIndex, len, layer, dataItemServices, datasetName, featureType);
  90579. }
  90580. });
  90581. } else {
  90582. that.layerAdded++;
  90583. that.sendMapToUser(len);
  90584. that.errorCallback && that.errorCallback(null, 'getLayerFaild', that.map);
  90585. }
  90586. })["catch"](function (error) {
  90587. that.layerAdded++;
  90588. that.sendMapToUser(len);
  90589. that.errorCallback && that.errorCallback(error, 'getLayerFaild', that.map);
  90590. });
  90591. }
  90592. } else if (dataSource && dataSource.type === "USER_DATA") {
  90593. that.addGeojsonFromUrl(layer, len, layerIndex, false);
  90594. } else if (layer.layerType === "TILE") {
  90595. that.getTileLayerExtent(layer, function (layerInfo) {
  90596. that.map.addLayer(that.createBaseLayer(layerInfo, layerIndex));
  90597. that.layerAdded++;
  90598. that.sendMapToUser(len);
  90599. }, function (e) {
  90600. that.layerAdded++;
  90601. that.sendMapToUser(len);
  90602. that.errorCallback && that.errorCallback(e, 'getLayerFaild', that.map);
  90603. });
  90604. } else if (layer.layerType === 'SUPERMAP_REST' || layer.layerType === "WMS" || layer.layerType === "WMTS") {
  90605. if (layer.layerType === "WMTS") {
  90606. that.getWmtsInfo(layer, function (layerInfo) {
  90607. that.map.addLayer(that.createBaseLayer(layerInfo, layerIndex));
  90608. that.layerAdded++;
  90609. that.sendMapToUser(len);
  90610. });
  90611. } else {
  90612. layer.projection = that.baseProjection;
  90613. that.map.addLayer(that.createBaseLayer(layer, layerIndex));
  90614. that.layerAdded++;
  90615. that.sendMapToUser(len);
  90616. }
  90617. } else if (dataSource && dataSource.type === "REST_DATA") {
  90618. //从restData获取数据
  90619. that.getFeaturesFromRestData(layer, layerIndex, len);
  90620. } else if (dataSource && dataSource.type === "REST_MAP" && dataSource.url) {
  90621. //示例数据
  90622. core_Util_Util.queryFeatureBySQL(dataSource.url, dataSource.layerName, 'smid=1', null, null, function (result) {
  90623. var recordsets = result && result.result.recordsets;
  90624. var recordset = recordsets && recordsets[0];
  90625. var attributes = recordset.fields;
  90626. if (recordset && attributes) {
  90627. var fileterAttrs = [];
  90628. for (var i in attributes) {
  90629. var value = attributes[i];
  90630. if (value.indexOf('Sm') !== 0 || value === "SmID") {
  90631. fileterAttrs.push(value);
  90632. }
  90633. }
  90634. that.getFeatures(fileterAttrs, layer, function (features) {
  90635. that.addLayer(layer, features, layerIndex);
  90636. that.layerAdded++;
  90637. that.sendMapToUser(len);
  90638. }, function (e) {
  90639. that.layerAdded++;
  90640. that.errorCallback && that.errorCallback(e, 'getFeatureFaild', that.map);
  90641. });
  90642. }
  90643. }, function (e) {
  90644. that.errorCallback && that.errorCallback(e, 'getFeatureFaild', that.map);
  90645. });
  90646. } else if (layer.layerType === "DATAFLOW_POINT_TRACK" || layer.layerType === "DATAFLOW_HEAT") {
  90647. that.getDataflowInfo(layer, function () {
  90648. that.addLayer(layer, features, layerIndex);
  90649. that.layerAdded++;
  90650. that.sendMapToUser(len);
  90651. }, function (e) {
  90652. that.layerAdded++;
  90653. that.errorCallback && that.errorCallback(e, 'getFeatureFaild', that.map);
  90654. });
  90655. }
  90656. }, this);
  90657. }
  90658. }
  90659. /**
  90660. * @private
  90661. * @function ol.supermap.WebMap.prototype.addGeojsonFromUrl
  90662. * @description 从web服务输入geojson地址的图层
  90663. * @param {object} layerInfo - 图层信息
  90664. * @param {Number} len - 总的图层数量
  90665. * @param {Number} layerIndex - 当前图层index
  90666. * @param {Boolean} withCredentials - 是否携带cookie
  90667. */
  90668. }, {
  90669. key: "addGeojsonFromUrl",
  90670. value: function addGeojsonFromUrl(layerInfo, len, layerIndex) {
  90671. var withCredentials = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.withCredentials;
  90672. // 通过web添加geojson不需要携带cookie
  90673. var dataSource = layerInfo.dataSource,
  90674. url = dataSource.url,
  90675. that = this;
  90676. FetchRequest.get(url, null, {
  90677. withCredentials: withCredentials,
  90678. withoutFormatSuffix: true
  90679. }).then(function (response) {
  90680. return response.json();
  90681. }).then( /*#__PURE__*/function () {
  90682. var _ref7 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee9(data) {
  90683. var features, _layerInfo$dataSource, divisionType, divisionField, geojson, geoJson;
  90684. return regenerator_default().wrap(function _callee9$(_context9) {
  90685. while (1) {
  90686. switch (_context9.prev = _context9.next) {
  90687. case 0:
  90688. if (!(!data || data.succeed === false)) {
  90689. _context9.next = 3;
  90690. break;
  90691. }
  90692. //请求失败
  90693. if (len) {
  90694. that.errorCallback && that.errorCallback(data.error, 'autoUpdateFaild', that.map);
  90695. } else {
  90696. that.layerAdded++;
  90697. that.sendMapToUser(len);
  90698. that.errorCallback && that.errorCallback(data.error, 'getLayerFaild', that.map);
  90699. }
  90700. return _context9.abrupt("return");
  90701. case 3:
  90702. if (!(data.type === 'CSV' || data.type === 'EXCEL')) {
  90703. _context9.next = 16;
  90704. break;
  90705. }
  90706. if (!(layerInfo.dataSource && layerInfo.dataSource.administrativeInfo)) {
  90707. _context9.next = 11;
  90708. break;
  90709. }
  90710. //行政规划信息
  90711. data.content.rows.unshift(data.content.colTitles);
  90712. _layerInfo$dataSource = layerInfo.dataSource.administrativeInfo, divisionType = _layerInfo$dataSource.divisionType, divisionField = _layerInfo$dataSource.divisionField;
  90713. geojson = that.excelData2FeatureByDivision(data.content, divisionType, divisionField);
  90714. features = that._parseGeoJsonData2Feature({
  90715. allDatas: {
  90716. features: geojson.features
  90717. },
  90718. fileCode: layerInfo.projection
  90719. });
  90720. _context9.next = 14;
  90721. break;
  90722. case 11:
  90723. _context9.next = 13;
  90724. return that.excelData2Feature(data.content, layerInfo);
  90725. case 13:
  90726. features = _context9.sent;
  90727. case 14:
  90728. _context9.next = 18;
  90729. break;
  90730. case 16:
  90731. geoJson = data.content ? JSON.parse(data.content) : data;
  90732. features = that.geojsonToFeature(geoJson, layerInfo);
  90733. case 18:
  90734. if (len) {
  90735. //上图
  90736. that.addLayer(layerInfo, features, layerIndex);
  90737. that.layerAdded++;
  90738. that.sendMapToUser(len);
  90739. } else {
  90740. //自动更新
  90741. that.map.removeLayer(layerInfo.layer);
  90742. layerInfo.labelLayer && that.map.removeLayer(layerInfo.labelLayer);
  90743. that.addLayer(layerInfo, features, layerIndex);
  90744. }
  90745. case 19:
  90746. case "end":
  90747. return _context9.stop();
  90748. }
  90749. }
  90750. }, _callee9);
  90751. }));
  90752. return function (_x12) {
  90753. return _ref7.apply(this, arguments);
  90754. };
  90755. }())["catch"](function (error) {
  90756. that.layerAdded++;
  90757. that.sendMapToUser(len);
  90758. that.errorCallback && that.errorCallback(error, 'getLayerFaild', that.map);
  90759. });
  90760. }
  90761. /**
  90762. * @private
  90763. * @function ol.supermap.WebMap.prototype.getServiceInfoFromLayer
  90764. * @description 判断使用哪种服务上图
  90765. * @param {Number} layerIndex - 图层对应的index
  90766. * @param {Number} len - 成功添加的图层个数
  90767. * @param {Object} layer - 图层信息
  90768. * @param {Array} dataItemServices - 数据发布的服务
  90769. * @param {String} datasetName - 数据服务的数据集名称
  90770. * @param {String} featureType - feature类型
  90771. * @param {Object} info - 数据服务的信息
  90772. */
  90773. }, {
  90774. key: "getServiceInfoFromLayer",
  90775. value: function getServiceInfoFromLayer(layerIndex, len, layer, dataItemServices, datasetName, featureType, info) {
  90776. var that = this;
  90777. var isMapService = info ? !info.isMvt : layer.layerType === 'HOSTED_TILE',
  90778. isAdded = false;
  90779. dataItemServices.forEach(function (service) {
  90780. if (isAdded) {
  90781. return;
  90782. } //有服务了,就不需要循环
  90783. if (service && isMapService && service.serviceType === 'RESTMAP') {
  90784. isAdded = true; //地图服务,判断使用mvt还是tile
  90785. that.getTileLayerInfo(service.address).then(function (restMaps) {
  90786. restMaps.forEach(function (restMapInfo) {
  90787. var bounds = restMapInfo.bounds;
  90788. layer.layerType = 'TILE';
  90789. layer.orginEpsgCode = that.baseProjection;
  90790. layer.units = restMapInfo.coordUnit && restMapInfo.coordUnit.toLowerCase();
  90791. layer.extent = [bounds.left, bounds.bottom, bounds.right, bounds.top];
  90792. layer.visibleScales = restMapInfo.visibleScales;
  90793. layer.url = restMapInfo.url;
  90794. layer.sourceType = 'TILE';
  90795. that.map.addLayer(that.createBaseLayer(layer, layerIndex));
  90796. that.layerAdded++;
  90797. that.sendMapToUser(len);
  90798. });
  90799. });
  90800. } else if (service && !isMapService && service.serviceType === 'RESTDATA') {
  90801. isAdded = true;
  90802. if (info && info.isMvt) {
  90803. var bounds = info.bounds;
  90804. layer = Object.assign(layer, {
  90805. layerType: "VECTOR_TILE",
  90806. epsgCode: info.epsgCode,
  90807. projection: "EPSG:".concat(info.epsgCode),
  90808. bounds: bounds,
  90809. extent: [bounds.left, bounds.bottom, bounds.right, bounds.top],
  90810. name: layer.name,
  90811. url: info.url,
  90812. visible: layer.visible,
  90813. featureType: featureType,
  90814. serverId: layer.serverId.toString()
  90815. });
  90816. that.map.addLayer(that.addVectorTileLayer(layer, layerIndex, 'RESTDATA'));
  90817. that.layerAdded++;
  90818. that.sendMapToUser(len);
  90819. } else {
  90820. //数据服务
  90821. isAdded = true; //关系型文件发布的数据服务
  90822. that.getDatasources(service.address).then(function (datasourceName) {
  90823. layer.dataSource.dataSourceName = datasourceName + ":" + datasetName;
  90824. layer.dataSource.url = "".concat(service.address, "/data");
  90825. that.getFeaturesFromRestData(layer, layerIndex, len);
  90826. });
  90827. }
  90828. }
  90829. });
  90830. if (!isAdded) {
  90831. //循环完成了,也没有找到合适的服务。有可能服务被删除
  90832. that.layerAdded++;
  90833. that.sendMapToUser(len);
  90834. that.errorCallback && that.errorCallback(null, 'getLayerFaild', that.map);
  90835. }
  90836. }
  90837. /**
  90838. * @private
  90839. * @function ol.supermap.WebMap.prototype.getDataflowInfo
  90840. * @description 获取数据流服务的参数
  90841. * @param {object} layerInfo - 图层信息
  90842. * @param {function} success - 成功回调函数
  90843. * @param {function} faild - 失败回调函数
  90844. */
  90845. }, {
  90846. key: "getDataflowInfo",
  90847. value: function getDataflowInfo(layerInfo, success, faild) {
  90848. var that = this;
  90849. var url = layerInfo.url,
  90850. token;
  90851. var requestUrl = that.getRequestUrl("".concat(url, ".json"), false);
  90852. if (layerInfo.credential && layerInfo.credential.token) {
  90853. token = layerInfo.credential.token;
  90854. requestUrl += "?token=".concat(token);
  90855. }
  90856. FetchRequest.get(requestUrl, null, {
  90857. withCredentials: this.withCredentials
  90858. }).then(function (response) {
  90859. return response.json();
  90860. }).then(function (result) {
  90861. layerInfo.featureType = "POINT";
  90862. if (result && result.featureMetaData) {
  90863. layerInfo.featureType = result.featureMetaData.featureType.toUpperCase();
  90864. }
  90865. layerInfo.wsUrl = result.urls[0].url;
  90866. success();
  90867. })["catch"](function () {
  90868. faild();
  90869. });
  90870. }
  90871. /**
  90872. * @private
  90873. * @function ol.supermap.WebMap.prototype.getFeaturesFromRestData
  90874. * @description 从数据服务中获取feature
  90875. * @param {object} layer - 图层信息
  90876. * @param {Number} layerIndex - 图层index
  90877. * @param {Number} layerLength - 图层数量
  90878. */
  90879. }, {
  90880. key: "getFeaturesFromRestData",
  90881. value: function getFeaturesFromRestData(layer, layerIndex, layerLength) {
  90882. var that = this,
  90883. dataSource = layer.dataSource,
  90884. url = layer.dataSource.url,
  90885. dataSourceName = dataSource.dataSourceName || layer.name;
  90886. var requestUrl = that.formatUrlWithCredential(url),
  90887. serviceOptions = {};
  90888. serviceOptions.withCredentials = this.withCredentials;
  90889. if (!this.excludePortalProxyUrl && !Util.isInTheSameDomain(requestUrl)) {
  90890. serviceOptions.proxy = this.getProxy();
  90891. }
  90892. if (['EPSG:-1', 'EPSG:0', 'EPSG:-1000'].includes(layer.projection)) {
  90893. // 不支持动态投影restData服务
  90894. that.layerAdded++;
  90895. that.sendMapToUser(layerLength);
  90896. that.errorCallback && that.errorCallback({}, 'getFeatureFaild', that.map);
  90897. return;
  90898. } //因为itest上使用的https,iserver是http,所以要加上代理
  90899. core_Util_Util.getFeatureBySQL(requestUrl, [dataSourceName], serviceOptions, function (result) {
  90900. var features = that.parseGeoJsonData2Feature({
  90901. allDatas: {
  90902. features: result.result.features.features
  90903. },
  90904. fileCode: that.baseProjection,
  90905. //因为获取restData用了动态投影,不需要再进行坐标转换。所以此处filecode和底图坐标系一致
  90906. featureProjection: that.baseProjection
  90907. });
  90908. that.addLayer(layer, features, layerIndex);
  90909. that.layerAdded++;
  90910. that.sendMapToUser(layerLength);
  90911. }, function (err) {
  90912. that.layerAdded++;
  90913. that.sendMapToUser(layerLength);
  90914. that.errorCallback && that.errorCallback(err, 'getFeatureFaild', that.map);
  90915. }, that.baseProjection.split("EPSG:")[1]);
  90916. }
  90917. /**
  90918. * @private
  90919. * @function ol.supermap.WebMap.prototype.getFeatures
  90920. * @description 从地图中获取feature
  90921. * @param {object} fields - 图层信息
  90922. * @param {Number} layerInfo - 图层index
  90923. * @param {Number} success - 成功回调
  90924. * @param {Number} faild - 失败回调
  90925. */
  90926. }, {
  90927. key: "getFeatures",
  90928. value: function getFeatures(fields, layerInfo, success, faild) {
  90929. var that = this;
  90930. var source = layerInfo.dataSource;
  90931. var fileCode = layerInfo.projection;
  90932. core_Util_Util.queryFeatureBySQL(source.url, source.layerName, null, fields, null, function (result) {
  90933. var recordsets = result.result.recordsets[0];
  90934. var features = recordsets.features.features;
  90935. var featuresObj = that.parseGeoJsonData2Feature({
  90936. allDatas: {
  90937. features: features
  90938. },
  90939. fileCode: fileCode,
  90940. featureProjection: that.baseProjection
  90941. }, 'JSON');
  90942. success(featuresObj);
  90943. }, function (err) {
  90944. faild(err);
  90945. });
  90946. }
  90947. /**
  90948. * @private
  90949. * @function ol.supermap.WebMap.prototype.sendMapToUser
  90950. * @description 将所有叠加图层叠加后,返回最终的map对象给用户,供他们操作使用
  90951. * @param {number} layersLen - 叠加图层总数
  90952. */
  90953. }, {
  90954. key: "sendMapToUser",
  90955. value: function sendMapToUser(layersLen) {
  90956. var lens = this.isHaveGraticule ? layersLen + 1 : layersLen;
  90957. if (this.layerAdded === lens && this.successCallback) {
  90958. this.successCallback(this.map, this.mapParams, this.layers, this.baseLayer);
  90959. }
  90960. }
  90961. /**
  90962. * @private
  90963. * @function ol.supermap.WebMap.prototype.excelData2Feature
  90964. * @description 将csv和xls文件内容转换成ol.feature
  90965. * @param {object} content - 文件内容
  90966. * @param {object} layerInfo - 图层信息
  90967. * @returns {Array} ol.feature的数组集合
  90968. */
  90969. }, {
  90970. key: "excelData2Feature",
  90971. value: function () {
  90972. var _excelData2Feature = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee10(content, layerInfo) {
  90973. var rows, colTitles, i, fileCode, dataSource, baseLayerEpsgCode, features, xField, yField, xIdx, yIdx, _yield$FetchRequest$g, dataMetaInfo, sampleData, _i, len, rowDatas, attributes, geomX, geomY, olGeom, j, leng, field, newField, feature;
  90974. return regenerator_default().wrap(function _callee10$(_context10) {
  90975. while (1) {
  90976. switch (_context10.prev = _context10.next) {
  90977. case 0:
  90978. rows = content.rows, colTitles = content.colTitles; // 解决V2恢复的数据中含有空格
  90979. for (i in colTitles) {
  90980. if (core_Util_Util.isString(colTitles[i])) {
  90981. colTitles[i] = core_Util_Util.trim(colTitles[i]);
  90982. }
  90983. }
  90984. fileCode = layerInfo.projection, dataSource = layerInfo.dataSource, baseLayerEpsgCode = this.baseProjection, features = [], xField = core_Util_Util.trim(layerInfo.xyField && layerInfo.xyField.xField || layerInfo.from && layerInfo.from.xField), yField = core_Util_Util.trim(layerInfo.xyField && layerInfo.xyField.yField || layerInfo.from && layerInfo.from.yField), xIdx = colTitles.indexOf(xField), yIdx = colTitles.indexOf(yField); // todo 优化 暂时这样处理
  90985. if (!(layerInfo.layerType === 'MIGRATION')) {
  90986. _context10.next = 20;
  90987. break;
  90988. }
  90989. _context10.prev = 4;
  90990. if (!(dataSource.type === 'PORTAL_DATA')) {
  90991. _context10.next = 14;
  90992. break;
  90993. }
  90994. _context10.next = 8;
  90995. return FetchRequest.get("".concat(this.server, "web/datas/").concat(dataSource.serverId, ".json"), null, {
  90996. withCredentials: this.withCredentials
  90997. }).then(function (res) {
  90998. return res.json();
  90999. });
  91000. case 8:
  91001. _yield$FetchRequest$g = _context10.sent;
  91002. dataMetaInfo = _yield$FetchRequest$g.dataMetaInfo;
  91003. // eslint-disable-next-line require-atomic-updates
  91004. layerInfo.xyField = {
  91005. xField: dataMetaInfo.xField,
  91006. yField: dataMetaInfo.yField
  91007. };
  91008. if (!dataMetaInfo.xIndex) {
  91009. xIdx = colTitles.indexOf(dataMetaInfo.xField);
  91010. yIdx = colTitles.indexOf(dataMetaInfo.yField);
  91011. } else {
  91012. xIdx = dataMetaInfo.xIndex;
  91013. yIdx = dataMetaInfo.yIndex;
  91014. }
  91015. _context10.next = 15;
  91016. break;
  91017. case 14:
  91018. if (dataSource.type === 'SAMPLE_DATA') {
  91019. // 示例数据从本地拿xyField
  91020. sampleData = SampleDataInfo_namespaceObject.find(function (item) {
  91021. return item.id === dataSource.name;
  91022. }) || {};
  91023. xField = sampleData.xField;
  91024. yField = sampleData.yField;
  91025. layerInfo.xyField = {
  91026. xField: xField,
  91027. yField: yField
  91028. };
  91029. xIdx = colTitles.findIndex(function (item) {
  91030. return item === xField;
  91031. });
  91032. yIdx = colTitles.findIndex(function (item) {
  91033. return item === yField;
  91034. });
  91035. }
  91036. case 15:
  91037. _context10.next = 20;
  91038. break;
  91039. case 17:
  91040. _context10.prev = 17;
  91041. _context10.t0 = _context10["catch"](4);
  91042. console.error(_context10.t0);
  91043. case 20:
  91044. _i = 0, len = rows.length;
  91045. case 21:
  91046. if (!(_i < len)) {
  91047. _context10.next = 41;
  91048. break;
  91049. }
  91050. rowDatas = rows[_i], attributes = {}, geomX = rows[_i][xIdx], geomY = rows[_i][yIdx]; // 位置字段信息不存在 过滤数据
  91051. if (!(geomX !== '' && geomY !== '')) {
  91052. _context10.next = 38;
  91053. break;
  91054. }
  91055. olGeom = new external_ol_geom_namespaceObject.Point([+geomX, +geomY]);
  91056. if (fileCode !== baseLayerEpsgCode) {
  91057. olGeom.transform(fileCode, baseLayerEpsgCode);
  91058. }
  91059. j = 0, leng = rowDatas.length;
  91060. case 27:
  91061. if (!(j < leng)) {
  91062. _context10.next = 36;
  91063. break;
  91064. }
  91065. field = colTitles[j];
  91066. if (!(field === undefined || field === null)) {
  91067. _context10.next = 31;
  91068. break;
  91069. }
  91070. return _context10.abrupt("continue", 33);
  91071. case 31:
  91072. field = field.trim();
  91073. if (Object.keys(attributes).indexOf(field) > -1) {
  91074. //说明前面有个一模一样的字段
  91075. newField = field + '_1';
  91076. attributes[newField] = rowDatas[j];
  91077. } else {
  91078. attributes[field] = rowDatas[j];
  91079. }
  91080. case 33:
  91081. j++;
  91082. _context10.next = 27;
  91083. break;
  91084. case 36:
  91085. feature = new (external_ol_Feature_default())({
  91086. geometry: olGeom,
  91087. attributes: attributes
  91088. });
  91089. features.push(feature);
  91090. case 38:
  91091. _i++;
  91092. _context10.next = 21;
  91093. break;
  91094. case 41:
  91095. return _context10.abrupt("return", Promise.resolve(features));
  91096. case 42:
  91097. case "end":
  91098. return _context10.stop();
  91099. }
  91100. }
  91101. }, _callee10, this, [[4, 17]]);
  91102. }));
  91103. function excelData2Feature(_x13, _x14) {
  91104. return _excelData2Feature.apply(this, arguments);
  91105. }
  91106. return excelData2Feature;
  91107. }()
  91108. /**
  91109. * @private
  91110. * @function ol.supermap.WebMap.prototype.excelData2FeatureByDivision
  91111. * @description 行政区划数据处理
  91112. * @param {object} content - 文件内容
  91113. * @param {object} layerInfo - 图层信息
  91114. * @returns {object} geojson对象
  91115. */
  91116. }, {
  91117. key: "excelData2FeatureByDivision",
  91118. value: function excelData2FeatureByDivision(content, divisionType, divisionField) {
  91119. var me = this;
  91120. var asyncInport;
  91121. if (divisionType === 'Province') {
  91122. asyncInport = window.ProvinceData;
  91123. } else if (divisionType === 'City') {
  91124. asyncInport = window.MunicipalData;
  91125. } else if (divisionType === 'GB-T_2260') {
  91126. // let geojso;
  91127. asyncInport = window.AdministrativeArea;
  91128. }
  91129. if (asyncInport) {
  91130. var geojson = me.changeExcel2Geojson(asyncInport.features, content.rows, divisionType, divisionField);
  91131. return geojson;
  91132. }
  91133. }
  91134. /**
  91135. * @private
  91136. * @function ol.supermap.WebMap.prototype._parseGeoJsonData2Feature
  91137. * @description 将geojson的数据转换成ol.Feature
  91138. * @param {object} metaData - 文件内容
  91139. * @returns {Array.<ol/Feature>} features
  91140. */
  91141. }, {
  91142. key: "_parseGeoJsonData2Feature",
  91143. value: function _parseGeoJsonData2Feature(metaData) {
  91144. var allFeatures = metaData.allDatas.features,
  91145. features = [];
  91146. for (var i = 0, len = allFeatures.length; i < len; i++) {
  91147. //不删除properties转换后,属性全都在feature上
  91148. var properties = Object.assign({}, allFeatures[i].properties);
  91149. delete allFeatures[i].properties;
  91150. var feature = transformTools.readFeature(allFeatures[i], {
  91151. dataProjection: metaData.fileCode,
  91152. featureProjection: this.baseProjection || 'ESPG:4326'
  91153. });
  91154. feature.setProperties({
  91155. attributes: properties
  91156. });
  91157. features.push(feature);
  91158. }
  91159. return features;
  91160. }
  91161. /**
  91162. * @private
  91163. * @function ol.supermap.WebMap.prototype.changeExcel2Geojson
  91164. * @description 将excel和csv数据转换成标准geojson数据
  91165. * @param {array} features - feature对象
  91166. * @param {array} datas - 数据内容
  91167. * @param {string} divisionType - 行政区划类型
  91168. * @param {string} divisionField - 行政区划字段
  91169. * @returns {object} geojson对象
  91170. */
  91171. }, {
  91172. key: "changeExcel2Geojson",
  91173. value: function changeExcel2Geojson(features, datas, divisionType, divisionField) {
  91174. var geojson = {
  91175. type: 'FeatureCollection',
  91176. features: []
  91177. };
  91178. if (datas.length < 2) {
  91179. return geojson; //只有一行数据时为标题
  91180. }
  91181. var titles = datas[0],
  91182. rows = datas.slice(1),
  91183. fieldIndex = titles.findIndex(function (title) {
  91184. return title === divisionField;
  91185. });
  91186. rows.forEach(function (row) {
  91187. var feature;
  91188. if (divisionType === 'GB-T_2260') {
  91189. feature = features.find(function (item) {
  91190. return item.properties.GB === row[fieldIndex];
  91191. });
  91192. } else {
  91193. feature = core_Util_Util.getHighestMatchAdministration(features, row[fieldIndex]);
  91194. } //todo 需提示忽略无效数据
  91195. if (feature) {
  91196. var newFeature = window.cloneDeep(feature);
  91197. newFeature.properties = {};
  91198. row.forEach(function (item, idx) {
  91199. //空格问题,看见DV多处处理空格问题,TODO统一整理
  91200. var key = titles[idx].trim();
  91201. newFeature.properties[key] = item;
  91202. });
  91203. geojson.features.push(newFeature);
  91204. }
  91205. });
  91206. return geojson;
  91207. }
  91208. /**
  91209. * @private
  91210. * @function ol.supermap.WebMap.prototype.geojsonToFeature
  91211. * @description geojson 转换为 feature
  91212. * @param {object} layerInfo - 图层信息
  91213. * @returns {Array} ol.feature的数组集合
  91214. */
  91215. }, {
  91216. key: "geojsonToFeature",
  91217. value: function geojsonToFeature(geojson, layerInfo) {
  91218. var allFeatures = geojson.features,
  91219. features = [];
  91220. for (var i = 0, len = allFeatures.length; i < len; i++) {
  91221. //转换前删除properties,这样转换后属性不会重复存储
  91222. var featureAttr = allFeatures[i].properties || {};
  91223. delete allFeatures[i].properties;
  91224. var feature = transformTools.readFeature(allFeatures[i], {
  91225. dataProjection: layerInfo.projection || 'EPSG:4326',
  91226. featureProjection: this.baseProjection || 'ESPG:4326'
  91227. }); //geojson格式的feature属性没有坐标系字段,为了统一,再次加上
  91228. var coordinate = feature.getGeometry().getCoordinates();
  91229. if (allFeatures[i].geometry.type === 'Point') {
  91230. // 标注图层 还没有属性值时候不加
  91231. if (allFeatures[i].properties) {
  91232. allFeatures[i].properties.lon = coordinate[0];
  91233. allFeatures[i].properties.lat = coordinate[1];
  91234. }
  91235. } // 标注图层特殊处理
  91236. var isMarker = false;
  91237. var attributes = void 0;
  91238. var useStyle = void 0;
  91239. if (allFeatures[i].dv_v5_markerInfo) {
  91240. //因为优化代码之前,属性字段都存储在propertise上,markerInfo没有
  91241. attributes = Object.assign({}, allFeatures[i].dv_v5_markerInfo, featureAttr);
  91242. if (attributes.lon) {
  91243. //标注图层不需要
  91244. delete attributes.lon;
  91245. delete attributes.lat;
  91246. }
  91247. }
  91248. if (allFeatures[i].dv_v5_markerStyle) {
  91249. useStyle = allFeatures[i].dv_v5_markerStyle;
  91250. isMarker = true;
  91251. }
  91252. var properties = void 0;
  91253. if (isMarker) {
  91254. properties = Object.assign({}, {
  91255. attributes: attributes
  91256. }, {
  91257. useStyle: useStyle
  91258. }); //feature上添加图层的id,为了对应图层
  91259. feature.layerId = layerInfo.timeId;
  91260. } else if (layerInfo.featureStyles) {
  91261. //V4 版本标注图层处理
  91262. var style = JSON.parse(layerInfo.featureStyles[i].style);
  91263. var attr = featureAttr;
  91264. var imgUrl = void 0;
  91265. if (attr._smiportal_imgLinkUrl.indexOf('http://') > -1 || attr._smiportal_imgLinkUrl.indexOf('https://') > -1) {
  91266. imgUrl = attr._smiportal_imgLinkUrl;
  91267. } else if (attr._smiportal_imgLinkUrl !== undefined && attr._smiportal_imgLinkUrl !== null && attr._smiportal_imgLinkUrl !== '') {
  91268. //上传的图片,加上当前地址
  91269. imgUrl = "".concat(core_Util_Util.getIPortalUrl(), "resources/markerIcon/").concat(attr._smiportal_imgLinkUrl);
  91270. }
  91271. attributes = {
  91272. dataViz_description: attr._smiportal_description,
  91273. dataViz_imgUrl: imgUrl,
  91274. dataViz_title: attr._smiportal_title,
  91275. dataViz_url: attr._smiportal_otherLinkUrl
  91276. };
  91277. style.anchor = [0.5, 1];
  91278. style.src = style.externalGraphic;
  91279. useStyle = style;
  91280. properties = Object.assign({}, {
  91281. attributes: attributes
  91282. }, {
  91283. useStyle: useStyle
  91284. });
  91285. delete attr._smiportal_description;
  91286. delete attr._smiportal_imgLinkUrl;
  91287. delete attr._smiportal_title;
  91288. delete attr._smiportal_otherLinkUrl;
  91289. } else {
  91290. properties = {
  91291. attributes: featureAttr
  91292. };
  91293. }
  91294. feature.setProperties(properties);
  91295. features.push(feature);
  91296. }
  91297. return features;
  91298. }
  91299. /**
  91300. * @private
  91301. * @function ol.supermap.WebMap.prototype.parseGeoJsonData2Feature
  91302. * @description 将从restData地址上获取的json转换成feature(从iserver中获取的json转换成feature)
  91303. * @param {object} metaData - json内容
  91304. * @returns {Array} ol.feature的数组集合
  91305. */
  91306. }, {
  91307. key: "parseGeoJsonData2Feature",
  91308. value: function parseGeoJsonData2Feature(metaData) {
  91309. var allFeatures = metaData.allDatas.features,
  91310. features = [];
  91311. for (var i = 0, len = allFeatures.length; i < len; i++) {
  91312. var properties = allFeatures[i].properties;
  91313. delete allFeatures[i].properties;
  91314. var feature = transformTools.readFeature(allFeatures[i], {
  91315. dataProjection: metaData.fileCode || 'EPSG:4326',
  91316. featureProjection: metaData.featureProjection || this.baseProjection || 'EPSG:4326'
  91317. }); //geojson格式的feature属性没有坐标系字段,为了统一,再次加上
  91318. var geometry = feature.getGeometry(); // 如果不存在geometry,也不需要组装feature
  91319. if (!geometry) {
  91320. continue;
  91321. }
  91322. var coordinate = geometry.getCoordinates();
  91323. if (allFeatures[i].geometry.type === 'Point') {
  91324. properties.lon = coordinate[0];
  91325. properties.lat = coordinate[1];
  91326. }
  91327. feature.setProperties({
  91328. attributes: properties
  91329. });
  91330. features.push(feature);
  91331. }
  91332. return features;
  91333. }
  91334. /**
  91335. * @private
  91336. * @function ol.supermap.WebMap.prototype.addLayer
  91337. * @description 将叠加图层添加到地图上
  91338. * @param {object} layerInfo - 图层信息
  91339. * @param {array} features - 图层上的feature集合
  91340. * @param {number} index 图层的顺序
  91341. */
  91342. }, {
  91343. key: "addLayer",
  91344. value: function addLayer(layerInfo, features, index) {
  91345. var layer,
  91346. that = this;
  91347. if (layerInfo.layerType === "VECTOR") {
  91348. if (layerInfo.featureType === "POINT") {
  91349. if (layerInfo.style.type === 'SYMBOL_POINT') {
  91350. layer = this.createSymbolLayer(layerInfo, features);
  91351. } else {
  91352. layer = this.createGraphicLayer(layerInfo, features);
  91353. }
  91354. } else {
  91355. //线和面
  91356. layer = this.createVectorLayer(layerInfo, features);
  91357. }
  91358. } else if (layerInfo.layerType === "UNIQUE") {
  91359. layer = this.createUniqueLayer(layerInfo, features);
  91360. } else if (layerInfo.layerType === "RANGE") {
  91361. layer = this.createRangeLayer(layerInfo, features);
  91362. } else if (layerInfo.layerType === "HEAT") {
  91363. layer = this.createHeatLayer(layerInfo, features);
  91364. } else if (layerInfo.layerType === "MARKER") {
  91365. layer = this.createMarkerLayer(features);
  91366. } else if (layerInfo.layerType === "DATAFLOW_POINT_TRACK") {
  91367. layer = this.createDataflowLayer(layerInfo, index);
  91368. } else if (layerInfo.layerType === "DATAFLOW_HEAT") {
  91369. layer = this.createDataflowHeatLayer(layerInfo);
  91370. } else if (layerInfo.layerType === "RANK_SYMBOL") {
  91371. layer = this.createRankSymbolLayer(layerInfo, features);
  91372. } else if (layerInfo.layerType === "MIGRATION") {
  91373. layer = this.createMigrationLayer(layerInfo, features);
  91374. }
  91375. var layerID = core_Util_Util.newGuid(8);
  91376. if (layer) {
  91377. layerInfo.name && layer.setProperties({
  91378. name: layerInfo.name,
  91379. layerID: layerID,
  91380. layerType: layerInfo.layerType
  91381. }); //刷新下图层,否则feature样式出不来
  91382. if (layerInfo && layerInfo.style && layerInfo.style.imageInfo) {
  91383. var img = new Image();
  91384. img.src = layerInfo.style.imageInfo.url;
  91385. img.onload = function () {
  91386. layer.getSource().changed();
  91387. };
  91388. }
  91389. if (layerInfo.layerType === 'MIGRATION') {
  91390. layer.appendTo(this.map); // 在这里恢复图层可见性状态
  91391. layer.setVisible(layerInfo.visible); // 设置鼠标样式为默认
  91392. layer.setCursor();
  91393. } else {
  91394. layerInfo.opacity != undefined && layer.setOpacity(layerInfo.opacity);
  91395. layer.setVisible(layerInfo.visible);
  91396. this.map.addLayer(layer);
  91397. }
  91398. layer.setZIndex(index);
  91399. var visibleScale = layerInfo.visibleScale,
  91400. autoUpdateTime = layerInfo.autoUpdateTime;
  91401. visibleScale && this.setVisibleScales(layer, visibleScale);
  91402. if (autoUpdateTime && !layerInfo.autoUpdateInterval) {
  91403. //自动更新数据
  91404. var dataSource = layerInfo.dataSource;
  91405. if (dataSource.accessType === "DIRECT" && !dataSource.url) {
  91406. // 二进制数据更新feautre所需的url
  91407. dataSource.url = "".concat(this.server, "web/datas/").concat(dataSource.serverId, "/content.json?pageSize=9999999&currentPage=1");
  91408. }
  91409. layerInfo.autoUpdateInterval = setInterval(function () {
  91410. that.updateFeaturesToMap(layerInfo, index, true);
  91411. }, autoUpdateTime);
  91412. }
  91413. }
  91414. layerInfo.layer = layer;
  91415. layerInfo.layerID = layerID;
  91416. if (layerInfo.labelStyle && layerInfo.labelStyle.labelField && layerInfo.layerType !== "DATAFLOW_POINT_TRACK") {
  91417. //存在标签专题图
  91418. //过滤条件过滤feature
  91419. features = layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features;
  91420. this.addLabelLayer(layerInfo, features);
  91421. }
  91422. }
  91423. /**
  91424. * @private
  91425. * @function ol.supermap.WebMap.prototype.updateFeaturesToMap
  91426. * @description 更新地图上的feature,适用于专题图
  91427. * @param {object} layerInfo - 图层信息
  91428. * @param {number} index 图层的顺序
  91429. */
  91430. }, {
  91431. key: "updateFeaturesToMap",
  91432. value: function updateFeaturesToMap(layerInfo, layerIndex) {
  91433. var that = this,
  91434. dataSource = layerInfo.dataSource,
  91435. url = layerInfo.dataSource.url,
  91436. dataSourceName = dataSource.dataSourceName || layerInfo.name;
  91437. if (dataSource.type === "USER_DATA" || dataSource.accessType === "DIRECT") {
  91438. that.addGeojsonFromUrl(layerInfo, null, layerIndex);
  91439. } else {
  91440. var requestUrl = that.formatUrlWithCredential(url),
  91441. serviceOptions = {};
  91442. serviceOptions.withCredentials = this.withCredentials;
  91443. if (!this.excludePortalProxyUrl && !Util.isInTheSameDomain(requestUrl)) {
  91444. serviceOptions.proxy = this.getProxy();
  91445. } //因为itest上使用的https,iserver是http,所以要加上代理
  91446. core_Util_Util.getFeatureBySQL(requestUrl, [dataSourceName], serviceOptions, function (result) {
  91447. var features = that.parseGeoJsonData2Feature({
  91448. allDatas: {
  91449. features: result.result.features.features
  91450. },
  91451. fileCode: layerInfo.projection,
  91452. featureProjection: that.baseProjection
  91453. }); //删除之前的图层和标签图层
  91454. that.map.removeLayer(layerInfo.layer);
  91455. layerInfo.labelLayer && that.map.removeLayer(layerInfo.labelLayer);
  91456. that.addLayer(layerInfo, features, layerIndex);
  91457. }, function (err) {
  91458. that.errorCallback && that.errorCallback(err, 'autoUpdateFaild', that.map);
  91459. });
  91460. }
  91461. }
  91462. /**
  91463. * @private
  91464. * @function ol.supermap.WebMap.prototype.addVectorTileLayer
  91465. * @description 添加vectorTILE图层
  91466. * @param {object} layerInfo - 图层信息
  91467. * @param {number} index 图层的顺序
  91468. * @param {String} type 创建的图层类型,restData为创建数据服务的mvt, restMap为创建地图服务的mvt
  91469. * @returns {ol/layer/VectorTile} 图层对象
  91470. */
  91471. }, {
  91472. key: "addVectorTileLayer",
  91473. value: function addVectorTileLayer(layerInfo, index, type) {
  91474. var layer;
  91475. if (type === 'RESTDATA') {
  91476. //用的是restdata服务的mvt
  91477. layer = this.createDataVectorTileLayer(layerInfo);
  91478. }
  91479. var layerID = core_Util_Util.newGuid(8);
  91480. if (layer) {
  91481. layerInfo.name && layer.setProperties({
  91482. name: layerInfo.name,
  91483. layerID: layerID
  91484. });
  91485. layerInfo.opacity != undefined && layer.setOpacity(layerInfo.opacity);
  91486. layer.setVisible(layerInfo.visible);
  91487. layer.setZIndex(index);
  91488. }
  91489. layerInfo.layer = layer;
  91490. layerInfo.layerID = layerID;
  91491. return layer;
  91492. }
  91493. /**
  91494. * @private
  91495. * @function ol.supermap.WebMap.prototype.createDataVectorTileLayer
  91496. * @description 创建vectorTILE图层
  91497. * @param {object} layerInfo - 图层信息
  91498. * @returns {ol/layer/VectorTile} 图层对象
  91499. */
  91500. }, {
  91501. key: "createDataVectorTileLayer",
  91502. value: function createDataVectorTileLayer(layerInfo) {
  91503. //创建图层
  91504. var format = new (external_ol_format_MVT_default())({
  91505. featureClass: (external_ol_Feature_default())
  91506. }); //要加上这一句,否则坐标,默认都是3857
  91507. (external_ol_format_MVT_default()).prototype.readProjection = function () {
  91508. return new external_ol_proj_namespaceObject.Projection({
  91509. code: '',
  91510. units: (external_ol_proj_Units_default()).TILE_PIXELS
  91511. });
  91512. };
  91513. var featureType = layerInfo.featureType;
  91514. var style = StyleUtils.toOpenLayersStyle(this.getDataVectorTileStyle(featureType), featureType);
  91515. return new external_ol_layer_namespaceObject.VectorTile({
  91516. //设置避让参数
  91517. source: new VectorTileSuperMapRest({
  91518. url: layerInfo.url,
  91519. projection: layerInfo.projection,
  91520. tileType: "ScaleXY",
  91521. format: format
  91522. }),
  91523. style: style
  91524. });
  91525. }
  91526. /**
  91527. * @private
  91528. * @function ol.supermap.WebMap.prototype.getDataVectorTileStyle
  91529. * @description 获取数据服务的mvt上图的默认样式
  91530. * @param {String} featureType - 要素类型
  91531. * @returns {Object} 样式参数
  91532. */
  91533. }, {
  91534. key: "getDataVectorTileStyle",
  91535. value: function getDataVectorTileStyle(featureType) {
  91536. var styleParameters = {
  91537. radius: 8,
  91538. //圆点半径
  91539. fillColor: '#EE4D5A',
  91540. //填充色
  91541. fillOpacity: 0.9,
  91542. strokeColor: '#ffffff',
  91543. //边框颜色
  91544. strokeWidth: 1,
  91545. strokeOpacity: 1,
  91546. lineDash: 'solid',
  91547. type: "BASIC_POINT"
  91548. };
  91549. if (["LINE", "LINESTRING", "MULTILINESTRING"].indexOf(featureType) > -1) {
  91550. styleParameters.strokeColor = '#4CC8A3';
  91551. styleParameters.strokeWidth = 2;
  91552. } else if (["REGION", "POLYGON", "MULTIPOLYGON"].indexOf(featureType) > -1) {
  91553. styleParameters.fillColor = '#826DBA';
  91554. }
  91555. return styleParameters;
  91556. }
  91557. /**
  91558. * @private
  91559. * @function ol.supermap.WebMap.prototype.getFiterFeatures
  91560. * @description 通过过滤条件查询满足的feature
  91561. * @param {string} filterCondition - 过滤条件
  91562. * @param {array} allFeatures - 图层上的feature集合
  91563. */
  91564. }, {
  91565. key: "getFiterFeatures",
  91566. value: function getFiterFeatures(filterCondition, allFeatures) {
  91567. var condition = this.parseFilterCondition(filterCondition);
  91568. var sql = "select * from json where (" + condition + ")";
  91569. var filterFeatures = [];
  91570. for (var i = 0; i < allFeatures.length; i++) {
  91571. var feature = allFeatures[i];
  91572. var filterResult = false;
  91573. try {
  91574. filterResult = window.jsonsql.query(sql, {
  91575. attributes: feature.get('attributes')
  91576. });
  91577. } catch (err) {
  91578. //必须把要过滤得内容封装成一个对象,主要是处理jsonsql(line : 62)中由于with语句遍历对象造成的问题
  91579. continue;
  91580. }
  91581. if (filterResult && filterResult.length > 0) {
  91582. //afterFilterFeatureIdx.push(i);
  91583. filterFeatures.push(feature);
  91584. }
  91585. }
  91586. return filterFeatures;
  91587. }
  91588. /**
  91589. * @private
  91590. * @function ol.supermap.WebMap.prototype.parseFilterCondition
  91591. * @description 1、替换查询语句 中的 and / AND / or / OR / = / !=
  91592. * 2、匹配 Name in ('', ''),多条件需用()包裹
  91593. * @param {string} filterCondition - 过滤条件
  91594. * @return {string} 换成组件能识别的字符串
  91595. */
  91596. }, {
  91597. key: "parseFilterCondition",
  91598. value: function parseFilterCondition(filterCondition) {
  91599. return filterCondition.replace(/=/g, "==").replace(/AND|and/g, "&&").replace(/or|OR/g, "||").replace(/<==/g, "<=").replace(/>==/g, ">=").replace(/\(?[^\(]+?\s*in\s*\([^\)]+?\)\)?/gi, function (res) {
  91600. // res格式:(省份 in ('四川', '河南'))
  91601. var data = res.match(/([^(]+?)\s*in\s*\(([^)]+?)\)/i);
  91602. return data.length === 3 ? "(".concat(data[2].split(",").map(function (c) {
  91603. return "".concat(data[1], " == ").concat(c.trim());
  91604. }).join(" || "), ")") : res;
  91605. });
  91606. }
  91607. /**
  91608. * @private
  91609. * @function ol.supermap.WebMap.prototype.createGraphicLayer
  91610. * @description 添加大数据图层到地图上
  91611. * @param {object} layerInfo - 图层信息
  91612. * @param {array} features - feature的集合
  91613. * @return {ol/layer/image} 大数据图层
  91614. */
  91615. }, {
  91616. key: "createGraphicLayer",
  91617. value: function createGraphicLayer(layerInfo, features) {
  91618. features = layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features;
  91619. var graphics = this.getGraphicsFromFeatures(features, layerInfo.style, layerInfo.featureType);
  91620. var source = new Graphic({
  91621. graphics: graphics,
  91622. render: 'canvas',
  91623. map: this.map,
  91624. isHighLight: false
  91625. });
  91626. return new external_ol_layer_namespaceObject.Image({
  91627. source: source
  91628. });
  91629. }
  91630. /**
  91631. * @private
  91632. * @function ol.supermap.WebMap.prototype.getGraphicsFromFeatures
  91633. * @description 将feature转换成大数据图层对应的Graphics要素
  91634. * @param {array} features - feature的集合
  91635. * @param {object} style - 图层样式
  91636. * @param {string} featureType - feature的类型
  91637. * @return {array} 大数据图层要素数组
  91638. */
  91639. }, {
  91640. key: "getGraphicsFromFeatures",
  91641. value: function getGraphicsFromFeatures(features, style, featureType) {
  91642. var olStyle = StyleUtils.getOpenlayersStyle(style, featureType),
  91643. shape = olStyle.getImage();
  91644. var graphics = []; //构建graphic
  91645. for (var i in features) {
  91646. var graphic = new Graphic_Graphic(features[i].getGeometry());
  91647. graphic.setStyle(shape);
  91648. graphic.setProperties({
  91649. attributes: features[i].get('attributes')
  91650. });
  91651. graphics.push(graphic);
  91652. }
  91653. return graphics;
  91654. }
  91655. /**
  91656. * @private
  91657. * @function ol.supermap.WebMap.prototype.createSymbolLayer
  91658. * @description 添加符号图层
  91659. * @param {object} layerInfo - 图层信息
  91660. * @param {array} features - feature的集合
  91661. * @return {ol/layer/Vector} 符号图层
  91662. */
  91663. }, {
  91664. key: "createSymbolLayer",
  91665. value: function createSymbolLayer(layerInfo, features) {
  91666. var style = StyleUtils.getSymbolStyle(layerInfo.style);
  91667. return new external_ol_layer_namespaceObject.Vector({
  91668. style: style,
  91669. source: new external_ol_source_namespaceObject.Vector({
  91670. features: layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features,
  91671. wrapX: false
  91672. }),
  91673. renderMode: 'image'
  91674. });
  91675. }
  91676. /**
  91677. * @private
  91678. * @function ol.supermap.WebMap.prototype.addLabelLayer
  91679. * @description 添加标签图层
  91680. * @param {object} layerInfo - 图层信息
  91681. * @param {array} features -feature的集合
  91682. * @returns {ol/layer/Vector} 图层对象
  91683. */
  91684. }, {
  91685. key: "addLabelLayer",
  91686. value: function addLabelLayer(layerInfo, features) {
  91687. var labelStyle = layerInfo.labelStyle;
  91688. var style = this.getLabelStyle(labelStyle, layerInfo);
  91689. var layer = layerInfo.labelLayer = new external_ol_layer_namespaceObject.Vector({
  91690. declutter: true,
  91691. styleOL: style,
  91692. labelField: labelStyle.labelField,
  91693. source: new external_ol_source_namespaceObject.Vector({
  91694. features: features,
  91695. wrapX: false
  91696. })
  91697. });
  91698. layer.setStyle(function (features) {
  91699. var labelField = labelStyle.labelField;
  91700. var label = features.get('attributes')[labelField.trim()] + "";
  91701. if (label === "undefined") {
  91702. return null;
  91703. }
  91704. var styleOL = layer.get('styleOL');
  91705. var text = styleOL.getText();
  91706. if (text && text.setText) {
  91707. text.setText(label);
  91708. }
  91709. return styleOL;
  91710. });
  91711. this.map.addLayer(layer);
  91712. layer.setVisible(layerInfo.visible);
  91713. layer.setZIndex(1000);
  91714. var visibleScale = layerInfo.visibleScale;
  91715. visibleScale && this.setVisibleScales(layer, visibleScale);
  91716. return layer;
  91717. }
  91718. /**
  91719. * @private
  91720. * @function ol.supermap.WebMap.prototype.setVisibleScales
  91721. * @description 改变图层可视范围
  91722. * @param {object} layer - 图层对象。ol.Layer
  91723. * @param {object} visibleScale - 图层样式参数
  91724. */
  91725. }, {
  91726. key: "setVisibleScales",
  91727. value: function setVisibleScales(layer, visibleScale) {
  91728. var maxResolution = this.resolutions[visibleScale.minScale],
  91729. minResolution = this.resolutions[visibleScale.maxScale]; //比例尺和分别率是反比的关系
  91730. maxResolution > 1 ? layer.setMaxResolution(Math.ceil(maxResolution)) : layer.setMaxResolution(maxResolution * 1.1);
  91731. layer.setMinResolution(minResolution);
  91732. }
  91733. /**
  91734. * @private
  91735. * @function ol.supermap.WebMap.prototype.getLabelStyle
  91736. * @description 获取标签样式
  91737. * @param {object} parameters - 标签图层样式参数
  91738. * @param {object} layerInfo - 图层样式参数
  91739. * @returns {ol/style/Style} 标签样式
  91740. */
  91741. }, {
  91742. key: "getLabelStyle",
  91743. value: function getLabelStyle(parameters, layerInfo) {
  91744. var style = layerInfo.style || layerInfo.pointStyle;
  91745. var _style$radius = style.radius,
  91746. radius = _style$radius === void 0 ? 0 : _style$radius,
  91747. _style$strokeWidth = style.strokeWidth,
  91748. strokeWidth = _style$strokeWidth === void 0 ? 0 : _style$strokeWidth,
  91749. beforeOffsetY = -(radius + strokeWidth);
  91750. var _parameters$fontSize = parameters.fontSize,
  91751. fontSize = _parameters$fontSize === void 0 ? '14px' : _parameters$fontSize,
  91752. fontFamily = parameters.fontFamily,
  91753. fill = parameters.fill,
  91754. backgroundFill = parameters.backgroundFill,
  91755. _parameters$offsetX = parameters.offsetX,
  91756. offsetX = _parameters$offsetX === void 0 ? 0 : _parameters$offsetX,
  91757. _parameters$offsetY = parameters.offsetY,
  91758. offsetY = _parameters$offsetY === void 0 ? beforeOffsetY : _parameters$offsetY,
  91759. _parameters$placement = parameters.placement,
  91760. placement = _parameters$placement === void 0 ? "point" : _parameters$placement,
  91761. _parameters$textBasel = parameters.textBaseline,
  91762. textBaseline = _parameters$textBasel === void 0 ? "bottom" : _parameters$textBasel,
  91763. _parameters$textAlign = parameters.textAlign,
  91764. textAlign = _parameters$textAlign === void 0 ? 'center' : _parameters$textAlign,
  91765. _parameters$outlineCo = parameters.outlineColor,
  91766. outlineColor = _parameters$outlineCo === void 0 ? "#000000" : _parameters$outlineCo,
  91767. _parameters$outlineWi = parameters.outlineWidth,
  91768. outlineWidth = _parameters$outlineWi === void 0 ? 0 : _parameters$outlineWi;
  91769. var option = {
  91770. font: "".concat(fontSize, " ").concat(fontFamily),
  91771. placement: placement,
  91772. textBaseline: textBaseline,
  91773. fill: new (external_ol_style_Fill_default())({
  91774. color: fill
  91775. }),
  91776. backgroundFill: new (external_ol_style_Fill_default())({
  91777. color: backgroundFill
  91778. }),
  91779. padding: [3, 3, 3, 3],
  91780. offsetX: layerInfo.featureType === 'POINT' ? offsetX : 0,
  91781. offsetY: layerInfo.featureType === 'POINT' ? offsetY : 0,
  91782. overflow: true,
  91783. maxAngle: 0
  91784. };
  91785. if (layerInfo.featureType === 'POINT') {
  91786. //线面不需要此参数,否则超出线面overflow:true,也不会显示标签
  91787. option.textAlign = textAlign;
  91788. }
  91789. if (outlineWidth > 0) {
  91790. option.stroke = new (external_ol_style_Stroke_default())({
  91791. color: outlineColor,
  91792. width: outlineWidth
  91793. });
  91794. }
  91795. return new (external_ol_style_Style_default())({
  91796. text: new (external_ol_style_Text_default())(option)
  91797. });
  91798. }
  91799. /**
  91800. * @private
  91801. * @function ol.supermap.WebMap.prototype.createVectorLayer
  91802. * @description 创建vector图层
  91803. * @param {object} layerInfo - 图层信息
  91804. * @param {array} features -feature的集合
  91805. * @returns {ol/layer/Vector} 矢量图层
  91806. */
  91807. }, {
  91808. key: "createVectorLayer",
  91809. value: function createVectorLayer(layerInfo, features) {
  91810. var featureType = layerInfo.featureType,
  91811. style = layerInfo.style;
  91812. var newStyle;
  91813. if (featureType === 'LINE' && core_Util_Util.isArray(style)) {
  91814. var _style = _slicedToArray(style, 2),
  91815. outlineStyle = _style[0],
  91816. strokeStyle = _style[1];
  91817. newStyle = strokeStyle.lineDash === 'solid' ? StyleUtils.getRoadPath(strokeStyle, outlineStyle) : StyleUtils.getPathway(strokeStyle, outlineStyle);
  91818. } else {
  91819. newStyle = StyleUtils.toOpenLayersStyle(layerInfo.style, layerInfo.featureType);
  91820. }
  91821. return new external_ol_layer_namespaceObject.Vector({
  91822. style: newStyle,
  91823. source: new external_ol_source_namespaceObject.Vector({
  91824. features: layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features,
  91825. wrapX: false
  91826. })
  91827. });
  91828. }
  91829. /**
  91830. * @private
  91831. * @function ol.supermap.WebMap.prototype.createHeatLayer
  91832. * @description 创建热力图图层
  91833. * @param {object} layerInfo - 图层信息
  91834. * @param {array} features -feature的集合
  91835. * @returns {ol/layer/Heatmap} 热力图图层
  91836. */
  91837. }, {
  91838. key: "createHeatLayer",
  91839. value: function createHeatLayer(layerInfo, features) {
  91840. //因为热力图,随着过滤,需要重新计算权重
  91841. features = layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features;
  91842. var source = new external_ol_source_namespaceObject.Vector({
  91843. features: features,
  91844. wrapX: false
  91845. });
  91846. var layerOptions = {
  91847. source: source
  91848. };
  91849. var themeSetting = layerInfo.themeSetting;
  91850. layerOptions.gradient = themeSetting.colors.slice();
  91851. layerOptions.radius = parseInt(themeSetting.radius); //自定义颜色
  91852. var customSettings = themeSetting.customSettings;
  91853. for (var i in customSettings) {
  91854. layerOptions.gradient[i] = customSettings[i];
  91855. } // 权重字段恢复
  91856. if (themeSetting.weight) {
  91857. this.changeWeight(features, themeSetting.weight);
  91858. }
  91859. return new external_ol_layer_namespaceObject.Heatmap(layerOptions);
  91860. }
  91861. /**
  91862. * @private
  91863. * @function ol.supermap.WebMap.prototype.changeWeight
  91864. * @description 改变当前权重字段
  91865. * @param {array} features - feature的集合
  91866. * @param {string} weightFeild - 权重字段
  91867. */
  91868. }, {
  91869. key: "changeWeight",
  91870. value: function changeWeight(features, weightFeild) {
  91871. var that = this;
  91872. this.fieldMaxValue = {};
  91873. this.getMaxValue(features, weightFeild);
  91874. var maxValue = this.fieldMaxValue[weightFeild];
  91875. features.forEach(function (feature) {
  91876. var attributes = feature.get('attributes');
  91877. try {
  91878. var value = attributes[weightFeild];
  91879. feature.set('weight', value / maxValue);
  91880. } catch (e) {
  91881. that.errorCallback && that.errorCallback(e);
  91882. }
  91883. });
  91884. }
  91885. /**
  91886. * @private
  91887. * @function ol.supermap.WebMap.prototype.getMaxValue
  91888. * @description 获取当前字段对应的最大值,用于计算权重
  91889. * @param {array} features - feature 数组
  91890. * @param {string} weightField - 权重字段
  91891. */
  91892. }, {
  91893. key: "getMaxValue",
  91894. value: function getMaxValue(features, weightField) {
  91895. var values = [],
  91896. that = this,
  91897. attributes;
  91898. var field = weightField;
  91899. if (this.fieldMaxValue[field]) {
  91900. return;
  91901. }
  91902. features.forEach(function (feature) {
  91903. //收集当前权重字段对应的所有值
  91904. attributes = feature.get('attributes');
  91905. try {
  91906. values.push(parseFloat(attributes[field]));
  91907. } catch (e) {
  91908. that.errorCallback && that.errorCallback(e);
  91909. }
  91910. });
  91911. this.fieldMaxValue[field] = ArrayStatistic.getArrayStatistic(values, 'Maximum');
  91912. }
  91913. /**
  91914. * @private
  91915. * @function ol.supermap.WebMap.prototype.createUniqueLayer
  91916. * @description 获取当前字段对应的最大值,用于计算权重
  91917. * @param {array} layerInfo - 图层信息
  91918. * @param {array} features - 所有feature结合
  91919. */
  91920. }, {
  91921. key: "createUniqueLayer",
  91922. value: function createUniqueLayer(layerInfo, features) {
  91923. var styleSource = this.createUniqueSource(layerInfo, features);
  91924. var layer = new external_ol_layer_namespaceObject.Vector({
  91925. styleSource: styleSource,
  91926. source: new external_ol_source_namespaceObject.Vector({
  91927. features: layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features,
  91928. wrapX: false
  91929. })
  91930. });
  91931. layer.setStyle(function (feature) {
  91932. var styleSource = layer.get('styleSource');
  91933. var labelField = styleSource.themeField;
  91934. var label = feature.get('attributes')[labelField];
  91935. var styleGroup = styleSource.styleGroups.find(function (item) {
  91936. return item.value === label;
  91937. });
  91938. return styleGroup.olStyle;
  91939. });
  91940. return layer;
  91941. }
  91942. /**
  91943. * @private
  91944. * @function ol.supermap.WebMap.prototype.createUniqueSource
  91945. * @description 创建单值图层的source
  91946. * @param {layerInfo} parameters- 图层信息
  91947. * @param {array} features - feature 数组
  91948. * @returns {{map: *, style: *, isHoverAble: *, highlightStyle: *, themeField: *, styleGroups: Array}}
  91949. */
  91950. }, {
  91951. key: "createUniqueSource",
  91952. value: function createUniqueSource(parameters, features) {
  91953. //找到合适的专题字段
  91954. var styleGroup = this.getUniqueStyleGroup(parameters, features);
  91955. return {
  91956. map: this.map,
  91957. //必传参数 API居然不提示
  91958. style: parameters.style,
  91959. isHoverAble: parameters.isHoverAble,
  91960. highlightStyle: parameters.highlightStyle,
  91961. themeField: parameters.themeSetting.themeField,
  91962. styleGroups: styleGroup
  91963. };
  91964. }
  91965. /**
  91966. * @private
  91967. * @function ol.supermap.WebMap.prototype.getUniqueStyleGroup
  91968. * @description 获取单值专题图的styleGroup
  91969. * @param {object} parameters- 图层信息
  91970. * @param {array} features - feature 数组
  91971. * @returns {Array} 单值样式
  91972. */
  91973. }, {
  91974. key: "getUniqueStyleGroup",
  91975. value: function getUniqueStyleGroup(parameters, features) {
  91976. // 找出所有的单值
  91977. var featureType = parameters.featureType,
  91978. style = parameters.style,
  91979. themeSetting = parameters.themeSetting;
  91980. var fieldName = themeSetting.themeField;
  91981. var names = [],
  91982. customSettings = themeSetting.customSettings;
  91983. for (var i in features) {
  91984. var attributes = features[i].get('attributes');
  91985. var name = attributes[fieldName];
  91986. var isSaved = false;
  91987. for (var j in names) {
  91988. if (names[j] === name) {
  91989. isSaved = true;
  91990. break;
  91991. }
  91992. }
  91993. if (!isSaved) {
  91994. names.push(name);
  91995. }
  91996. } //生成styleGroup
  91997. var styleGroup = [];
  91998. names.forEach(function (name, index) {
  91999. //兼容之前自定义是用key,现在因为数据支持编辑,需要用属性值。
  92000. var key = this.webMapVersion === "1.0" ? index : name;
  92001. var custom = customSettings[key];
  92002. if (core_Util_Util.isString(custom)) {
  92003. //兼容之前自定义只存储一个color
  92004. custom = this.getCustomSetting(style, custom, featureType);
  92005. customSettings[key] = custom;
  92006. } // 转化成 ol 样式
  92007. var olStyle,
  92008. type = custom.type;
  92009. if (type === 'SYMBOL_POINT') {
  92010. olStyle = StyleUtils.getSymbolStyle(custom);
  92011. } else if (type === 'SVG_POINT') {
  92012. olStyle = StyleUtils.getSVGStyle(custom);
  92013. } else if (type === 'IMAGE_POINT') {
  92014. olStyle = StyleUtils.getImageStyle(custom);
  92015. } else {
  92016. olStyle = StyleUtils.toOpenLayersStyle(custom, featureType);
  92017. }
  92018. styleGroup.push({
  92019. olStyle: olStyle,
  92020. style: customSettings[key],
  92021. value: name
  92022. });
  92023. }, this);
  92024. return styleGroup;
  92025. }
  92026. /**
  92027. * 获取单值专题图自定义样式对象
  92028. * @param {*} style 图层上的样式
  92029. * @param {*} color 单值对应的颜色
  92030. * @param {*} featureType 要素类型
  92031. */
  92032. }, {
  92033. key: "getCustomSetting",
  92034. value: function getCustomSetting(style, color, featureType) {
  92035. var newProps = {};
  92036. if (featureType === "LINE") {
  92037. newProps.strokeColor = color;
  92038. } else {
  92039. newProps.fillColor = color;
  92040. }
  92041. var customSetting = Object.assign(style, newProps);
  92042. return customSetting;
  92043. }
  92044. /**
  92045. * @private
  92046. * @function ol.supermap.WebMap.prototype.createRangeLayer
  92047. * @description 创建分段图层
  92048. * @param {object} layerInfo- 图层信息
  92049. * @param {array} features - 所有feature结合
  92050. * @returns {ol/layer/Vector} 单值图层
  92051. */
  92052. }, {
  92053. key: "createRangeLayer",
  92054. value: function createRangeLayer(layerInfo, features) {
  92055. //这里获取styleGroup要用所以的feature
  92056. var styleSource = this.createRangeSource(layerInfo, features);
  92057. var layer = new external_ol_layer_namespaceObject.Vector({
  92058. styleSource: styleSource,
  92059. source: new external_ol_source_namespaceObject.Vector({
  92060. features: layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features,
  92061. wrapX: false
  92062. })
  92063. });
  92064. layer.setStyle(function (feature) {
  92065. var styleSource = layer.get('styleSource');
  92066. if (styleSource) {
  92067. var labelField = styleSource.themeField;
  92068. var value = Number(feature.get('attributes')[labelField.trim()]);
  92069. var styleGroups = styleSource.styleGroups;
  92070. for (var i = 0; i < styleGroups.length; i++) {
  92071. if (i === 0) {
  92072. if (value >= styleGroups[i].start && value <= styleGroups[i].end) {
  92073. return styleGroups[i].olStyle;
  92074. }
  92075. } else {
  92076. if (value > styleGroups[i].start && value <= styleGroups[i].end) {
  92077. return styleGroups[i].olStyle;
  92078. }
  92079. }
  92080. }
  92081. }
  92082. });
  92083. return layer;
  92084. }
  92085. /**
  92086. * @private
  92087. * @function ol.supermap.WebMap.prototype.createRangeSource
  92088. * @description 创建分段专题图的图层source
  92089. * @param {object} parameters- 图层信息
  92090. * @param {array} features - 所以的feature集合
  92091. * @returns {Object} 图层source
  92092. */
  92093. }, {
  92094. key: "createRangeSource",
  92095. value: function createRangeSource(parameters, features) {
  92096. //找到合适的专题字段
  92097. var styleGroup = this.getRangeStyleGroup(parameters, features);
  92098. if (styleGroup) {
  92099. return {
  92100. style: parameters.style,
  92101. themeField: parameters.themeSetting.themeField,
  92102. styleGroups: styleGroup
  92103. };
  92104. } else {
  92105. return false;
  92106. }
  92107. }
  92108. /**
  92109. * @private
  92110. * @function ol.supermap.WebMap.prototype.getRangeStyleGroup
  92111. * @description 获取分段专题图的styleGroup样式
  92112. * @param {object} parameters- 图层信息
  92113. * @param {array} features - 所以的feature集合
  92114. * @returns {Array} styleGroups
  92115. */
  92116. }, {
  92117. key: "getRangeStyleGroup",
  92118. value: function getRangeStyleGroup(parameters, features) {
  92119. // 找出分段值
  92120. var featureType = parameters.featureType,
  92121. themeSetting = parameters.themeSetting,
  92122. style = parameters.style;
  92123. var count = themeSetting.segmentCount,
  92124. method = themeSetting.segmentMethod,
  92125. colors = themeSetting.colors,
  92126. customSettings = themeSetting.customSettings,
  92127. fieldName = themeSetting.themeField;
  92128. var values = [],
  92129. attributes;
  92130. var segmentCount = count;
  92131. var segmentMethod = method;
  92132. var that = this;
  92133. features.forEach(function (feature) {
  92134. attributes = feature.get("attributes");
  92135. try {
  92136. if (attributes) {
  92137. //过滤掉非数值的数据
  92138. var value = attributes[fieldName.trim()];
  92139. if (value !== undefined && value !== null && core_Util_Util.isNumber(value)) {
  92140. values.push(parseFloat(value));
  92141. }
  92142. } else if (feature.get(fieldName) && core_Util_Util.isNumber(feature.get(fieldName))) {
  92143. if (feature.get(fieldName)) {
  92144. values.push(parseFloat(feature.get(fieldName)));
  92145. }
  92146. }
  92147. } catch (e) {
  92148. that.errorCallback && that.errorCallback(e);
  92149. }
  92150. });
  92151. var segements;
  92152. try {
  92153. segements = ArrayStatistic.getArraySegments(values, segmentMethod, segmentCount);
  92154. } catch (e) {
  92155. that.errorCallback && that.errorCallback(e);
  92156. }
  92157. if (segements) {
  92158. var itemNum = segmentCount;
  92159. if (attributes && segements[0] === segements[attributes.length - 1]) {
  92160. itemNum = 1;
  92161. segements.length = 2;
  92162. } //保留两位有效数
  92163. for (var key in segements) {
  92164. var value = segements[key];
  92165. if (Number(key) === 0) {
  92166. // 最小的值下舍入,要用两个等于号。否则有些值判断不对
  92167. value = Math.floor(value * 100) / 100;
  92168. } else {
  92169. // 其余上舍入
  92170. value = Math.ceil(value * 100) / 100 + 0.1; // 加0.1 解决最大值没有样式问题
  92171. }
  92172. segements[key] = Number(value.toFixed(2));
  92173. } //获取一定量的颜色
  92174. var curentColors = colors;
  92175. curentColors = ColorsPickerUtil.getGradientColors(curentColors, itemNum, 'RANGE');
  92176. for (var index = 0; index < itemNum; index++) {
  92177. if (index in customSettings) {
  92178. if (customSettings[index]["segment"]["start"]) {
  92179. segements[index] = customSettings[index]["segment"]["start"];
  92180. }
  92181. if (customSettings[index]["segment"]["end"]) {
  92182. segements[index + 1] = customSettings[index]["segment"]["end"];
  92183. }
  92184. }
  92185. } //生成styleGroup
  92186. var styleGroups = [];
  92187. for (var i = 0; i < itemNum; i++) {
  92188. var color = curentColors[i];
  92189. if (i in customSettings) {
  92190. if (customSettings[i].color) {
  92191. color = customSettings[i].color;
  92192. }
  92193. }
  92194. if (featureType === "LINE") {
  92195. style.strokeColor = color;
  92196. } else {
  92197. style.fillColor = color;
  92198. } // 转化成 ol 样式
  92199. var olStyle = StyleUtils.toOpenLayersStyle(style, featureType);
  92200. var start = segements[i];
  92201. var end = segements[i + 1];
  92202. styleGroups.push({
  92203. olStyle: olStyle,
  92204. color: color,
  92205. start: start,
  92206. end: end
  92207. });
  92208. }
  92209. return styleGroups;
  92210. } else {
  92211. return false;
  92212. }
  92213. }
  92214. /**
  92215. * @private
  92216. * @function ol.supermap.WebMap.prototype.createMarkerLayer
  92217. * @description 创建标注图层
  92218. * @param {array} features - 所以的feature集合
  92219. * @returns {ol/layer/Vector} 矢量图层
  92220. */
  92221. }, {
  92222. key: "createMarkerLayer",
  92223. value: function createMarkerLayer(features) {
  92224. features && this.setEachFeatureDefaultStyle(features);
  92225. return new external_ol_layer_namespaceObject.Vector({
  92226. source: new external_ol_source_namespaceObject.Vector({
  92227. features: features,
  92228. wrapX: false
  92229. })
  92230. });
  92231. }
  92232. /**
  92233. * @private
  92234. * @function ol.supermap.WebMap.prototype.createDataflowLayer
  92235. * @description 创建数据流图层
  92236. * @param {object} layerInfo- 图层信息
  92237. * @param {number} layerIndex - 图层的zindex
  92238. * @returns {ol/layer/Vector} 数据流图层
  92239. */
  92240. }, {
  92241. key: "createDataflowLayer",
  92242. value: function createDataflowLayer(layerInfo, layerIndex) {
  92243. var layerStyle = layerInfo.pointStyle,
  92244. style; //获取样式
  92245. style = StyleUtils.getOpenlayersStyle(layerStyle, layerInfo.featureType);
  92246. var source = new external_ol_source_namespaceObject.Vector({
  92247. wrapX: false
  92248. }),
  92249. labelLayer,
  92250. labelSource,
  92251. pathLayer,
  92252. pathSource;
  92253. var layer = new external_ol_layer_namespaceObject.Vector({
  92254. styleOL: style,
  92255. source: source
  92256. });
  92257. if (layerInfo.labelStyle && layerInfo.visible) {
  92258. //有标签图层
  92259. labelLayer = this.addLabelLayer(layerInfo); //和编辑页面保持一致
  92260. labelLayer.setZIndex(1000);
  92261. labelSource = labelLayer.getSource();
  92262. }
  92263. var visibleScale = layerInfo.visibleScale;
  92264. if (layerInfo.lineStyle && layerInfo.visible) {
  92265. pathLayer = this.createVectorLayer({
  92266. style: layerInfo.lineStyle,
  92267. featureType: "LINE"
  92268. });
  92269. pathSource = pathLayer.getSource();
  92270. pathLayer.setZIndex(layerIndex);
  92271. this.map.addLayer(pathLayer);
  92272. visibleScale && this.setVisibleScales(pathLayer, visibleScale); // 挂载到layerInfo上,便于删除
  92273. layerInfo.pathLayer = pathLayer;
  92274. }
  92275. var featureCache = {},
  92276. labelFeatureCache = {},
  92277. pathFeatureCache = {},
  92278. that = this;
  92279. this.createDataflowService(layerInfo, function (featureCache, labelFeatureCache, pathFeatureCache) {
  92280. return function (feature) {
  92281. that.events.triggerEvent('updateDataflowFeature', {
  92282. feature: feature,
  92283. identifyField: layerInfo.identifyField,
  92284. layerID: layerInfo.layerID
  92285. });
  92286. if (layerInfo.filterCondition) {
  92287. //过滤条件
  92288. var condition = that.parseFilterCondition(layerInfo.filterCondition);
  92289. var sql = "select * from json where (" + condition + ")";
  92290. var filterResult = window.jsonsql.query(sql, {
  92291. attributes: feature.get('attributes')
  92292. });
  92293. if (filterResult && filterResult.length > 0) {
  92294. that.addDataflowFeature(feature, layerInfo.identifyField, {
  92295. dataflowSource: source,
  92296. featureCache: featureCache,
  92297. labelSource: labelSource,
  92298. labelFeatureCache: labelFeatureCache,
  92299. pathSource: pathSource,
  92300. pathFeatureCache: pathFeatureCache,
  92301. maxPointCount: layerInfo.maxPointCount
  92302. });
  92303. }
  92304. } else {
  92305. that.addDataflowFeature(feature, layerInfo.identifyField, {
  92306. dataflowSource: source,
  92307. featureCache: featureCache,
  92308. labelSource: labelSource,
  92309. labelFeatureCache: labelFeatureCache,
  92310. pathSource: pathSource,
  92311. pathFeatureCache: pathFeatureCache,
  92312. maxPointCount: layerInfo.maxPointCount
  92313. });
  92314. }
  92315. };
  92316. }(featureCache, labelFeatureCache, pathFeatureCache));
  92317. this.setFeatureStyle(layer, layerInfo.directionField, layerStyle.type);
  92318. return layer;
  92319. }
  92320. /**
  92321. * @private
  92322. * @function ol.supermap.WebMap.prototype.addDataflowFeature
  92323. * @description 添加数据流的feature
  92324. * @param {object} feature - 服务器更新的feature
  92325. * @param {string} identifyField - 标识feature的字段
  92326. * @param {object} options - 其他参数
  92327. */
  92328. }, {
  92329. key: "addDataflowFeature",
  92330. value: function addDataflowFeature(feature, identifyField, options) {
  92331. options.dataflowSource && this.addFeatureFromDataflowService(options.dataflowSource, feature, identifyField, options.featureCache);
  92332. options.labelSource && this.addFeatureFromDataflowService(options.labelSource, feature, identifyField, options.labelFeatureCache);
  92333. options.pathSource && this.addPathFeature(options.pathSource, feature, identifyField, options.pathFeatureCache, options.maxPointCount);
  92334. }
  92335. /**
  92336. * @private
  92337. * @function ol.supermap.WebMap.prototype.addPathFeature
  92338. * @description 添加数据流图层中轨迹线的feature
  92339. * @param {object} source - 轨迹线图层的source
  92340. * @param {object} feature - 轨迹线feature
  92341. * @param {string} identifyField - 标识feature的字段
  92342. * @param {object} featureCache - 存储feature
  92343. * @param {number} maxPointCount - 轨迹线最多点个数数量
  92344. */
  92345. }, {
  92346. key: "addPathFeature",
  92347. value: function addPathFeature(source, feature, identifyField, featureCache, maxPointCount) {
  92348. var coordinates = [];
  92349. var geoID = feature.get(identifyField);
  92350. if (featureCache[geoID]) {
  92351. //加过feautre
  92352. coordinates = featureCache[geoID].getGeometry().getCoordinates();
  92353. coordinates.push(feature.getGeometry().getCoordinates());
  92354. if (maxPointCount && coordinates.length > maxPointCount) {
  92355. coordinates.splice(0, coordinates.length - maxPointCount);
  92356. }
  92357. featureCache[geoID].getGeometry().setCoordinates(coordinates);
  92358. } else {
  92359. coordinates.push(feature.getGeometry().getCoordinates());
  92360. featureCache[geoID] = new (external_ol_Feature_default())({
  92361. geometry: new external_ol_geom_namespaceObject.LineString(coordinates)
  92362. });
  92363. source.addFeature(featureCache[geoID]);
  92364. }
  92365. }
  92366. /**
  92367. * @private
  92368. * @function ol.supermap.WebMap.prototype.setFeatureStyle
  92369. * @description 设置feature样式
  92370. * @param {object} layer - 图层对象
  92371. * @param {string} directionField - 方向字段
  92372. * @param {string} styleType - 样式的类型
  92373. */
  92374. }, {
  92375. key: "setFeatureStyle",
  92376. value: function setFeatureStyle(layer, directionField, styleType) {
  92377. var layerStyle = layer.get('styleOL');
  92378. layer.setStyle(function (feature) {
  92379. //有转向字段
  92380. var value, image;
  92381. if (directionField !== undefined && directionField !== "未设置" && directionField !== "None") {
  92382. value = feature.get('attributes')[directionField];
  92383. } else {
  92384. value = 0;
  92385. }
  92386. if (value > 360 || value < 0) {
  92387. return null;
  92388. }
  92389. if (styleType === "SYMBOL_POINT") {
  92390. image = layerStyle.getText();
  92391. } else {
  92392. image = layerStyle.getImage();
  92393. } //默认用户使用的是角度,换算成弧度
  92394. var rotate = Math.PI * value / 180;
  92395. image && image.setRotation(rotate);
  92396. return layerStyle;
  92397. });
  92398. }
  92399. /**
  92400. * @private
  92401. * @function ol.supermap.WebMap.prototype.createDataflowHeatLayer
  92402. * @description 创建数据流服务的热力图图层
  92403. * @param {object} layerInfo - 图层参数
  92404. * @returns {ol/layer/Heatmap} 热力图图层对象
  92405. */
  92406. }, {
  92407. key: "createDataflowHeatLayer",
  92408. value: function createDataflowHeatLayer(layerInfo) {
  92409. var source = this.createDataflowHeatSource(layerInfo);
  92410. var layerOptions = {
  92411. source: source
  92412. };
  92413. layerOptions.gradient = layerInfo.themeSetting.colors.slice();
  92414. layerOptions.radius = parseInt(layerInfo.themeSetting.radius);
  92415. if (layerInfo.themeSetting.customSettings) {
  92416. var customSettings = layerInfo.themeSetting.customSettings;
  92417. for (var i in customSettings) {
  92418. layerOptions.gradient[i] = customSettings[i];
  92419. }
  92420. }
  92421. return new external_ol_layer_namespaceObject.Heatmap(layerOptions);
  92422. }
  92423. /**
  92424. * @private
  92425. * @function ol.supermap.WebMap.prototype.createDataflowHeatSource
  92426. * @description 创建数据流服务的热力图的source
  92427. * @param {object} layerInfo - 图层参数
  92428. * @returns {ol/souce/Vector} 热力图source对象
  92429. */
  92430. }, {
  92431. key: "createDataflowHeatSource",
  92432. value: function createDataflowHeatSource(layerInfo) {
  92433. var that = this,
  92434. source = new external_ol_source_namespaceObject.Vector({
  92435. wrapX: false
  92436. });
  92437. var featureCache = {};
  92438. this.createDataflowService(layerInfo, function (featureCache) {
  92439. return function (feature) {
  92440. if (layerInfo.filterCondition) {
  92441. //过滤条件
  92442. var condition = that.parseFilterCondition(layerInfo.filterCondition);
  92443. var sql = "select * from json where (" + condition + ")";
  92444. var filterResult = window.jsonsql.query(sql, {
  92445. attributes: feature.get('attributes')
  92446. });
  92447. if (filterResult && filterResult.length > 0) {
  92448. that.addDataflowFeature(feature, layerInfo.identifyField, {
  92449. dataflowSource: source,
  92450. featureCache: featureCache
  92451. });
  92452. }
  92453. } else {
  92454. that.addDataflowFeature(feature, layerInfo.identifyField, {
  92455. dataflowSource: source,
  92456. featureCache: featureCache
  92457. });
  92458. } // 权重字段恢复
  92459. if (layerInfo.themeSetting.weight) {
  92460. that.changeWeight(source.getFeatures(), layerInfo.themeSetting.weight);
  92461. }
  92462. };
  92463. }(featureCache));
  92464. return source;
  92465. }
  92466. /**
  92467. * @private
  92468. * @function ol.supermap.WebMap.prototype.addFeatureFromDataflowService
  92469. * @description 将feature添加到数据流图层
  92470. * @param {object} source - 图层对应的source
  92471. * @param {object} feature - 需要添加到图层的feature
  92472. * @param {object} identifyField - feature的标识字段
  92473. * @param {object} featureCache - 存储已添加到图层的feature对象
  92474. */
  92475. }, {
  92476. key: "addFeatureFromDataflowService",
  92477. value: function addFeatureFromDataflowService(source, feature, identifyField, featureCache) {
  92478. //判断是否有这个feature,存在feature就更新位置。
  92479. var geoID = feature.get(identifyField);
  92480. if (geoID !== undefined && featureCache[geoID]) {
  92481. /*if(that.addFeatureFinish) {
  92482. //feature全都加上图层,就缩放范围
  92483. MapManager.zoomToExtent(LayerUtil.getBoundsFromFeatures(source.getFeatures()));
  92484. that.addFeatureFinish = false;
  92485. }*/
  92486. featureCache[geoID].setGeometry(feature.getGeometry());
  92487. featureCache[geoID].setProperties(feature.getProperties());
  92488. source.changed();
  92489. } else {
  92490. source.addFeature(feature);
  92491. featureCache[geoID] = feature;
  92492. }
  92493. }
  92494. /**
  92495. * @private
  92496. * @function ol.supermap.WebMap.prototype.createDataflowService
  92497. * @description 将feature添加到数据流图层
  92498. * @param {object} layerInfo - 图层参数
  92499. * @param {object} callback - 回调函数
  92500. */
  92501. }, {
  92502. key: "createDataflowService",
  92503. value: function createDataflowService(layerInfo, callback) {
  92504. var that = this;
  92505. var dataflowService = new DataFlowService(layerInfo.wsUrl).initSubscribe();
  92506. dataflowService.on('messageSucceeded', function (e) {
  92507. var geojson = JSON.parse(e.value.data);
  92508. var feature = transformTools.readFeature(geojson, {
  92509. dataProjection: layerInfo.projection || "EPSG:4326",
  92510. featureProjection: that.baseProjection || 'EPSG:4326'
  92511. });
  92512. feature.setProperties({
  92513. attributes: geojson.properties
  92514. });
  92515. callback(feature);
  92516. });
  92517. layerInfo.dataflowService = dataflowService;
  92518. }
  92519. /**
  92520. * @private
  92521. * @function ol.supermap.WebMap.prototype.setEachFeatureDefaultStyle
  92522. * @description 为标注图层上的feature设置样式
  92523. * @param {array} features - 所以的feature集合
  92524. */
  92525. }, {
  92526. key: "setEachFeatureDefaultStyle",
  92527. value: function setEachFeatureDefaultStyle(features) {
  92528. var that = this;
  92529. features = core_Util_Util.isArray(features) || features instanceof (external_ol_Collection_default()) ? features : [features];
  92530. features.forEach(function (feature) {
  92531. var geomType = feature.getGeometry().getType().toUpperCase(); // let styleType = geomType === "POINT" ? 'MARKER' : geomType;
  92532. var defaultStyle = feature.getProperties().useStyle;
  92533. if (defaultStyle) {
  92534. if (geomType === 'POINT' && defaultStyle.text) {
  92535. //说明是文字的feature类型
  92536. geomType = "TEXT";
  92537. }
  92538. var attributes = that.setFeatureInfo(feature);
  92539. feature.setProperties({
  92540. useStyle: defaultStyle,
  92541. attributes: attributes
  92542. }); //标注图层的feature上需要存一个layerId,为了之后样式应用到图层上使用
  92543. // feature.layerId = timeId;
  92544. if (geomType === 'POINT' && defaultStyle.src && defaultStyle.src.indexOf('http://') === -1 && defaultStyle.src.indexOf('https://') === -1) {
  92545. //说明地址不完整
  92546. defaultStyle.src = that.server + defaultStyle.src;
  92547. }
  92548. } else {
  92549. defaultStyle = StyleUtils.getMarkerDefaultStyle(geomType, that.server);
  92550. }
  92551. feature.setStyle(StyleUtils.toOpenLayersStyle(defaultStyle, geomType));
  92552. }, this);
  92553. }
  92554. /**
  92555. * @private
  92556. * @function ol.supermap.WebMap.prototype.setFeatureInfo
  92557. * @description 为feature设置属性
  92558. * @param {array} feature - 单个feature
  92559. * @returns {object} 属性
  92560. */
  92561. }, {
  92562. key: "setFeatureInfo",
  92563. value: function setFeatureInfo(feature) {
  92564. var attributes = feature.get('attributes'),
  92565. defaultAttr = {
  92566. dataViz_title: '',
  92567. dataViz_description: '',
  92568. dataViz_imgUrl: '',
  92569. dataViz_url: ''
  92570. },
  92571. newAttribute = Object.assign(defaultAttr, attributes);
  92572. var properties = feature.getProperties();
  92573. for (var key in newAttribute) {
  92574. if (properties[key]) {
  92575. newAttribute[key] = properties[key];
  92576. delete properties[key];
  92577. }
  92578. }
  92579. return newAttribute;
  92580. }
  92581. /**
  92582. * @private
  92583. * @function ol.supermap.WebMap.prototype.createRankSymbolLayer
  92584. * @description 创建等级符号图层
  92585. * @param {object} layerInfo - 图层信息
  92586. * @param {array} features - 添加到图层上的features
  92587. * @returns {ol/layer/Vector} 矢量图层
  92588. */
  92589. }, {
  92590. key: "createRankSymbolLayer",
  92591. value: function createRankSymbolLayer(layerInfo, features) {
  92592. var styleSource = this.createRankStyleSource(layerInfo, features, layerInfo.featureType);
  92593. var layer = new external_ol_layer_namespaceObject.Vector({
  92594. styleSource: styleSource,
  92595. source: new external_ol_source_namespaceObject.Vector({
  92596. features: layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features,
  92597. wrapX: false
  92598. }),
  92599. renderMode: 'image'
  92600. });
  92601. layer.setStyle(function (feature) {
  92602. var styleSource = layer.get('styleSource');
  92603. var themeField = styleSource.parameters.themeSetting.themeField;
  92604. var value = Number(feature.get('attributes')[themeField]);
  92605. var styleGroups = styleSource.styleGroups;
  92606. for (var i = 0, len = styleGroups.length; i < len; i++) {
  92607. if (value >= styleGroups[i].start && value < styleGroups[i].end) {
  92608. return styleSource.styleGroups[i].olStyle;
  92609. }
  92610. }
  92611. });
  92612. return layer;
  92613. }
  92614. /**
  92615. * @private
  92616. * @function ol.supermap.WebMap.prototype.createRankSymbolLayer
  92617. * @description 创建等级符号图层的source
  92618. * @param {object} parameters - 图层信息
  92619. * @param {array} features - 添加到图层上的features
  92620. * @param {string} featureType - feature的类型
  92621. * @returns {object} styleGroups
  92622. */
  92623. }, {
  92624. key: "createRankStyleSource",
  92625. value: function createRankStyleSource(parameters, features, featureType) {
  92626. var themeSetting = parameters.themeSetting,
  92627. themeField = themeSetting.themeField;
  92628. var styleGroups = this.getRankStyleGroup(themeField, features, parameters, featureType);
  92629. return styleGroups ? {
  92630. parameters: parameters,
  92631. styleGroups: styleGroups
  92632. } : false;
  92633. }
  92634. /**
  92635. * @private
  92636. * @function ol.supermap.WebMap.prototype.getRankStyleGroup
  92637. * @description 获取等级符号的style
  92638. * @param {string} themeField - 分段字段
  92639. * @param {array} features - 添加到图层上的features
  92640. * @param {object} parameters - 图层参数
  92641. * @param {string} featureType - feature的类型
  92642. * @returns {array} stylegroup
  92643. */
  92644. }, {
  92645. key: "getRankStyleGroup",
  92646. value: function getRankStyleGroup(themeField, features, parameters, featureType) {
  92647. // 找出所有的单值
  92648. var values = [],
  92649. segements = [],
  92650. style = parameters.style,
  92651. themeSetting = parameters.themeSetting,
  92652. segmentMethod = themeSetting.segmentMethod || this.defaultParameters.themeSetting.segmentMethod,
  92653. segmentCount = themeSetting.segmentCount || this.defaultParameters.themeSetting.segmentCount,
  92654. customSettings = themeSetting.customSettings,
  92655. minR = parameters.themeSetting.minRadius,
  92656. maxR = parameters.themeSetting.maxRadius,
  92657. fillColor = style.fillColor,
  92658. colors = parameters.themeSetting.colors;
  92659. features.forEach(function (feature) {
  92660. var attributes = feature.get('attributes'),
  92661. value = attributes[themeField]; // 过滤掉空值和非数值
  92662. if (value == null || !core_Util_Util.isNumber(value)) {
  92663. return;
  92664. }
  92665. values.push(Number(value));
  92666. });
  92667. try {
  92668. segements = ArrayStatistic.getArraySegments(values, segmentMethod, segmentCount);
  92669. } catch (error) {
  92670. console.error(error);
  92671. } // 处理自定义 分段
  92672. for (var i = 0; i < segmentCount; i++) {
  92673. if (i in customSettings) {
  92674. var startValue = customSettings[i]['segment']['start'],
  92675. endValue = customSettings[i]['segment']['end'];
  92676. startValue != null && (segements[i] = startValue);
  92677. endValue != null && (segements[i + 1] = endValue);
  92678. }
  92679. } //生成styleGroup
  92680. var styleGroup = [];
  92681. if (segements && segements.length) {
  92682. var len = segements.length,
  92683. incrementR = (maxR - minR) / (len - 1),
  92684. // 半径增量
  92685. start,
  92686. end,
  92687. radius = Number(((maxR + minR) / 2).toFixed(2)); // 获取颜色
  92688. var rangeColors = colors ? ColorsPickerUtil.getGradientColors(colors, len, 'RANGE') : [];
  92689. for (var j = 0; j < len - 1; j++) {
  92690. start = Number(segements[j].toFixed(2));
  92691. end = Number(segements[j + 1].toFixed(2)); // 这里特殊处理以下分段值相同的情况(即所有字段值相同)
  92692. radius = start === end ? radius : minR + Math.round(incrementR * j); // 最后一个分段时将end+0.01,避免取不到最大值
  92693. end = j === len - 2 ? end + 0.01 : end; // 处理自定义 半径
  92694. radius = customSettings[j] && customSettings[j].radius ? customSettings[j].radius : radius; // 转化成 ol 样式
  92695. style.radius = radius;
  92696. style.fillColor = customSettings[j] && customSettings[j].color ? customSettings[j].color : rangeColors[j] || fillColor;
  92697. var olStyle = StyleUtils.getOpenlayersStyle(style, featureType, true);
  92698. styleGroup.push({
  92699. olStyle: olStyle,
  92700. radius: radius,
  92701. start: start,
  92702. end: end,
  92703. fillColor: style.fillColor
  92704. });
  92705. }
  92706. return styleGroup;
  92707. } else {
  92708. return false;
  92709. }
  92710. }
  92711. /**
  92712. * @private
  92713. * @function ol.supermap.WebMap.prototype.checkUploadToRelationship
  92714. * @description 检查是否上传到关系型
  92715. * @param {String} fileId - 文件的id
  92716. * @returns {Promise<T | never>} 关系型文件一些参数
  92717. */
  92718. }, {
  92719. key: "checkUploadToRelationship",
  92720. value: function checkUploadToRelationship(fileId) {
  92721. var url = this.getRequestUrl("".concat(this.server, "web/datas/").concat(fileId, "/datasets.json"));
  92722. return FetchRequest.get(url, null, {
  92723. withCredentials: this.withCredentials
  92724. }).then(function (response) {
  92725. return response.json();
  92726. }).then(function (result) {
  92727. return result;
  92728. });
  92729. }
  92730. /**
  92731. * @private
  92732. * @function ol.supermap.WebMap.prototype.getDatasources
  92733. * @description 获取关系型文件发布的数据服务中数据源的名称
  92734. * @param {String} url - 获取数据源信息的url
  92735. * @returns {Promise<T | never>} 数据源名称
  92736. */
  92737. }, {
  92738. key: "getDatasources",
  92739. value: function getDatasources(url) {
  92740. var requestUrl = this.getRequestUrl("".concat(url, "/data/datasources.json"));
  92741. return FetchRequest.get(requestUrl, null, {
  92742. withCredentials: this.withCredentials
  92743. }).then(function (response) {
  92744. return response.json();
  92745. }).then(function (datasource) {
  92746. var datasourceNames = datasource.datasourceNames;
  92747. return datasourceNames[0];
  92748. });
  92749. }
  92750. /**
  92751. * @private
  92752. * @function ol.supermap.WebMap.prototype.getDataService
  92753. * @description 获取上传的数据信息
  92754. * @param {String} fileId - 文件id
  92755. * @param {String} datasetName 数据服务的数据集名称
  92756. * @returns {Promise<T | never>} 数据的信息
  92757. */
  92758. }, {
  92759. key: "getDataService",
  92760. value: function getDataService(fileId, datasetName) {
  92761. var url = this.getRequestUrl("".concat(this.server, "web/datas/").concat(fileId, ".json"));
  92762. return FetchRequest.get(url, null, {
  92763. withCredentials: this.withCredentials
  92764. }).then(function (response) {
  92765. return response.json();
  92766. }).then(function (result) {
  92767. result.fileId = fileId;
  92768. result.datasetName = datasetName;
  92769. return result;
  92770. });
  92771. }
  92772. /**
  92773. * @private
  92774. * @function ol.supermap.WebMap.prototype.getRootUrl
  92775. * @description 获取请求地址
  92776. * @param {string} url 请求的地址
  92777. * @param {boolean} 请求是否带上Credential.
  92778. * @returns {Promise<T | never>} 请求地址
  92779. */
  92780. }, {
  92781. key: "getRequestUrl",
  92782. value: function getRequestUrl(url, excludeCreditial) {
  92783. url = excludeCreditial ? url : this.formatUrlWithCredential(url); //如果传入进来的url带了代理则不需要处理
  92784. if (this.excludePortalProxyUrl) {
  92785. return;
  92786. }
  92787. return Util.isInTheSameDomain(url) ? url : "".concat(this.getProxy()).concat(encodeURIComponent(url));
  92788. }
  92789. /**
  92790. * 给url带上凭证密钥
  92791. * @param {*} url 地址
  92792. */
  92793. }, {
  92794. key: "formatUrlWithCredential",
  92795. value: function formatUrlWithCredential(url) {
  92796. if (this.credentialValue) {
  92797. //有token之类的配置项
  92798. url = url.indexOf("?") === -1 ? "".concat(url, "?").concat(this.credentialKey, "=").concat(this.credentialValue) : "".concat(url, "&").concat(this.credentialKey, "=").concat(this.credentialValue);
  92799. }
  92800. return url;
  92801. }
  92802. /**
  92803. * @private
  92804. * @function ol.supermap.WebMap.prototype.getProxy
  92805. * @description 获取代理地址
  92806. * @returns {Promise<T | never>} 代理地址
  92807. */
  92808. }, {
  92809. key: "getProxy",
  92810. value: function getProxy(type) {
  92811. if (!type) {
  92812. type = 'json';
  92813. }
  92814. return this.proxy || this.server + "apps/viewer/getUrlResource.".concat(type, "?url=");
  92815. }
  92816. /**
  92817. * @private
  92818. * @function ol.supermap.WebMap.prototype.getTileLayerInfo
  92819. * @description 获取地图服务的信息
  92820. * @param {String} url 地图服务的url(没有地图名字)
  92821. * @returns {Promise<T | never>} 地图服务信息
  92822. */
  92823. }, {
  92824. key: "getTileLayerInfo",
  92825. value: function getTileLayerInfo(url) {
  92826. var that = this,
  92827. epsgCode = that.baseProjection.split('EPSG:')[1];
  92828. var requestUrl = that.getRequestUrl("".concat(url, "/maps.json"));
  92829. return FetchRequest.get(requestUrl, null, {
  92830. withCredentials: this.withCredentials
  92831. }).then(function (response) {
  92832. return response.json();
  92833. }).then(function (mapInfo) {
  92834. var promises = [];
  92835. if (mapInfo) {
  92836. mapInfo.forEach(function (info) {
  92837. var mapUrl = that.getRequestUrl("".concat(info.path, ".json?prjCoordSys=").concat(encodeURI(JSON.stringify({
  92838. epsgCode: epsgCode
  92839. }))));
  92840. var promise = FetchRequest.get(mapUrl, null, {
  92841. withCredentials: that.withCredentials
  92842. }).then(function (response) {
  92843. return response.json();
  92844. }).then(function (restMapInfo) {
  92845. restMapInfo.url = info.path;
  92846. return restMapInfo;
  92847. });
  92848. promises.push(promise);
  92849. });
  92850. }
  92851. return Promise.all(promises).then(function (allRestMaps) {
  92852. return allRestMaps;
  92853. });
  92854. });
  92855. }
  92856. /**
  92857. * 通过wkt参数扩展支持多坐标系
  92858. *
  92859. * @param {String} wkt 字符串
  92860. * @param {string} crsCode epsg信息,如: "EPSG:4490"
  92861. *
  92862. * @returns {Boolean} 坐标系是否添加成功
  92863. */
  92864. }, {
  92865. key: "addProjctionFromWKT",
  92866. value: function addProjctionFromWKT(wkt, crsCode) {
  92867. if (typeof wkt !== 'string') {
  92868. //参数类型错误
  92869. return false;
  92870. } else {
  92871. if (wkt === "EPSG:4326" || wkt === "EPSG:3857") {
  92872. return true;
  92873. } else {
  92874. var epsgCode = crsCode || this.getEpsgInfoFromWKT(wkt);
  92875. if (epsgCode) {
  92876. lib.defs(epsgCode, wkt); // 重新注册proj4到ol.proj,不然不会生效
  92877. if (external_ol_proj_proj4_namespaceObject && external_ol_proj_proj4_namespaceObject.register) {
  92878. external_ol_proj_proj4_namespaceObject.register(lib);
  92879. } else if (window.ol.proj && window.ol.proj.setProj4) {
  92880. window.ol.proj.setProj4(lib);
  92881. }
  92882. return true;
  92883. } else {
  92884. // 参数类型非wkt标准
  92885. return false;
  92886. }
  92887. }
  92888. }
  92889. }
  92890. /**
  92891. * 通过wkt参数获取坐标信息
  92892. *
  92893. * @param {String} wkt 字符串
  92894. * @returns {String} epsg 如:"EPSG:4326"
  92895. */
  92896. }, {
  92897. key: "getEpsgInfoFromWKT",
  92898. value: function getEpsgInfoFromWKT(wkt) {
  92899. if (typeof wkt !== 'string') {
  92900. return false;
  92901. } else if (wkt.indexOf("EPSG") === 0) {
  92902. return wkt;
  92903. } else {
  92904. var lastAuthority = wkt.lastIndexOf("AUTHORITY") + 10,
  92905. endString = wkt.indexOf("]", lastAuthority) - 1;
  92906. if (lastAuthority > 0 && endString > 0) {
  92907. return "EPSG:".concat(wkt.substring(lastAuthority, endString).split(",")[1].substr(1));
  92908. } else {
  92909. return false;
  92910. }
  92911. }
  92912. }
  92913. /**
  92914. * @private
  92915. * @function ol.supermap.WebMap.prototype.createMigrationLayer
  92916. * @description 创建迁徙图
  92917. * @param {Object} layerInfo 图层信息
  92918. * @param {Array} features 要素数组
  92919. * @returns {ol/layer} 图层
  92920. */
  92921. }, {
  92922. key: "createMigrationLayer",
  92923. value: function createMigrationLayer(layerInfo, features) {
  92924. // 获取图层外包DOM
  92925. if (!window.EChartsLayer.prototype.getContainer) {
  92926. window.EChartsLayer.prototype.getContainer = function () {
  92927. return this.$container;
  92928. };
  92929. } // 设置图层可见性
  92930. if (!window.EChartsLayer.prototype.setVisible) {
  92931. window.EChartsLayer.prototype.setVisible = function (visible) {
  92932. if (visible) {
  92933. var _options = this.get('options');
  92934. if (_options) {
  92935. this.setChartOptions(_options);
  92936. this.unset('options');
  92937. }
  92938. } else {
  92939. var _options2 = this.getChartOptions();
  92940. this.set('options', _options2);
  92941. this.clear();
  92942. this.setChartOptions({});
  92943. }
  92944. };
  92945. } // 设置图层层级
  92946. if (!window.EChartsLayer.prototype.setZIndex) {
  92947. window.EChartsLayer.prototype.setZIndex = function (zIndex) {
  92948. var container = this.getContainer();
  92949. if (container) {
  92950. container.style.zIndex = zIndex;
  92951. }
  92952. };
  92953. }
  92954. /**
  92955. * 设置鼠标样式
  92956. * .cursor-default > div {
  92957. * cursor: default !important;
  92958. * }
  92959. */
  92960. if (!window.EChartsLayer.prototype.setCursor) {
  92961. window.EChartsLayer.prototype.setCursor = function () {
  92962. var cursor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
  92963. var container = this.getContainer();
  92964. if (container && cursor === 'default') {
  92965. container.classList.add('cursor-default');
  92966. }
  92967. };
  92968. }
  92969. var properties = core_Util_Util.getFeatureProperties(features);
  92970. var lineData = this.createLinesData(layerInfo, properties);
  92971. var pointData = this.createPointsData(lineData, layerInfo, properties);
  92972. var options = this.createOptions(layerInfo, lineData, pointData);
  92973. var layer = new window.EChartsLayer(options, {
  92974. // hideOnMoving: true,
  92975. // hideOnZooming: true
  92976. //以下三个参数,如果不按照这样设置,会造成不可见图层时,缩放还会出现图层
  92977. hideOnMoving: false,
  92978. hideOnZooming: false,
  92979. forcedPrecomposeRerender: true
  92980. });
  92981. layer.type = 'ECHARTS';
  92982. return layer;
  92983. }
  92984. /**
  92985. * @private
  92986. * @function ol.supermap.WebMap.prototype.createOptions
  92987. * @description 创建echarts的options
  92988. * @param {Object} layerInfo 图层信息
  92989. * @param {Array} lineData 线数据
  92990. * @param {Array} pointData 点数据
  92991. * @returns {Object} echarts参数
  92992. */
  92993. }, {
  92994. key: "createOptions",
  92995. value: function createOptions(layerInfo, lineData, pointData) {
  92996. var series;
  92997. var lineSeries = this.createLineSeries(layerInfo, lineData);
  92998. if (pointData && pointData.length) {
  92999. var pointSeries = this.createPointSeries(layerInfo, pointData);
  93000. series = lineSeries.concat(pointSeries);
  93001. } else {
  93002. series = lineSeries.slice();
  93003. }
  93004. var options = {
  93005. series: series
  93006. };
  93007. return options;
  93008. }
  93009. /**
  93010. * @private
  93011. * @function ol.supermap.WebMap.prototype.createLineSeries
  93012. * @description 创建线系列
  93013. * @param {Object} layerInfo 图层参数
  93014. * @param {Array} lineData 线数据
  93015. * @returns {Object} 线系列
  93016. */
  93017. }, {
  93018. key: "createLineSeries",
  93019. value: function createLineSeries(layerInfo, lineData) {
  93020. var lineSetting = layerInfo.lineSetting;
  93021. var animationSetting = layerInfo.animationSetting;
  93022. var linesSeries = [// 轨迹线样式
  93023. {
  93024. name: 'line-series',
  93025. type: 'lines',
  93026. zlevel: 1,
  93027. silent: true,
  93028. effect: {
  93029. show: animationSetting.show,
  93030. constantSpeed: animationSetting.constantSpeed,
  93031. trailLength: 0,
  93032. symbol: animationSetting.symbol,
  93033. symbolSize: animationSetting.symbolSize
  93034. },
  93035. lineStyle: {
  93036. normal: {
  93037. color: lineSetting.color,
  93038. type: lineSetting.type,
  93039. width: lineSetting.width,
  93040. opacity: lineSetting.opacity,
  93041. curveness: lineSetting.curveness
  93042. }
  93043. },
  93044. data: lineData
  93045. }];
  93046. if (lineData.length > MAX_MIGRATION_ANIMATION_COUNT) {
  93047. // linesSeries[0].large = true;
  93048. // linesSeries[0].largeThreshold = 100;
  93049. linesSeries[0].blendMode = 'lighter';
  93050. }
  93051. return linesSeries;
  93052. }
  93053. /**
  93054. * @private
  93055. * @function ol.supermap.WebMap.prototype.createPointSeries
  93056. * @description 创建点系列
  93057. * @param {Object} layerInfo 图层参数
  93058. * @param {Array} pointData 点数据
  93059. * @returns {Object} 点系列
  93060. */
  93061. }, {
  93062. key: "createPointSeries",
  93063. value: function createPointSeries(layerInfo, pointData) {
  93064. var lineSetting = layerInfo.lineSetting;
  93065. var animationSetting = layerInfo.animationSetting;
  93066. var labelSetting = layerInfo.labelSetting;
  93067. var pointSeries = [{
  93068. name: 'point-series',
  93069. coordinateSystem: 'geo',
  93070. zlevel: 2,
  93071. silent: true,
  93072. label: {
  93073. normal: {
  93074. show: labelSetting.show,
  93075. position: 'right',
  93076. formatter: '{b}',
  93077. color: labelSetting.color,
  93078. fontFamily: labelSetting.fontFamily
  93079. }
  93080. },
  93081. itemStyle: {
  93082. normal: {
  93083. color: lineSetting.color || labelSetting.color
  93084. }
  93085. },
  93086. data: pointData
  93087. }];
  93088. if (animationSetting.show) {
  93089. // 开启动画
  93090. pointSeries[0].type = 'effectScatter';
  93091. pointSeries[0].rippleEffect = {
  93092. brushType: 'stroke'
  93093. };
  93094. } else {
  93095. // 关闭动画
  93096. pointSeries[0].type = 'scatter';
  93097. }
  93098. return pointSeries;
  93099. }
  93100. /**
  93101. * @private
  93102. * @function ol.supermap.WebMap.prototype.createPointsData
  93103. * @param {Array} lineData 线数据
  93104. * @param {Object} layerInfo 图层信息
  93105. * @param {Array} properties 属性
  93106. * @returns {Array} 点数据
  93107. */
  93108. }, {
  93109. key: "createPointsData",
  93110. value: function createPointsData(lineData, layerInfo, properties) {
  93111. var data = [],
  93112. labelSetting = layerInfo.labelSetting; // 标签隐藏则直接返回
  93113. if (!labelSetting.show || !lineData.length) {
  93114. return data;
  93115. }
  93116. var fromData = [],
  93117. toData = [];
  93118. lineData.forEach(function (item, idx) {
  93119. var coords = item.coords,
  93120. fromCoord = coords[0],
  93121. toCoord = coords[1],
  93122. fromProperty = properties[idx][labelSetting.from],
  93123. toProperty = properties[idx][labelSetting.to]; // 起始字段去重
  93124. var f = fromData.find(function (d) {
  93125. return d.value[0] === fromCoord[0] && d.value[1] === fromCoord[1];
  93126. });
  93127. !f && fromData.push({
  93128. name: fromProperty,
  93129. value: fromCoord
  93130. }); // 终点字段去重
  93131. var t = toData.find(function (d) {
  93132. return d.value[0] === toCoord[0] && d.value[1] === toCoord[1];
  93133. });
  93134. !t && toData.push({
  93135. name: toProperty,
  93136. value: toCoord
  93137. });
  93138. });
  93139. data = fromData.concat(toData);
  93140. return data;
  93141. }
  93142. /**
  93143. * @private
  93144. * @function ol.supermap.WebMap.prototype.createLinesData
  93145. * @param {Object} layerInfo 图层信息
  93146. * @param {Array} properties 属性
  93147. * @returns {Array} 线数据
  93148. */
  93149. }, {
  93150. key: "createLinesData",
  93151. value: function createLinesData(layerInfo, properties) {
  93152. var data = [];
  93153. if (properties && properties.length) {
  93154. // 重新获取数据
  93155. var from = layerInfo.from,
  93156. to = layerInfo.to,
  93157. fromCoord,
  93158. toCoord;
  93159. if (from.type === 'XY_FIELD' && from['xField'] && from['yField'] && to['xField'] && to['yField']) {
  93160. properties.forEach(function (property) {
  93161. var fromX = property[from['xField']],
  93162. fromY = property[from['yField']],
  93163. toX = property[to['xField']],
  93164. toY = property[to['yField']];
  93165. if (!fromX || !fromY || !toX || !toY) {
  93166. return;
  93167. }
  93168. fromCoord = [property[from['xField']], property[from['yField']]];
  93169. toCoord = [property[to['xField']], property[to['yField']]];
  93170. data.push({
  93171. coords: [fromCoord, toCoord]
  93172. });
  93173. });
  93174. } else if (from.type === 'PLACE_FIELD' && from['field'] && to['field']) {
  93175. var centerDatas = ProvinceCenter_namespaceObject.concat(MunicipalCenter_namespaceObject);
  93176. properties.forEach(function (property) {
  93177. var fromField = property[from['field']],
  93178. toField = property[to['field']];
  93179. fromCoord = centerDatas.find(function (item) {
  93180. return core_Util_Util.isMatchAdministrativeName(item.name, fromField);
  93181. });
  93182. toCoord = centerDatas.find(function (item) {
  93183. return core_Util_Util.isMatchAdministrativeName(item.name, toField);
  93184. });
  93185. if (!fromCoord || !toCoord) {
  93186. return;
  93187. }
  93188. data.push({
  93189. coords: [fromCoord.coord, toCoord.coord]
  93190. });
  93191. });
  93192. }
  93193. }
  93194. return data;
  93195. }
  93196. /**
  93197. * @private
  93198. * @function ol.supermap.WebMap.prototype.getService
  93199. * @description 获取当前数据发布的服务中的某种类型服务
  93200. * @param {Array} services 服务集合
  93201. * @param {String} type 服务类型,RESTDATA, RESTMAP
  93202. * @returns {Object} 服务
  93203. */
  93204. }, {
  93205. key: "getService",
  93206. value: function getService(services, type) {
  93207. var service = services.filter(function (info) {
  93208. return info && info.serviceType === type;
  93209. });
  93210. return service[0];
  93211. }
  93212. /**
  93213. * @private
  93214. * @function ol.supermap.WebMap.prototype.isMvt
  93215. * @description 判断当前能否使用数据服务的mvt上图方式
  93216. * @param {String} serviceUrl 数据服务的地址
  93217. * @param {String} datasetName 数据服务的数据集名称
  93218. * @returns {Object} 数据服务的信息
  93219. */
  93220. }, {
  93221. key: "isMvt",
  93222. value: function isMvt(serviceUrl, datasetName) {
  93223. var that = this;
  93224. return this.getDatasetsInfo(serviceUrl, datasetName).then(function (info) {
  93225. //判断是否和底图坐标系一直
  93226. if (info.epsgCode == that.baseProjection.split('EPSG:')[1]) {
  93227. return FetchRequest.get(that.getRequestUrl("".concat(info.url, "/tilefeature.mvt")), null, {
  93228. withCredentials: that.withCredentials
  93229. }).then(function (response) {
  93230. return response.json();
  93231. }).then(function (result) {
  93232. info.isMvt = result.error && result.error.code === 400;
  93233. return info;
  93234. })["catch"](function () {
  93235. return info;
  93236. });
  93237. }
  93238. return info;
  93239. });
  93240. }
  93241. /**
  93242. * @private
  93243. * @function ol.supermap.WebMap.prototype.getDatasetsInfo
  93244. * @description 获取数据集信息
  93245. * @param {String} serviceUrl 数据服务的地址
  93246. * @param {String} datasetName 数据服务的数据集名称
  93247. * @returns {Object} 数据服务的信息
  93248. */
  93249. }, {
  93250. key: "getDatasetsInfo",
  93251. value: function getDatasetsInfo(serviceUrl, datasetName) {
  93252. var that = this;
  93253. return that.getDatasources(serviceUrl).then(function (datasourceName) {
  93254. //判断mvt服务是否可用
  93255. var url = "".concat(serviceUrl, "/data/datasources/").concat(datasourceName, "/datasets/").concat(datasetName, ".json");
  93256. return FetchRequest.get(that.getRequestUrl(url), null, {
  93257. withCredentials: that.withCredentials
  93258. }).then(function (response) {
  93259. return response.json();
  93260. }).then(function (datasetsInfo) {
  93261. return {
  93262. epsgCode: datasetsInfo.datasetInfo.prjCoordSys.epsgCode,
  93263. bounds: datasetsInfo.datasetInfo.bounds,
  93264. url: url //返回的是原始url,没有代理。因为用于请求mvt
  93265. };
  93266. });
  93267. });
  93268. }
  93269. /**
  93270. * @private
  93271. * @function ol.supermap.WebMap.prototype.isRestMapMapboxStyle
  93272. * @description 仅判断是否为restmap mvt地图服务 rest-map服务的Mapbox Style资源地址是这样的: .../iserver/services/map-Population/rest/maps/PopulationDistribution/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true
  93273. * @param {Object} layerInfo webmap中的MapStylerLayer
  93274. * @returns {Boolean} 是否为restmap mvt地图服务
  93275. */
  93276. }, {
  93277. key: "isRestMapMapboxStyle",
  93278. value: function isRestMapMapboxStyle(layerInfo) {
  93279. var restMapMVTStr = '/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY';
  93280. var dataSource = layerInfo.dataSource;
  93281. var layerType = layerInfo.layerType;
  93282. if (dataSource && dataSource.type === "EXTERNAL" && dataSource.url.indexOf(restMapMVTStr) > -1 && (layerType === "MAPBOXSTYLE" || layerType === "VECTOR_TILE")) {
  93283. return true;
  93284. }
  93285. return false;
  93286. }
  93287. /**
  93288. * @private
  93289. * @function ol.supermap.WebMap.prototype.getMapboxStyleLayerInfo
  93290. * @description 获取mapboxstyle图层信息
  93291. * @param {layerInfo} layerInfo 图层信息
  93292. * @returns {Object} 图层信息
  93293. */
  93294. }, {
  93295. key: "getMapboxStyleLayerInfo",
  93296. value: function getMapboxStyleLayerInfo(mapInfo, layerInfo) {
  93297. var _this = this;
  93298. return new Promise(function (resolve, reject) {
  93299. return _this.getMapLayerExtent(layerInfo).then(function (layer) {
  93300. return _this.getMapboxStyle(mapInfo, layer).then(function (styleLayer) {
  93301. Object.assign(layer, styleLayer);
  93302. resolve(layer);
  93303. })["catch"](function (error) {
  93304. reject(error);
  93305. });
  93306. })["catch"](function (error) {
  93307. reject(error);
  93308. });
  93309. });
  93310. }
  93311. /**
  93312. * @private
  93313. * @function ol.supermap.WebMap.prototype.getMapLayerExtent
  93314. * @description 获取mapboxstyle图层信息
  93315. * @param {Object} layerInfo 图层信息
  93316. * @returns {Object} 图层信息
  93317. */
  93318. }, {
  93319. key: "getMapLayerExtent",
  93320. value: function getMapLayerExtent(layerInfo) {
  93321. var restMapMVTStr = '/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY';
  93322. var dataSource = layerInfo.dataSource;
  93323. var url = dataSource.url;
  93324. if (this.isRestMapMapboxStyle(layerInfo)) {
  93325. url = url.replace(restMapMVTStr, '');
  93326. }
  93327. url = this.getRequestUrl(url + '.json');
  93328. var credential = layerInfo.credential;
  93329. var credentialValue, keyfix; //携带令牌(restmap用的首字母大写,但是这里要用小写)
  93330. if (credential) {
  93331. keyfix = Object.keys(credential)[0];
  93332. credentialValue = credential[keyfix];
  93333. url = "".concat(url, "?").concat(keyfix, "=").concat(credentialValue);
  93334. }
  93335. return FetchRequest.get(url, null, {
  93336. withCredentials: this.withCredentials,
  93337. withoutFormatSuffix: true,
  93338. headers: {
  93339. 'Content-Type': 'application/json;chartset=uft-8'
  93340. }
  93341. }).then(function (response) {
  93342. return response.json();
  93343. }).then(function (result) {
  93344. layerInfo.visibleScales = result.visibleScales;
  93345. layerInfo.coordUnit = result.coordUnit;
  93346. layerInfo.scale = result.scale;
  93347. layerInfo.epsgCode = result.prjCoordSys.epsgCode;
  93348. layerInfo.bounds = result.bounds;
  93349. return layerInfo;
  93350. })["catch"](function (error) {
  93351. return error;
  93352. });
  93353. }
  93354. /**
  93355. * @private
  93356. * @function ol.supermap.WebMap.prototype.getMapboxStyle
  93357. * @description 获取mapboxstyle --- ipt中自定义底图请求mapboxstyle目前有两种url格式
  93358. * rest-map服务的Mapbox Style资源地址是这样的: .../iserver/services/map-Population/rest/maps/PopulationDistribution/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true
  93359. * restjsr片服务的Mapbox Style资源地址是这样的:.../iserver/services/map-china400/restjsr/v1/vectortile/maps/China/style.json
  93360. * @param {Object} mapboxstyle图层信息
  93361. * @returns {Object} 图层信息
  93362. */
  93363. }, {
  93364. key: "getMapboxStyle",
  93365. value: function getMapboxStyle(mapInfo, layerInfo) {
  93366. var _this = this;
  93367. var url = layerInfo.url || layerInfo.dataSource.url;
  93368. var styleUrl = url;
  93369. if (styleUrl.indexOf('/restjsr/') > -1) {
  93370. styleUrl = "".concat(styleUrl, "/style.json");
  93371. }
  93372. styleUrl = this.getRequestUrl(styleUrl);
  93373. var credential = layerInfo.credential; //携带令牌(restmap用的首字母大写,但是这里要用小写)
  93374. var credentialValue, keyfix;
  93375. if (credential) {
  93376. keyfix = Object.keys(credential)[0];
  93377. credentialValue = credential[keyfix];
  93378. styleUrl = "".concat(styleUrl, "?").concat(keyfix, "=").concat(credentialValue);
  93379. }
  93380. return FetchRequest.get(styleUrl, null, {
  93381. withCredentials: this.withCredentials,
  93382. withoutFormatSuffix: true,
  93383. headers: {
  93384. 'Content-Type': 'application/json;chartset=uft-8'
  93385. }
  93386. }).then(function (response) {
  93387. return response.json();
  93388. }).then(function (styles) {
  93389. _this._matchStyleObject(styles);
  93390. var bounds = layerInfo.bounds; // 处理携带令牌的情况
  93391. if (credentialValue) {
  93392. styles.sprite = "".concat(styles.sprite, "?").concat(keyfix, "=").concat(credentialValue);
  93393. var sources = styles.sources;
  93394. var sourcesNames = Object.keys(sources);
  93395. sourcesNames.forEach(function (sourceName) {
  93396. styles.sources[sourceName].tiles.forEach(function (tiles, i) {
  93397. styles.sources[sourceName].tiles[i] = "".concat(tiles, "?").concat(keyfix, "=").concat(credentialValue);
  93398. });
  93399. });
  93400. }
  93401. var newLayerInfo = {
  93402. url: url,
  93403. sourceType: 'VECTOR_TILE',
  93404. layerType: 'VECTOR_TILE',
  93405. styles: styles,
  93406. extent: bounds && [bounds.left, bounds.bottom, bounds.right, bounds.top],
  93407. bounds: layerInfo.bounds,
  93408. projection: "EPSG:" + layerInfo.epsgCode,
  93409. epsgCode: layerInfo.epsgCode,
  93410. name: layerInfo.name
  93411. };
  93412. Object.assign(layerInfo, newLayerInfo);
  93413. if (layerInfo.zIndex > 0) {
  93414. // 过滤styles 非底图mapboxstyle图层才需此处理
  93415. _this.modifyMapboxstyleLayer(mapInfo, layerInfo);
  93416. }
  93417. return layerInfo;
  93418. })["catch"](function (error) {
  93419. return error;
  93420. });
  93421. }
  93422. /**
  93423. * @private
  93424. * @function ol.supermap.WebMap.prototype.modifyMapboxstyleLayer
  93425. * @description mapboxstyle图层:1. layer id重复问题 2.叠加图层背景色问题
  93426. * @param {Object} mapInfo 地图信息
  93427. * @param {Object} layerInfo 当前要添加到地图的图层
  93428. */
  93429. }, {
  93430. key: "modifyMapboxstyleLayer",
  93431. value: function modifyMapboxstyleLayer(mapInfo, layerInfo) {
  93432. var that = this;
  93433. if (mapInfo.layers && mapInfo.layers.length === 0) {
  93434. return;
  93435. }
  93436. var curLayers = layerInfo.styles.layers;
  93437. if (!curLayers) {
  93438. return;
  93439. } // 非底图,则移除"background"图层
  93440. curLayers = curLayers.filter(function (layer) {
  93441. return layer.type !== "background";
  93442. });
  93443. layerInfo.styles.layers = curLayers; // 处理mapboxstyle图层layer id重复的情况
  93444. var addedLayersArr = mapInfo.layers.filter(function (layer) {
  93445. return layer.layerType === 'VECTOR_TILE' && layer.zIndex !== layerInfo.zIndex;
  93446. }).map(function (addLayer) {
  93447. return addLayer.styles && addLayer.styles.layers;
  93448. });
  93449. if (!addedLayersArr || addedLayersArr && addedLayersArr.length === 0) {
  93450. return;
  93451. }
  93452. addedLayersArr.forEach(function (layers) {
  93453. curLayers.forEach(function (curLayer) {
  93454. that.renameLayerId(layers, curLayer);
  93455. });
  93456. });
  93457. }
  93458. /**
  93459. * @private
  93460. * @function ol.supermap.WebMap.prototype.renameLayerId
  93461. * @description mapboxstyle图层 id重复的layer添加后缀编码 (n)[参考mapstudio]
  93462. * @param {mapboxgl.Layer[]} layers 已添加到地图的图层组
  93463. * @param {mapboxgl.Layer} curLayer 当前图层
  93464. */
  93465. }, {
  93466. key: "renameLayerId",
  93467. value: function renameLayerId(layers, curLayer) {
  93468. if (layers.find(function (l) {
  93469. return l.id === curLayer.id;
  93470. })) {
  93471. var result = curLayer.id.match(/(.+)\((\w)\)$/);
  93472. if (result) {
  93473. curLayer.id = "".concat(result[1], "(").concat(+result[2] + 1, ")");
  93474. } else {
  93475. curLayer.id += '(1)';
  93476. }
  93477. if (layers.find(function (l) {
  93478. return l.id === curLayer.id;
  93479. })) {
  93480. this.renameLayerId(layers, curLayer);
  93481. }
  93482. }
  93483. }
  93484. /**
  93485. * @private
  93486. * @function mapboxgl.supermap.WebMap.prototype._matchStyleObject
  93487. * @description 恢复 style 为标准格式。
  93488. * @param {Object} style - mapbox 样式。
  93489. */
  93490. }, {
  93491. key: "_matchStyleObject",
  93492. value: function _matchStyleObject(style) {
  93493. var sprite = style.sprite,
  93494. glyphs = style.glyphs;
  93495. if (sprite && WebMap_typeof(sprite) === 'object') {
  93496. style.sprite = Object.values(sprite)[0];
  93497. }
  93498. if (glyphs && WebMap_typeof(glyphs) === 'object') {
  93499. style.glyphs = Object.values(glyphs)[0];
  93500. }
  93501. }
  93502. /**
  93503. * @private
  93504. * @function ol.supermap.WebMap.prototype.renameLayerId
  93505. * @description 判断url是否是iportal的代理地址
  93506. * @param {*} serviceUrl
  93507. */
  93508. }, {
  93509. key: "isIportalProxyServiceUrl",
  93510. value: function isIportalProxyServiceUrl(serviceUrl) {
  93511. if (this.serviceProxy && this.serviceProxy.enable && serviceUrl) {
  93512. var proxyStr = '';
  93513. if (this.serviceProxy.proxyServerRootUrl) {
  93514. proxyStr = "".concat(this.serviceProxy.proxyServerRootUrl, "/");
  93515. } else if (this.serviceProxy.rootUrlPostfix) {
  93516. proxyStr = "".concat(this.serviceProxy.port, "/").concat(this.serviceProxy.rootUrlPostfix, "/");
  93517. } else if (!this.serviceProxy.rootUrlPostfix) {
  93518. proxyStr = "".concat(this.serviceProxy.port, "/");
  93519. }
  93520. if (this.serviceProxy.port !== 80) {
  93521. return serviceUrl.indexOf(proxyStr) >= 0;
  93522. } else {
  93523. // 代理端口为80,url中不一定有端口,满足一种情况即可
  93524. return serviceUrl.indexOf(proxyStr) >= 0 || serviceUrl.indexOf(proxyStr.replace(':80', '')) >= 0;
  93525. }
  93526. } else {
  93527. return false;
  93528. }
  93529. }
  93530. /**
  93531. * @private
  93532. * @function ol.supermap.WebMap.prototype.getStyleResolutions
  93533. * @description 创建图层分辨率
  93534. * @param {Object} bounds 图层上下左右范围
  93535. * @returns {Array} styleResolutions 样式分辨率
  93536. */
  93537. }, {
  93538. key: "getStyleResolutions",
  93539. value: function getStyleResolutions(bounds) {
  93540. var minZoom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  93541. var maxZoom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 22;
  93542. var styleResolutions = [];
  93543. var TILE_SIZE = 512;
  93544. var temp = Math.abs(bounds.left - bounds.right) / TILE_SIZE;
  93545. for (var i = minZoom; i <= maxZoom; i++) {
  93546. if (i === 0) {
  93547. styleResolutions[i] = temp;
  93548. continue;
  93549. }
  93550. temp = temp / 2;
  93551. styleResolutions[i] = temp;
  93552. }
  93553. return styleResolutions;
  93554. }
  93555. /**
  93556. * @private
  93557. * @function ol.supermap.WebMap.prototype.createVisibleResolution
  93558. * @description 创建图层可视分辨率
  93559. * @param {Array} visibleScales 可视比例尺范围
  93560. * @param {Array} indexbounds
  93561. * @param {Object} bounds 图层上下左右范围
  93562. * @param {String} coordUnit
  93563. * @returns {Array} visibleResolution
  93564. */
  93565. }, {
  93566. key: "createVisibleResolution",
  93567. value: function createVisibleResolution(visibleScales, indexbounds, bounds, coordUnit) {
  93568. var _this5 = this;
  93569. var visibleResolution = []; // 1 设置了地图visibleScales的情况
  93570. if (visibleScales && visibleScales.length > 0) {
  93571. visibleResolution = visibleScales.map(function (scale) {
  93572. var value = 1 / scale;
  93573. var res = _this5.getResFromScale(value, coordUnit);
  93574. return res;
  93575. });
  93576. } else {
  93577. // 2 地图的bounds
  93578. var envelope = this.getEnvelope(indexbounds, bounds);
  93579. visibleResolution = this.getStyleResolutions(envelope);
  93580. }
  93581. return visibleResolution;
  93582. }
  93583. /**
  93584. * @private
  93585. * @function ol.supermap.WebMap.prototype.createVisibleResolution
  93586. * @description 图层边界范围
  93587. * @param {Array} indexbounds
  93588. * @param {Object} bounds 图层上下左右范围
  93589. * @returns {Object} envelope
  93590. */
  93591. }, {
  93592. key: "getEnvelope",
  93593. value: function getEnvelope(indexbounds, bounds) {
  93594. var envelope = {};
  93595. if (indexbounds && indexbounds.length === 4) {
  93596. envelope.left = indexbounds[0];
  93597. envelope.bottom = indexbounds[1];
  93598. envelope.right = indexbounds[2];
  93599. envelope.top = indexbounds[3];
  93600. } else {
  93601. envelope = bounds;
  93602. }
  93603. return envelope;
  93604. }
  93605. /**
  93606. * @private
  93607. * @function ol.supermap.WebMap.prototype.createMVTLayer
  93608. * @description 创建矢量瓦片图层
  93609. * @param {object} layerInfo - 图层信息
  93610. */
  93611. }, {
  93612. key: "createMVTLayer",
  93613. value: function createMVTLayer(layerInfo) {
  93614. // let that = this;
  93615. var styles = layerInfo.styles;
  93616. var indexbounds = styles && styles.metadata && styles.metadata.indexbounds;
  93617. var visibleResolution = this.createVisibleResolution(layerInfo.visibleScales, indexbounds, layerInfo.bounds, layerInfo.coordUnit);
  93618. var envelope = this.getEnvelope(indexbounds, layerInfo.bounds);
  93619. var styleResolutions = this.getStyleResolutions(envelope); // const origin = [envelope.left, envelope.top];
  93620. var withCredentials = this.isIportalProxyServiceUrl(styles.sprite); // 创建MapBoxStyle样式
  93621. var mapboxStyles = new MapboxStyles({
  93622. style: styles,
  93623. source: styles.name,
  93624. resolutions: styleResolutions,
  93625. map: this.map,
  93626. withCredentials: withCredentials
  93627. });
  93628. return new Promise(function (resolve) {
  93629. mapboxStyles.on('styleloaded', function () {
  93630. var minResolution = visibleResolution[visibleResolution.length - 1];
  93631. var maxResolution = visibleResolution[0];
  93632. var layer = new external_ol_layer_namespaceObject.VectorTile({
  93633. //设置避让参数
  93634. declutter: true,
  93635. source: new VectorTileSuperMapRest({
  93636. style: styles,
  93637. withCredentials: withCredentials,
  93638. projection: layerInfo.projection,
  93639. format: new (external_ol_format_MVT_default())({
  93640. featureClass: (external_ol_render_Feature_default())
  93641. }),
  93642. wrapX: false
  93643. }),
  93644. style: mapboxStyles.featureStyleFuntion,
  93645. visible: layerInfo.visible,
  93646. zIndex: layerInfo.zIndex,
  93647. opacity: layerInfo.opacity,
  93648. minResolution: minResolution,
  93649. // The maximum resolution (exclusive) below which this layer will be visible.
  93650. maxResolution: maxResolution > 1 ? Math.ceil(maxResolution) : maxResolution * 1.1
  93651. });
  93652. resolve(layer);
  93653. });
  93654. });
  93655. }
  93656. /**
  93657. * @private
  93658. * @function ol.supermap.WebMap.prototype.isSameDomain
  93659. * @description 判断是否同域名(如果是域名,只判断后门两级域名是否相同,第一级忽略),如果是ip地址则需要完全相同。
  93660. * @param {*} url
  93661. */
  93662. }, {
  93663. key: "isSameDomain",
  93664. value: function isSameDomain(url) {
  93665. var documentUrlArray = url.split("://"),
  93666. substring = documentUrlArray[1];
  93667. var domainIndex = substring.indexOf("/"),
  93668. domain = substring.substring(0, domainIndex);
  93669. var documentUrl = document.location.toString();
  93670. var docUrlArray = documentUrl.split("://"),
  93671. documentSubstring = docUrlArray[1];
  93672. var docuDomainIndex = documentSubstring.indexOf("/"),
  93673. docDomain = documentSubstring.substring(0, docuDomainIndex);
  93674. if (domain.indexOf(':') > -1 || window.location.port !== "") {
  93675. //说明用的是ip地址,判断完整域名判断
  93676. return domain === docDomain;
  93677. } else {
  93678. var domainArray = domain.split('.'),
  93679. docDomainArray = docDomain.split('.');
  93680. return domainArray[1] === docDomainArray[1] && domainArray[2] === docDomainArray[2];
  93681. }
  93682. }
  93683. /**
  93684. * @private
  93685. * @function ol.supermap.WebMap.prototype.isSupportWebp
  93686. * @description 判断是否支持webP
  93687. * @param {*} url 服务地址
  93688. * @param {*} token 服务token
  93689. * @returns {boolean}
  93690. */
  93691. }, {
  93692. key: "isSupportWebp",
  93693. value: function isSupportWebp(url, token) {
  93694. // 还需要判断浏览器
  93695. var isIE = this.isIE();
  93696. if (isIE || this.isFirefox() && this.getFirefoxVersion() < 65 || this.isChrome() && this.getChromeVersion() < 32) {
  93697. return false;
  93698. }
  93699. url = token ? "".concat(url, "/tileImage.webp?token=").concat(token) : "".concat(url, "/tileImage.webp");
  93700. var isSameDomain = Util.isInTheSameDomain(url),
  93701. excledeCreditial;
  93702. if (isSameDomain && !token) {
  93703. // online上服务域名一直,要用token值
  93704. excledeCreditial = false;
  93705. } else {
  93706. excledeCreditial = true;
  93707. }
  93708. url = this.getRequestUrl(url, excledeCreditial);
  93709. return FetchRequest.get(url, null, {
  93710. withCredentials: this.withCredentials,
  93711. withoutFormatSuffix: true
  93712. }).then(function (response) {
  93713. if (response.status !== 200) {
  93714. throw response.status;
  93715. }
  93716. return response;
  93717. }).then(function () {
  93718. return true;
  93719. })["catch"](function () {
  93720. return false;
  93721. });
  93722. }
  93723. /**
  93724. * @private
  93725. * @function ol.supermap.WebMap.prototype.isIE
  93726. * @description 判断当前浏览器是否为IE
  93727. * @returns {boolean}
  93728. */
  93729. }, {
  93730. key: "isIE",
  93731. value: function isIE() {
  93732. if (!!window.ActiveXObject || "ActiveXObject" in window) {
  93733. return true;
  93734. }
  93735. return false;
  93736. }
  93737. /**
  93738. * @private
  93739. * @function ol.supermap.WebMap.prototype.isFirefox
  93740. * @description 判断当前浏览器是否为 firefox
  93741. * @returns {boolean}
  93742. */
  93743. }, {
  93744. key: "isFirefox",
  93745. value: function isFirefox() {
  93746. var userAgent = navigator.userAgent;
  93747. return userAgent.indexOf("Firefox") > -1;
  93748. }
  93749. /**
  93750. * @private
  93751. * @function ol.supermap.WebMap.prototype.isChrome
  93752. * @description 判断当前浏览器是否为谷歌
  93753. * @returns {boolean}
  93754. */
  93755. }, {
  93756. key: "isChrome",
  93757. value: function isChrome() {
  93758. var userAgent = navigator.userAgent;
  93759. return userAgent.indexOf("Chrome") > -1;
  93760. }
  93761. /**
  93762. * @private
  93763. * @function ol.supermap.WebMap.prototype.getFirefoxVersion
  93764. * @description 获取火狐浏览器的版本号
  93765. * @returns {Number}
  93766. */
  93767. }, {
  93768. key: "getFirefoxVersion",
  93769. value: function getFirefoxVersion() {
  93770. var userAgent = navigator.userAgent.toLowerCase(),
  93771. version = userAgent.match(/firefox\/([\d.]+)/);
  93772. return +version[1];
  93773. }
  93774. /**
  93775. * @private
  93776. * @function ol.supermap.WebMap.prototype.getChromeVersion
  93777. * @description 获取谷歌浏览器版本号
  93778. * @returns {Number}
  93779. */
  93780. }, {
  93781. key: "getChromeVersion",
  93782. value: function getChromeVersion() {
  93783. var userAgent = navigator.userAgent.toLowerCase(),
  93784. version = userAgent.match(/chrome\/([\d.]+)/);
  93785. return +version[1];
  93786. }
  93787. /**
  93788. * @private
  93789. * @function ol.supermap.WebMap.prototype.addGraticule
  93790. * @description 创建经纬网
  93791. * @param {object} mapInfo - 地图信息
  93792. */
  93793. }, {
  93794. key: "addGraticule",
  93795. value: function addGraticule(mapInfo) {
  93796. if (this.isHaveGraticule) {
  93797. this.createGraticuleLayer(mapInfo.grid.graticule);
  93798. this.layerAdded++;
  93799. var lens = mapInfo.layers ? mapInfo.layers.length : 0;
  93800. this.sendMapToUser(lens);
  93801. }
  93802. }
  93803. /**
  93804. * @private
  93805. * @function ol.supermap.WebMap.prototype.createGraticuleLayer
  93806. * @description 创建经纬网图层
  93807. * @param {object} layerInfo - 图层信息
  93808. * @returns {ol/layer/Vector} 矢量图层
  93809. */
  93810. }, {
  93811. key: "createGraticuleLayer",
  93812. value: function createGraticuleLayer(layerInfo) {
  93813. var strokeColor = layerInfo.strokeColor,
  93814. strokeWidth = layerInfo.strokeWidth,
  93815. lineDash = layerInfo.lineDash,
  93816. extent = layerInfo.extent,
  93817. visible = layerInfo.visible,
  93818. interval = layerInfo.interval,
  93819. lonLabelStyle = layerInfo.lonLabelStyle,
  93820. latLabelStyle = layerInfo.latLabelStyle;
  93821. var epsgCode = this.baseProjection; // 添加经纬网需要设置extent、worldExtent
  93822. var projection = new external_ol_proj_namespaceObject.get(epsgCode);
  93823. projection.setExtent(extent);
  93824. projection.setWorldExtent(external_ol_proj_namespaceObject.transformExtent(extent, epsgCode, 'EPSG:4326'));
  93825. var graticuleOptions = {
  93826. layerID: 'graticule_layer',
  93827. strokeStyle: new (external_ol_style_Stroke_default())({
  93828. color: strokeColor,
  93829. width: strokeWidth,
  93830. lineDash: lineDash
  93831. }),
  93832. extent: extent,
  93833. visible: visible,
  93834. intervals: interval,
  93835. showLabels: true,
  93836. zIndex: 9999,
  93837. wrapX: false,
  93838. targetSize: 0
  93839. };
  93840. lonLabelStyle && (graticuleOptions.lonLabelStyle = new (external_ol_style_Text_default())({
  93841. font: "".concat(lonLabelStyle.fontSize, " ").concat(lonLabelStyle.fontFamily),
  93842. textBaseline: lonLabelStyle.textBaseline,
  93843. fill: new (external_ol_style_Fill_default())({
  93844. color: lonLabelStyle.fill
  93845. }),
  93846. stroke: new (external_ol_style_Stroke_default())({
  93847. color: lonLabelStyle.outlineColor,
  93848. width: lonLabelStyle.outlineWidth
  93849. })
  93850. }));
  93851. latLabelStyle && (graticuleOptions.latLabelStyle = new (external_ol_style_Text_default())({
  93852. font: "".concat(latLabelStyle.fontSize, " ").concat(latLabelStyle.fontFamily),
  93853. textBaseline: latLabelStyle.textBaseline,
  93854. fill: new (external_ol_style_Fill_default())({
  93855. color: latLabelStyle.fill
  93856. }),
  93857. stroke: new (external_ol_style_Stroke_default())({
  93858. color: latLabelStyle.outlineColor,
  93859. width: latLabelStyle.outlineWidth
  93860. })
  93861. }));
  93862. var layer = new external_ol_layer_namespaceObject.Graticule(graticuleOptions);
  93863. this.map.addLayer(layer);
  93864. }
  93865. }]);
  93866. return WebMap;
  93867. }((external_ol_Observable_default()));
  93868. ;// CONCATENATED MODULE: ./src/openlayers/mapping/index.js
  93869. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  93870. * This program are made available under the terms of the Apache License, Version 2.0
  93871. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93872. ;// CONCATENATED MODULE: ./src/openlayers/namespace.js
  93873. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  93874. * This program are made available under the terms of the Apache License, Version 2.0
  93875. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93876. /* control */
  93877. /* core */
  93878. /* mapping */
  93879. /* overlay */
  93880. /* service */
  93881. if (window && window.ol) {
  93882. var namespace_ol = window.ol;
  93883. namespace_ol.supermap = window.ol.supermap || {};
  93884. namespace_ol.supermap.control = window.ol.supermap.control || {}; // control
  93885. namespace_ol.supermap.control.ChangeTileVersion = ChangeTileVersion;
  93886. namespace_ol.supermap.control.Logo = Logo;
  93887. namespace_ol.supermap.control.ScaleLine = ScaleLine; // core
  93888. namespace_ol.supermap.StyleUtils = StyleUtils;
  93889. namespace_ol.supermap.Util = core_Util_Util; // mapping
  93890. namespace_ol.source.BaiduMap = BaiduMap;
  93891. namespace_ol.source.ImageSuperMapRest = ImageSuperMapRest;
  93892. namespace_ol.source.SuperMapCloud = SuperMapCloud;
  93893. namespace_ol.source.Tianditu = Tianditu;
  93894. namespace_ol.source.TileSuperMapRest = TileSuperMapRest;
  93895. namespace_ol.supermap.WebMap = WebMap; // overlay
  93896. namespace_ol.style.CloverShape = CloverShape;
  93897. namespace_ol.Graphic = Graphic_Graphic;
  93898. namespace_ol.style.HitCloverShape = HitCloverShape;
  93899. namespace_ol.source.GeoFeature = GeoFeature;
  93900. namespace_ol.source.Theme = theme_Theme_Theme;
  93901. namespace_ol.supermap.ThemeFeature = ThemeFeature;
  93902. namespace_ol.supermap.MapboxStyles = MapboxStyles;
  93903. namespace_ol.supermap.VectorTileStyles = VectorTileStyles;
  93904. namespace_ol.source.DataFlow = DataFlow;
  93905. namespace_ol.source.Graph = Graph_Graph;
  93906. namespace_ol.source.Graphic = Graphic;
  93907. namespace_ol.source.HeatMap = HeatMap;
  93908. namespace_ol.source.Label = Label_Label;
  93909. namespace_ol.source.Mapv = Mapv;
  93910. namespace_ol.source.Range = Range;
  93911. namespace_ol.source.RankSymbol = RankSymbol_RankSymbol;
  93912. namespace_ol.source.Turf = Turf;
  93913. namespace_ol.source.Unique = Unique;
  93914. namespace_ol.source.VectorTileSuperMapRest = VectorTileSuperMapRest; // service
  93915. namespace_ol.supermap.AddressMatchService = AddressMatchService;
  93916. namespace_ol.supermap.ChartService = ChartService;
  93917. namespace_ol.supermap.DataFlowService = DataFlowService;
  93918. namespace_ol.supermap.FeatureService = FeatureService;
  93919. namespace_ol.supermap.FieldService = FieldService;
  93920. namespace_ol.supermap.GridCellInfosService = GridCellInfosService;
  93921. namespace_ol.supermap.GeoprocessingService = GeoprocessingService;
  93922. namespace_ol.supermap.LayerInfoService = LayerInfoService;
  93923. namespace_ol.supermap.MapService = MapService;
  93924. namespace_ol.supermap.MeasureService = MeasureService;
  93925. namespace_ol.supermap.NetworkAnalyst3DService = NetworkAnalyst3DService;
  93926. namespace_ol.supermap.NetworkAnalystService = NetworkAnalystService;
  93927. namespace_ol.supermap.ProcessingService = ProcessingService;
  93928. namespace_ol.supermap.QueryService = QueryService_QueryService;
  93929. namespace_ol.supermap.ServiceBase = ServiceBase;
  93930. namespace_ol.supermap.SpatialAnalystService = SpatialAnalystService;
  93931. namespace_ol.supermap.ThemeService = ThemeService;
  93932. namespace_ol.supermap.TrafficTransferAnalystService = TrafficTransferAnalystService;
  93933. namespace_ol.supermap.WebPrintingJobService = WebPrintingJobService;
  93934. }
  93935. }();
  93936. !function() {
  93937. "use strict";
  93938. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  93939. * This program are made available under the terms of the Apache License, Version 2.0
  93940. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93941. }();
  93942. /******/ })()
  93943. ;